
What you need
Use a calibrated, synchronized stereo pair and a textured static target. Evaluate saved rectified images before connecting a robot.
Read the diagram as a data table
| Condition or component | mm |
|---|---|
| 40-pixel disparity | 15 |
| 20-pixel disparity | 60 |
The calculation
Z = f × B / d |δZ| ≈ f × B × |δd| / d²
f is focal length in pixels, B is baseline in m, d is disparity in pixels and Z is m.
Worked example
With f=800 pixels and B=0.06 m, disparity 40 pixels gives 1.2 m depth. At 20 pixels, depth is 2.4 m. A 0.5-pixel disparity error gives approximate depth errors of 15 mm and 60 mm respectively.
Try it step by step
- Calibrate and rectify the pair, then inspect whether corresponding features lie on the expected epipolar lines.
- Evaluate matching on representative materials, including low-texture, shiny and repetitive surfaces.
- Reject invalid or low-confidence disparity and propagate plausible disparity uncertainty into a depth budget.
- Compare recovered depth with independent distances throughout the robot’s intended operating range.
How to check the result
Publish error versus distance and material rather than a single best-case depth value. Missing depth must not be silently replaced with a plausible target.
Common mistake to avoid
The formula assumes calibrated rectified geometry. Occlusions, exposure differences and asynchronous cameras can invalidate individual correspondences.
Reference reading
Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.


