FAST算法原理:http://blog.csdn.net/quincuntial/article/details/50461508
/*
*@function FAST_Detect.cpp
*@brief FAST角点检测
*@author ltc
*@date 18:33 Friday,December 4th,2015
*/
#include<opencv2\core\core.hpp>
#include<opencv2\highgui\highgui.hpp>
#include<opencv2\features2d\features2d.hpp>
#include<opencv2\imgproc\imgproc.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main(int argc,char* argv[])
{
Mat image;
image = imread("lena.bmp",IMREAD_COLOR);
if(image.empty())
{
cerr<<"Failure in loading image"<<endl;
return -1;
}
Mat grayImage;
cvtColor(image,grayImage,COLOR_BGR2GRAY);
imshow("src",image);
vector<KeyPoint> keyPoint;
//第一种检测方式
FastFeatureDetector fast;
fast.detect(grayImage,keyPoint);
//第二种检测方式
//FAST(grayImage,keyPoint,20);
drawKeypoints(grayImage,keyPoint,image,Scalar::all(-1),1);
imshow("FAST",image);
waitKey(0);
return 0;
}
FAST检测结果:

本文介绍了一种基于FAST算法的角点检测方法,并通过代码示例展示了如何使用OpenCV库在图像中检测角点。文章提供了两种检测方式的实现过程,并展示了检测结果。
2万+

被折叠的 条评论
为什么被折叠?



