簡體   English   中英

OpenCV std :: vector <cv :: Point2f>到cv :: Mat

[英]OpenCV std::vector< cv::Point2f > to cv::Mat

我正在OpenCV中開發應用程序,在Windows上 ,以下代碼有效,並且可以編譯/運行:

/* Calculate the transformation points */
std::vector<cv::Point2f> img1;
std::vector<cv::Point2f> img2;
for( int i = 0; i < good_matches.size(); i++ ) {
    img1.push_back( keypoints_imageOne[ good_matches[i].queryIdx ].pt );
    img2.push_back( keypoints_imageTwo[ good_matches[i].trainIdx ].pt );
}

/* Generate the homogonous matrix from the transformation points */
cv::Mat H = cv::findHomography(img1, img2, CV_RANSAC);

但是,當我切換到MacLinux機器時 ,我收到一條錯誤消息,指出沒有參數的函數原型(因為函數原型需要cv::Mat代替std::vector< cv::Point2f >

所以我的問題是,我如何/應該從std::vector < cv::Point2f >cv::Mat否則應該怎么做?

看來您在Linux上具有舊版本的OpenCV。 我認為,將向量用作openCV函數輸入的可能性已添加到2.3版中。

因此,祝您更新愉快!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM