如何在findHomography之后知道透视变换矩阵

时间:2013-07-10 09:07:14

标签: opencv matrix mat perspective image-stitching

我是OpenCV的新手,我正在做一些关于图像拼接的事情。

在下面的代码中,我想知道透视变换矩阵是什么并显示矩阵,但是我收到以下错误。

//-- Find the Homography
cv::Mat H = cv::findHomography(cv::Mat(vec2),cv::Mat(vec1),CV_RANSAC);
cout << H.at(0,0) <<endl;

2 个答案:

答案 0 :(得分:1)

要显示矩阵,只需执行std::cout<<H<<std::endl;

使用cv::Mat::at您需要在参数中添加矩阵类型(它是模板方法)。 有关here

的参数的详细信息,请查看cv::Mat::at

答案 1 :(得分:0)

尝试H.at&lt; double&gt; (i,j)..它为我工作....