在数字图像处理和机器视觉中,边缘检测是一个基本问题和关键环节,因此,精确地检测图像边缘是非常必要的。提出了一种基于灰度梯度和反正切函数拟合的亚像素边缘检测算法。首先,通过Canny算子粗略提取输入图像的边缘;然后对初步得到的边缘像素逐点提取灰度梯度方向,以提取的梯度方向为坐标轴正方向建立灰度梯度直角坐标系;最后利用最小二乘法,采用反正切函数拟合图像边缘的灰度梯度,获得亚像素边缘位置。利用Microsoft Visual Studio 2008平台进行实验,结果表明:与基于小波变换及基于Zemike矩的亚像素边缘检测方法相比,所提算法定位精度较高,检测速度较快,能够更完整地检测出图像的平滑边缘。
In digital image proeessing and machine vision,edge detection is one of the fundamental problems and key links,therefore,it is very necessary to detect the image edge accurately. There proposes a sub-pixel edge detection algorithm which is based on the fitting of gray gradient and arctan function. Firstly, the Canny operator is used to locate the input image edge roughly,then the gray gradient direction are extracted point by point using the preliminary edge pixels,and estabilish the rectangular coordinate system of gray gradient direction whose positive direction is the extracted gradient direction. Finally,the sub-pixel edge location is obtained by the least square method using the fitting of arctan function on the gray gradient of the edge of the image. The experi- ment is provided to illustrate the effectiveness of the above algorithm compared with sub-pixel edge detection algorithm based on wavelet transform method and based on Zernike moments by Mierosofl Visual Studio 2008 platform, the results show that this algorithm has higher positioning accuracy, faster detection speed,and it can detect a smooth edge of the image more perfectly.