RANK-BASED FILTERS
In the preceding chapter, two very different categories of neighborhood proce-
dures were introduced. One used a convolution kernel of weights that were multiplied
by the pixel values, and the results summed, while the other was based on ranking
the pixels in the neighborhood into order and selecting the median, brightest or
darkest value. The sharpening methods described above are convolution methods
that use all of the pixels in the neighborhood, with weights that depend on distance
and direction from the central pixel. It is also useful to apply rank-based procedures
to select details of interest for enhancement.
The top-hat filter is used to select objects that are darker (or brighter) than the
local background for retention or removal. The procedure uses two neighborhoods
for ranking. Usually the central one is circular and the outer one is an annulus that
surrounds it. The name comes from drawing this configuration (Figure 3.16) with
the inner neighborhood shown as the crown of a top hat and the outer one as the
brim. The height of the crown is the required brightness difference between the
feature (which must fit inside the crown) and the background.
The top hat compares the darkest pixel in the inner region to the darkest one in
the surrounding neighborhood. If the difference between these is greater than some
threshold value the pixel is kept, otherwise it is not. This allows selection of features
based on size (defined by the inner region), contrast (the required difference in pixel
values), and separation (the width of the brim). As shown in Figure 3.17, features
that are large, or close together, or have long lines, are rejected because the darkest
values in the inner and outer neighborhoods are not sufficiently different. Obviously,
the logic can be reversed to look for bright features instead of dark ones.
One of the principal uses of the top-hat filter is locating spikes in Fourier-space
power spectra. The high frequency periodic noise spikes shown in the preceding
chapter are efficiently located by a top-hat filter, rather than by manual marking. A
top hat was used in this way to create the filter that removed the periodic noise in
Figure 2.35 of the preceding chapter. The procedure is also useful whenever images
contain features of interest that have a particular size, especially when the image
also contains other larger objects, possibly on a nonuniform background. Figure
3.18 shows an example.
If the top-hat filter can be used to isolate a particular structure from an image,
it follows that it can also be used to remove it. When used for that purpose, it is a
FIGURE 3.16
Schematic drawing of a top-hat filter.
Crown Brim
2241_C03.fm Page 145 Thursday, April 28, 2005 10:28 AM
Copyright © 2005 CRC Press LLC