2013-07-10 26 views
0

我是新來opencv,我正在做一些關於圖像拼接。我怎麼能知道後,透視變換矩陣findHomography

在下面的代碼中,我想知道透視變換矩陣是什麼並顯示矩陣。但是,我收到以下錯誤。

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

哪些錯誤? – Alexey

回答

1

要顯示矩陣,只需做std::cout<<H<<std::endl;

要使用cv::Mat::at您需要將矩陣類型添加到參數(它是一個模板方法)。 看here約論據cv::Mat::at

+0

我使用了'std :: cout << H << std :: endl;',但是它在顯示時得到了一箇中斷H.I想知道由findHomography生成的Mat H有些不同嗎? – user2567753

+0

休息?你的意思是錯誤還是什麼?如果難以描述,可以粘貼輸出。 – morynicz

+0

我的意思是中斷。調用堆棧窗口中的結果如下:> \t ConsoleApplication1.exe!cv :: operator <<(std :: basic_ostream >&out,const cv :: Mat&mtx)line 3543 \t C++ \t ConsoleApplication1.exe中!主()線123 \t C++ \t ConsoleApplication1.exe中!__ tmainCRTStartup()線536 \tç \t ConsoleApplication1.exe中!mainCRTStartup()線377 \tç – user2567753

0

更多信息嘗試H.at <雙>(I,J)..其作品對我來說....