Algorithm
to Making Random Dot Stereogram

Start with a Depth Map of the object to be displayed. The depth map describes how deep each part of the object is. Usually, the depth map is a gray-scale picture, with lighter shades representing less depth, and darker shades representing more depth. Since there are no constraints on the vertical direction (only the horizontal plane is of our interest), we can focus our efforts on a line by line basis (equivalent to a “for” loop, where in each loop we examine a specific horizontal line). For each point on the depth map, identify the corresponding pair of points, with separation depending on the depth, and their mean position coinciding with the original point on the depth map. The points in any pair must have the same color, but the rest of the points not coinciding with any other pair of “linked” points can be assigned a random color. The basic algorithm will be presented in the next few pages, with reference to an algorithm employed by Andrew Steer (www.techmind.org) as a basic guideline.