Skip to content

bill2239/stereo_matching

Repository files navigation

stereo matching

Simple CPU implementation from scratch of Block Matching using simple Sum of Square difference, rank transform or census transform followed by hamming distance as matching cost. Defualt version use OpenMP optimization (save about 200ms execution time per image), also have the option to use Visual c++ (for windows user) concurrency module to parallellize the code execution (but slower than openMP in my case)
You can either compile the code to executable with gcc or visual studio with Opencv installed. This have been tested in Windows 10 and ubuntu 20.04

left image:
image
right image:
image
disparity image with fixed windows ssd:
image
disparity image with rank transform:
image
disparity image with census transform:
image

Clearly, choosing rank transform or census transform as matching cost make disparity map less noisy, probably the nature of these transform make left and right images less sensitive to illumination changes. p.s. using census transform is slower than using rank transform


Reqirement

$OPENCV

Compile

bash ./build.sh 

Usage cd build ./stereo_mathing -left= -right= -max-disparity= -window_size= -tranwin_size= -output= -parallel= -cost= -windows=

Examples

./stereo_matching -left=im1.png -right=im2.png -max-disparity=50 -window_size=6 -tranwin_size=7 -output=depth_new.png -parallel=yes -cost=rank -windows=yes

If you find this repo useful to you please consider click the button below to donate and support my work! Buy Me A Coffee

About

Simple implementation from scratch for depth determination with simple block-matching stereo matching algorithm using C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors