1

I have 2 image one is left the other is right image. I want to implement disparity mapping. There are some questions in my mind.

Firstlty dispartiy image is 1 channel gray image but the left and right images are 3 channels bgr images. If we convert these 3 channels image to gray image, do i loss information? If yes, how can i get disparity image from 3 channels img to 1 channel disparity image. I mean how can demote to 3 channels image to 1 channels image to get disparity image?

Thanks for answers..

cemalinanc
  • 11
  • 2

2 Answers2

0

Yes, you are losing information by combining all three channels into a single channel grayscale image.

There are certainly algorithms that use 3 channels to compute a disparity map, but opencv does not contain functions that implement these algorithms.

Have you considered taking out each channel R, G and B and computing the correspondence for each seperately? Of course, you would need to figure out a clever way to combine the results into one final disparity map, but it could be fun!

tbridge
  • 1,754
  • 1
  • 18
  • 35
0

Try first to find the corresponding pixels, then apply SAD difference on the two matrices, then find the minimum value and display it at the disparity map.

user
  • 86,916
  • 18
  • 197
  • 190