Image Processing Reference
In-Depth Information
P x,y-1
P x+1,y-1
P x-1, y-1
Edge
direction
at P x, y
M 1
P x, y
My
P x+1,y
P x-1, y
Mx
P x+1,y+1
P x,y+1
P x-1,y+1
M 2
Normal
to edge
direction
Figure 4.16
Interpolation in non-maximum suppression
M
M
MM
M
-
y
x
x
y
M
1 =
M(x
+ 1, - 1) +
y
Mx, y
(
- )
(4.20)
x
and
M
M
MM
M
-
y
x
x
y
M
2 =
M(x
- 1, + 1) +
y
Mx, y
(
+ )
(4.21)
x
The point P x , y is then marked as a maximum if M ( x, y ) exceeds both M 1 and M 2 , otherwise
it is set to zero. In this manner the peaks of the ridges of edge magnitude data are retained,
whilst those not at the peak are set to zero. The implementation of non-maximum suppression
first requires a function which generates the co-ordinates of the points between which the
edge magnitude is interpolated. This is the function get_coords in Code 4.9 which
requires the angle of the normal to the edge direction, returning the co-ordinates of the
points beyond and behind the normal.
The non-maximum suppression operator, non_max in Code 4.10 then interpolates the
edge magnitude at the two points either side of the normal to the edge direction. If the edge
magnitude at the point of interest exceeds these two then it is retained, otherwise it is
discarded. Note that the potential singularity in Equations 4.20 and 4.21 can be avoided by
use of multiplication in the magnitude comparison, as opposed to division in interpolation,
as it is in Code 4.10 . In practice, however, this implementation, Codes 4.9 and 4.10 , can
suffer from numerical imprecision and ill-conditioning. Accordingly, it is better to implement
a hand-crafted interpretation of Equations 4.20 and 4.21 applied separately to the four
quadrants. This is too lengthy to be included here, but a version is included with the
worksheet for Chapter 4 (to be found on the website, p. 26).
The transfer function associated with hysteresis thresholding is shown in Figure 4.17 .
Points are set to white once the upper threshold is exceeded and set to black when the lower
Search WWH ::




Custom Search