Ask Your Question

Kada's profile - activity

2015-12-16 05:02:03 -0600 received badge  Enthusiast
2015-12-11 09:08:08 -0600 commented question Mirroring using Hartley Rectification

http://stackoverflow.com/questions/25... I read findFundamental can be unstable sometimes. Could it be that I need to calculate the fundamental matrix myself?

2015-12-08 13:06:33 -0600 received badge  Editor (source)
2015-12-08 12:02:43 -0600 asked a question Mirroring using Hartley Rectification

Hi, I've been using Hartley Calibration Algorithm, since stereoCalibrate/stereoRectify delivers no output due to high baseline Stereo with Camera Rotation.

The left image though heavily sheared and mirrored.

image description

I've used the anti-shearing algorithm by Zhang, but it doesn't revert the mirroring.

Here is the Homographic Matrix I obtain from stereoRectifyUncalibrated:

H1(left):
[-0.09377726121369795, 0.04328690336693735, 86.72993843873914;
 -0.004977161606602101, 0.155454257309974, 3.550060089738537;
 -1.736436872968937e-05, -4.655031712266116e-07, 0.1663350901457538]

Here is the shearing transform matrix I obtain from my anti-shearing implementation:

shear matrix (left): 
[1.683146574043227, -0.5007180072161737, 0;
 0, 1, 0;
 0, 0, 1]

I have to add a translation matrix, because the shearing moves the image to the right, so I calculate:

T: 
[1, 0, -144.2016197365122;
 0, 1, 0;
 0, 0, 1]

(with T.at(0,2) from:

vec = shear * H1 * (0,0)                   //top left point of image
T.at(0,2) = 0 - vec.at(0,0)

)

Here is the picture when I calculate the new homography:

newH1 = T * shear * H1

image description

Even though the image is now pretty straight and moved into the picture now it is still mirrored....

I'm hesitant to simply set the first value of H1 to it's positive value since I got the feeling there might be something wrong at another place. Am I getting something from the calculation, is there a known problem with the Hartley Algorithm, that it mirrors the images? Any advice appreciated!