www.techmind.org logo
by W.A. Steer  PhD
About...


 

Errata for "Stereogram Programming Techniques", chapter 13

My stereogram software was still in a phase of rapid development when I wrote the document now published in the book "Stereogram Programming Techniques". In rigorous testing shortly after the script was sent to the authors, I discovered a few previously unnoticed bugs in the programs, and also a couple of transcription errors. Unfortuanately I was not given the opportunity to proof-read the text as finally formatted for the book and most of my corrections did not make it to the printed page.

Picture of front cover of book "Stereogram Programming Techniques"
by Christopher D. Watkins and Vincent P. Mallette
(Charles River Media, Inc.), 1996
ISBN: 1-886801-00-2

See the Charles River Media page for more information about the book.

The ammendments below should be made to chapter 13 of the book.


The equation at the bottom of page 204 reads:

Zmax = bkdepth[(patwidth * obsdist) / (eyesep - patwidth)]

but should read:

Zmax = bkdepth = (patwidth * obsdist) / (eyesep - patwidth)

Sorry, with hindsight my original could have been more clear.


On page 207, 3rd line from bottom,
page 217, 10th line down,
and page 220, 17th line down, there is a line in the program which reads:
    if (vis==TRUE) lookL[right]=left; lookR[left]=right; // make link
The need for braces around the conditional code was overlooked in the original program, in each case the line should have read:
    if (vis==TRUE) { lookL[right]=left; lookR[left]=right; } // make link

On page 212, after the sentence (4th paragraph) which reads "The pattern can be continued using the following rule for unconstrained points:", there are two lines of program code:
    PatPos[x]=PatPos[x-1]+1;
    PatPosY[x]=PatPos[x-1];
The upper line should have a modulo-patwidth, and the lower one should refer to PatPosY on both sides of the assignment. They should read:
    PatPos[x]=(PatPos[x-1]+1) % patwidth;
    PatPosY[x]=PatPosY[x-1];
as in the full program listing.
Page 221, 9th line should read:
    for (x=s-1; x>=0; x--)
the -- was inadvertantly converted to its "typographical equivalent" (an em-dash) by my wordprocessor.
Page 221, 23rd line reads:
    tpatY=(patY+((s-lastlinked)/(vpatwidth/2))*(ydpi/16))
                                              % patternbmp->GetHeight();
To prevent artifacts arising when there is a depth step in the middle pattern stripe (this relates to the from-the-centre-outwards method), it is necessary to further y-shift pattern which is inserted when working leftwards by putting a +2 in this line. It should read:
    tpatY=(patY+((s-lastlinked)/(vpatwidth/2)+2)*(ydpi/16))
                                              % patternbmp->GetHeight();

The "last minute speedup" on page 222 for oversampled stereograms was conceptually correct, but a couple of minor errors crept into the detail. This section should have read:
replace:
    for (x=0; x<vwidth; x++)
    {
     featureZ=oversam*<depth of image at (x/oversam,y)>

     sep=(int)(((long)veyeSep*featureZ)/(featureZ+vobsDist));

     left=x-sep/2; right=left+sep;
with:
    for (x=0; x<vwidth; x++)
    {
     if ((x % oversam)==0) // SPEEDUP for oversampled pictures
     {
      featureZ=oversam*<depth of image at (x/oversam,y)>

      sep=(int)(((long)veyeSep*featureZ)/(featureZ+vobsDist));
     }

     left=x-sep/2; right=left+sep;

The Web document "Stereograms - a technical description of my algorithms and programs" at http://www.techmind.org/stereo/stech.html incorporates numerous refinements (simplifications and speedups) and supercedes the material published as chapter 13 of SPT.
Stereo index Homepage

Content last modified: 18 June 1996
Page last revised: 12 June 2002

Source: http://www.techmind.org/stereo/spterr.html

©1995-2002 William Andrew Steer
andrew@techmind.org