perspectiveTransform error
Hi forum,
Im trying to use perspectiveTransform but I keep getting error. I tried to follow the solution from this thread http://answers.opencv.org/question/18...
_players[i].getCoordinates() is of type Point
_homography_matrix is a 3 x 3 Mat
Mat temp_Mat = Mat::zeros(2, 1, CV_32FC2);
for (int i = 0; i < _players.size(); i++)
{
cout << Mat(_players[i].get_Coordinates()) << endl;
perspectiveTransform(Mat(_players[i].get_Coordinates()), temp_Mat, _homography_matrix);
}
Also, how do I convert temp_Mat into type Point ?
OpenCV Error: Assertion failed (scn + 1 == m.cols) in cv::perspectiveTransform
I have tried checking for the types my Mat using the link below.
Still no success.
have another look at the docs again.you need 2 correspondingvector<Point2f>
arrays with +4 elements each as input, the output will be a 3x3 homogeneous transformation matrixHi berak, the function you linked me to is the "getPerspectiveTransform()" which gives me the 3x3 homography matrix.
I am trying to use the function "perspectiveTransform" which multiplies the homography matrix to a single pixel ( Point ) http://docs.opencv.org/modules/core/d...
ouch, my bad, misread your post.
Okay I got the problem solved.
http://docs.opencv.org/doc/tutorials/...
This tutorial made use of perspectiveTransform. I followed it and it worked. Oh man.. I am so bad at this. I have got so much more to learn...