Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

FindHomography

I have some difficulties with very simple use of FindHomography. This is my simple code.

std::vector<cv::Point2f> P1(3);
P1[0].x = 10;  P1[0].y = 10;
P1[1].x = 20;  P1[1].y = 20;
P1[2].x = 30;  P1[2].y = 30;

std::vector<cv::Point2f> P2(3);
P2[0].x = 210; P2[0].y = 210;
P2[1].x = 220; P2[1].y = 220;
P2[2].x = 230; P2[2].y = 230;

cv::Mat T;
T = cv::findHomography( mat_p1, mat_p2, 0 );

The result matrix is

[-1.#IND, -1.#IND, -1.#IND; 1.#INF, -1.#INF, -1.#IND; -1.#IND, -1.#IND, -1.#IND]