Misplaced Pages

Deriche edge detector

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
For other uses, see Deriche.
Feature detection
Edge detection
Corner detection
Blob detection
Ridge detection
Hough transform
Structure tensor
Affine invariant feature detection
Feature description
Scale space
This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (March 2013) (Learn how and when to remove this message)

Deriche edge detector is an edge detection operator developed by Rachid Deriche in 1987. It is 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 ) = S ω e α | x | sin ω x {\displaystyle 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 ω {\displaystyle \omega } approaches 0. Such filter then uses the formula:

f ( x ) = S x e α | x | {\displaystyle 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
α α = 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.

Deriche detector implementation

It is 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 i j 1 = a 1 x i j + a 2 x i j 1 + b 1 y i j 1 1 + b 2 y i j 2 1 {\displaystyle y_{ij}^{1}=a_{1}x_{ij}+a_{2}x_{ij-1}+b_{1}y_{ij-1}^{1}+b_{2}y_{ij-2}^{1}}

and from right to left according to the formula:

y i j 2 = a 3 x i j + 1 + a 4 x i j + 2 + b 1 y i j + 1 2 + b 2 y i j + 2 2 {\displaystyle y_{ij}^{2}=a_{3}x_{ij+1}+a_{4}x_{ij+2}+b_{1}y_{ij+1}^{2}+b_{2}y_{ij+2}^{2}}

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

θ i j = c 1 ( y i j 1 + y i j 2 ) {\displaystyle \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 i j 1 = a 5 θ i j + a 6 θ i 1 j + b 1 y i 1 j 1 + b 2 y i 2 j 1 {\displaystyle y_{ij}^{1}=a_{5}\theta _{ij}+a_{6}\theta _{i-1j}+b_{1}y_{i-1j}^{1}+b_{2}y_{i-2j}^{1}}
y i j 2 = a 7 θ i + 1 j + a 8 θ i + 2 j + b 1 y i + 1 j 2 + b 2 y i + 2 j 2 {\displaystyle y_{ij}^{2}=a_{7}\theta _{i+1j}+a_{8}\theta _{i+2j}+b_{1}y_{i+1j}^{2}+b_{2}y_{i+2j}^{2}}
Θ i j = c 2 ( y i j 1 + y i j 2 ) {\displaystyle \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.

Deriche filter coefficients
smoothing x-derivative y-derivative
k {\displaystyle k} ( 1 e α ) 2 1 + 2 α e α e 2 α {\displaystyle {\frac {{(1-e^{-\alpha })}^{2}}{1+2\alpha e^{-\alpha }-e^{-2\alpha }}}} ( 1 e α ) 2 1 + 2 α e α e 2 α {\displaystyle {\frac {{(1-e^{-\alpha })}^{2}}{1+2\alpha e^{-\alpha }-e^{-2\alpha }}}} ( 1 e α ) 2 1 + 2 α e α e 2 α {\displaystyle {\frac {{(1-e^{-\alpha })}^{2}}{1+2\alpha e^{-\alpha }-e^{-2\alpha }}}}
a 1 {\displaystyle a_{1}} k {\displaystyle k} 0 k {\displaystyle k}
a 2 {\displaystyle a_{2}} k e α ( α 1 ) {\displaystyle ke^{-\alpha }(\alpha -1)} 1 k e α ( α 1 ) {\displaystyle ke^{-\alpha }(\alpha -1)}
a 3 {\displaystyle a_{3}} k e α ( α + 1 ) {\displaystyle ke^{-\alpha }(\alpha +1)} -1 k e α ( α + 1 ) {\displaystyle ke^{-\alpha }(\alpha +1)}
a 4 {\displaystyle a_{4}} k e 2 α {\displaystyle -ke^{-2\alpha }} 0 k e 2 α {\displaystyle -ke^{-2\alpha }}
a 5 {\displaystyle a_{5}} k {\displaystyle k} k {\displaystyle k} 0
a 6 {\displaystyle a_{6}} k e α ( α 1 ) {\displaystyle ke^{-\alpha }(\alpha -1)} k e α ( α 1 ) {\displaystyle ke^{-\alpha }(\alpha -1)} 1
a 7 {\displaystyle a_{7}} k e α ( α + 1 ) {\displaystyle ke^{-\alpha }(\alpha +1)} k e α ( α + 1 ) {\displaystyle ke^{-\alpha }(\alpha +1)} -1
a 8 {\displaystyle a_{8}} k e 2 α {\displaystyle -ke^{-2\alpha }} k e 2 α {\displaystyle -ke^{-2\alpha }} 0
b 1 {\displaystyle b_{1}} 2 e α {\displaystyle 2e^{-\alpha }} 2 e α {\displaystyle 2e^{-\alpha }} 2 e α {\displaystyle 2e^{-\alpha }}
b 2 {\displaystyle b_{2}} e 2 α {\displaystyle -e^{-2\alpha }} e 2 α {\displaystyle -e^{-2\alpha }} e 2 α {\displaystyle -e^{-2\alpha }}
c 1 {\displaystyle c_{1}} 1 ( 1 e α ) 2 {\displaystyle -{(1-e^{-\alpha })}^{2}} 1
c 2 {\displaystyle c_{2}} 1 1 ( 1 e α ) 2 {\displaystyle -{(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
Filtered image
Filter parameters α = 1.5
low threshold = 20
high threshold = 40
α = 4.0
low threshold = 50
high threshold = 90
α = 0.8
low threshold = 26
high threshold = 41
α = 1.0
low threshold = 15
high threshold = 35

See also

Further reading

  • R. Deriche, Using Canny's criteria to derive a recursively implemented optimal edge detector, Int. J. Computer Vision, Vol. 1, pp. 167–187, April 1987.
  • R. Sirdey, A Gentle Introduction to the Deriche Optimal Edge Detector, Éditions des Nik's news, 1998.
  • J. Canny, A Computational Approach To Edge Detection, IEEE Transactions on Pattern Analysis and Machine Intelligence, 8(6):679–698, 1986.

External links

Category:
Deriche edge detector Add topic