Emgu CV 角点检测

     点是是图像中的特殊位置,是常用且非常实用的一类特征,而点的局部特征也可以叫做“关键特征点”(keypoint feature)或“角点”(conrner)。本文在C#中使用emgu cv中的cvGoodFeaturesToTrack与cvCornerHarris验证了Shi-Tomasi角点与Harris角点,十分有趣哦,上图先。

    在Emgu中Shi-Tomasi对应的函数是cvGoodFeaturesToTrack,其函数形式及参数意义如下:


 Parameters

image (IntPtr)The source 8-bit or floating-point 32-bit, single-channel image

eigImage(IntPtr)Temporary floating-point 32-bit image of the same size as image

 tempImage(IntPtr)Another temporary image of the same size and same format as eig_image

corners (IntPtr)Output parameter. Detected corners

cornerCount ( Int32 )Output parameter. Number of detected corners

qualityLevel (Double)Multiplier for the maxmin eigenvalue; specifies minimal accepted quality of image corners

minDistance (Double)Limit, specifying minimum possible distance between returned corners; Euclidian distance is used

mask (IntPtr)Region of interest. The function selects points either in the specified region or in the whole image if the mask is NULL

blockSize (Int32)Size of the averaging block, passed to underlying cvCornerMinEigenVal or cvCornerHarris used by the function

 useHarris(Int32)If nonzero, Harris operator (cvCornerHarris) is used instead of default cvCornerMinEigenVal.

k (Double)Free parameter of Harris detector; used only if useHarris != 0

     Harris角点检测对应的函数是cvCornerHarris,该函数检测的结果实际上是一幅包含Harris角点的浮点型单通道图像 如果要计算Harris角点列表,可以使用cvGoodFeatureToTrack函数,并传递适当的参数。

 Parameters

image (IntPtr)Input image

harrisResponce (IntPtr)Image to store the Harris detector responces. Should have the same size as image

blockSize (Int32)Neighborhood size

apertureSize (Int32)Aperture parameter for Sobel operator (see cvSobel). format. In the case of floating-point input format this parameter is the number of the fixed float filter used for differencing.

k (Double)Harris detector free parameter.

      在Emgu中,大部分函数均需要传递多个参数,我在使用这些函数时通常对参数设置的数量级感到非常疑惑,在CSharp中为这些参数传递指针对于我而言也是一个难题,下面的代码我查阅的很多资料才拼凑出来的,可能效果不是最好的,但是它们可以正常执行,并且基本能满足我的需求,在此记录下来,供需要的同学参考。以下代码使用时,请在工程中包含EMGU的相关引用。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

Fork me on GitHub