local period → disparity → depth

Autostereogramdecoder

Drop an autostereogram here, paste one, or load a file.
No image handy? Build a test image.

Shift
px
Self-distance
RMS difference vs shift candidate dip selected click the curve to pick a shift
no image
Depth
no depth field yet
farnear

Behind the map

Pattern lock
no image loaded

Red is the image, cyan is the same image slid left by the shift. Where the pattern matches they cancel to grey; only the hidden surface breaks colour.

Subtract and clean
nothing to show yet
Load an image to run the pipeline.

How it decodes

  1. Find the period

    The image is slid over itself one pixel at a time, up to half its width. For every shift, the RMS difference over the overlapping region is measured — an area-normalised L2 distance, so wide and narrow overlaps compare fairly. The first prominent dip is the pattern period.

  2. Subtract the copy

    At that shift the background pattern cancels out. The residual |I(x) − I(x−s)| is taken across RGB, min-max normalised, pushed through a sigmoid, blurred, then opened and closed.

  3. Measure it cell by cell

    One shift only separates near from far. For the levels between, the dip search runs again in a grid of square cells. Each cell is matched at its own size — the summation region is the cell while the lag reaches across the row, so a cell never has to be as wide as a period.

  4. Place it on the image

    Depth at scene point X is carried by the pair (X − sep/2, X + sep/2), so every reading is placed at that pair's midpoint. The texture overlay is pulled back by half a shift for the same reason: the pixel above a surface is not the pixel that encodes it.