1Pamsistoaglyph User Manual(0)                    Pamsistoaglyph User Manual(0)
2
3
4

NAME

6       pamsistoaglyph  -  convert  a  single-image  stereogram  to  a red/cyan
7       anaglyphic image
8
9
10

SYNOPSIS

12       pamsistoaglyph [--invert] [--sep=number] [--minsep=number] [--gray=num‐
13       ber] [in_netpbmfile
14
15
16       All options can be abbreviated to their shortest unique prefix. You may
17       use either white space or an equals sign between an option name and its
18       value.
19
20
21

DESCRIPTION

23       This program is part of Netpbm(1).
24
25       pamsistoaglyph  reads  a  Netpbm  image  as input and produces a Netpbm
26       image as output.
27
28       pamsistoaglyph takes a single-image stereogram (SIS) such as those pro‐
29       duced  by  pamstereogram(1)  and  converts  it to a red/cyan anaglyphic
30       image such as those produced by ppm3d(1).   Many  people  have  trouble
31       tricking their eyes into focusing beyond the image in front of them and
32       are therefore unable to perceive the 3-D shape hidden within a  single-
33       image stereogram.  Anaglyphic stereograms are easier to perceive in 3-D
34       but require a pair of red/cyan glasses such  as  those  often  used  to
35       watch 3-D movies. The goal of pamsistoaglyph is to help people who have
36       trouble viewing single-image stereograms see the intriguing 3-D effect.
37
38       pamsistoaglyph can convert single-image random-dot stereograms (SIRDS),
39       wallpaper  stereograms,  and  even dual-image stereograms to anaglyphic
40       images.
41
42
43

OPTIONS

45       For most images, no command-line options need to be specified. The fol‐
46       lowing options are available, however, for unusual circumstances:
47
48
49
50       --invert
51              Swap the left- and right-eye
52                  images. pamsistoaglyph assumes that its input
53                  represents   a   wall-eyed   stereogram  and  generates  the
54              anaglyphic
55                  image accordingly. If the generated image appears to  recede
56              into
57                  the  page  where  it  should  pop  out of the page (and vice
58              versa),
59                  this typically implies that the input image represents a
60                  cross-eyed stereogram. Use --invert to correct
61                  the image depth.
62
63
64       --sep=number
65              Specify the distance in pixels between the left- and right-eye
66                  images.  Essentially,  this  corresponds  to  the   distance
67              between
68                  repetitions of the background pattern.  The --sep
69                  option should rarely be necessary
70                  as pamsistoaglyph is fairly good at determining
71                  automatically the eye-separation distance.
72
73
74       --minsep=number
75              This option is similar to --sep but
76                  constrains pamsistoaglyph only to
77                  a minimum eye-separation distance. Any distance larger
78                  than number is acceptable.  The --minsep
79                  option should rarely be necessary
80                  as pamsistoaglyph is fairly good at determining
81                  automatically  the  eye-separation  distance.   The  default
82              value for
83                  the minimum eye-separation distance  is  10%  of  the  image
84              width;
85                  this value seems to work well in practice.
86
87
88       --gray=number
89              Limit the number of gray levels to use when searching for the
90                  optimal eye-separation
91                  distance.  Because pamsistoaglyph looks for
92                  repeated  patterns,  it  is  vulnerable to being confused by
93              slight
94                  variations  in  color.   By  reducing  the  input  image  to
95              grayscale and
96                  capping the number of gray levels,
97                  pamsistoaglyph ameliorates the effects of
98                  unintentional color variations (such as those caused by con‐
99              version
100                  from a low-quality JPEG image, for example). The default  of
101              63
102                  seems to work well so the --gray option should
103                  rarely be necessary.
104
105
106
107

NOTES

109       The registration algorithm used by pamsistoaglyph was developed specif‐
110       ically for this program. As far as  the  author  knows,  there  are  no
111       existing algorithms for converting stereograms to anaglyphs.  The algo‐
112       rithm works as follows:
113
114
115
116       ·      Convert the image to grayscale to increase the ability to  iden‐
117              tify
118                  matches.
119
120
121       ·      Count the number of pixels that match N pixels ahead in the
122                  image for all N in [1, width/2].
123
124
125       ·      Maintain a running mean (mu) and standard deviation (sigma) of
126                  the number of matched pixels.
127
128
129       ·      Store the N corresponding to each spike in the number of
130                  matched  pixels.  A spike is defined as a tally that exceeds
131              the
132                  mean plus one, two, or three standard deviations.  Only  the
133              first
134                  spike of a given standard-deviation multiplier is stored.
135
136
137       ·      If a tally greater than mu+3sigma was encountered, return the
138                  corresponding N. If not, then if a tally greater than
139                  mu+2sigma was encountered, return the
140                  corresponding N. If not, then if a tally greater than
141                  mu+sigma was encountered, return the
142                  corresponding N. If not, then return the N that
143                  produces the minimum average distance between matched pixels
144                  (i.e., #matches divided by #pixels). If no
145                  such N exceeds the minimum allowable eye-separation value,
146                  return zero to indicate failure.
147
148
149       ·      If  the  algorithm  returned  zero, rerun the algorithm indepen‐
150              dently
151                  on each row of the input image and return the median of
152                  all N that exceed the minimum allowable eye-separation
153                  value. If no such N exists, abort with an error
154                  message.
155
156
157

HISTORY

159       Scott Pakin wrote pamsistoaglyph in April 2009.  It first  appeared  in
160       Netpbm in Release 10.47 (June 2009).
161
162
163

AUTHOR

165       Copyright (C) 2009 Scott Pakin, scott+pbm@pakin.org.
166
167
168

SEE ALSO

170       ·
171
172              pamstereogram(1)
173
174       ·
175
176              ppm3d(1),
177
178       ·
179
180              http://en.wikipedia.org/wiki/Stereogram
181http://en.wikipedia.org/wiki/Stereogram
182

DOCUMENT SOURCE

184       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
185       source.  The master documentation is at
186
187              http://netpbm.sourceforge.net/doc/pamsistoaglyph.html
188
189netpbm documentation             5 April 2009    Pamsistoaglyph User Manual(0)
Impressum