代码:
#include <iostream>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image = imread("D:/house.jpg", 0);
vector<KeyPoint> keypoints;
//cv::FastFeatureDetector fast(40);
//fast.detect(image, keypoints); 版本问题这两句不好使,用下面代替
Ptr<FeatureDetector> fast = FastFeatureDetector::create(40);
fast->detect(image, keypoints);
drawKeypoints(image, keypoints, image, Scalar(255, 255, 255), DrawMatchesFlags::DRAW_OVER_OUTIMG);
namedWindow("FAST Features");
imshow("FAST Features", image);
waitKey(0);
return 0;
}