Stereo Matching & Disparity Map Generation
Stereo matching is like how your two eyes work together to figure out how far away something is by comparing slightly different views from each eye.
🎯 Learning Objectives
- ✓ Explain the geometric relationship between disparity, baseline, focal length, and depth using triangulation principles
- ✓ Calculate depth values from a given disparity map using the stereo triangulation formula
- ✓ Analyze matching accuracy by quantifying sub-pixel error and its impact on point cloud precision
- ✓ Design a stereo matching pipeline—including rectification, cost computation, aggregation, and disparity refinement—for a mining face monitoring application
- ✓ Apply census transform and semi-global matching (SGM) to generate a noise-resilient disparity map from underground mine wall imagery
📖 Why This Matters
📘 Core Principles
📐 Stereo Triangulation Depth Formula
Depth from Disparity
Z = (B × f) / dComputes absolute depth (Z) in meters from measured disparity (d) in meters, using calibrated baseline (B) and focal length (f).
| Symbol | Name | Unit | Description |
|---|---|---|---|
| Z | Depth | m | Distance from camera origin to 3D point |
| B | Baseline | m | Separation distance between left and right camera optical centers |
| f | Focal Length | m | Effective focal length of rectified stereo camera system |
| d | Disparity | m | Horizontal pixel offset between corresponding points, converted to physical units via sensor pitch |
💡 Worked Example
🏗️ Real-World Application
🔧 Interactive Calculator
🔧 Open Industrial Robot Vision Guidance & Integration Calculator📋 Case Connection
Unstructured tote input with random part orientation, variable box dimensions, and reflective surfaces causing glare
Thermal distortion-induced seam deviation (>1.8 mm) between stamped aluminum panels; inconsistent joint gap due to fixtu...
Highly reflective titanium fasteners (M3–M8), nested geometry, dense packing, and strict traceability requirements
Variable burr height (0.1–2.4 mm) and location due to inconsistent casting; complex freeform surfaces limiting fixed-too...