Ask Your Question

Revision history [back]

This is really old, but since I have stumbled upon here, I am adding the answer just in case someone else come looking.

You need to _rotate_ the images to ensure disparities are horizontal. 90 degree counter-clockwise rotation will be required for above case. Earlier answer mentions flipping the images, but the actual operation that you need is rotation (flip() is used in the process).

Assuming Mat imgL and imgR are the input images, rotate them as follows: Mat imgL_rotated, imgR_rotated; cv::flip(imgL.t(), imgL_rotated, 0); // Transpose and flip for 270 rotation cv::flip(imgR.t(), imgR_rotated, 0);

The output will be stored in img*_rotated Mats.