FAST特征点检测features2D

Posted on 2014-02-20 19:06  sylar少侠  阅读(262)  评论(0)    收藏  举报
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>

#include <vector>

using namespace cv;

void main()
{
	Mat image;
	image = imread("d:\\p.jpg");
	// vector of keyPoints
	std::vector<KeyPoint> keyPoints;
	// construction of the fast feature detector object
	FastFeatureDetector fast(40);	// 检测的阈值为40
	// feature point detection
	fast.detect(image,keyPoints);
	drawKeypoints(image, keyPoints, image, Scalar::all(255), DrawMatchesFlags::DRAW_OVER_OUTIMG);
	imshow("FAST feature", image);
	cvWaitKey(0);
}

  

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3