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