文档介绍:
基于图像反差的改进 Canny 算子边缘提取
许迪,王娟,张天序**
(华中科技大学图像识别与人工智能研究所,武汉 430074)
5
10
15
20
25
30
35
40
摘要:图像边缘指的是其周围像素灰度有阶跃变化或者屋顶变化的那些像素的集合,反映了
灰度值的不连续性。通常我们利用图像的一阶导数和二阶导数来提取边缘。传统的 Canny
边缘检测算法易受噪声的影响,对孤立点和伪边缘敏感。本文对图像 3×3 领域对角方向上
的梯度幅值进行了检验,提高的了定位的精度。同时,这种梯幅值度是绝对的,不能很好的
应对光照不均匀的高反差图像。本文同时引入基于图像反差的概念,计算局部梯度的相对值,
提高了边缘检测的质量。
关键词:Canny 算子;图像反差;相对梯度;边缘提取
中图分类号:TP391
An improved edge detection method based on image
contrast
Xu Di, Wang Juan, Zhang Tianxu
(Huazhong University of science and technology , Institute for Pattern Recognition and Artificial
Intelligence, WuHan 430074)
Abstract: Edge refers to the gray pixels around the roof of a step change or a change in the set of
those pixels, reflecting the gray value of the discontinuity. Usually we use images of the first order
derivative and second derivative to extract the edge. Traditional Canny edge detection algorithm is
sensitive to noise, can’t effect better on isolated points and always produce fake edge. In this paper,
we use a template window of 3 × 3 pixsels which allows us to get gradient amplitude in diagonal
direction. This will improve the positioning accuracy and reduce the noise. In addition, we also
introduce the concept of local image contrast in this paper. This can effectively settle problem
when the image unevenly illuminated. The calculation of the relative value of the local gradient
improves the quality of edge detection, espeically those edges in the dark area.
Keywords: Canny operator; Image contrast; Relative gradient; Edge detection
0 引言
图像分析时,人们采用过许多方法来从图像中提取出边缘结构。由于物体的边缘结构决
定了物体形状上的许多特性,边缘检测技术在机器视觉领域得到了广泛的应用。物体与背景
之间、物体与物体之间、基元与基元之间都广泛存在着边缘。常见的边缘有 3 种:阶梯状边
缘、脉冲状边缘和屋脊状边缘[1]。如果一个像素落在图像中某一个物体的边界上,那么它的
邻域将成为一个灰度级的变化带。对这种变化最有用的两个特征是灰度的变化率和方向,它
们分别以梯度向量的幅度和方向来表示。边缘检测算子检查每个像素的邻域并对灰度变化率
进行量化,也包括方向的确定,大多数使用基于方向导数掩膜求卷积的方法。传统 canny 算
子只考虑了横纵 4 个方向上的梯度幅值,边缘定位不够精确。此外,传统 canny 计算的梯度
幅值是绝对值,会导致弱信息的丢失[2]。本文对传统 canny 进行改造,提出了同时计算 3×3
邻域 8 个方向上的相对梯度幅值。既提高了定位精度,同时保留住了弱信息。
作者简