How to use decomposeHomographyMat in OpenCV3
I did the calibration and there is the intrinsic camera calibration matrix 'K'.
Then I used SURF and there is the homography matrix 'H'.
Now I need to decompose Homography matrix, in OpenCV3 there is a function 'decomposeHomographyMat'
int cv::decomposeHomographyMat(InputArray H, InputArray K, OutputArrayOfArrays rotations, OutputArrayOfArrays translations, OutputArrayOfArrays normals )
I write:
Mat rotations, translations, normals;
decomposeHomographyMat(H, K, 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, file/home/lwc-pc/opencv-3.1.0/modules/core/src/matrix.cpp, line 2667 terminate called after throwing an instance of 'cv::Exception' what(): /home/lwc-pc/opencv-3.1.0/modules/core/src/matrix.cpp:2667: error: (-215) k == STD_VECTOR_MAT in function getMatRef
I don't know why?
Help me , please!!!!!
looking at the docs and your errormsg, i'd guess it is:
It's great, thanks a lot
There is more question.
When the program run, there are 4 value of rotations.
Which one is the correct value?
And I need the rotation angle for the camera plane.
How to do it?
@nistar, what library u included in your decomposition code . i m getting error while compiling the code