68
Biomedical Signal and Image Processing
of the Gaussian controlling the degree of smoothing. The output of the smoothing
filter, S(i, j), is related to the original image and the smoothing filter as follows:
S i
( , j ) = G( ,
i j ) ∗ I( ,
i j )
(4.5)
In the next step, in order to calculate the magnitude and orientation (direction) of the
gradient vector, the gradient of the smoothed image is used to produce the horizontal
and vertical partial (directional) derivatives P(i, j) and Q(i, j), respectively. These
directional derivatives are calculated as follows:
S i
( , j + −
1) S i
( , j ) + S i
( +1, j + −
1 ) S i
( + 1, j)
P i
( , j ) ≈
(4.6)
2
and
S i
( , j ) −
+
S i
( 1, j) + S i
( , j +1) −
+
S i
( 1, j + 1)
Q i
( , j ) ≈
(4.7)
2
As it can be seen, P(i, j) is calculated as the average of the horizontal derivate at
pixels (i, j) and (i + 1, j). The value of Q(i, j) is calculated similarly using the average of the vertical derivative at pixels (i, j) and (i, j + 1). The magnitude M(i, j) and
orientation θ(i, j) of the gradient vector are then given as follows:
M i
( , j ) = P( ,
i j )
2
+ Q( ,
i j )
2
(4.8)
and
−1 ⎡Q i
( , j ) ⎤
q( ,
i j ) = tan ⎢
⎥
(4.9)
⎣ P i
( , j ) ⎦
In the third step, a thresholding operation is applied to identify the ridges of the edge
pixels. In Canny method, an edge point is defined as a point whose gradient’s magnitude identifies a local maximum in the direction of the gradient. The process of
searching for such pixels, which is often called “non-maxima suppression,” thresholds the gradient magnitude to find potential edge pixels. This step will result to an
image N(i, j), which is 0 except at the local maxima points.
After applying non-maxima suppression, there are often many false edge fragments in the image often caused by either noisy pixels or by edge-like fragments in
the image that do not represent a true edge. To discard these false edge fragments,
one can apply thresholds to N(i, j) and set all of the values below the threshold value
to 0. After thresholding, an array including the edges of the image, I(i, j), is obtained.
As the description of the thresholding step implies, the selection of the right threshold values is a sensitive choice. While small threshold values can allow many false
Précédent

- 95/412

Suivant