Reputation: 1
i want to measure distance of a object using a stereo camera set, till now i have calibrated and rectified my camera , generated disparity map.Using opencv stereo_match. But i am stuck on how to move forward to find the distance of an object in the image using disparity matrix. Also i am in doubt about the disparity matrix, can someone please explain it.What is the content of it. Also how to improve the disparity map , i have tried to change the parameters but with little success. Any help would be appreciated, some sample codes or any link.
Thank you
Upvotes: 0
Views: 14794
Reputation: 11
There is a code on stereo-vision, using OpenCV and Python available on GitHub: https://github.com/LearnTechWithUs/Stereo-Vision
The explanations are in German though...
There is also a Youtube video of the project: https://www.youtube.com/watch?v=xjx4mbZXaNc
The program is able to measure the distance of an object present in the image.
Upvotes: 1
Reputation: 168
"Q – 4 x 4 perspective transformation matrix that can be obtained with stereoRectify()
."
If you follow https://github.com/opencv/opencv/blob/master/samples/python/stereo_match.py you note in line 57 that you need to divide disp
by 16.0 to get real dimensions.
As for the parameters: keep trying, it really depends on your setup. For minDisparity
and numDisparities
you can manually inspect your images to find a suitable range.
Upvotes: 0