Stereo Matching using Dynamic Programming implemented in MATLAB and Python.
- Dynamic Programming (DP)
- DP with Left–Right Axes DSI
- DP with Left–Disparity Axes DSI
The algorithms are implemented in both MATLAB and Python.
All algorithms are optimized for performance using matrix operations and other techniques.
Download the project as ZIP file, unzip it, and run the scripts.
- NumPy
- Matplotlib
- OpenCV (
opencv-python)
The project contains MATLAB and Python scripts, each implementing a stereo matching algorithm. The files left.png and right.png contain the stereo image pair used as input.
To use a different stereo pair, replace these two images with your own. In this case, you must also adjust the disparity levels parameter in the script you are running.
You may optionally modify other parameters as needed. If the input images contain little or no noise, it is recommended not to use the Gaussian filter.
The results between MATLAB and Python implementation are similar.
Below are the disparity maps produced from the Tsukuba stereo pair.
This project is licensed under the MIT License. See the LICENSE file for details.



