1Pamsistoaglyph User Manual(0) Pamsistoaglyph User Manual(0)
2
3
4
6 pamsistoaglyph - convert a single-image stereogram to a red/cyan
7 anaglyphic image
8
9
10
12 pamsistoaglyph [--invert] [--sep=number] [--minsep=number] [--gray=num‐
13 ber] [in_netpbmfile
14
15 All options can be abbreviated to their shortest unique prefix. You may
16 use either white space or an equals sign between an option name and its
17 value.
18
19
20
22 This program is part of Netpbm(1).
23
24 pamsistoaglyph reads a Netpbm image as input and produces a Netpbm im‐
25 age as output.
26
27 pamsistoaglyph takes a single-image stereogram (SIS) such as those pro‐
28 duced by pamstereogram(1) and converts it to a red/cyan anaglyphic im‐
29 age such as those produced by ppm3d(1). Many people have trouble
30 tricking their eyes into focusing beyond the image in front of them and
31 are therefore unable to perceive the 3-D shape hidden within a single-
32 image stereogram. Anaglyphic stereograms are easier to perceive in 3-D
33 but require a pair of red/cyan glasses such as those often used to
34 watch 3-D movies. The goal of pamsistoaglyph is to help people who have
35 trouble viewing single-image stereograms see the intriguing 3-D effect.
36
37 pamsistoaglyph can convert single-image random-dot stereograms (SIRDS),
38 wallpaper stereograms, and even dual-image stereograms to anaglyphic
39 images.
40
41
42
44 In addition to the options common to all programs based on libnetpbm
45 (most notably -quiet, see
46 Common Options ⟨index.html#commonoptions⟩ ), pamsistoaglyph recognizes
47 the following command line options:
48
49 For most images, no command-line options need to be specified. The
50 following options are available, however, for unusual circumstances.
51
52
53
54 --invert
55 Swap the left- and right-eye
56 images. pamsistoaglyph assumes that its input
57 represents a wall-eyed stereogram and generates the
58 anaglyphic
59 image accordingly. If the generated image appears to recede
60 into
61 the page where it should pop out of the page (and vice
62 versa),
63 this typically implies that the input image represents a
64 cross-eyed stereogram. Use --invert to correct
65 the image depth.
66
67
68 --sep=number
69 Specify the distance in pixels between the left- and right-eye
70 images. Essentially, this corresponds to the distance be‐
71 tween
72 repetitions of the background pattern. The --sep
73 option should rarely be necessary
74 as pamsistoaglyph is fairly good at determining
75 automatically the eye-separation distance.
76
77
78 --minsep=number
79 This option is similar to --sep but
80 constrains pamsistoaglyph only to
81 a minimum eye-separation distance. Any distance larger
82 than number is acceptable. The --minsep
83 option should rarely be necessary
84 as pamsistoaglyph is fairly good at determining
85 automatically the eye-separation distance. The default
86 value for
87 the minimum eye-separation distance is 10% of the image
88 width;
89 this value seems to work well in practice.
90
91
92 --gray=number
93 Limit the number of gray levels to use when searching for the
94 optimal eye-separation
95 distance. Because pamsistoaglyph looks for
96 repeated patterns, it is vulnerable to being confused by
97 slight
98 variations in color. By reducing the input image to
99 grayscale and
100 capping the number of gray levels,
101 pamsistoaglyph ameliorates the effects of
102 unintentional color variations (such as those caused by con‐
103 version
104 from a low-quality JPEG image, for example). The default of
105 63
106 seems to work well so the --gray option should
107 rarely be necessary.
108
109
110
111
113 The registration algorithm used by pamsistoaglyph was developed specif‐
114 ically for this program. As far as the author knows, there are no ex‐
115 isting algorithms for converting stereograms to anaglyphs. The algo‐
116 rithm works as follows:
117
118
119
120 • Convert the image to grayscale to increase the ability to iden‐
121 tify
122 matches.
123
124
125 • Count the number of pixels that match N pixels ahead in the
126 image for all N in [1, width/2].
127
128
129 • Maintain a running mean (mu) and standard deviation (sigma) of
130 the number of matched pixels.
131
132
133 • Store the N corresponding to each spike in the number of
134 matched pixels. A spike is defined as a tally that exceeds
135 the
136 mean plus one, two, or three standard deviations. Only the
137 first
138 spike of a given standard-deviation multiplier is stored.
139
140
141 • If a tally greater than mu+3sigma was encountered, return the
142 corresponding N. If not, then if a tally greater than
143 mu+2sigma was encountered, return the
144 corresponding N. If not, then if a tally greater than
145 mu+sigma was encountered, return the
146 corresponding N. If not, then return the N that
147 produces the minimum average distance between matched pixels
148 (i.e., #matches divided by #pixels). If no
149 such N exceeds the minimum allowable eye-separation value,
150 return zero to indicate failure.
151
152
153 • If the algorithm returned zero, rerun the algorithm indepen‐
154 dently
155 on each row of the input image and return the median of
156 all N that exceed the minimum allowable eye-separation
157 value. If no such N exists, abort with an error
158 message.
159
160
161
163 Scott Pakin wrote pamsistoaglyph in April 2009. It first appeared in
164 Netpbm in Release 10.47 (June 2009).
165
166
167
169 Copyright (C) 2009 Scott Pakin, scott+pbm@pakin.org
170
171
172
174 •
175
176 pamstereogram(1)
177
178 •
179
180 ppm3d(1),
181
182 •
183
184 http://en.wikipedia.org/wiki/Stereogram
185 ⟨http://en.wikipedia.org/wiki/Stereogram⟩
186
188 This manual page was generated by the Netpbm tool 'makeman' from HTML
189 source. The master documentation is at
190
191 http://netpbm.sourceforge.net/doc/pamsistoaglyph.html
192
193netpbm documentation 05 April 2009 Pamsistoaglyph User Manual(0)