gpt4 book ai didi

opencv - 在图像集上使用FeatureDetector的第二个变体

转载 作者:行者123 更新时间:2023-12-02 17:53:32 25 4
gpt4 key购买 nike

我能够成功地将许多图像加载到 vector vector<Mat>中。加载后的图像可以使用imread函数显示。

问题是,我想使用第二种方法对这组图像应用SIFT,如文档中所述:

void FeatureDetector::detect(const vector<Mat>& images, vector<vector<KeyPoint>>& keypoints, const vector<Mat>& masks=vector<Mat>() ) const

这将产生以下错误:
error C2664: 'void cv::FeatureDetector::detect(const cv::Mat &,std::vector<_Ty> &,const cv::Mat &) const' : cannot convert parameter 1 from 'std::vector<_Ty>' to 'const cv::Mat &'

我正在使用的代码:
vector<Mat> images;

/* code to add all images to vector not shown as its messy but it was performed with FindFirstFile of windows.h. All images loaded correctly as they can be read by imread*/

initModule_nonfree();

Ptr<FeatureDetector> get_keypoints = FeatureDetector::create("SIFT");
vector<KeyPoint> keypoints;
get_keypoints->detect(images , keypoints);

get_keypoints->detect(images , keypoints);中检测到错误

最佳答案

根据detect签名,keypoints应该是vector<vector<KeyPoint>>,但是您将其声明为vector<KeyPoint>

关于opencv - 在图像集上使用FeatureDetector的第二个变体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13503751/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com