边缘检测子综述(A review of classic edge detectors[J]. Image Processing On Line, 2012.)

网友投稿 1058 2022-08-30

边缘检测子综述(A review of classic edge detectors[J]. Image Processing On Line, 2012.)

边缘检测子综述(A review of classic edge detectors[J]. Image Processing On Line, 2012.)

本文主要最12年发表在IPOL上的一篇关于边缘检测子的综述(A review of classic edge detectors [1])做一简单总结和分析。

本文将主流的边缘检测子分为一阶偏导(Sobel, Prewitt and Roberts)和二阶偏导(Marr-Hildreth and Haralick. )两类,并分别从定性(感知)和定量(操作次数,执行时间)的角度对它们分别分析和讨论。

1.基本概念

边缘检测的基本原理是检测图像像素的突然变化。

2.基于一阶导数的边缘检测子

基于一阶导数的边缘检测子基本都有如下的结构,差异仅存在于它们计算导数时的滤波器类型。

图片 f 强度变化的大小和方向用梯度算子(gradient operator)来衡量:

梯度向量∇f在位置(x,y)的大小magnitude (M) 和方向direction (α) 为:

在图片任意位置(x, y)边的方向正交于梯度向量的方向α(x, y) 。

2.1. Roberts算子(The Roberts Operators)

L.G. Rob erts [2]使用一阶泰勒展开式(the first order Taylor expansion )来近似一阶偏导。

2.2. Prewitt算子(The Prewitt Operators)

尽管2D(2×2)掩模概念简单,但是关于中心点不对称。包含对称信息的算子必须是奇数的,最小的为(3×3)。

The left hand mask can be constructed (up to a scale factor) as the convolution of two filters: a vertical derivative [−1 0 1]T and an horizontal moving average [1 1 1]. The same reasoning could be applied to the right hand mask. Hence, these operators can be interpreted as the consecutive application of an horizontal low pass filter with a vertical derivative filter, and vice versa. Thus, they show smoothing properties in the direction orthogonal to the gradient.

2.3. Sobel算子(The Sobel Operators)

Sobel算子是Prewitt算子的一个加权版本,平滑效果一般比Prewitt算子好。

Sobel masks can be seen (up to a scale factor) as the convolution of a vertical derivation mask [−1 0 1]T with an horizontal smoothing filter [1 2 1](closer to a Gaussian response than Prewitt), and vice versa. Hence, these operators have better smoothing properties, as mentioned in the preceding paragraph.

2.4. 边缘的计算(Computation of the Edges)

在获得梯度的近似值后(存储于两个矩阵,分别对应fx和fy),接着通过 式来获得图片强度的大小,最后使用一个阈值(常为最大值的百分比值)来过滤它:

2.5. 伪代码(Pseudo-code)

3.基于二阶导数的边缘检测子

前面讨论的基于一阶导数的边缘检测子主要差异在于使用不同的掩模来过滤图片。然而它并没有考虑边缘的特征和图片中的噪声。接下来介绍的基于二阶导数的边缘检测子在检测边缘前先减少噪声。

3.1. Marr-Hildreth算法(The Marr and Hildreth Algorithm)

3.1.1.基本概念 基于寻找图片的二阶导数的零交叉点(zero crossing points)来检测边缘。本文主要实现了两种方法:A1:用一个高斯核 对图片进行卷积然后使用一个3× 3 核来近似二阶导数; A2: 使用一个高斯核的Laplacian算子对图片卷积,接下来在过滤后的图片中搜索零交叉点(zero crossing points)。

3.1.2.Marr-Hildreth 边缘检测算法

A. 通过采样高斯核(如下)获得的n × n高斯低通滤波器过滤图片;

B. 使用如下图所示的3 × 3掩模计算从1所过滤图片的Laplacian;

C. 找到从步骤2所得图片的零交叉点(zero crossing points)。

3.1.3.零交叉(Zero Crossing)

A zero crossing at pixel p implies that the signs of at least two opposite neighboring pixels are different. There are four cases to test: left/right, up/down, and the two diagonals. In this case two conditions must hold: first, the signs of the opposite pixels must differ, and second, their difference in absolute value must be greater than a certain threshold.

每个像素有8个邻居,分别为

如果以下条件有任一满足,该点就认为是边缘点。

零交叉检测是Marr-Hildreth边缘检测方法的主要特点。一般来说它的精度可以满足实际需求,但当要求更高精度时可以使用其他方法找到亚像素级的精度[2]。

3.1.4.伪代码

3.2. Haralick 算法(The Haralick Algorithm)

In this method, however, the input image is smoothly approximated through local bi-cubic polynomial fitting. Then, when calculating the second derivative analytically, it is possible to find an equivalent expression to find the zeros of the second derivative of the polynomial as a function of its parameters.

3.2.1 双三次多项式拟合(Bi-cubic Polynomial Fitting)

给定图片中任意一个像素(x0,y0),它周围的邻居可以使用下式来接近

Haralick把当前像素作为坐标中心,即当前像素的邻居中心为(0, 0),有

因为有10个参数,所以我们要求有25(能满足条件的最小奇数矩阵为 5 × 5)个数据的邻居。因此有:

这个最小二乘问题可以使用下式来求解

对每个因子ki   (i从1到10)

其中,bi为矩阵B的第i行

重排bi为5 × 5矩阵形式并标记为 maski

3.2.2 二阶导数的解析计算(Analytical Calculation of the Second Derivative)

Haralick算法的主要思想是寻找“二阶导数的负斜率零交叉点”(negative slop ed zero crossings of the second derivative),即寻找上升的阶跃型边缘。通过Haralick的定义,一个像素被认为是边缘要求满足下面三个条件: - 一阶导数非零; - 二阶导数为零; - 三阶导数为负。

利用极坐标来表示原始直角坐标,

其中 θ 为梯度向量角。代入(3.5)式,有

其中

对(3.11)求一阶导,二阶导和三阶导,求满足上面条件的解。

3.2.3 算法(Algorithm)

3.2.4 伪代码(Pseudo-code)

参考及延伸材料: [1] ​​​Spontón H, Cardelino J. A review of classic edge detectors[J]. Image Processing On Line, 2012.​​​ [2] W. E. Lorensen and H. E. Cline, Marching cubes: A high resolution 3D surface construction algorithm, in Proceedings of the 14th Annual Conference on Computer Graphics and Interactive Techniques, vol. 21, New York, NY, USA, Aug. 1987, ACM, pp. 163–169. [3] R. M. Haralick, Digital step edges from zero crossing of the second directional derivatives, IEEE Transactions on Pattern Analysis and Machine Intelligence, 6 (1984), pp. 58–68. ​​​http://dx.doi.org/10.1109/TPAMI.1984.4767475​​.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:luogu1196 银河英雄传说
下一篇:MySQL临时表
相关文章

 发表评论

暂时没有评论,来抢沙发吧~