C++ 特征检测Opencv
我是OpenCV特征检测和匹配的初学者。我正在尝试编写一个简单的方法来检测并用图像显示检测到的特征。以下是我编写的方法:C++ 特征检测Opencv,c++,opencv,image-processing,C++,Opencv,Image Processing,我是OpenCV特征检测和匹配的初学者。我正在尝试编写一个简单的方法来检测并用图像显示检测到的特征。以下是我编写的方法: void FeatureDetection::detectSimpleFeature(Mat image){ Mat gray_image, output_image; cvtColor(image,gray_image,CV_BGR2GRAY); // Detect Keypoints using Simple Detector Ptr<
void FeatureDetection::detectSimpleFeature(Mat image){
Mat gray_image, output_image;
cvtColor(image,gray_image,CV_BGR2GRAY);
// Detect Keypoints using Simple Detector
Ptr<Feature2D> detectors;
vector<KeyPoint> keypoint_1;
detectors->detect(image, keypoint_1);
drawKeypoints(gray_image, keypoint_1, output_image, Scalar::all(-1), DrawMatchesFlags:: DEFAULT);
namedWindow("Keypoints Detection");
imshow("Keypoints Detection", output_image);
waitKey(0);
}
void FeatureDetection::detectSimpleFeature(Mat图像){
Mat灰度图像,输出灰度图像;
CVT颜色(图像、灰度图像、CV灰度);
//使用简单检测器检测关键点
Ptr探测器;
向量关键点_1;
检测器->检测(图像,关键点1);
drawKeypoints(灰度图像、关键点图像、输出图像、标量::全部(-1)、DrawMatchesFlags::默认);
namedWindow(“关键点检测”);
imshow(“关键点检测”,输出图像);
等待键(0);
}
此函数中没有编译时错误,但在运行时,程序正在崩溃。有人能帮忙吗
我也在搜索特殊类型的探测器,如SURF、SIFT等,但在我下载和构建的库中找不到。请建议 你看过OpenCV了吗?嗨,Catree,我试着根据这个例子改变我的方法。我正在使用AKAZE检测器,我想使用SIFT/SURF检测器,但在安装的库中找不到这些检测器。可能的原因是什么?SIFT/SURF在中。您可以在OpenCV 2.4版本中找到它们