EmGUCV中类函数 FastFeatureDetector使用详解

FastFeatureDetector Class

释义:FAST(加速检测特)关键点检测器,源自 E. Rosten ("Machine learning for high-speed corner detection, 2006).
继承关系:Emgu.CV.Features2D.FastFeatureDetector
派生:Emgu.CV.Cuda.CudaFastFeatureDetector
定义(C#):

FastFeatureDetector fastCPU = new FastFeatureDetector(int threshold = 10,bool nonmaxSupression = true,);   
threshold :数据类型 System.Int32,中心像素和围绕该像素的圆上的像素之间强度差的阈值。
nonmaxSupression (可选):数据类型 System.Boolean,是否使用非极大值抑制。

方法(检测特征点)

 1、根据给定的关键点位置计算图像上的描述符。 无返回值
 public void Compute(IInputArray image,VectorOfKeyPoint keyPoints,IOutputArray descriptors)
 2、从图像中检测关键点, 返回可迭代的(MKeyPoint[])关键点对象
 public MKeyPoint[] Detect(IInputArray image,IInputArray mask = null)
 3、检测图像中的关键点,并根据关键点位置计算图像上的描述符。 无返回值
 public void DetectAndCompute(IInputArray image,IInputArray mask,VectorOfKeyPoint keyPoints,IOutputArray descriptors,	bool useProvidedKeyPoints)
 4、检测图像中的特征 ,无返回值
 public void DetectRaw(IInputArray image,VectorOfKeyPoint keypoints,IInputArray mask = null)

实例演示

    FastFeatureDetector fastCPU = new FastFeatureDetector(40, true);              
    string path = @"C:\Users\Administrator\Desktop\EMGU_CV\Image_Data\002.jpg";  //图片路径
	Mat mat = new Mat(path);
	MKeyPoint[] modelKeyPoints = fastCPU.Detect(mat, null);
	foreach (var modelKeyPoint in modelKeyPoints)
	{
	  Point point=new Point((int)modelKeyPoint.Point.X, (int)modelKeyPoint.Point.Y);
	  CvInvoke.Circle(mat, point, ((int)modelKeyPoint.Size), new MCvScalar(0, 125, 0), 1);
	}                 
	CvInvoke.Imshow("img", mat);
	CvInvoke.WaitKey(0);

EmGUCV中类函数 FastFeatureDetector使用详解_第1张图片

你可能感兴趣的:(计算机视觉,图像处理,人工智能)