Image Processing Reference
In-Depth Information
already been labelled as white (otherwise the function would become an infinite loop). If
both conditions are satisfied (and the point is within the picture) then the point is set to
white and becomes a seed point for further analysis. This implementation tries to check the
seed point as well, even though it has already been set to white. The operator could be
arranged not to check the current seed point, by direct calculation without the for loops,
and this would be marginally faster. Including an extra Boolean constraint to inhibit check
of the seed point would only slow the operation. The connect routine is recursive: it is
called again by the new seed point.
The process starts with the point that exceeds the upper threshold. When such a point is
found, it is set to white and it becomes a seed point where connectivity analysis starts. The
calling operator for the connectivity analysis, hyst_thr , which starts the whole process
is given in Code 4.13 . When hyst_thr is invoked, its arguments are the co-ordinates of
the point of current interest, the non-maximum suppressed edge image, n_edg (which is
eventually delivered as the hysteresis thresholded image), and the upper and lower switching
thresholds, upp and low , respectively. For display purposes, this operator requires a later
operation to remove points which have not been set to white (to remove those points which
are below the upper threshold and which are not connected to points above the lower
threshold). This is rarely used in application since the points set to white are the only ones
of interest in later processing.
for x 1..cols(n_edg)-2
for y 1..rows(n_edg)-2
if[(n_edg y,x upp)·(n_edg y,x 255)]
n_edg y,x 255
n_edg
hyst_thr(n_edg,upp,low):=
connect(x,y,n_edg,low)
n_edg
Code 4.13
Hysteresis thresholding operator
A comparison with the results of uniform thresholding is shown in Figure 4.20 . Figure
4.20 (a) shows the result of hysteresis thresholding of a Sobel edge detected image of the
eye with an upper threshold set to 40 pixels, and a lower threshold of 10 pixels. Figures
4.20 (b) and (c) show the result of uniform thresholding applied to the image with thresholds
of 40 pixels and 10 pixels, respectively. Uniform thresholding can select too few points if
the threshold is too high, and too many if it is too low. Hysteresis thresholding naturally
selects all the points in Figure 4.20 (b), and some of those in Figure 4.20 (c), those connected
to the points in (b). In particular, part of the nose is partly present in Figure 4.20 (a),
whereas it is absent in Figure 4.20 (b) and masked by too many edge points in Figure
4.20 (c). Also, the eyebrow is more complete in (a) whereas it is only partial in (b) and
complete (but obscured) in (c). Hysteresis thresholding therefore has an ability to detect
major features of interest in the edge image, in an improved manner to uniform thresholding.
The action of the Canny operator on a larger image is shown in Figure 4.21 , in comparison
with the result of the Sobel operator. Figure 4.21 (a) is the original image of a face, Figure
4.21 (b) is the result of the Canny operator (using a 5 × 5 Gaussian operator with σ = 1 and
with upper and lower thresholds set appropriately) and Figure 4.21 (c) is the result of a
Search WWH ::




Custom Search