Stereo matching and disparity map accuracy issue

5 views (last 30 days)
Hi, My team and I are currently utilising the 'stereo camera calibrator' app to produce a disparity map to be then utilised for depth perception.
Our first prototype was physically unrefined but the disparity map was quite accurate after calibration. We then opted to improve our prototype by slimming the design down but as we moved the Web cam cameras to the new mount, no matter how much we calibrate/use the calibrator, the disparity map comes out choppy and inaccurate. We are testing with a similar amount of images, with a similar testing distance and similar board orientations.
We didn't touch the code whatsoever during the shift to the new design so we are not exactly sure what may be the problem.
Any help is much appreciated. Thanks!

Answers (1)

Dima Lisin
Dima Lisin on 27 Jul 2015
Edited: Dima Lisin on 27 Jul 2015
Hi Victor,
When you moved the cameras to the new mount, did the "baseline" (distance between the cameras) change? Did the distance to the objects of interest change? Also, did you remember to re-calibrate the cameras after you moved them?
When you call the disparity function, the DisparityRange parameter is very important, and it depends on your baseline and the distance to the objects in the scene. To get an idea of what the disparity range should be, create an anaglyph from your rectified images using the stereoAnaglyph function. Then display the anaglyph using imtool, and use the ruler widget to measure distances between several pairs of corresponding points. That should give you a good sense of the disparity range.
Also, make sure you know which of your cameras is on the left, and which is on the right. It makes things easier if your camera 1 is on the left, as you look in the same direction as the cameras. If camera 1 is on the right, your disparity will be negative.

Categories

Find more on MATLAB Support Package for USB Webcams in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!