Information Technology Reference
In-Depth Information
where v is the filter output, as shown in Fig. 7.4(e), and r,g,b are the color com-
ponents. The output of the red-filter is used in the following as a mask to suppress
dark lines of other colors.
Figure 7.4(f) shows the result of the color filtering. This image is based on the
green component that has been convolved with a 3 × 3 center-surround kernel to
amplify high image frequencies. If the maximal red-filter response of a pixel's 3 × 3-
neighborhood does not exceed the average red-filter response by at least a value of
eight, then a value of 32 is added to the filter output. Thus, the pixels close to the
red lines appear darker than the background.
Contrast Enhancement. The next step of the preprocessing is to enhance the im-
age contrast. This is done by stretching the pixel intensities linearly from an interval
[ g min ,g max ] to [0 , 224] . All intensities lower than g min are set to 0 (black). All in-
tensities larger than g max are set to 255 (white), the background value.
The lower threshold g min is determined using the intensity histogram shown in
Figure 7.5(a) for the three examples from Fig. 7.4. Because one cannot perceive
a clear distinction between the intensities of the print and the background, g min is
chosen as the minimal intensity that has at least 32 darker pixels in the histogram.
The upper threshold g max is initialized similarly by setting it to the minimal in-
tensity value that has (128 + a/ 16) darker pixels in the histogram, where a is the
total number of pixels. It is modified to lie in the closest local minimum of the his-
togram in order to minimize the segmentation error between the background and the
brightest foreground pixels. The described method of choosing the interval borders
ensures that, after contrast stretching, some black pixels exist and that most pixels
are assigned to the background.
In Figure 7.5(b) the results of this contrast stretching are shown. The readabil-
ity of the meter values has improved greatly. On the other hand, one can observe
that some isolated pixels which correspond to noise were segmented as foreground.
Furthermore, some adjacent lines are merged to single foreground blobs. To address
these problems, a counter c is computed for the 8-neighborhood of each pixel. It
counts the foreground pixels. Dark pixels with an intensity smaller than 128 are
counted twice.
(a)
(b)
(c)
Fig. 7.5. Contrast enhancement. For the examples from Fig. 7.4 are shown: (a) histogram with
marked minimal and maximal gray values; (b) contrast stretched; (c) isolated pixels removed
and blobs weakened.
Search WWH ::




Custom Search