about summary refs log tree commit diff
path: root/pamsistoaglyph.html
diff options
context:
space:
mode:
Diffstat (limited to 'pamsistoaglyph.html')
-rw-r--r--pamsistoaglyph.html183
1 files changed, 183 insertions, 0 deletions
diff --git a/pamsistoaglyph.html b/pamsistoaglyph.html
new file mode 100644
index 00000000..292e394b
--- /dev/null
+++ b/pamsistoaglyph.html
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Pamsistoaglyph User Manual</title>
+<meta http-equiv="content-type" content="text/html; charset=us-ascii" />
+</head>
+
+<body>
+
+<h1>pamsistoaglyph</h1>
+
+<p>Updated: 5 April 2009
+
+<p><a href="#index">Table Of Contents</a></p>
+
+
+<h2 id="name">NAME</h2>
+
+<p>pamsistoaglyph - convert a single-image stereogram to a red/cyan
+anaglyphic image</p>
+
+
+<h2 id="synopsis">SYNOPSIS</h2>
+
+<p><b>pamsistoaglyph</b>
+[--<b>invert</b>]
+[--<b>sep</b>=<i>number</i>]
+[--<b>minsep</b>=<i>number</i>]
+[--<b>gray</b>=<i>number</i>]
+[<i>in_netpbmfile</i>
+[<i>out_netpbmfile</i>]]</p>
+
+<p>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.</p>
+
+
+<h2 id="description">DESCRIPTION</h2>
+
+<p>This program is part of <a href="index.html">Netpbm</a>.
+
+<p><b>pamsistoaglyph</b> reads a Netpbm image as input and
+produces a Netpbm image as output.</p>
+
+<p><b>pamsistoaglyph</b> takes a single-image stereogram
+(SIS) such as those produced by <a href=
+"http://netpbm.sourceforge.net/doc/pamstereogram.html">pamstereogram</a>
+and converts it to a red/cyan anaglyphic image such as those produced
+by <a href="http://netpbm.sourceforge.net/doc/ppm3d.html">ppm3d</a>.
+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
+<b>pamsistoaglyph</b> is to help people who have trouble
+viewing single-image stereograms see the intriguing 3-D effect.</p>
+
+<p><b>pamsistoaglyph</b> can convert single-image random-dot
+stereograms (SIRDS), wallpaper stereograms, and even dual-image
+stereograms to anaglyphic images.</p>
+
+
+<h2 id="options">OPTIONS</h2>
+
+<p>For most images, no command-line options need to be specified. The
+following options are available, however, for unusual
+circumstances:</p>
+
+<dl>
+<dt><b>--invert</b></dt>
+<dd>Swap the left- and right-eye
+    images. <b>pamsistoaglyph</b> 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 <b>--invert</b> to correct
+    the image depth.</dd>
+
+<dt><b>--sep</b>=<i>number</i></dt>
+<dd>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 <b>--sep</b>
+    option should rarely be necessary
+    as <b>pamsistoaglyph</b> is fairly good at determining
+    automatically the eye-separation distance.</dd>
+
+<dt><b>--minsep</b>=<i>number</i></dt>
+<dd>This option is similar to <b>--sep</b> but
+    constrains <b>pamsistoaglyph</b> only to
+    a <i>minimum</i> eye-separation distance. Any distance larger
+    than <i>number</i> is acceptable.  The <b>--minsep</b>
+    option should rarely be necessary
+    as <b>pamsistoaglyph</b> 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.</dd>
+
+<dt><b>--gray</b>=<i>number</i></dt>
+<dd>Limit the number of gray levels to use when searching for the
+    optimal eye-separation
+    distance.  Because <b>pamsistoaglyph</b> 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,
+    <b>pamsistoaglyph</b> 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 <b>--gray</b> option should
+    rarely be necessary.</dd>
+</dl>
+
+
+<h2 id="notes">NOTES</h2>
+
+<p>The registration algorithm used by <b>pamsistoaglyph</b>
+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:</p>
+
+<ol>
+<li>Convert the image to grayscale to increase the ability to identify
+    matches.</li>
+
+<li>Count the number of pixels that match <i>N</i> pixels ahead in the
+    image for all <i>N</i> in [1, <i>width</i>/2].</li>
+
+<li>Maintain a running mean (&mu;) and standard deviation (&sigma;) of
+    the number of matched pixels.</li>
+
+<li>Store the <i>N</i> 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.</li>
+
+<li>If a tally greater than &mu;+3&sigma; was encountered, return the
+    corresponding <i>N</i>. If not, then if a tally greater than
+    &mu;+2&sigma; was encountered, return the
+    corresponding <i>N</i>. If not, then if a tally greater than
+    &mu;+&sigma; was encountered, return the
+    corresponding <i>N</i>. If not, then return the <i>N</i> that
+    produces the minimum average distance between matched pixels
+    (i.e.,&nbsp;<i>#matches</i> divided by <i>#pixels</i>). If no
+    such <i>N</i> exceeds the minimum allowable eye-separation value,
+    return zero to indicate failure.</li>
+
+<li>If the algorithm returned zero, rerun the algorithm independently
+    on each row of the input image and return the median of
+    all <i>N</i> that exceed the minimum allowable eye-separation
+    value. If no such <i>N</i> exists, abort with an error
+    message.</li>
+</ol>
+
+
+<h2 id="author">AUTHOR</h2>
+
+<p>Copyright (C) 2009 Scott
+Pakin, <a href="mailto:scott+pbm@pakin.org.">scott+pbm@pakin.org.</a></p>
+
+
+<h2 id="seealso">SEE ALSO</h2>
+
+<p><b><a href="pamstereogram.html">pamstereogram</a></b>,
+<b><a href="ppm3d.html">ppm3d</a></b>,
+&lt;<a href="http://en.wikipedia.org/wiki/Stereogram">
+http://en.wikipedia.org/wiki/Stereogram</a>&gt;</p>
+
+
+<hr />
+<h2 id="index">Table Of Contents</h2>
+
+<ul>
+<li><a href="#synopsis">SYNOPSIS</a></li>
+<li><a href="#description">DESCRIPTION</a></li>
+<li><a href="#options">OPTIONS</a></li>
+<li><a href="#notes">NOTES</a></li>
+<li><a href="#author">AUTHOR</a></li>
+<li><a href="#seealso">SEE ALSO</a></li>
+</ul>
+
+</body>
+</html>
+