Deriche edge detector

Deriche边缘检测器是一种1987年提出的边缘检测算子,它基于Canny的工作并优化了边缘检测结果。算法包括平滑、梯度计算、非极大值抑制和滞后阈值四个步骤。主要区别在于Deriche使用IIR滤波器,可通过参数α调整检测质量和定位精度。该滤波器在处理噪声图像或需要大量平滑时表现出优势,且适用于高度并行的系统如NVIDIA CUDA。

http://en.wikipedia.org/wiki/Deriche_edge_detector


Deriche edge detector is an edge detection operator developed by Rachid Deriche in 1987. It's a multistep algorithm used to obtain an optimal result of edge detection in a discrete two-dimensional image. This algorithm is based on John F. Canny's work related to the edge detection (Canny's edge detector) and his criteria for optimal edge detection:

  • Detection quality – all existing edges should be marked and no false detection should occur.
  • Accuracy - the marked edges should be as close to the edges in the real image as possible.
  • Unambiguity - a given edge in the image should only be marked once. No multiple responses to one edge in the real image should occur.

For this reason, this algorithm is often referred to as Canny-Deriche detector.


Differences between Canny and Deriche edge detector

Deriche edge detector, like Canny edge detector, consists of the following 4 steps:

  1. Smoothing
  2. Calculation of magnitude and gradient direction
  3. Non-maximum suppression
  4. Hysteresis thresholding (using two thresholds)

The essential difference is in the implementation of the first two steps of the algorithm. Unlike the Canny edge detector, Deriche edge detector uses the IIR filter in the form:

 f(x)=\frac{S}{\omega}e^{-\alpha|x|}sin\omega x

The filter optimizes the Canny criteria. As is evident from the preceding formula, the most effective filter is obtained when the value of \omega approaches 0. Such filter then uses the formula:

 f(x)=Sxe^{-\alpha|x|}

The advantage of such a filter is that it can be adapted to the characteristics of the processed image using only one parameter. If the value of α is small (usually between 0.25 and 0.5), it results in better detection. On the other hand, better localization is achieved when the parameter has a higher value (around 2 or 3). For most of the normal cases parameter value of around 1 is recommended.

Example of smoothing using Deriche filter
Image
Sun flower - Deriche filter smoothing - alpha = 0.25.jpg
Sun flower - Deriche filter smoothing - alpha = 0.5.jpg
Sun flower - Deriche filter smoothing - alpha = 1.jpg
Sun flower - Deriche filter smoothing - alpha = 2.jpg
αα = 0.25α = 0.5α = 1α = 2

Using the IIR filter makes sense especially in cases where the processed image is noisy or a large amount of smoothing is required (which leads to large convolution kernel for FIR filter). In these cases, the Deriche detector has considerable advantage over the Canny detector, because it is able to process images in a short constant time independent of the desired amount of smoothing.

[edit]Deriche detector implementation

It's possible to separate the process of obtaining the value of a two-dimensional Deriche filter into two parts. In first part, image array is passed in the horizontal direction from left to right according to the following formula:

y_{ij}^1=a_1x_{ij}+a_2x_{ij-1}+b_1y_{ij-1}^1+b_2y_{ij-2}^1

and from right to left according to the formula:

y_{ij}^2=a_3x_{ij+1}+a_4x_{ij+2}+b_1y_{ij+1}^2+b_2y_{ij+2}^2

The result of the computation is then stored into temporary two-dimensional array:

\theta_{ij}=c_1(y_{ij}^1+y_{ij}^2)

The second step of the algorithm is very similar to the first one. The two-dimensional array from the previous step is used as the input. It is then passed in the vertical direction from top to bottom and bottom-up according to the following formulas:

y_{ij}^1=a_5\theta_{ij}+a_6\theta_{i-1j}+b_1y_{i-1j}^1+b_2y_{i-2j}^1
y_{ij}^2=a_7\theta_{i+1j}+a_8\theta_{i+2j}+b_1y_{i+1j}^2+b_2y_{i+2j}^2
\Theta_{ij}=c_2(y_{ij}^1+y_{ij}^2)

The description of the algorithm implies that the processed rows and columns are independent of each other. As a result, the solution based on the IIR filter is often employed in embedded systems and architectures, which support a high level of parallelization, such as NVIDIA CUDA.

Deriche filter coeficients
  smoothing x-derivative y-derivative
k \frac{​{(1-e^{-\alpha})}^2}{1+2\alpha e^{-\alpha}-e^{-2\alpha}} \frac{​{(1-e^{-\alpha})}^2}{1+2\alpha e^{-\alpha}-e^{-2\alpha}} \frac{​{(1-e^{-\alpha})}^2}{1+2\alpha e^{-\alpha}-e^{-2\alpha}}
a_1k0k
a_2ke^{-\alpha}(\alpha-1)1ke^{-\alpha}(\alpha-1)
a_3ke^{-\alpha}(\alpha+1)-1ke^{-\alpha}(\alpha+1)
a_4 -ke^{-2\alpha} 0 -ke^{-2\alpha}
a_5kk0
a_6ke^{-\alpha}(\alpha-1)ke^{-\alpha}(\alpha-1)1
a_7ke^{-\alpha}(\alpha+1)ke^{-\alpha}(\alpha+1)-1
a_8 -ke^{-2\alpha} -ke^{-2\alpha} 0
b_12e^{-\alpha}2e^{-\alpha}2e^{-\alpha}
b_2 -e^{-2\alpha} -e^{-2\alpha} -e^{-2\alpha}
c_11-{(1-e^{-\alpha})}^21
c_211-{(1-e^{-\alpha})}^2

The mathematical properties of the algorithm are often used in practical implementation of the Deriche detector. It is sufficient to implement only one part of the algorithm, which is then called twice, while performing a transposition of the resulting matrix.

Examples of using Deriche filter on various source images
Source image
Sunflowers in July.jpg
Magician artwork.jpg
F1A glider hook.jpg
Grapevine leaf.jpg
Filtered image
Sunflowers image processed by Deriche edge detector.jpg
Magician processed by Deriche edge detector.jpg
F1A glider hook processed by Deriche edge detector.jpg
Grapevine leaf processed by Deriche edge detector.jpg
Filter parametersα = 1.5
low treshold = 20
high treshold = 40
α = 4.0
low treshold = 50
high treshold = 90
α = 0.8
low treshold = 26
high treshold = 41
α = 1.0
low treshold = 15
high treshold = 35


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值