Stereo Matching Algorithms in MATLAB and Python
Stereo matching is a core problem in computer vision, and performance matters, especially when working with large images or real-time systems. In this post, I’m sharing a set of fast, optimized stereo matching algorithms implemented in MATLAB and Python.
What’s Included
- Two versions of Block Matching
- Two versions of Dynamic Programming
- Semi-Global Matching and Semi-Global Block Matching
- Three versions of Belief Propagation
All algorithms are available in: Stereo Matching Algorithms in MATLAB and Python
Example Outputs
The algorithms are tested using the Tsukuba stereo image.
Here are the resulting disparity maps generated by each method.
- Block Matching using Sum of Absolute Differences

- Block Matching using Census Transformation

- Dynamic Programming with Left-Right Axes DSI

- Dynamic Programming with Left-Disparity Axes DSI

- Semi-Global Matching

- Semi-Global Block Matching

- Belief Propagation with Accelerated Message Update Schedule

- Belief Propagation with Synchronous Message Update Schedule

There is also a second approach to Belief Propagation with Synchronous Message Update Schedule, which produces the same result.