Disparity for both left and right image, is it possible?

asked 2019-07-05 07:22:19 -0600

BuenaVentura gravatar image


I have a stereo pair and I would like to find the disparity map of the left image, then the disparity map of the right image and see the difference of these two disparity maps. Now, I know that in order to compute disparity (e.g. with Block Matching) I run:

bm->compute(img1, img2, disp).

Therefore, If I wish to find the disparity of the left image I should run:

bm->compute(imgL, imgR, disp).

and for the disparity of the right image:

bm->compute(imgR, imgL, disp).

That is, I just changed the order of the arguments. Is it the correct way to do it? The disparity of the right image seems really poor quality in comparison with the one of the left image. Is there any other way to find the disparity difference between these two disparity maps (i.e. left and right image disparity maps)?

edit retag flag offensive close merge delete


Look for Left-Right Consistency Check. There should be some stereo methods / implementations that already have it.

Eduardo gravatar imageEduardo ( 2019-07-05 08:03:34 -0600 )edit

The Left-Right Consistency Check is performed by openCV function validateDisparity(), and is used as a filter in both BM and SGBM algorithms. That is, it just returns the filtered disparity map not the difference between the left and right disparity maps. It also takes as input the left disparity map and the matrix "cost" computed by the stereo correspondence algorithm.

It is more like a pseudo LR consistency check.

BuenaVentura gravatar imageBuenaVentura ( 2019-07-05 08:09:59 -0600 )edit

When searching the corresponding pixel in the right image, its x-position should be >= x-position in the left image.

When searching the corresponding pixel in the left image, its x-position should <= x-position in the right image.

This should explain why switching the argument gives poor results.

Eduardo gravatar imageEduardo ( 2019-07-07 12:54:26 -0600 )edit