How to use decomposeHomographyMat in OpenCV3

asked 2016-01-02 08:38:07 -0600

nistar gravatar image

I did the calibration and there is the intrinsic camera calibration matrix.

FileStorage fs("out_camera_data.xml", FileStorage::READ);
Mat cameraMatrix, distCoeffs;
fs["Camera_Matrix"] >> cameraMatrix;
fs["Distortion_Coefficients"] >> distCoeffs;


Then I used SURF and there is the homography matrix.

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


Now I need to decompose Homography matrix, in OpenCV3 there is a function 'decomposeHomographyMat link text'

Mat rotations, translations, normals;
decomposeHomographyMat(H, cameraMatrix, rotations, translations, normals) ;


When I build the program, it don't have error.
But when it run, there is a problem.

OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in getMatRef
terminate called after throwing an instance of 'cv::Exception'
what(): error: (-215) k == STD_VECTOR_MAT in function getMatRef

I don't know why?
Help me, please.........

edit retag flag offensive close merge delete

Comments

Help me, please

nistar gravatar imagenistar ( 2016-01-03 07:56:26 -0600 )edit