opencv之8.3检测FAST特征

代码:

#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;
}
    
    
    =

代码:

#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;
}
  
  
    =

猜你喜欢

转载自blog.csdn.net/a839766550/article/details/78324528