FAST特征點,FastFeatureDetector


FAST,2006年提出並在2010年稍作修改后發表,若某像素與其周圍鄰域內足夠多的像素點相差較大,則該像素可能是角點。

【函數】

Ptr<FastFeatureDetector> create( int threshold=10,bool nonmaxSuppression=true,int type=FastFeatureDetector::TYPE_9_16 );

【參數】原理鏈接

threshold——閾值

nonmaxSuppression——非極大值抑制

type——鄰域類型

【案例】

#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;

int main()
{
    Mat srcImage = imread("D:/sunflower.png");
        Mat srcGrayImage;
        if (srcImage.channels() == 3)
        {
            cvtColor(srcImage,srcGrayImage,CV_RGB2GRAY);
        }
        else
        {
            srcImage.copyTo(srcGrayImage);
        }
        vector<KeyPoint>detectKeyPoint;
        Mat keyPointImage;

        Ptr<FastFeatureDetector> fast = FastFeatureDetector::create();
        fast->detect(srcGrayImage,detectKeyPoint);
        drawKeypoints(srcImage,detectKeyPoint,keyPointImage,Scalar(0,0,255),DrawMatchesFlags::DEFAULT);

        imshow("src image",srcImage);
        imshow("keyPoint",keyPointImage);

        waitKey(0);
        return 0;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM