基于Canny算子的图像边缘检测及优化
Image Edge Detection and Optimization Based on Canny Operator
摘要: 图像边缘检测是图像处理和计算机视觉中的基本问题。本文针对图像边缘检测,首先利用二维高斯滤波器对原图像进行滤波降噪,对原始数据与高斯平滑模板作卷积,然后使用一阶差分算子计算水平方向和垂直方向的梯度幅值分量,得到图像的梯度的幅值和梯度的方向,最后进行非极大值抑制与双阈值检测和边缘连接,建立了基于Canny算子的图像边缘检测模型。针对传统Canny算法的缺陷,本文提出了一种改进的Canny边缘检测算法,建立了基于自适应平滑滤波的边缘检测模型。在平滑图像的同时锐化边缘,使用水平、垂直、45˚和135˚四个方向梯度模板计算图像梯度,改善了传统Canny算法在计算梯度时对噪声的敏感性。实验结果表明,改进的模型在检测到更多边缘细节的同时,也具备较强的自适应性。特别地,在噪声环境中,改进的模型检测效果更优。
Abstract:
Image edge detection is a basic problem in image processing and computer vision. In this paper, for image edge detection, the original image is filtered and denoised by two-dimensional Gaussian filter, and the original data is convolved with Gaussian smoothing template. Then the first difference operator is used to calculate the horizontal and vertical gradient amplitude components, and the amplitude and direction of the gradient of the image are obtained. Finally, non-maximum suppression, double threshold detection and edge connection are performed,an image edge detection model based on Canny operator is established. Aiming at the defects of traditional Canny algorithm, an improved Canny edge detection algorithm is proposed in this paper, and an edge detection model based on adaptive smoothing filter is established. The edge is sharped while the image is smoothed, and the image gradient is calculated using horizontal, vertical, 45˚ and 135˚ gradient templates, which improves the sensitivity of traditional Canny algorithm to noise when calculating gradient. The results show that the improved model not only detects more edge details, but also has strong adaptability. In particular, the improved model detection results are better in the noisy environment.
参考文献
|
[1]
|
左飞. 数字图像技术: 原理与实践[M]. 北京: 电子工业出版社, 2014.
|
|
[2]
|
郑南宁. 计算机视觉与模式识别[M]. 北京: 国防工业出版社, 1998.
|
|
[3]
|
章毓晋. 图像工程(中册)——图像分析[M]. 北京: 清华大学出版社, 2005.
|
|
[4]
|
Marr, D. and Hidreth, E.C. (1980) Theory of Edge Detection. Proceedings of the Royal Society of London, London, B207, 187-217. [Google Scholar] [CrossRef] [PubMed]
|
|
[5]
|
Canny, J. (1986) A Computational Approach to Edge Detection. IEEE Trans Pattern Analysis and Machine Intelligence, 8, 679-698. [Google Scholar] [CrossRef]
|
|
[6]
|
刘庆民, 张蕾, 李雪. 基于改进Canny的芯片图像边缘检测算法[J]. 计算机工程与设计, 2016, 37(11): 3063-3067.
|
|
[7]
|
Chen, X.F., Guan, H.B., Gu, J.N., et al. (2012) A Study and Improvements on Canny Algorithm. Advanced Engineering Forum, 6, 205-209. [Google Scholar] [CrossRef]
|
|
[8]
|
徐武, 张强, 王欣达, 等. 基于改进Canny算子的图像边缘检测方法[J]. 激光杂志, 2022, 43(4): 103-108.
|
|
[9]
|
李靖, 王慧, 闫科, 等. 改进Canny算法的图像边缘增强法[J]. 测绘科学技术学报, 2021, 38(4): 398-403.
|
|
[10]
|
许宏科, 秦严严, 陈会茹. 一种基于改进Canny的边缘检测算法[J]. 红外技术, 2014, 36(3): 210-214.
|
|
[11]
|
景晓军, 李剑峰, 熊玉庆. 静止图像的一种自适应平滑滤波算法[J]. 通信学报, 2002, 23(10): 6-14.
|
|
[12]
|
马宇飞. 基于梯度算子的图像边缘检测算法研究[D]: [硕士学位论文]. 西安: 西安电子科技大学, 2013.
|