Depth without objects
One might think that stereo works by first recognizing objects in both images and then comparing where they are. Random-dot stereograms show that it does not have to: each image is a uniform field of random dots, without edges, shapes or any other cue. Only the correspondence between the two images contains the shape.
To build one, take two surfaces covered with random dots, a background and a shape in front of it, and render them as two cameras of a rectified stereo pair would see them. The dots of the shape appear shifted by its disparity, those of the background by a smaller one. Where the shape hides different parts of the background in the two images, a strip of background is visible in one image only, filled with new dots.
Finding the shape
Comparing the left image with the right one moved by a disparity makes all surfaces with that disparity agree everywhere, and everything else agree only by chance, for about half of the dots. Sweeping shows the background at its disparity and the shape at its own. Window matching does this for every pixel and picks the best : with random dots, every window is distinctive, so the disparity map comes out almost perfectly, except at the edges of the shape and in the strips seen by only one camera.
Human vision does the same. Bela Julesz used random-dot stereograms to show that the brain can match the images of the two eyes before recognizing anything, and the same principle is behind single-image stereograms such as the Magic Eye pictures.
Try this
- Look at each image of the pair alone: there is no square. Then try to fuse them, looking through the screen with left | right or crossing your eyes with right | left; the square floats in front with one order and appears sunk behind with the other.
- Move the disparity slider of the comparison: at the background turns white, at the shape's disparity the square does.
- Set the window radius to 0: single pixels are black or white, so half of all disparities match by chance and the map is noise. A radius of 2 or 3 is already enough.
- Choose two steps: two nested squares at different depths, both recovered from dots alone.
- Set the share of black dots to 0.05: the images are almost white, most windows look alike, and the matching fails, as in any textureless region.
- Increase the dot size to 4 px: windows smaller than a dot contain no structure, and the window has to grow with the dots.