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