Ask Your Question

Revision history [back]

homography unbounded values observed

I get different outputs for cvFindHomography() and findHomography() (C++). findHomography produces big floating point numbers whereas cvFindHomography produces smaller values. why? I have copied the code and its corresponding outputs below. Request for help and thanks in advance.

Code:1

double h[9];

CvMat _h = cvMat(3, 3, CV_64F, h);

std::vector < CvPoint2D32f > pt1, pt2;

CvMat _pt1, _pt2;

_pt1 = cvMat(1, nCnt, CV_32FC2, &pt1[0]);

_pt2 = cvMat(1, nCnt, CV_32FC2, &pt2[0]);

cvFindHomography( &_pt1, &_pt2, &_h, CV_RANSAC, 1)

Values returned in _h printed using cout

0.999928 0.000027 0.013392

0.000018 0.999958 -0.005272

-0.000000 -0.000000 1.000000

Code:2

Mat H(3, 3, CV_64F);

std::vector < Point2f > pt1, pt2;

findHomography(pt1, pt2, &H, RANSAC, 1);

Values returned in H printed using cout

0.000000 1.874995 0.000000

-0.488446 0.000000 1.175271

0.000000 0.520783 -6536181216787541205712896.000000