摘要
详细介绍了Canny算法在图像处理中的重大应用。也将Canny算法和图像处理的基本原理、应用的步骤进行了介绍,并应用Canny算法提取出了较好的边缘,并且针对Canny算法第一个步骤高斯提取上的缺陷——容易将边缘信息弱化,提出了选择性平滑滤波,其中的思想是:设定一个阈值,让邻域内的像素点的灰度值与中心点像素灰度值的差值小于这个阈值的像素点进行平滑滤波,而不是让邻域内所有的像素点参与滤波。针对Canny算法选择阈值的困难性和不确定性,提出了迭代算法来求取高低阈值,其中的思想是:先用直方图统计出图像的最小灰度值和最大灰度值,然后求均值,作为最原始阈值。该阈值将图像分为高于和低于这个阈值的部分。然后分别求这两部分图像的灰度均值,将这两个灰度均值求和求均值,和最原始的阈值进行比较,按照上述步骤再次计算,直到得出最佳高低阈值。不仅解决了阈值选择问题,也优化了Canny边缘提取效果。
The important application of Canny algorithm in image processing is introduced in detail.The Canny algorithm and the basic principle of image processing and application steps are also introduced,and the Canny algorithm is used to extract better edges.Aiming at the defect of Gaussian extraction in the first step of Canny algorithm,which is easy to weaken the edge information,a selective smoothing filter is proposed.The idea is to set a threshold so that the difference between the gray value of pixels in the neighborhood and the gray value of pixels at the center is less than the threshold for smooth filtering,rather than allowing all pixels in the neighborhood to participate in filtering.In view of the difficulty and uncertainty of the Canny algorithm in choosing the threshold value,an iterative algorithm is proposed to obtain the high and low threshold value.The idea is to calculate the minimum gray value and maximum gray value of the image with the histogram,and then calculate the mean value as the most original threshold which divides the image into parts above and below the threshold.Then calculate the grayscale mean of these two parts of the image,sum the two grayscale mean to calculate the mean,and compare them with the original threshold.Follow the above steps again until the optimal high and low threshold is obtained.It not only solves the problem of threshold selection,but also optimizes the effect of Canny edge extraction.
作者
胡松
黄志远
邓磊
李壮豪
范洁滢
曾维
HU Song;HUANG Zhi-yuan;DENG Lei;LI Zhuang-hao;FAN Jie-ying;ZENG Wei(Chengdu University of Technology,Chengdu 610000,China)
出处
《计算机技术与发展》
2020年第10期106-110,209,共6页
Computer Technology and Development
基金
2019年四川省大学生创新训练项目(S201910616127)。
关键词
CANNY算法
Canny算子改进
高斯滤波
梯度计算
非极大值抑制
双阈值检测
选择性平滑滤波
迭代算法
Canny algorithm
Canny operator improvement
Gaussian filtering
gradient calculation
non-maximum suppression
double threshold detection
selective smoothing filtering
iterative algorithm