summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-leap-15-6/man1/pamsistoaglyph.1
blob: 1f2469cb8c1f92823f55297a572f459c22fc4105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it!  If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "Pamsistoaglyph User Manual" 0 "5 April 2009" "netpbm documentation"




.PP

.PP



.UN name
.SH NAME
.PP
pamsistoaglyph - convert a single-image stereogram to a red/cyan
anaglyphic image


.UN synopsis
.SH SYNOPSIS
.PP
\fBpamsistoaglyph\fP
[--\fBinvert\fP]
[--\fBsep\fP=\fInumber\fP]
[--\fBminsep\fP=\fInumber\fP]
[--\fBgray\fP=\fInumber\fP]
[\fIin_netpbmfile\fP

.PP
All options can be abbreviated to their shortest unique prefix. You
may use either white space or an equals sign between an option name
and its value.


.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBpamsistoaglyph\fP reads a Netpbm image as input and
produces a Netpbm image as output.
.PP
\fBpamsistoaglyph\fP takes a single-image stereogram
(SIS) such as those produced by
.BR "pamstereogram" (1)\c
\&
and converts it to a red/cyan anaglyphic image such as those produced
by
.BR "ppm3d" (1)\c
\&.
Many people have trouble tricking their eyes into focusing beyond the
image in front of them and are therefore unable to perceive the 3-D
shape hidden within a single-image stereogram.  Anaglyphic stereograms
are easier to perceive in 3-D but require a pair of red/cyan glasses
such as those often used to watch 3-D movies. The goal of
\fBpamsistoaglyph\fP is to help people who have trouble
viewing single-image stereograms see the intriguing 3-D effect.
.PP
\fBpamsistoaglyph\fP can convert single-image random-dot
stereograms (SIRDS), wallpaper stereograms, and even dual-image
stereograms to anaglyphic images.


.UN options
.SH OPTIONS
.PP
For most images, no command-line options need to be specified. The
following options are available, however, for unusual
circumstances:


.TP
\fB--invert\fP
Swap the left- and right-eye
    images. \fBpamsistoaglyph\fP assumes that its input
    represents a wall-eyed stereogram and generates the anaglyphic
    image accordingly. If the generated image appears to recede into
    the page where it should pop out of the page (and vice versa),
    this typically implies that the input image represents a
    cross-eyed stereogram. Use \fB--invert\fP to correct
    the image depth.

.TP
\fB--sep\fP=\fInumber\fP
Specify the distance in pixels between the left- and right-eye
    images. Essentially, this corresponds to the distance between
    repetitions of the background pattern.  The \fB--sep\fP
    option should rarely be necessary
    as \fBpamsistoaglyph\fP is fairly good at determining
    automatically the eye-separation distance.

.TP
\fB--minsep\fP=\fInumber\fP
This option is similar to \fB--sep\fP but
    constrains \fBpamsistoaglyph\fP only to
    a \fIminimum\fP eye-separation distance. Any distance larger
    than \fInumber\fP is acceptable.  The \fB--minsep\fP
    option should rarely be necessary
    as \fBpamsistoaglyph\fP is fairly good at determining
    automatically the eye-separation distance.  The default value for
    the minimum eye-separation distance is 10% of the image width;
    this value seems to work well in practice.

.TP
\fB--gray\fP=\fInumber\fP
Limit the number of gray levels to use when searching for the
    optimal eye-separation
    distance.  Because \fBpamsistoaglyph\fP looks for
    repeated patterns, it is vulnerable to being confused by slight
    variations in color.  By reducing the input image to grayscale and
    capping the number of gray levels,
    \fBpamsistoaglyph\fP ameliorates the effects of
    unintentional color variations (such as those caused by conversion
    from a low-quality JPEG image, for example). The default of 63
    seems to work well so the \fB--gray\fP option should
    rarely be necessary.



.UN notes
.SH NOTES
.PP
The registration algorithm used by \fBpamsistoaglyph\fP
was developed specifically for this program. As far as the author
knows, there are no existing algorithms for converting stereograms to
anaglyphs.  The algorithm works as follows:


.IP \(bu
Convert the image to grayscale to increase the ability to identify
    matches.

.IP \(bu
Count the number of pixels that match \fIN\fP pixels ahead in the
    image for all \fIN\fP in [1, \fIwidth\fP/2].

.IP \(bu
Maintain a running mean (mu) and standard deviation (sigma) of
    the number of matched pixels.

.IP \(bu
Store the \fIN\fP corresponding to each spike in the number of
    matched pixels. A spike is defined as a tally that exceeds the
    mean plus one, two, or three standard deviations. Only the first
    spike of a given standard-deviation multiplier is stored.

.IP \(bu
If a tally greater than mu+3sigma was encountered, return the
    corresponding \fIN\fP. If not, then if a tally greater than
    mu+2sigma was encountered, return the
    corresponding \fIN\fP. If not, then if a tally greater than
    mu+sigma was encountered, return the
    corresponding \fIN\fP. If not, then return the \fIN\fP that
    produces the minimum average distance between matched pixels
    (i.e.,\ \fI#matches\fP divided by \fI#pixels\fP). If no
    such \fIN\fP exceeds the minimum allowable eye-separation value,
    return zero to indicate failure.

.IP \(bu
If the algorithm returned zero, rerun the algorithm independently
    on each row of the input image and return the median of
    all \fIN\fP that exceed the minimum allowable eye-separation
    value. If no such \fIN\fP exists, abort with an error
    message.


.UN history
.SH HISTORY
.PP
Scott Pakin wrote \fBpamsistoaglyph\fP in April 2009.  It first appeared
in Netpbm in Release 10.47 (June 2009).


.UN author
.SH AUTHOR
.PP
Copyright (C) 2009 Scott
Pakin, \fIscott+pbm@pakin.org.\fP


.UN seealso
.SH SEE ALSO



.IP \(bu

.BR "pamstereogram" (1)\c
\&
.IP \(bu

.BR "ppm3d" (1)\c
\&,
.IP \(bu

.UR http://en.wikipedia.org/wiki/Stereogram
http://en.wikipedia.org/wiki/Stereogram
.UE
\&
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source.  The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/pamsistoaglyph.html
.PP