Information Technology Reference
In-Depth Information
(a) (b) (c)
Fig. 8.4. Background correction: (a) original image with non-uniform lighting; (b) estimated
background intensity; (c) corrected image.
(a) I f I t I b I f I t I b (b)
Fig. 8.5. Threshold estimation: (a) histogram of background corrected image and smoothed
histogram with estimated threshold, as well as background and foreground intensity; (b) con-
trast enhanced image.
Figure 8.5(a) shows the intensity histogram of the corrected image, as well as
a smoothed version of it. Smoothing was done by repeatedly applying a binomial
1 / 4 (1 2 1) kernel until the number of local minima reduced to one. The index of
the remaining local minimum is now used as a threshold I t . The two local maxima
represent the intensities of the foreground I f and the background I b . Both are used
to determine a range I t ± u where the contrast is stretched linearly:
( I b I f ) / 10 ,
u =
w =
min(255 ,I t + u ) ,
max(0 ,I t u ) ,
b =
8
<
0
: C ( i,j ) < b
S ( i,j )
=
255
: C ( i,j ) > w
. (8.3)
:
( C ( i,j ) b ) 255 / ( w b )
:
else
The resulting image S ( i,j ) is shown in Figure 8.5(b). As can be seen, most
pixels are either black or white, but some pixels at borders between cells have been
assigned intermediate gray values, representing uncertainty.
Figure 8.6 shows the contrast stretched versions of the images from Fig. 8.3. In
general, these images are a good approximation to the desired output, a black and
Search WWH ::




Custom Search