Quality of disparity map

OpenCV, Python and other image processing questions
Post Reply
ZhZh
Posts: 2
Joined: Sat May 02, 2020 6:17 pm

Quality of disparity map

Post by ZhZh »

Hello,

I've tried to make the disparity map with my own fisheye stereo cameras, according to the article
https://stereopi.com/blog/opencv-compar ... reo-vision
and the scripts from
https://github.com/realizator/stereopi-fisheye-robot

I've successfully calibrated the cameras, the undistortion results are good, but the disparity map computed from the two images are totally not satisfying.

Following are the images taken with the two cameras and the disparity result:
LeftAndRight.png
LeftAndRight.png (1.35 MiB) Viewed 1109 times
disparity.png
disparity.png (390.06 KiB) Viewed 1109 times
as you can see, there are several problems in the disparity map:

1. There are many noises in the map.
2. The color of the ground, the walls and the closets are all dark blue, it means the code can't compute their disparity, unlike the example showed in the tutorial:
example.png
example.png (386.41 KiB) Viewed 1109 times
even thouth I used the same parameters.
3. Even if I change the parameters, I could only reduce the noises and get the disparity of the contours, instead of the objects.

No metter how I change the parameters, I still can't get the satisfying result. Could you point out the possible mistakes I've made, or something important I might have ignored? What I should do to get at least a "filled' disparity map, not just contours with noises? Should I do something like Pre- and Post-processing? Or could you at least give me a direction, I have totally no idea what I should do now.

Thanks a lot!

User avatar
Realizator
Site Admin
Posts: 501
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Quality of disparity map

Post by Realizator »

Hello ZhZh,
FIrst notice is a calibration quality. If you look at the top left corner of your calibrated images (the zone near the conditioner on the ceiling), you may notice a serious difference between left and right images. Usually it means, that while taking your calibration images, you did not exposed your checkerboard in the corners of the image (but, for example, exposed it in the center of the image and nearby).
As for your question about "dark blue" color of the walls. The key settings, responsible for the "range of sensitivity" (depth sensitivity), are MinDisp and NumOfDisp. If your stereoscopic setup does not recognize far objects, it means your NumOfDisp parameter is too small. Usually I start to tune the Depth Map with the MinDisp and NumOfDisp, to get "red" colors for the nearest objects on the scene, and blue for "far" objects.

Also please notice, that the two first options (SpeckleWindowSize and SpeckleRange) are responsible for the "smoothness" of your map. The smaller these parameters, the smaller details can be recognized (but you'll get more noise). On your screenshots these numbers are not small. I can suggest, that with the small numbers for the Speckle settings your depth map looks bad (as calibration is not ideal). FJYI, with the bigger Speckle settings depth map algorithm became more resistant to the calibration issues, but precision is not so good.
Eugene a.k.a. Realizator

ZhZh
Posts: 2
Joined: Sat May 02, 2020 6:17 pm

Re: Quality of disparity map

Post by ZhZh »

Realizator wrote:
Tue May 05, 2020 7:38 am
Hello ZhZh,
FIrst notice is a calibration quality. If you look at the top left corner of your calibrated images (the zone near the conditioner on the ceiling), you may notice a serious difference between left and right images. Usually it means, that while taking your calibration images, you did not exposed your checkerboard in the corners of the image (but, for example, exposed it in the center of the image and nearby).
As for your question about "dark blue" color of the walls. The key settings, responsible for the "range of sensitivity" (depth sensitivity), are MinDisp and NumOfDisp. If your stereoscopic setup does not recognize far objects, it means your NumOfDisp parameter is too small. Usually I start to tune the Depth Map with the MinDisp and NumOfDisp, to get "red" colors for the nearest objects on the scene, and blue for "far" objects.

Also please notice, that the two first options (SpeckleWindowSize and SpeckleRange) are responsible for the "smoothness" of your map. The smaller these parameters, the smaller details can be recognized (but you'll get more noise). On your screenshots these numbers are not small. I can suggest, that with the small numbers for the Speckle settings your depth map looks bad (as calibration is not ideal). FJYI, with the bigger Speckle settings depth map algorithm became more resistant to the calibration issues, but precision is not so good.
Hello Realizator,
thanks for your reply! I'll try your suggestions to recalibrate and see how it turns out.

Post Reply