Page 57 -
P. 57
Chapter 2 ■ Edge-Detection Techniques 31
1
1
the gradient at the point (x,y),but at (x − , y − ). Theedgelocations would
2 2
therefore be shifted by one half of a pixel in the −x and −y directions. A better
choice for an approximation might be 2 :
∇ x2 A = A(x + 1, y) − A(x − 1, y)
∇ y2 A = A(x, y + 1) − A(x, y − 1) (EQ 2.5)
This operator is symmetrical with respect to the pixel (x,y),althoughitdoes
not consider the value of the pixel at (x,y).
Whichever operator is used to compute the gradient, the resulting vector
contains information about how strong the edge is at that pixel and what
its direction is. The magnitude of the gradient vector is the length of the
hypotenuse of the right triangle having sides and this reflects the strength of
the edge, or edge response, at any given pixel. The direction of the edge at the
same pixel is the angle that the hypotenuse makes with the axis.
Mathematically, the edge response is given by:
∂A ∂A
2 2
G mag = + (EQ 2.6)
∂x ∂y
and the direction of the edge is approximately:
∂A
∂y
G dir = atan (EQ 2.7)
∂A
∂x
The edge magnitude will be a real number, and is usually converted to
an integer by rounding. Any pixel having a gradient that exceeds a specified
threshold value is said to be an edge pixel, and others are not. Technically,
an edge detector will report the edge pixels only, whereas edge enhancement
draws the edge pixels over the original image. This distinction will not be
important in the further discussion. The two edge detectors evaluated here
will use the middle value in the range of grey levels as a threshold.
At this point, it would be useful to see the results of the two gradient
operators applied to an image. For the purposes of evaluation of all the
methods to be presented, a standard set of test images is suggested. The basic
set appears in Figure 2.8, and noisy versions off these will also be used. Noise
will be normally distributed and have standard deviations of 3, 9, and 18. For
an edge gradient of 18 grey levels, these correspond to signal-to-noise ratios
of 6, 2, and 1, respectively. The appearance of the edge-enhanced test images
will give a rough cue about how successful the edge-detection algorithm is.