OpenCV estimates distance and normal vector from homography

I am matching a pattern from which I know my distance and my regular vector.

i.e. if my homography is an identification matrix, then my camera is at a distance = 1.0 m, and my normal one is at 0.

Now I have a second image in which I successfully aligned my template with homography:

     [0.82072, 0.05685, 66.75024]
 H = [0.02006, 0.86092, 39.34907]
     [0.00003, 0.00017, 01.00000]

I also have a camera matrix.

opencv function:

cv::decomposeHomographyMat()

gives me 4 solutions for rotation (3x3 mat), translation (3x1 mat) and normal vector (3x1).

cv::warpPerspective()

The ability to match the almost perfect current view of the camera with my template.

Thus, it should be possible to get the actual scaling (template for alignment) and the normal vector.

But I can’t understand how to actually choose the right solutions cv :: decoseHomographyMat (), am I missing something?

: "" ...

+3
2

.

:

ROI, ( , ROI).

:

ROI ( , 8 ​​ ) cv:: decposeHomographyMat()

, 3D (x, y, z) z < 0 (.. ).

:

. , .

:

Translation_Solution1 = -1* Translation_Solution2

ROI . ROI , , "", .. z . , z.

.

, , warpPerspective() , .

+4

Source: https://habr.com/ru/post/1583888/


All Articles