Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error in transormation using FindHomography

I have two images (img_1 and img_2) of a plane "A" acquired by the same camera in two consecutive times. Between these two instants the camera performs a little rotation around one of the two axes x, y (considering that the z one points to the plane "A" ...so the transformation between the images is perspective.

My goal is to find a point (previously detected in img_1) in img_2. So i use FindHomography function and than i multiply the coordinates of such a point (setting z=1, normalized as suggested here: findhomography) with the matrix obtained.

The problem i that the new point in img_2 is always shifted a bit in one direction with respect where it should be....

what am i doing wrong? could be something about the scale factor? (take into account that the transformation matrix for translational movement of the camera is computed) properly

Error in transormation using FindHomography

I have two images (img_1 and img_2) of a plane "A" acquired by the same camera in two consecutive times. Between these two instants the camera performs a little rotation around one of the two axes x, y (considering that the z one points to the plane "A" ...so the transformation between the images is perspective.

My goal is to find a point (previously detected in img_1) in img_2. So i use FindHomography function and than i multiply the coordinates of such a point (setting z=1, normalized as suggested here: findhomography) with the matrix obtained.

The problem i that the new point in img_2 is always shifted a bit in one direction with respect where it should be....

what am i doing wrong? could be something about the scale factor? (take into account that the transformation matrix for translational movement of the camera is computed) properly computed properly).

My code is the same of this example obviously my code stops at:

             Mat H = findHomography( obj, scene, CV_RANSAC );

..than, in the main function, i simply do:

dstMat = H*srcMat;

where scrMat is the point in img_1 (setting z=1) and dstMat is the point in img_2