Stereo Matching Algorithms in MATLAB
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.
What’s Included
-
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 this GitHub repository.
Example Input
The algorithms are tested using the Tsukuba stereo image.

Example Outputs
Here are the resulting disparity maps generated by each method.
Block Matching

Dynamic Programming (Left–Right Axes)

Dynamic Programming (Left–Disparity Axes)

Semi-Global Matching

Semi-Global Block Matching

Belief Propagation (Accelerated)

Belief Propagation (Synchronous)

More Resources
- Block Matching
- Stereo Matching using Dynamic Programming (Left-Right Axes)
- Stereo Matching using Dynamic Programming (Left-Disparity Axes)
- Semi-Global Matching
- Semi-Global Block Matching
- Stereo Matching using Belief Propagation (Accelerated)
- Stereo Matching using Belief Propagation (Synchronous)
- Stereo Matching using Belief Propagation (Synchronous) - a different aproach