Stereo Depth from Calibrated Pairs
Two lenses a hand apart see the world twice. Stereo depth turns their pixel shift into metric distance with one division.
Why Does This Exist?
Monocular depth estimation guesses scale; robots need it measured. Stereo depth exists as the metric answer from passive cameras: with known baseline and intrinsics from camera calibration and parameters, every disparity becomes meters without learning. Learned cost volumes now sharpen the matching, but the geometry stays fixed.
Matching detail is disparity estimation; the two-view tour is stereo vision.
Think of It Like This
Ranging with outstretched arms
Hold a finger up and blink left-right: near fingers jump far, distant doors barely move. Pace your eyes wider apart and even the door starts to jump.
Eyes are cameras and eye spacing is the baseline. The analogy stops at pixels: eyes interpolate smoothly while sensors quantize, so far depth arrives in coarse steps.
How It Actually Works
Rectification warps both images so matches share rows. A cost volume scores disparities per pixel, classically by patch cost and now by 3D-convolution over learned features as in PSMNet. Subpixel refinement fits a parabola around the cost minimum. Depth follows ; range resolution follows , so doubling the baseline halves far error but shrinks overlap and raises occlusion.
Worked numbers
Driving rig with px and m observes px. Then m. A px subpixel error moves depth by m near, while at px ( m) the same error moves depth by about m.
Code
def stereo_depth(d: float, f: float, baseline: float) -> float: return f * baseline / d # rectified metric depth
print(stereo_depth(129.6, 720.0, 0.54)) # -> 3.0Watch Out For
Trusting far stereo past its baseline
Beyond about baselines the quantization steps exceed object sizes, so cars smear across lanes. The symptom is distant depth that looks dense but wanders meters per frame. Fuse long-range radar or monocular priors instead of stretching stereo alone.
The Quick Version
- Stereo depth rectifies, matches along rows, and divides by disparity.
- Known baseline makes every depth metric without learned scale.
- Cost volumes plus subpixel fits give modern accuracy near px.
- Error grows with range squared over baseline.
- and baseline m map disparity to m.
- Wide baselines gain range but lose overlap and add occlusion.