A stereo blockmatching algorithm I programmed for my thesis.
It uses dynamic programming cost minimization and has the ability to aggregate cost functions.
-
Input:
rectified stereo image (for example left.png right.png)
-
Output:
Disparity image/ inverse depth map.
There is no minimal or maximal disparity so calculating the image might take a while.
Usage:
mybm -s left.png right.png
will calculate a disparity map for the stereoset left.png right.png.
mybm -s left.png right.png -c -o disparity.png
will save the disparity map in an image file. "-c" will make sure that the disparity map is colored in the opencv "jet" colormap for better reckognition of height. disparity.png will be the output image
Based on the following libraries:
- OpenCV
Install dependencies on Ubuntu (or Debian based distributions):
sudo apt-get install build-essential cmake libopencv-dev
Build the programm:
cmake .
make
Release version:
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release ..
make
If you build the programm succesfully you should be able to see the "mybm" executable