繁体   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