Module 4
Module 4
TABLE 4.3
Name DFT Pairs
(Continued)
7) Correlation f(x, y) h(x, y) 3 F *(u, v) H(u, v)
theorem† f*(x, y)h(x, y) 3 F(u, v) H(u, v)
8) Discrete unit d(x, y) 3 1
impulse
sin(pua) sin(pvb) -jp(ua + vb)
9) Rectangle rect[a, b] 3 ab e
(pua) (pvb)
10) Sine sin(2pu0x + 2pv0y) 3
www.EBooksWorld.ir
256 Chapter 4 ■ Filtering in the Frequency Domain
a b
FIGURE 4.29 (a) SEM image of a damaged integrated circuit. (b) Fourier spectrum of
(a). (Original image courtesy of Dr. J. M. Hudak, Brockhouse Institute for Materials
Research, McMaster University, Hamilton, Ontario, Canada.)
www.EBooksWorld.ir
4.7 ■ The Basics of Filtering in the Frequency Domain 257
that is off-axis slightly to the left. This component was caused by the edges of
the oxide protrusions. Note how the angle of the frequency component with
respect to the vertical axis corresponds to the inclination (with respect to the
horizontal axis) of the long white element, and note also the zeros in the ver-
tical frequency component, corresponding to the narrow vertical span of the
oxide protrusions.
These are typical of the types of associations that can be made in general
between the frequency and spatial domains. As we show later in this chapter,
even these types of gross associations, coupled with the relationships men-
tioned previously between frequency content and rate of change of intensity
levels in an image, can lead to some very useful results. In the next section,
we show the effects of modifying various frequency ranges in the transform
of Fig. 4.29(a).
†
Many software implementations of the 2-D DFT (e.g., MATLAB) do not center the transform. This im-
plies that filter functions must be arranged to correspond to the same data format as the uncentered
transform (i.e., with the origin at the top left). The net result is that filters are more difficult to generate
and display. We use centering in our discussions to aid in visualization, which is crucial in developing a
clear understanding of filtering concepts. Either method can be used practice, as long as consistency is
maintained.
www.EBooksWorld.ir
258 Chapter 4 ■ Filtering in the Frequency Domain
FIGURE 4.30
Result of filtering
the image in
Fig. 4.29(a) by
setting to 0 the
term F(M> 2, N> 2)
in the Fourier
transform.
www.EBooksWorld.ir
4.7 ■ The Basics of Filtering in the Frequency Domain 259
H (u, v)
H (u, v)
H(u, v)
M/2 N/2 M/ 2 N/ 2
u
v
N/2 M/2 a
u v u v
a b c
d e f
FIGURE 4.31 Top row: frequency domain filters. Bottom row: corresponding filtered images obtained using
Eq. (4.7-1).We used a = 0.85 in (c) to obtain (f) (the height of the filter itself is 1). Compare (f) with Fig. 4.29(a).
a b c
FIGURE 4.32 (a) A simple image. (b) Result of blurring with a Gaussian lowpass filter without padding.
(c) Result of lowpass filtering with padding. Compare the light area of the vertical edges in (b) and (c).
www.EBooksWorld.ir
260 Chapter 4 ■ Filtering in the Frequency Domain
a b
FIGURE 4.33 2-D image periodicity inherent in using the DFT. (a) Periodicity without
image padding. (b) Periodicity after padding with 0s (black). The dashed areas in the
center correspond to the image in Fig. 4.32(a). (The thin white lines in both images are
superimposed for clarity; they are not part of the data.)
dashed image, it will encompass part of the image and also part of the bottom
of the periodic image right above it. When a dark and a light region reside
under the filter, the result is a mid-gray, blurred output. However, when the fil-
ter is passing through the top right side of the image, the filter will encompass
only light areas in the image and its right neighbor. The average of a constant
is the same constant, so filtering will have no effect in this area, giving the re-
sult in Fig. 4.32(b). Padding the image with 0s creates a uniform border around
the periodic sequence, as Fig. 4.33(b) shows. Convolving the blurring function
with the padded “mosaic” of Fig. 4.33(b) gives the correct result in Fig. 4.32(c).
You can see from this example that failure to pad an image can lead to erro-
neous results. If the purpose of filtering is only for rough visual analysis, the
padding step is skipped sometimes.
Thus far, the discussion has centered on padding the input image, but
Eq. (4.7-1) also involves a filter that can be specified either in the spatial or in
the frequency domain. However, padding is done in the spatial domain, which
raises an important question about the relationship between spatial padding
and filters specified directly in the frequency domain.
At first glance, one could conclude that the way to handle padding of a
frequency domain filter is to construct the filter to be of the same size as the
image, compute the IDFT of the filter to obtain the corresponding spatial fil-
ter, pad that filter in the spatial domain, and then compute its DFT to return
to the frequency domain. The 1-D example in Fig. 4.34 illustrates the pitfalls in
this approach. Figure 4.34(a) shows a 1-D ideal lowpass filter in the frequency
domain. The filter is real and has even symmetry, so we know from property 8
in Table 4.1 that its IDFT will be real and symmetric also. Figure 4.34(b)
shows the result of multiplying the elements of the frequency domain filter
www.EBooksWorld.ir
4.7 ■ The Basics of Filtering in the Frequency Domain 261
1.2 0.04 a c
b d
1
0.03 FIGURE 4.34
(a) Original filter
0.8
specified in the
0.6 0.02 (centered)
frequency domain.
0.4 (b) Spatial
0.01 representation
0.2 obtained by
computing the
0
0 IDFT of (a).
(c) Result of
0.2 0.01 padding (b) to twice
0 128 255 0 128 256 384 511 its length (note the
0.04 1.2 discontinuities).
(d) Corresponding
1 filter in the
0.03
frequency domain
0.8 obtained by
0.02 computing the DFT
0.6 of (c). Note the
ringing caused by
0.4
0.01 the discontinuities
in (c). (The curves
0.2
appear continuous
0 because the points
0
were joined to
0.01 0.2 simplify visual
0 128 255 0 128 256 384 511 analysis.)
by (-1)u and computing its IDFT to obtain the corresponding spatial filter.
The extremes of this spatial function are not zero so, as Fig. 4.34(c) shows,
zero-padding the function created two discontinuities (padding the two ends
of the function is the same as padding one end, as long as the total number of
zeros used is the same).
To get back to the frequency domain, we compute the DFT of the spatial,
padded filter. Figure 4.34(d) shows the result.The discontinuities in the spatial fil-
ter created ringing in its frequency domain counterpart, as you would expect
from the results in Example 4.1. Viewed another way, we know from that exam-
ple that the Fourier transform of a box function is a sinc function with frequency
components extending to infinity, and we would expect the same behavior from
the inverse transform of a box.That is, the spatial representation of an ideal (box) See the end of Section
4.3.3 regarding the defini-
frequency domain filter has components extending to infinity. Therefore, any tion of an ideal filter.
spatial truncation of the filter to implement zero-padding will introduce disconti-
nuities, which will then in general result in ringing in the frequency domain (trun-
cation can be avoided in this case if it is done at zero crossings, but we are
interested in general procedures, and not all filters have zero crossings).
What the preceding results tell us is that, because we cannot work with an infi-
nite number of components, we cannot use an ideal frequency domain filter [as in
www.EBooksWorld.ir
262 Chapter 4 ■ Filtering in the Frequency Domain
Fig. 4.34(a)] and simultaneously use zero padding to avoid wraparound error. A
decision on which limitation to accept is required. Our objective is to work with
specified filter shapes in the frequency domain (including ideal filters) without
having to be concerned with truncation issues. One approach is to zero-pad im-
ages and then create filters in the frequency domain to be of the same size as the
padded images (remember, images and filters must be of the same size when
using the DFT). Of course, this will result in wraparound error because no
padding is used for the filter, but in practice this error is mitigated significantly by
the separation provided by the padding of the image, and it is preferable to ring-
ing. Smooth filters (such as those in Fig. 4.31) present even less of a problem.
Specifically, then, the approach we will follow in this chapter in order to work
with filters of a specified shape directly in the frequency domain is to pad images
to size P * Q and construct filters of the same dimensions. As explained ear-
lier, P and Q are given by Eqs. (4.6-29) and (4.6-30).
We conclude this section by analyzing the phase angle of the filtered trans-
form. Because the DFT is a complex array, we can express it in terms of its real
and imaginary parts:
The phase angle is not altered by filtering in the manner just described be-
cause H(u, v) cancels out when the ratio of the imaginary and real parts is
formed in Eq. (4.6-17). Filters that affect the real and imaginary parts equally,
and thus have no effect on the phase, are appropriately called zero-phase-shift
filters. These are the only types of filters considered in this chapter.
Even small changes in the phase angle can have dramatic (usually undesir-
able) effects on the filtered output. Figure 4.35 illustrates the effect of some-
thing as simple as a scalar change. Figure 4.35(a) shows an image resulting
from multiplying the angle array in Eq. (4.6-15) by 0.5, without changing
a b
FIGURE 4.35
(a) Image resulting
from multiplying by
0.5 the phase angle
in Eq. (4.6-15) and
then computing the
IDFT. (b) The
result of
multiplying the
phase by 0.25. The
spectrum was not
changed in either of
the two cases.
www.EBooksWorld.ir
4.7 ■ The Basics of Filtering in the Frequency Domain 263
ƒ F(u, v) ƒ , and then computing the IDFT. The basic shapes remain unchanged,
but the intensity distribution is quite distorted. Figure 4.35(b) shows the result
of multiplying the phase by 0.25. The image is almost unrecognizable.
†
If H(u, v) is to be generated from a given spatial filter, h(x, y), then we form hp(x, y) by padding the
spatial filter to size P * Q, multiply the expanded array by (-1)x + y, and compute the DFT of the result
to obtain a centered H(u, v). Example 4.15 illustrates this procedure.
www.EBooksWorld.ir
264 Chapter 4 ■ Filtering in the Frequency Domain
a b c
d e f
g h
FIGURE 4.36
(a) An M * N
image, f.
(b) Padded image,
fp of size P * Q.
(c) Result of
multiplying fp by
(-1)x + y.
(d) Spectrum of
Fp. (e) Centered
Gaussian lowpass
filter, H, of size
P * Q.
(f) Spectrum of
the product HFp.
(g) gp, the product
of (-1)x + y and
the real part of
the IDFT of HFp.
(h) Final result, g,
obtained by
cropping the first
M rows and N
columns of gp.
spatial domain. Conversely, it follows from a similar analysis and the convolu-
tion theorem that, given a spatial filter, we obtain its frequency domain repre-
sentation by taking the forward Fourier transform of the spatial filter.
Therefore, the two filters form a Fourier transform pair:
where h(x, y) is a spatial filter. Because this filter can be obtained from the re-
sponse of a frequency domain filter to an impulse, h(x, y) sometimes is re-
ferred to as the impulse response of H(u, v). Also, because all quantities in a
discrete implementation of Eq. (4.7-4) are finite, such filters are called finite
impulse response (FIR) filters. These are the only types of linear spatial filters
considered in this book.
We introduced spatial convolution in Section 3.4.1 and discussed its imple-
mentation in connection with Eq. (3.4-2), which involved convolving func-
tions of different sizes. When we speak of spatial convolution in terms of the
www.EBooksWorld.ir
4.7 ■ The Basics of Filtering in the Frequency Domain 265
convolution theorem and the DFT, it is implied that we are convolving peri-
odic functions, as explained in Fig. 4.28. For this reason, as explained earlier,
Eq. (4.6-23) is referred to as circular convolution. Furthermore, convolution
in the context of the DFT involves functions of the same size, whereas in
Eq. (3.4-2) the functions typically are of different sizes.
In practice, we prefer to implement convolution filtering using Eq. (3.4-2)
with small filter masks because of speed and ease of implementation in
hardware and/or firmware. However, filtering concepts are more intuitive in
the frequency domain. One way to take advantage of the properties of both
domains is to specify a filter in the frequency domain, compute its IDFT,
and then use the resulting, full-size spatial filter as a guide for constructing
smaller spatial filter masks (more formal approaches are mentioned in
Section 4.11.4). This is illustrated next. Later in this section, we illustrate
also the converse, in which a small spatial filter is given and we obtain its
full-size frequency domain representation. This approach is useful for ana-
lyzing the behavior of small spatial filters in the frequency domain. Keep in
mind during the following discussion that the Fourier transform and its in-
verse are linear processes (Problem 4.14), so the discussion is limited to lin-
ear filtering.
In the following discussion, we use Gaussian filters to illustrate how
frequency domain filters can be used as guides for specifying the coefficients
of some of the small masks discussed in Chapter 3. Filters based on Gaussian
functions are of particular interest because, as noted in Table 4.3, both the
forward and inverse Fourier transforms of a Gaussian function are real
Gaussian functions. We limit the discussion to 1-D to illustrate the underly-
ing principles. Two-dimensional Gaussian filters are discussed later in this
chapter.
Let H(u) denote the 1-D frequency domain Gaussian filter:
H(u) = A e -u >2s
2 2
(4.7-5)
These equations† are important for two reasons: (1) They are a Fourier trans-
form pair, both components of which are Gaussian and real. This facilitates
analysis because we do not have to be concerned with complex numbers. In
addition, Gaussian curves are intuitive and easy to manipulate. (2) The func-
tions behave reciprocally. When H(u) has a broad profile (large value of s),
†
As mentioned in Table 4.3, closed forms for the forward and inverse Fourier transforms of Gaussians
are valid only for continuous functions. To use discrete formulations we simply sample the continuous
Gaussian transforms. Our use of discrete variables here implies that we are dealing with sampled
transforms.
www.EBooksWorld.ir
266 Chapter 4 ■ Filtering in the Frequency Domain
h(x) has a narrow profile, and vice versa. In fact, as s approaches infinity, H(u)
tends toward a constant function and h(x) tends toward an impulse, which im-
plies no filtering in the frequency and spatial domains, respectively.
Figures 4.37(a) and (b) show plots of a Gaussian lowpass filter in the fre-
quency domain and the corresponding lowpass filter in the spatial domain.
Suppose that we want to use the shape of h(x) in Fig. 4.37(b) as a guide for
specifying the coefficients of a small spatial mask. The key similarity be-
tween the two filters is that all their values are positive. Thus, we conclude
that we can implement lowpass filtering in the spatial domain by using a
mask with all positive coefficients (as we did in Section 3.5.1). For reference,
Fig. 4.37(b) shows two of the masks discussed in that section. Note the recip-
rocal relationship between the width of the filters, as discussed in the previ-
ous paragraph. The narrower the frequency domain filter, the more it will
attenuate the low frequencies, resulting in increased blurring. In the spatial
domain, this means that a larger mask must be used to increase blurring, as
illustrated in Example 3.13.
More complex filters can be constructed using the basic Gaussian function
of Eq. (4.7-5). For example, we can construct a highpass filter as the difference
of Gaussians:
Figures 4.37(c) and (d) show plots of these two equations. We note again the
reciprocity in width, but the most important feature here is that h(x) has a pos-
itive center term with negative terms on either side. The small masks shown in
a c H (u) H (u)
b d
FIGURE 4.37
(a) A 1-D Gaussian
lowpass filter in the
frequency domain.
(b) Spatial
lowpass filter
corresponding to u u
(a). (c) Gaussian h(x) h (x)
highpass filter in
the frequency 1 1 1 1 1 1
1
domain. (d) Spatial ––
9
1
1
1 1
1 1
1 8 1
1 1 1
highpass filter 1 2 1 0 1 0
corresponding to 1
–– 2
16
4 2 1 4 1
1 2 1 0 1 0
(c). The small 2-D
masks shown are x x
spatial filters we
used in Chapter 3.
www.EBooksWorld.ir
4.7 ■ The Basics of Filtering in the Frequency Domain 267
Fig. 4.37(d) “capture” this property. These two masks were used in Chapter 3
as sharpening filters, which we now know are highpass filters.
Although we have gone through significant effort to get here, be assured
that it is impossible to truly understand filtering in the frequency domain
without the foundation we have just established. In practice, the frequency
domain can be viewed as a “laboratory” in which we take advantage of the
correspondence between frequency content and image appearance. As is
demonstrated numerous times later in this chapter, some tasks that would be
exceptionally difficult or impossible to formulate directly in the spatial do-
main become almost trivial in the frequency domain. Once we have selected a
specific filter via experimentation in the frequency domain, the actual imple-
mentation of the method usually is done in the spatial domain. One approach
is to specify small spatial masks that attempt to capture the “essence” of the
full filter function in the spatial domain, as we explained in Fig. 4.37. A more
formal approach is to design a 2-D digital filter by using approximations
based on mathematical or statistical criteria. We touch on this point again in
Section 4.11.4.
■ In this example, we start with a spatial mask and show how to generate its EXAMPLE 4.15:
corresponding filter in the frequency domain. Then, we compare the filtering Obtaining a
results obtained using frequency domain and spatial techniques. This type of frequency domain
filter from a small
analysis is useful when one wishes to compare the performance of given spa-
spatial mask.
tial masks against one or more “full” filter candidates in the frequency do-
main, or to gain deeper understanding about the performance of a mask. To
keep matters simple, we use the 3 * 3 Sobel vertical edge detector from
Fig. 3.41(e). Figure 4.38(a) shows a 600 * 600 pixel image, f(x, y), that we wish
to filter, and Fig. 4.38(b) shows its spectrum.
Figure 4.39(a) shows the Sobel mask, h(x, y) (the perspective plot is ex-
plained below). Because the input image is of size 600 * 600 pixels and the fil-
ter is of size 3 * 3 we avoid wraparound error by padding f and h to size
a b
FIGURE 4.38
(a) Image of a
building, and
(b) its spectrum.
www.EBooksWorld.ir
268 Chapter 4 ■ Filtering in the Frequency Domain
a b
c d 1 0 1
FIGURE 4.39
2 0 2
(a) A spatial
mask and
1 0 1
perspective plot
of its
corresponding
frequency domain
filter. (b) Filter
shown as an
image. (c) Result
of filtering
Fig. 4.38(a) in the
frequency domain
with the filter in
(b). (d) Result of
filtering the same
image with the
spatial filter in
(a). The results
are identical.
602 * 602 pixels, according to Eqs. (4.6-29) and (4.6-30). The Sobel mask ex-
hibits odd symmetry, provided that it is embedded in an array of zeros of even
size (see Example 4.10). To maintain this symmetry, we place h(x, y) so that its
center is at the center of the 602 * 602 padded array. This is an important as-
pect of filter generation. If we preserve the odd symmetry with respect to the
padded array in forming hp(x, y), we know from property 9 in Table 4.1 that
H(u, v) will be purely imaginary. As we show at the end of this example, this
will yield results that are identical to filtering the image spatially using h(x, y).
If the symmetry were not preserved, the results would no longer be same.
The procedure used to generate H(u, v) is: (1) multiply hp(x, y) by (-1)x + y
to center the frequency domain filter; (2) compute the forward DFT of the re-
sult in (1); (3) set the real part of the resulting DFT to 0 to account for parasitic
real parts (we know that H(u, v) has to be purely imaginary); and (4) multiply
the result by (-1)u + v. This last step reverses the multiplication of H(u, v) by
(-1)u + v, which is implicit when h(x, y) was moved to the center of hp(x, y).
Figure 4.39(a) shows a perspective plot of H(u, v), and Fig. 4.39(b) shows
www.EBooksWorld.ir
4.8 ■ Image Smoothing Using Frequency Domain Filters 269
H(u, v) as an image. As, expected, the function is odd, thus the antisymmetry
about its center. Function H(u, v) is used as any other frequency domain filter
in the procedure outlined in Section 4.7.3.
Figure 4.39(c) is the result of using the filter just obtained in the proce-
dure outlined in Section 4.7.3 to filter the image in Fig. 4.38(a). As expected
from a derivative filter, edges are enhanced and all the constant intensity
areas are reduced to zero (the grayish tone is due to scaling for display).
Figure 4.39(d) shows the result of filtering the same image in the spatial do-
main directly, using h(x, y) in the procedure outlined in Section 3.6.4. The re-
sults are identical. ■
1 if D(u, v) … D0
H(u, v) = b (4.8-1)
0 if D(u, v) 7 D0
where D0 is a positive constant and D(u, v) is the distance between a point (u, v)
in the frequency domain and the center of the frequency rectangle; that is,
where, as before, P and Q are the padded sizes from Eqs. (4.6-31) and (4.6-32).
Figure 4.40(a) shows a perspective plot of H(u, v) and Fig. 4.40(b) shows the
filter displayed as an image. As mentioned in Section 4.3.3, the name ideal
indicates that all frequencies on or inside a circle of radius D0 are passed
www.EBooksWorld.ir
270 Chapter 4 ■ Filtering in the Frequency Domain
H(u, v) H (u, v)
v
1
u v
D (u, v)
D0
u
a b c
FIGURE 4.40 (a) Perspective plot of an ideal lowpass-filter transfer function. (b) Filter displayed as an image.
(c) Filter radial cross section.
without attenuation, whereas all frequencies outside the circle are completely
attenuated (filtered out). The ideal lowpass filter is radially symmetric about
the origin, which means that the filter is completely defined by a radial cross
section, as Fig. 4.40(c) shows. Rotating the cross section by 360° yields the fil-
ter in 2-D.
For an ILPF cross section, the point of transition between H(u, v) = 1 and
H(u, v) = 0 is called the cutoff frequency. In the case of Fig. 4.40, for example,
the cutoff frequency is D0. The sharp cutoff frequencies of an ILPF cannot be
realized with electronic components, although they certainly can be simulated
in a computer. The effects of using these “nonphysical” filters on a digital
image are discussed later in this section.
The lowpass filters introduced in this chapter are compared by studying
their behavior as a function of the same cutoff frequencies. One way to estab-
lish a set of standard cutoff frequency loci is to compute circles that enclose
specified amounts of total image power PT. This quantity is obtained by sum-
ming the components of the power spectrum of the padded images at each
point (u, v), for u = 0, 1, Á , P - 1 and v = 0, 1, Á , Q - 1; that is,
P-1 Q-1
PT = a a P(u, v) (4.8-3)
u=0 v=0
where P(u, v) is given in Eq. (4.6-18). If the DFT has been centered, a circle of
radius D0 with origin at the center of the frequency rectangle encloses a per-
cent of the power, where
and the summation is taken over values of (u, v) that lie inside the circle or on
its boundary.
www.EBooksWorld.ir
4.8 ■ Image Smoothing Using Frequency Domain Filters 271
Figures 4.41(a) and (b) show a test pattern image and its spectrum. The
circles superimposed on the spectrum have radii of 10, 30, 60, 160, and 460
pixels, respectively. These circles enclose a percent of the image power, for
a = 87.0, 93.1, 95.7, 97.8, and 99.2%, respectively. The spectrum falls off
rapidly, with 87% of the total power being enclosed by a relatively small
circle of radius 10.
■ Figure 4.42 shows the results of applying ILPFs with cutoff frequencies at EXAMPLE 4.16:
the radii shown in Fig. 4.41(b). Figure 4.42(b) is useless for all practical pur- Image smoothing
using an ILPF.
poses, unless the objective of blurring is to eliminate all detail in the image,
except the “blobs” representing the largest objects. The severe blurring in
this image is a clear indication that most of the sharp detail information in
the picture is contained in the 13% power removed by the filter. As the filter
radius increases, less and less power is removed, resulting in less blurring.
Note that the images in Figs. 4.42(c) through (e) are characterized by “ring-
ing,” which becomes finer in texture as the amount of high frequency con-
tent removed decreases. Ringing is visible even in the image [Fig. 4.42(e)] in
which only 2% of the total power was removed. This ringing behavior is a
characteristic of ideal filters, as you will see shortly. Finally, the result for
a = 99.2 shows very slight blurring in the noisy squares but, for the most
part, this image is quite close to the original. This indicates that little edge
information is contained in the upper 0.8% of the spectrum power in this
particular case.
It is clear from this example that ideal lowpass filtering is not very practi-
cal. However, it is useful to study their behavior as part of our development of
a b
FIGURE 4.41 (a) Test pattern of size 688 * 688 pixels, and (b) its Fourier spectrum. The
spectrum is double the image size due to padding but is shown in half size so that it fits
in the page. The superimposed circles have radii equal to 10, 30, 60, 160, and 460 with
respect to the full-size spectrum image. These radii enclose 87.0, 93.1, 95.7, 97.8, and
99.2% of the padded image power, respectively.
www.EBooksWorld.ir
272 Chapter 4 ■ Filtering in the Frequency Domain
a b
c d
e f
FIGURE 4.42 (a) Original image. (b)–(f) Results of filtering using ILPFs with cutoff
frequencies set at radii values 10, 30, 60, 160, and 460, as shown in Fig. 4.41(b). The
power removed by these filters was 13, 6.9, 4.3, 2.2, and 0.8% of the total, respectively.
www.EBooksWorld.ir
4.8 ■ Image Smoothing Using Frequency Domain Filters 273
filtering concepts. Also, as shown in the discussion that follows, some interest-
ing insight is gained by attempting to explain the ringing property of ILPFs in
the spatial domain. ■
The blurring and ringing properties of ILPFs can be explained using the
convolution theorem. Figure 4.43(a) shows the spatial representation, h(x, y), of
an ILPF of radius 10, and Fig. 4.43(b) shows the intensity profile of a line passing
through the center of the image. Because a cross section of the ILPF in the fre-
quency domain looks like a box filter, it is not unexpected that a cross section of
the corresponding spatial filter has the shape of a sinc function. Filtering in the
spatial domain is done by convolving h(x, y) with the image. Imagine each pixel
in the image being a discrete impulse whose strength is proportional to the in-
tensity of the image at that location. Convolving a sinc with an impulse copies
the sinc at the location of the impulse. The center lobe of the sinc is the principal
cause of blurring, while the outer, smaller lobes are mainly responsible for ring-
ing. Convolving the sinc with every pixel in the image provides a nice model for
explaining the behavior of ILPFs. Because the “spread” of the sinc function is in-
versely proportional to the radius of H(u, v), the larger D0 becomes, the more
the spatial sinc approaches an impulse which, in the limit, causes no blurring at
all when convolved with the image. This type of reciprocal behavior should be
routine to you by now. In the next two sections, we show that it is possible to
achieve blurring with little or no ringing, which is an important objective in
lowpass filtering.
a b
FIGURE 4.43
(a) Representation
in the spatial
domain of an
ILPF of radius 5
and size
1000 * 1000.
(b) Intensity
profile of a
horizontal line
passing through
the center of the
image.
www.EBooksWorld.ir
274 Chapter 4 ■ Filtering in the Frequency Domain
H(u, v) H (u, v)
v 1.0
n1
0.5 n2
n3
u n4
v
D(u, v)
D0
u
a b c
FIGURE 4.44 (a) Perspective plot of a Butterworth lowpass-filter transfer function. (b) Filter displayed as an
image. (c) Filter radial cross sections of orders 1 through 4.
Unlike the ILPF, the BLPF transfer function does not have a sharp discon-
tinuity that gives a clear cutoff between passed and filtered frequencies. For
filters with smooth transfer functions, defining a cutoff frequency locus at
points for which H(u, v) is down to a certain fraction of its maximum value is
customary. In Eq. (4.8-5), (down 50% from its maximum value of 1) when
D(u, v) = D0.
EXAMPLE 4.17: ■ Figure 4.45 shows the results of applying the BLPF of Eq. (4.8-5) to
Image smoothing Fig. 4.45(a), with n = 2 and D0 equal to the five radii in Fig. 4.41(b). Unlike the
with a
results in Fig. 4.42 for the ILPF, we note here a smooth transition in blurring as
Butterworth
lowpass filter. a function of increasing cutoff frequency. Moreover, no ringing is visible in any
of the images processed with this particular BLPF, a fact attributed to the fil-
ter’s smooth transition between low and high frequencies. ■
www.EBooksWorld.ir
4.8 ■ Image Smoothing Using Frequency Domain Filters 275
a b
c d
e f
FIGURE 4.45 (a) Original image. (b)–(f) Results of filtering using BLPFs of order 2,
with cutoff frequencies at the radii shown in Fig. 4.41. Compare with Fig. 4.42.
www.EBooksWorld.ir
276 Chapter 4 ■ Filtering in the Frequency Domain
a b c d
FIGURE 4.46 (a)–(d) Spatial representation of BLPFs of order 1, 2, 5, and 20, and corresponding intensity
profiles through the center of the filters (the size in all cases is 1000 * 1000 and the cutoff frequency is 5).
Observe how ringing increases as a function of filter order.
where, as in Eq. (4.8-2), D(u, v) is the distance from the center of the frequency
rectangle. Here we do not use a multiplying constant as in Section 4.7.4 in
order to be consistent with the filters discussed in the present section, whose
highest value is 1. As before, s is a measure of spread about the center. By let-
ting s = D0, we can express the filter using the notation of the other filters in
this section:
2
(u, v)>2D02
H(u, v) = e -D (4.8-7)
where D0 is the cutoff frequency. When D(u, v) = D0, the GLPF is down to
0.607 of its maximum value.
As Table 4.3 shows, the inverse Fourier transform of the GLPF is Gaussian
also. This means that a spatial Gaussian filter, obtained by computing the
IDFT of Eq. (4.8-6) or (4.8-7), will have no ringing. Figure 4.47 shows a per-
spective plot, image display, and radial cross sections of a GLPF function, and
Table 4.4 summarizes the lowpass filters discussed in this section.
www.EBooksWorld.ir
4.8 ■ Image Smoothing Using Frequency Domain Filters 277
H(u, v) H (u, v)
v 1.0
D0 10
0.667 D0 20
D0 40
D0 100
u v
D(u, v)
u
a b c
FIGURE 4.47 (a) Perspective plot of a GLPF transfer function. (b) Filter displayed as an image. (c) Filter
radial cross sections for various values of D0.
TABLE 4.4
Lowpass filters. D0 is the cutoff frequency and n is the order of the Butterworth filter.
1 if D(u, v) … D0 1 2 2
H(u, v) = b H(u, v) = H(u, v) = e -D (u,v)>2D0
0 if D(u, v) 7 D0 1 + [D(u, v)>D0] 2n
■ Figure 4.48 shows the results of applying the GLPF of Eq. (4.8-7) to EXAMPLE 4.18:
Fig. 4.48(a), with D0 equal to the five radii in Fig. 4.41(b). As in the case of the Image smoothing
BLPF of order 2 (Fig. 4.45), we note a smooth transition in blurring as a func- with a Gaussian
lowpass filter.
tion of increasing cutoff frequency. The GLPF achieved slightly less smoothing
than the BLPF of order 2 for the same value of cutoff frequency, as can be
seen, for example, by comparing Figs. 4.45(c) and 4.48(c). This is expected, be-
cause the profile of the GLPF is not as “tight” as the profile of the BLPF of
order 2. However, the results are quite comparable, and we are assured of no
ringing in the case of the GLPF. This is an important characteristic in practice,
especially in situations (e.g., medical imaging) in which any type of artifact is
unacceptable. In cases where tight control of the transition between low and
high frequencies about the cutoff frequency are needed, then the BLPF pre-
sents a more suitable choice. The price of this additional control over the filter
profile is the possibility of ringing. ■
www.EBooksWorld.ir
278 Chapter 4 ■ Filtering in the Frequency Domain
a b
c d
e f
FIGURE 4.48 (a) Original image. (b)–(f) Results of filtering using GLPFs with cutoff
frequencies at the radii shown in Fig. 4.41. Compare with Figs. 4.42 and 4.45.
www.EBooksWorld.ir
4.8 ■ Image Smoothing Using Frequency Domain Filters 279
a b
FIGURE 4.49
(a) Sample text of
low resolution
(note broken
characters in
magnified view).
(b) Result of
filtering with a
GLPF (broken
character
segments were
joined).
satellite and aerial images. Similar results can be obtained using the lowpass
spatial filtering techniques discussed in Section 3.5.
Figure 4.49 shows a sample of text of poor resolution. One encounters text
like this, for example, in fax transmissions, duplicated material, and historical
records. This particular sample is free of additional difficulties like smudges,
creases, and torn sections. The magnified section in Fig. 4.49(a) shows that the
characters in this document have distorted shapes due to lack of resolution,
and many of the characters are broken. Although humans fill these gaps visu-
ally without difficulty, machine recognition systems have real difficulties read-
ing broken characters. One approach for handling this problem is to bridge
small gaps in the input image by blurring it. Figure 4.49(b) shows how well
characters can be “repaired” by this simple process using a Gaussian lowpass
filter with D0 = 80. The images are of size 444 * 508 pixels.
Lowpass filtering is a staple in the printing and publishing industry, where it
is used for numerous preprocessing functions, including unsharp masking, as We discuss unsharp
masking in the frequency
discussed in Section 3.6.3. “Cosmetic” processing is another use of lowpass fil- domain in Section 4.9.5
tering prior to printing. Figure 4.50 shows an application of lowpass filtering
for producing a smoother, softer-looking result from a sharp original. For
human faces, the typical objective is to reduce the sharpness of fine skin lines
and small blemishes. The magnified sections in Figs. 4.50(b) and (c) clearly
show a significant reduction in fine skin lines around the eyes in this case. In
fact, the smoothed images look quite soft and pleasing.
Figure 4.51 shows two applications of lowpass filtering on the same image,
but with totally different objectives. Figure 4.51(a) is an 808 * 754 very high
resolution radiometer (VHRR) image showing part of the Gulf of Mexico
(dark) and Florida (light), taken from a NOAA satellite (note the horizontal
sensor scan lines). The boundaries between bodies of water were caused by
loop currents. This image is illustrative of remotely sensed images in which sen-
sors have the tendency to produce pronounced scan lines along the direction in
which the scene is being scanned (see Example 4.24 for an illustration of a
www.EBooksWorld.ir
280 Chapter 4 ■ Filtering in the Frequency Domain
a b c
FIGURE 4.50 (a) Original image (784 * 732 pixels). (b) Result of filtering using a GLPF with D0 = 100.
(c) Result of filtering using a GLPF with D0 = 80. Note the reduction in fine skin lines in the magnified
sections in (b) and (c).
physical cause). Lowpass filtering is a crude but simple way to reduce the effect
of these lines, as Fig. 4.51(b) shows (we consider more effective approaches in
Sections 4.10 and 5.4.1). This image was obtained using a GLFP with D0 = 50.
The reduction in the effect of the scan lines can simplify the detection of fea-
tures such as the interface boundaries between ocean currents.
Figure 4.51(c) shows the result of significantly more aggressive Gaussian
lowpass filtering with D0 = 20. Here, the objective is to blur out as much de-
tail as possible while leaving large features recognizable. For instance, this type
of filtering could be part of a preprocessing stage for an image analysis system
that searches for features in an image bank. An example of such features could
be lakes of a given size, such as Lake Okeechobee in the lower eastern region
of Florida, shown as a nearly round dark region in Fig. 4.51(c). Lowpass filter-
ing helps simplify the analysis by averaging out features smaller than the ones
of interest.
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 281
a b c
FIGURE 4.51 (a) Image showing prominent horizontal scan lines. (b) Result of filtering using a GLPF with
D0 = 50. (c) Result of using a GLPF with D0 = 20. (Original image courtesy of NOAA.)
4.8, we consider only zero-phase-shift filters that are radially symmetric. All
filtering in this section is based on the procedure outlined in Section 4.7.3, so
all filter functions, H(u, v), are understood to be discrete functions of size
P * Q; that is, the discrete frequency variables are in the range
u = 0, 1, 2, Á , P - 1 and v = 0, 1, 2, Á , Q - 1.
A highpass filter is obtained from a given lowpass filter using the equation
where HLP (u, v) is the transfer function of the lowpass filter. That is, when the
lowpass filter attenuates frequencies, the highpass filter passes them, and vice
versa.
In this section, we consider ideal, Butterworth, and Gaussian highpass fil-
ters. As in the previous section, we illustrate the characteristics of these filters
in both the frequency and spatial domains. Figure 4.52 shows typical 3-D plots,
image representations, and cross sections for these filters. As before, we see
that the Butterworth filter represents a transition between the sharpness of
the ideal filter and the broad smoothness of the Gaussian filter. Figure 4.53,
discussed in the sections that follow, illustrates what these filters look like in
the spatial domain. The spatial filters were obtained and displayed by using the
procedure used to generate Figs. 4.43 and 4.46.
0 if D(u, v) … D0
H(u, v) = b (4.9-2)
1 if D(u, v) 7 D0
www.EBooksWorld.ir
282 Chapter 4 ■ Filtering in the Frequency Domain
H(u, v) H(u, v)
v 1.0
u v
D(u, v)
u
H(u, v) H(u, v)
v 1.0
u v
D(u, v)
u
H(u, v) H(u, v)
v 1.0
u v
a b c D(u, v)
d e f
g h i u
FIGURE 4.52 Top row: Perspective plot, image representation, and cross section of a typical ideal highpass
filter. Middle and bottom rows: The same sequence for typical Butterworth and Gaussian highpass filters.
where D0 is the cutoff frequency and D(u, v) is given by Eq. (4.8-2). This ex-
pression follows directly from Eqs. (4.8-1) and (4.9-1). As intended, the IHPF
is the opposite of the ILPF in the sense that it sets to zero all frequencies inside
a circle of radius D0 while passing, without attenuation, all frequencies outside
the circle. As in the case of the ILPF, the IHPF is not physically realizable. How-
ever, we consider it here for completeness and, as before, because its proper-
ties can be used to explain phenomena such as ringing in the spatial domain.
The discussion will be brief.
Because of the way in which they are related [Eq. (4.9-1)], we can expect
IHPFs to have the same ringing properties as ILPFs. This is demonstrated
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 283
~ ~ ~
a b c
FIGURE 4.53 Spatial representation of typical (a) ideal, (b) Butterworth, and (c) Gaussian frequency domain
highpass filters, and corresponding intensity profiles through their centers.
clearly in Fig. 4.54, which consists of various IHPF results using the original
image in Fig. 4.41(a) with D0 set to 30, 60, and 160 pixels, respectively. The ring-
ing in Fig. 4.54(a) is so severe that it produced distorted, thickened object
boundaries (e.g., look at the large letter “a”). Edges of the top three circles do
not show well because they are not as strong as the other edges in the image
(the intensity of these three objects is much closer to the background intensity,
a b c
FIGURE 4.54 Results of highpass filtering the image in Fig. 4.41(a) using an IHPF with D0 = 30, 60, and 160.
www.EBooksWorld.ir
284 Chapter 4 ■ Filtering in the Frequency Domain
1
1 + [D0>D(u, v)]2n
H(u, v) = (4.9-3)
where D(u, v) is given by Eq. (4.8-2). This expression follows directly from
Eqs. (4.8-5) and (4.9-1). The middle row of Fig. 4.52 shows an image and cross
section of the BHPF function.
As with lowpass filters, we can expect Butterworth highpass filters to be-
have smoother than IHPFs. Figure 4.55 shows the performance of a BHPF, of
a b c
FIGURE 4.55 Results of highpass filtering the image in Fig. 4.41(a) using a BHPF of order 2 with D0 = 30, 60,
and 160, corresponding to the circles in Fig. 4.41(b). These results are much smoother than those obtained
with an IHPF.
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 285
a b c
FIGURE 4.56 Results of highpass filtering the image in Fig. 4.41(a) using a GHPF with D0 = 30, 60, and 160,
corresponding to the circles in Fig. 4.41(b). Compare with Figs. 4.54 and 4.55.
order 2 and with D0 set to the same values as in Fig. 4.54. The boundaries are
much less distorted than in Fig. 4.54, even for the smallest value of cutoff fre-
quency. Because the spot sizes in the center areas of the IHPF and the BHPF
are similar [see Figs. 4.53(a) and (b)], the performance of the two filters on the
smaller objects is comparable. The transition into higher values of cutoff fre-
quencies is much smoother with the BHPF.
TABLE 4.5
Highpass filters. D0 is the cutoff frequency and n is the order of the Butterworth filter.
1 if D(u, v) … D0 1 2 2
H(u, v) = b H(u, v) = 1 - e -D (u,v)>2D0
1 + [D0 >D(u, v)]2n
H(u, v) =
0 if D(u, v) 7 D0
www.EBooksWorld.ir
286 Chapter 4 ■ Filtering in the Frequency Domain
EXAMPLE 4.19: ■ Figure 4.57(a) is a 1026 * 962 image of a thumb print in which smudges
Using highpass (a typical problem) are evident. A key step in automated fingerprint recog-
filtering and
nition is enhancement of print ridges and the reduction of smudges. En-
thresholding for
image hancement is useful also in human interpretation of prints. In this example,
enhancement. we use highpass filtering to enhance the ridges and reduce the effects of
smudging. Enhancement of the ridges is accomplished by the fact that they
contain high frequencies, which are unchanged by a highpass filter. On the
other hand, the filter reduces low frequency components, which correspond
to slowly varying intensities in the image, such as the background and
smudges. Thus, enhancement is achieved by reducing the effect of all fea-
tures except those with high frequencies, which are the features of interest
in this case.
Figure 4.57(b) is the result of using a Butterworth highpass filter of order 4
The value D0 = 50 is ap- with a cutoff frequency of 50. As expected, the highpass-filtered image lost its
proximately 2.5% of the
short dimension of the gray tones because the dc term was reduced to 0. The net result is that dark
padded image. The idea tones typically predominate in highpass-filtered images, thus requiring addi-
is for D0 to be close to
the origin so low fre- tional processing to enhance details of interest. A simple approach is to thresh-
quencies are attenuated, old the filtered image. Figure 4.57(c) shows the result of setting to black all
but not completely elimi-
nated. A range of 2% to negative values and to white all positive values in the filtered image. Note how
5% of the short dimen- the ridges are clear and the effect of the smudges has been reduced consider-
sion is a good starting
point. ably. In fact, ridges that are barely visible in the top, right section of the image
in Fig. 4.57(a) are nicely enhanced in Fig. 4.57(c). ■
a b c
FIGURE 4.57 (a) Thumb print. (b) Result of highpass filtering (a). (c) Result of
thresholding (b). (Original image courtesy of the U.S. National Institute of Standards
and Technology.)
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 287
or, with respect to the center of the frequency rectangle, using the filter
where D(u, v) is the distance function given in Eq. (4.8-2). Then, the Laplacian
image is obtained as:
where F(u, v) is the DFT of f(x, y). As explained in Section 3.6.2, enhance-
ment is achieved using the equation:
Although this result is elegant, it has the same scaling issues just mentioned,
compounded by the fact that the normalizing factor is not as easily computed.
For this reason, Eq. (4.9-8) is the preferred implementation in the frequency
domain, with §2f(x, y) computed using Eq. (4.9-7) and scaled using the ap-
proach mentioned in the previous paragraph.
■ Figure 4.58(a) is the same as Fig. 3.38(a), and Fig. 4.58(b) shows the result of EXAMPLE 4.20:
using Eq. (4.9-8), in which the Laplacian was computed in the frequency do- Image sharpening
in the frequency
main using Eq. (4.9-7). Scaling was done as described in connection with that
domain using the
equation. We see by comparing Figs. 4.58(b) and 3.38(e) that the frequency do- Laplacian.
main and spatial results are identical visually. Observe that the results in these
two figures correspond to the Laplacian mask in Fig. 3.37(b), which has a -8 in
the center (Problem 4.26). ■
www.EBooksWorld.ir
288 Chapter 4 ■ Filtering in the Frequency Domain
a b
FIGURE 4.58
(a) Original,
blurry image.
(b) Image
enhanced using
the Laplacian in
the frequency
domain. Compare
with Fig. 3.38(e).
with
where HLP (u, v) is a lowpass filter and F(u, v) is the Fourier transform of
f(x, y). Here, fLP (x, y) is a smoothed image analogous to f(x, y) in Eq. (3.6-8).
Then, as in Eq. (3.6-9),
Using Eq. (4.9-1), we can express this result in terms of a highpass filter:
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 289
where k1 Ú 0 gives controls of the offset from the origin [see Fig. 4.31(c)] and
k2 Ú 0 controls the contribution of high frequencies.
■ Figure 4.59(a) shows a 416 * 596 chest X-ray with a narrow range of inten- EXAMPLE 4.21:
sity levels. The objective of this example is to enhance the image using high- Image
enhancement
frequency-emphasis filtering. X-rays cannot be focused in the same manner
using high-
that optical lenses are focused, and the resulting images generally tend to be frequency-
slightly blurred. Because the intensities in this particular image are biased emphasis filtering.
toward the dark end of the gray scale, we also take this opportunity to give
an example of how spatial domain processing can be used to complement
frequency-domain filtering.
Figure 4.59(b) shows the result of highpass filtering using a Gaussian filter Artifacts such as ringing
are unacceptable in med-
with D0 = 40 (approximately 5% of the short dimension of the padded ical imaging. Thus, it is
image). As expected, the filtered result is rather featureless, but it shows faint- good practice to avoid
using filters that have the
ly the principal edges in the image. Figure 4.59(c) shows the advantage of high- potential for introducing
emphasis filtering, where we used Eq. (4.9-15) with k1 = 0.5 and k2 = 0.75. artifacts in the processed
image. Because spatial
Although the image is still dark, the gray-level tonality due to the low-frequency and frequency domain
components was not lost. Gaussian filters are
Fourier transform pairs,
As discussed in Section 3.3.1, an image characterized by intensity levels in a these filters produce
narrow range of the gray scale is an ideal candidate for histogram equaliza- smooth results that are
void of artifacts.
tion. As Fig. 4.59(d) shows, this was indeed an appropriate method to further
enhance the image. Note the clarity of the bone structure and other details
that simply are not visible in any of the other three images. The final enhanced
image is a little noisy, but this is typical of X-ray images when their gray scale
is expanded. The result obtained using a combination of high-frequency em-
phasis and histogram equalization is superior to the result that would be ob-
tained by using either method alone. ■
www.EBooksWorld.ir
290 Chapter 4 ■ Filtering in the Frequency Domain
a b
c d
FIGURE 4.59 (a) A chest X-ray image. (b) Result of highpass filtering with a Gaussian
filter. (c) Result of high-frequency-emphasis filtering using the same filter. (d) Result of
performing histogram equalization on (c). (Original image courtesy of Dr. Thomas R.
Gest, Division of Anatomical Sciences, University of Michigan Medical School.)
ᑣ E z(x, y) F = ᑣ E ln f(x, y) F
process.
= ᑣ E ln i(x, y) F + ᑣ E ln r(x, y) F
(4.9-19)
or
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 291
where Fi (u, v) and Fr (u, v) are the Fourier transforms of ln i(x, y) and
ln r(x, y), respectively.
We can filter Z(u, v) using a filter H(u, v) so that
By defining
and
Finally, because z(x, y) was formed by taking the natural logarithm of the
input image, we reverse the process by taking the exponential of the filtered
result to form the output image:
g(x, y) = e s(x,y)
where
and
www.EBooksWorld.ir
292 Chapter 4 ■ Filtering in the Frequency Domain
FIGURE 4.60
Summary of steps
f(x, y) ln DF T H (u, v) (DF T)1 exp g (x, y)
in homomorphic
filtering.
The filtering approach just derived is summarized in Fig. 4.60. This method
is based on a special case of a class of systems known as homomorphic systems.
In this particular application, the key to the approach is the separation of the
illumination and reflectance components achieved in the form shown in
Eq. (4.9-20). The homomorphic filter function H(u, v) then can operate on
these components separately, as indicated by Eq. (4.9-21).
The illumination component of an image generally is characterized by slow
spatial variations, while the reflectance component tends to vary abruptly, par-
ticularly at the junctions of dissimilar objects. These characteristics lead to as-
sociating the low frequencies of the Fourier transform of the logarithm of an
image with illumination and the high frequencies with reflectance. Although
these associations are rough approximations, they can be used to advantage in
image filtering, as illustrated in Example 4.22.
A good deal of control can be gained over the illumination and reflectance
components with a homomorphic filter. This control requires specification of
a filter function H(u, v) that affects the low- and high-frequency components
of the Fourier transform in different, controllable ways. Figure 4.61 shows a
cross section of such a filter. If the parameters gL and gH are chosen so that
gL 6 1 and gH 7 1, the filter function in Fig. 4.61 tends to attenuate the con-
tribution made by the low frequencies (illumination) and amplify the contri-
bution made by high frequencies (reflectance). The net result is simultaneous
dynamic range compression and contrast enhancement.
The shape of the function in Fig. 4.61 can be approximated using the basic
form of a highpass filter. For example, using a slightly modified form of the
Gaussian highpass filter yields the function
D(u, v)
www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 293
where D(u, v) is defined in Eq. (4.8-2) and the constant c controls the
sharpness of the slope of the function as it transitions between gL and gH.
This filter is similar to the high-emphasis filter discussed in the previous
section.
■ Figure 4.62(a) shows a full body PET (Positron Emission Tomography) EXAMPLE 4.22:
scan of size 1162 * 746 pixels. The image is slightly blurry and many of its Image
enhancement
low-intensity features are obscured by the high intensity of the “hot spots”
using
dominating the dynamic range of the display. (These hot spots were caused by homomorphic
a tumor in the brain and one in the lungs.) Figure 4.62(b) was obtained by ho- filtering.
momorphic filtering Fig. 4.62(a) using the filter in Eq. (4.9-29) with
gL = 0.25, gH = 2, c = 1, and D0 = 80. A cross section of this filter looks Recall that filtering uses
image padding, so the fil-
just like Fig. 4.61, with a slightly steeper slope. ter is of size P * Q.
Note in Fig. 4.62(b) how much sharper the hot spots, the brain, and the
skeleton are in the processed image, and how much more detail is visible in
this image. By reducing the effects of the dominant illumination components
(the hot spots), it became possible for the dynamic range of the display to
allow lower intensities to become much more visible. Similarly, because the
high frequencies are enhanced by homomorphic filtering, the reflectance
components of the image (edge information) were sharpened considerably.
The enhanced image in Fig. 4.62(b) is a significant improvement over the
original. ■
a b
FIGURE 4.62
(a) Full body PET
scan. (b) Image
enhanced using
homomorphic
filtering. (Original
image courtesy of
Dr. Michael
E. Casey, CTI
PET Systems.)
www.EBooksWorld.ir
6.1 ■ Color Fundamentals 395
FIGURE 6.2 Wavelengths comprising the visible range of the electromagnetic spectrum.
(Courtesy of the General Electric Co., Lamp Business Division.)
www.EBooksWorld.ir
396 Chapter 6 ■ Color Image Processing
Purplish blue
Blue
Blue green
Green
Yellowish green
Yellow
Orange
Reddish orange
Red
www.EBooksWorld.ir
6.1 ■ Color Fundamentals 397
human eye, colors are seen as variable combinations of the so-called primary
colors red (R), green (G), and blue (B). For the purpose of standardization, the
CIE (Commission Internationale de l’Eclairage—the International Commis-
sion on Illumination) designated in 1931 the following specific wavelength val-
ues to the three primary colors: blue = 435.8 nm, green = 546.1 nm, and
red = 700 nm. This standard was set before the detailed experimental curves
shown in Fig. 6.3 became available in 1965. Thus, the CIE standards correspond
only approximately with experimental data. We note from Figs. 6.2 and 6.3 that
no single color may be called red, green, or blue. Also, it is important to keep in
mind that having three specific primary color wavelengths for the purpose of
standardization does not mean that these three fixed RGB components acting
alone can generate all spectrum colors. Use of the word primary has been widely
misinterpreted to mean that the three standard primaries, when mixed in vari-
ous intensity proportions, can produce all visible colors. As you will see shortly,
this interpretation is not correct unless the wavelength also is allowed to vary,
in which case we would no longer have three fixed, standard primary colors.
The primary colors can be added to produce the secondary colors of light—
magenta (red plus blue), cyan (green plus blue), and yellow (red plus green).
Mixing the three primaries, or a secondary with its opposite primary color, in
the right intensities produces white light. This result is shown in Fig. 6.4(a),
which also illustrates the three primary colors and their combinations to pro-
duce the secondary colors.
a
MIXTURES OF LIGHT b
(Additive primaries)
GREEN FIGURE 6.4
Primary and
secondary colors
YELLOW CYAN of light and
WHITE pigments.
(Courtesy of the
RED BLUE General Electric
MAGENTA
Co., Lamp
Business
Division.)
MIXTURES OF PIGMENTS
(Subtractive primaries)
YELLOW
RED GREEN
BLACK
MAGENTA CYAN
BLUE
www.EBooksWorld.ir
398 Chapter 6 ■ Color Image Processing
Differentiating between the primary colors of light and the primary colors
of pigments or colorants is important. In the latter, a primary color is defined
as one that subtracts or absorbs a primary color of light and reflects or trans-
mits the other two. Therefore, the primary colors of pigments are magenta,
cyan, and yellow, and the secondary colors are red, green, and blue. These col-
ors are shown in Fig. 6.4(b). A proper combination of the three pigment pri-
maries, or a secondary with its opposite primary, produces black.
Color television reception is an example of the additive nature of light col-
ors. The interior of CRT (cathode ray tube) color TV screens is composed of a
large array of triangular dot patterns of electron-sensitive phosphor. When ex-
cited, each dot in a triad produces light in one of the primary colors. The inten-
sity of the red-emitting phosphor dots is modulated by an electron gun inside
the tube, which generates pulses corresponding to the “red energy” seen by
the TV camera. The green and blue phosphor dots in each triad are modulated
in the same manner. The effect, viewed on the television receiver, is that the
three primary colors from each phosphor triad are “added” together and re-
ceived by the color-sensitive cones in the eye as a full-color image. Thirty suc-
cessive image changes per second in all three colors complete the illusion of a
continuous image display on the screen.
CRT displays are being replaced by “flat panel” digital technologies, such as
liquid crystal displays (LCDs) and plasma devices. Although they are funda-
mentally different from CRTs, these and similar technologies use the same
principle in the sense that they all require three subpixels (red, green, and
blue) to generate a single color pixel. LCDs use properties of polarized light to
block or pass light through the LCD screen and, in the case of active matrix
display technology, thin film transistors (TFTs) are used to provide the proper
signals to address each pixel on the screen. Light filters are used to produce
the three primary colors of light at each pixel triad location. In plasma units,
pixels are tiny gas cells coated with phosphor to produce one of the three pri-
mary colors. The individual cells are addressed in a manner analogous to
LCDs. This individual pixel triad coordinate addressing capability is the foun-
dation of digital displays.
The characteristics generally used to distinguish one color from another are
brightness, hue, and saturation. As indicated earlier in this section, brightness
embodies the achromatic notion of intensity. Hue is an attribute associated
with the dominant wavelength in a mixture of light waves. Hue represents
dominant color as perceived by an observer. Thus, when we call an object red,
orange, or yellow, we are referring to its hue. Saturation refers to the relative
purity or the amount of white light mixed with a hue. The pure spectrum colors
are fully saturated. Colors such as pink (red and white) and lavender (violet
and white) are less saturated, with the degree of saturation being inversely
proportional to the amount of white light added.
Hue and saturation taken together are called chromaticity, and, therefore, a
color may be characterized by its brightness and chromaticity. The amounts of
red, green, and blue needed to form any particular color are called the
www.EBooksWorld.ir
6.1 ■ Color Fundamentals 399
†
The use of x, y, z in this context follows notational convention. These should not be confused with the
use of (x, y) to denote spatial coordinates in other sections of the book.
www.EBooksWorld.ir
400 Chapter 6 ■ Color Image Processing
FIGURE 6.5
Chromaticity
diagram.
(Courtesy of the
General Electric
Co., Lamp
Business
Division.)
energy to any point on the boundary of the chart will define all the shades of
that particular spectrum color.
Extension of this procedure to three colors is straightforward. To determine
the range of colors that can be obtained from any three given colors in the
chromaticity diagram, we simply draw connecting lines to each of the three
color points. The result is a triangle, and any color on the boundary or inside
the triangle can be produced by various combinations of the three initial col-
ors. A triangle with vertices at any three fixed colors cannot enclose the entire
color region in Fig. 6.5. This observation supports graphically the remark made
earlier that not all colors can be obtained with three single, fixed primaries.
The triangle in Figure 6.6 shows a typical range of colors (called the color
gamut) produced by RGB monitors. The irregular region inside the triangle
is representative of the color gamut of today’s high-quality color printing
www.EBooksWorld.ir
6.2 ■ Color Models 401
.9 FIGURE 6.6
Typical color
520 gamut of color
monitors
.8 530
(triangle) and
color printing
510 540
G
devices (irregular
.7
region).
550
560
.6
570
500
.5
580
y-axis
590
.4
600
610
R 620
.3 490
640
780
.2
480
.1
470
460
B
450 380
0
0 .1 .2 .3 .4 .5 .6 .7 .8
x-axis
devices. The boundary of the color printing gamut is irregular because color
printing is a combination of additive and subtractive color mixing, a process
that is much more difficult to control than that of displaying colors on a
monitor, which is based on the addition of three highly controllable light
primaries.
www.EBooksWorld.ir
402 Chapter 6 ■ Color Image Processing
FIGURE 6.7 B
Schematic of the
RGB color cube.
Points along the
main diagonal (0, 0, 1)
Blue Cyan
have gray values,
from black at the
origin to white at Magenta
White
point (1, 1, 1).
(1, 0, 0)
Red Yellow
www.EBooksWorld.ir
6.2 ■ Color Models 403
■ The cube shown in Fig. 6.8 is a solid, composed of the (28)3 = 16,777,216 EXAMPLE 6.1:
colors mentioned in the preceding paragraph. A convenient way to view these Generating the
hidden face
colors is to generate color planes (faces or cross sections of the cube). This is planes and a cross
accomplished simply by fixing one of the three colors and allowing the other section of the
two to vary. For instance, a cross-sectional plane through the center of the cube RGB color cube.
and parallel to the GB-plane in Fig. 6.8 is the plane (127, G, B) for
G, B = 0, 1, 2, Á , 255. Here we used the actual pixel values rather than the
mathematically convenient normalized values in the range [0, 1] because the
former values are the ones actually used in a computer to generate colors.
Figure 6.9(a) shows that an image of the cross-sectional plane is viewed simply
by feeding the three individual component images into a color monitor. In the
component images, 0 represents black and 255 represents white (note that
these are gray-scale images). Finally, Fig. 6.9(b) shows the three hidden surface
planes of the cube in Fig. 6.8, generated in the same manner.
It is of interest to note that acquiring a color image is basically the process
shown in Fig. 6.9 in reverse. A color image can be acquired by using three fil-
ters, sensitive to red, green, and blue, respectively. When we view a color scene
with a monochrome camera equipped with one of these filters, the result is a
monochrome image whose intensity is proportional to the response of that fil-
ter. Repeating this process with each filter produces three monochrome im-
ages that are the RGB component images of the color scene. (In practice,
RGB color image sensors usually integrate this process into a single device.)
Clearly, displaying these three RGB component images in the form shown in
Fig. 6.9(a) would yield an RGB color rendition of the original color scene. ■
www.EBooksWorld.ir
404 Chapter 6 ■ Color Image Processing
a
b
FIGURE 6.9 Red
(a) Generating
the RGB image of
the cross-sectional
color plane (127,
G, B). (b) The
three hidden
Green RGB
surface planes in Color
the color cube of monitor
Fig. 6.8.
Blue
(R 0) (G 0) (B 0)
www.EBooksWorld.ir
6.2 ■ Color Models 405
TABLE 6.1
Number System Color Equivalents
Valid values of
Hex 00 33 66 99 CC FF each RGB
Decimal 0 51 102 153 204 255 component in a
safe color.
Each of the 216 safe colors is formed from three RGB values as before, but
each value can only be 0, 51, 102, 153, 204, or 255. Thus, RGB triplets of these
values give us (6)3 = 216 possible values (note that all values are divisible by
3). It is customary to express these values in the hexagonal number system, as
shown in Table 6.1. Recall that hex numbers 0, 1, 2, Á , 9, A, B, C, D, E, F
correspond to decimal numbers 0, 1, 2, Á , 9, 10, 11, 12, 13, 14, 15. Recall
also that (0)16 = (0000)2 and (F)16 = (1111)2. Thus, for example,
(FF)16 = (255)10 = (11111111)2 and we see that a grouping of two hex num-
bers forms an 8-bit byte.
Since it takes three numbers to form an RGB color, each safe color is
formed from three of the two digit hex numbers in Table 6.1. For example, the
purest red is FF0000. The values 000000 and FFFFFF represent black and
white, respectively. Keep in mind that the same result is obtained by using the
more familiar decimal notation. For instance, the brightest red in decimal no-
tation has R = 255 (FF) and G = B = 0.
Figure 6.10(a) shows the 216 safe colors, organized in descending RGB val-
ues. The square in the top left array has value FFFFFF (white), the second
square to its right has value FFFFCC, the third square has value FFFF99, and
a
b
FIGURE 6.10
(a) The 216 safe
RGB colors.
(b) All the grays
in the 256-color
RGB system
(grays that are
part of the safe
color group are
shown
underlined).
AAAAAA
DDDDDD
BBBBBB
CCCCCC
EEEEEE
FFFFFF
000000
111111
222222
333333
444444
555555
666666
777777
888888
999999
www.EBooksWorld.ir
406 Chapter 6 ■ Color Image Processing
so on for the first row. The second row of that same array has values FFCCFF,
FFCCCC, FFCC99, and so on. The final square of that array has value FF0000
(the brightest possible red). The second array to the right of the one just ex-
amined starts with value CCFFFF and proceeds in the same manner, as do the
other remaining four arrays. The final (bottom right) square of the last array
has value 000000 (black). It is important to note that not all possible 8-bit gray
colors are included in the 216 safe colors. Figure 6.10(b) shows the hex codes
for all the possible gray colors in a 256-color RGB system. Some of these val-
ues are outside of the safe color set but are represented properly (in terms of
their relative intensities) by most display systems. The grays from the safe
color group, (KKKKKK)16, for K = 0, 3, 6, 9, C, F, are shown underlined in
Fig. 6.10(b).
Figure 6.11 shows the RGB safe-color cube. Unlike the full-color cube in
Fig. 6.8, which is solid, the cube in Fig. 6.11 has valid colors only on the sur-
face planes. As shown in Fig. 6.10(a), each plane has a total of 36 colors, so
the entire surface of the safe-color cube is covered by 216 different colors, as
expected.
C 1 R
CMS = C1S - CGS (6.2-1)
Y 1 B
where, again, the assumption is that all color values have been normalized to
the range [0, 1]. Equation (6.2-1) demonstrates that light reflected from a
FIGURE 6.11
The RGB safe-
color cube.
www.EBooksWorld.ir
6.2 ■ Color Models 407
surface coated with pure cyan does not contain red (that is, C = 1 - R in the
equation). Similarly, pure magenta does not reflect green, and pure yellow
does not reflect blue. Equation (6.2-1) also reveals that RGB values can be
obtained easily from a set of CMY values by subtracting the individual CMY
values from 1. As indicated earlier, in image processing this color model is
used in connection with generating hardcopy output, so the inverse opera-
tion from CMY to RGB generally is of little practical interest.
According to Fig. 6.4, equal amounts of the pigment primaries, cyan, ma-
genta, and yellow should produce black. In practice, combining these colors
for printing produces a muddy-looking black. So, in order to produce true
black (which is the predominant color in printing), a fourth color, black, is
added, giving rise to the CMYK color model. Thus, when publishers talk about
“four-color printing,” they are referring to the three colors of the CMY color
model plus black.
www.EBooksWorld.ir
408 Chapter 6 ■ Color Image Processing
a b
FIGURE 6.12 White White
Conceptual
relationships
between the RGB
and HSI color Magenta Magenta
models. Cyan Yellow Cyan Yellow
Black Black
www.EBooksWorld.ir
6.2 ■ Color Models 409
The key point to keep in mind regarding the cube arrangement in Fig. 6.12
and its corresponding HSI color space is that the HSI space is represented by a
vertical intensity axis and the locus of color points that lie on planes
perpendicular to this axis. As the planes move up and down the intensity axis,
the boundaries defined by the intersection of each plane with the faces of the
cube have either a triangular or hexagonal shape. This can be visualized much
more readily by looking at the cube down its gray-scale axis, as shown in
Fig. 6.13(a). In this plane we see that the primary colors are separated by 120°.
The secondary colors are 60° from the primaries, which means that the angle
between secondaries also is 120°. Figure 6.13(b) shows the same hexagonal
shape and an arbitrary color point (shown as a dot). The hue of the point is de-
termined by an angle from some reference point. Usually (but not always) an
angle of 0° from the red axis designates 0 hue, and the hue increases counter-
clockwise from there. The saturation (distance from the vertical axis) is the
length of the vector from the origin to the point. Note that the origin is defined
by the intersection of the color plane with the vertical intensity axis. The impor-
tant components of the HSI color space are the vertical intensity axis, the
length of the vector to a color point, and the angle this vector makes with the
red axis. Therefore, it is not unusual to see the HSI planes defined is terms of
the hexagon just discussed, a triangle, or even a circle, as Figs. 6.13(c) and (d)
show. The shape chosen does not matter because any one of these shapes can
be warped into one of the other two by a geometric transformation. Figure 6.14
shows the HSI model based on color triangles and also on circles.
Green Yellow
Blue Magenta
Green Yellow Green Yellow
Green
S S
H H
Cyan Red Cyan S Yellow Cyan Red
H
a
b c d
FIGURE 6.13 Hue and saturation in the HSI color model. The dot is an arbitrary color
point. The angle from the red axis gives the hue, and the length of the vector is the
saturation. The intensity of all colors in any of these planes is given by the position of
the plane on the vertical intensity axis.
www.EBooksWorld.ir
410 Chapter 6 ■ Color Image Processing
a White
b
FIGURE 6.14 The I 0.75
HSI color model
based on
(a) triangular and I
(b) circular color
planes. The Green
triangles and Cyan Yellow
circles are H
perpendicular to S
I 0.5 Blue Red
the vertical Magenta
intensity axis.
Black
White
I 0.75
Green Yellow
I 0.5 Cyan H
S Red
Blue Magenta
Black
www.EBooksWorld.ir
6.2 ■ Color Models 411
with†
1
2 [(R - G) + (R - B)]
u = cos b -1
r
[(R - G) + (R - B)(G - B)]1>2
2
Given values of HSI in the interval [0, 1], we now want to find the correspond-
ing RGB values in the same range. The applicable equations depend on the
values of H. There are three sectors of interest, corresponding to the 120° in-
tervals in the separation of primaries (see Fig. 6.13). We begin by multiplying
H by 360°, which returns the hue to its original range of [0°, 360°].
d
S cos H
R = Ic1 + (6.2-6)
cos(60° - H)
and
G = 3I - (R + B) (6.2-7)
†
It is good practice to add a small number in the denominator of this expression to avoid dividing by 0
when R = G = B, in which case u will be 90°. Note that when all RGB components are equal, Eq. (6.2-3)
gives S = 0. In addition, the conversion from HSI back to RGB in Eqs. (6.2-5) through (6.2-7) will give
R = G = B = I, as expected, because when R = G = B, we are dealing with a gray-scale image.
www.EBooksWorld.ir
412 Chapter 6 ■ Color Image Processing
d
S cos H
G = Ic1 + (6.2-10)
cos(60° - H)
and
B = 3I - (R + G) (6.2-11)
d
S cos H
B = Ic1 + (6.2-14)
cos(60° - H)
and
R = 3I - (G + B) (6.2-15)
Uses of these equations for image processing are discussed in several of the
following sections.
EXAMPLE 6.2: ■ Figure 6.15 shows the hue, saturation, and intensity images for the RGB
The HSI values values shown in Fig. 6.8. Figure 6.15(a) is the hue image. Its most distinguishing
corresponding to feature is the discontinuity in value along a 45° line in the front (red) plane of
the image of the
RGB color cube. the cube. To understand the reason for this discontinuity, refer to Fig. 6.8, draw
a line from the red to the white vertices of the cube, and select a point in the
middle of this line. Starting at that point, draw a path to the right, following the
cube around until you return to the starting point. The major colors encoun-
tered in this path are yellow, green, cyan, blue, magenta, and back to red. Ac-
cording to Fig. 6.13, the values of hue along this path should increase from 0°
a b c
FIGURE 6.15 HSI components of the image in Fig. 6.8. (a) Hue, (b) saturation, and (c) intensity images.
www.EBooksWorld.ir
6.2 ■ Color Models 413
to 360° (i.e., from the lowest to highest possible values of hue). This is precise-
ly what Fig. 6.15(a) shows because the lowest value is represented as black and
the highest value as white in the gray scale. In fact, the hue image was original-
ly normalized to the range [0, 1] and then scaled to 8 bits; that is, it was con-
verted to the range [0, 255], for display.
The saturation image in Fig. 6.15(b) shows progressively darker values to-
ward the white vertex of the RGB cube, indicating that colors become less and
less saturated as they approach white. Finally, every pixel in the intensity
image shown in Fig. 6.15(c) is the average of the RGB values at the corre-
sponding pixel in Fig. 6.8. ■
a b
c d
FIGURE 6.16
(a) RGB image
and the com-
ponents of its
corresponding
HSI image:
(b) hue,
(c) saturation, and
(d) intensity.
www.EBooksWorld.ir
414 Chapter 6 ■ Color Image Processing
a b
c d
FIGURE 6.17
(a)–(c) Modified
HSI component
images.
(d) Resulting
RGB image. (See
Fig. 6.16 for the
original HSI
images.)
To change the individual color of any region in the RGB image, we change
the values of the corresponding region in the hue image of Fig. 6.16(b). Then
we convert the new H image, along with the unchanged S and I images, back to
RGB using the procedure explained in connection with Eqs. (6.2-5) through
(6.2-15). To change the saturation (purity) of the color in any region, we follow
the same procedure, except that we make the changes in the saturation image
in HSI space. Similar comments apply to changing the average intensity of any
region. Of course, these changes can be made simultaneously. For example, the
image in Fig. 6.17(a) was obtained by changing to 0 the pixels corresponding to
the blue and green regions in Fig. 6.16(b). In Fig. 6.17(b) we reduced by half
the saturation of the cyan region in component image S from Fig. 6.16(c). In
Fig. 6.17(c) we reduced by half the intensity of the central white region in the
intensity image of Fig. 6.16(d). The result of converting this modified HSI
image back to RGB is shown in Fig. 6.17(d). As expected, we see in this figure
that the outer portions of all circles are now red; the purity of the cyan region
was diminished, and the central region became gray rather than white. Al-
though these results are simple, they illustrate clearly the power of the HSI
color model in allowing independent control over hue, saturation, and intensi-
ty, quantities with which we are quite familiar when describing colors.
www.EBooksWorld.ir
6.3 ■ Pseudocolor Image Processing 415
from the processes associated with true color images, a topic discussed starting
in Section 6.4. The principal use of pseudocolor is for human visualization and
interpretation of gray-scale events in an image or sequence of images. As noted
at the beginning of this chapter, one of the principal motivations for using color
is the fact that humans can discern thousands of color shades and intensities,
compared to only two dozen or so shades of gray.
(Black) 0 y
www.EBooksWorld.ir
416 Chapter 6 ■ Color Image Processing
FIGURE 6.19 An
alternative
representation of c2
the intensity-
slicing technique.
Color
c1
0 li L1
Intensity levels
where ck is the color associated with the kth intensity interval Vk defined by
the partitioning planes at l = k - 1 and l = k.
The idea of planes is useful primarily for a geometric interpretation of the
intensity-slicing technique. Figure 6.19 shows an alternative representation
that defines the same mapping as in Fig. 6.18. According to the mapping func-
tion shown in Fig. 6.19, any input intensity level is assigned one of two colors,
depending on whether it is above or below the value of li. When more levels
are used, the mapping function takes on a staircase form.
EXAMPLE 6.3: ■ A simple, but practical, use of intensity slicing is shown in Fig. 6.20. Figure
Intensity slicing. 6.20(a) is a monochrome image of the Picker Thyroid Phantom (a radiation
test pattern), and Fig. 6.20(b) is the result of intensity slicing this image into
eight color regions. Regions that appear of constant intensity in the mono-
chrome image are really quite variable, as shown by the various colors in the
sliced image. The left lobe, for instance, is a dull gray in the monochrome
image, and picking out variations in intensity is difficult. By contrast, the color
image clearly shows eight different regions of constant intensity, one for each
of the colors used. ■
a b
FIGURE 6.20
(a) Monochrome
image of the Picker
Thyroid Phantom.
(b) Result of
density slicing into
eight colors.
(Courtesy of Dr.
J. L. Blankenship,
Instrumentation
and Controls
Division, Oak
Ridge National
Laboratory.)
www.EBooksWorld.ir
6.3 ■ Pseudocolor Image Processing 417
In the preceding simple example, the gray scale was divided into intervals and
a different color was assigned to each region, without regard for the meaning of
the gray levels in the image. Interest in that case was simply to view the different
gray levels constituting the image. Intensity slicing assumes a much more mean-
ingful and useful role when subdivision of the gray scale is based on physical
characteristics of the image. For instance, Fig. 6.21(a) shows an X-ray image of a
weld (the horizontal dark region) containing several cracks and porosities (the
bright, white streaks running horizontally through the middle of the image). It
is known that when there is a porosity or crack in a weld, the full strength of the
X-rays going through the object saturates the imaging sensor on the other side of
the object.Thus, intensity values of 255 in an 8-bit image coming from such a sys-
tem automatically imply a problem with the weld. If a human were to be the ulti-
mate judge of the analysis, and manual processes were employed to inspect welds
(still a common procedure today), a simple color coding that assigns one color to
a
b
FIGURE 6.21
(a) Monochrome
X-ray image of a
weld. (b) Result
of color coding.
(Original image
courtesy of
X-TEK Systems,
Ltd.)
www.EBooksWorld.ir
418 Chapter 6 ■ Color Image Processing
level 255 and another to all other intensity levels would simplify the inspector’s
job considerably. Figure 6.21(b) shows the result. No explanation is required to
arrive at the conclusion that human error rates would be lower if images were
displayed in the form of Fig. 6.21(b), instead of the form shown in Fig. 6.21(a). In
other words, if the exact intensity value or range of values one is looking for is
known, intensity slicing is a simple but powerful aid in visualization, especially if
numerous images are involved. The following is a more complex example.
EXAMPLE 6.4: ■ Measurement of rainfall levels, especially in the tropical regions of the
Use of color to Earth, is of interest in diverse applications dealing with the environment. Accu-
highlight rainfall rate measurements using ground-based sensors are difficult and expensive to
levels.
acquire, and total rainfall figures are even more difficult to obtain because a
significant portion of precipitation occurs over the ocean. One approach for ob-
taining rainfall figures is to use a satellite. The TRMM (Tropical Rainfall Mea-
suring Mission) satellite utilizes, among others, three sensors specially designed
to detect rain: a precipitation radar, a microwave imager, and a visible and in-
frared scanner (see Sections 1.3 and 2.3 regarding image sensing modalities).
The results from the various rain sensors are processed, resulting in esti-
mates of average rainfall over a given time period in the area monitored by the
sensors. From these estimates, it is not difficult to generate gray-scale images
whose intensity values correspond directly to rainfall, with each pixel repre-
senting a physical land area whose size depends on the resolution of the sen-
sors. Such an intensity image is shown in Fig. 6.22(a), where the area monitored
by the satellite is the slightly lighter horizontal band in the middle one-third of
the picture (these are the tropical regions). In this particular example, the rain-
fall values are average monthly values (in inches) over a three-year period.
Visual examination of this picture for rainfall patterns is quite difficult, if
not impossible. However, suppose that we code intensity levels from 0 to 255
using the colors shown in Fig. 6.22(b). Values toward the blues signify low val-
ues of rainfall, with the opposite being true for red. Note that the scale tops out
at pure red for values of rainfall greater than 20 inches. Figure 6.22(c) shows
the result of color coding the gray image with the color map just discussed. The
results are much easier to interpret, as shown in this figure and in the zoomed
area of Fig. 6.22(d). In addition to providing global coverage, this type of data
allows meteorologists to calibrate ground-based rain monitoring systems with
greater precision than ever before. ■
www.EBooksWorld.ir
6.3 ■ Pseudocolor Image Processing 419
a b
c d
FIGURE 6.22 (a) Gray-scale image in which intensity (in the lighter horizontal band shown) corresponds to
average monthly rainfall. (b) Colors assigned to intensity values. (c) Color-coded image. (d) Zoom of the
South American region. (Courtesy of NASA.)
FIGURE 6.23
Red Functional block
fR (x, y)
transformation diagram for
pseudocolor
image processing.
fR, fG, and fB are
Green fed into the
f(x, y) fG (x, y) corresponding
transformation
red, green, and
blue inputs of an
RGB color
monitor.
Blue
fB (x, y)
transformation
www.EBooksWorld.ir
420 Chapter 6 ■ Color Image Processing
EXAMPLE 6.5: ■ Figure 6.24(a) shows two monochrome images of luggage obtained from an
Use of airport X-ray scanning system. The image on the left contains ordinary articles.
pseudocolor for The image on the right contains the same articles, as well as a block of simulated
highlighting
explosives plastic explosives. The purpose of this example is to illustrate the use of intensi-
contained in ty level to color transformations to obtain various degrees of enhancement.
luggage. Figure 6.25 shows the transformation functions used. These sinusoidal func-
tions contain regions of relatively constant value around the peaks as well as
regions that change rapidly near the valleys. Changing the phase and frequen-
cy of each sinusoid can emphasize (in color) ranges in the gray scale. For in-
stance, if all three transformations have the same phase and frequency, the
output image will be monochrome. A small change in the phase between the
three transformations produces little change in pixels whose intensities corre-
spond to peaks in the sinusoids, especially if the sinusoids have broad profiles
(low frequencies). Pixels with intensity values in the steep section of the sinu-
soids are assigned a much stronger color content as a result of significant dif-
ferences between the amplitudes of the three sinusoids caused by the phase
displacement between them.
a
b c
FIGURE 6.24
Pseudocolor
enhancement by
using the gray
level to color
transformations in
Fig. 6.25.
(Original image
courtesy of
Dr. Mike Hurwitz,
Westinghouse.)
www.EBooksWorld.ir
6.3 ■ Pseudocolor Image Processing 421
a
L1 b
FIGURE 6.25
Red Transformation
functions used to
obtain the images
L1 in Fig. 6.24.
Green
L1
Blue
Intensity
0 L1
Explosive Garment Background
bag
L1
Red
L1
Green
L1
Blue
Intensity
0 L1
Explosive Garment Background
bag
The image shown in Fig. 6.24(b) was obtained with the transformation
functions in Fig. 6.25(a), which shows the gray-level bands corresponding to
the explosive, garment bag, and background, respectively. Note that the ex-
plosive and background have quite different intensity levels, but they were
both coded with approximately the same color as a result of the periodicity of
the sine waves. The image shown in Fig. 6.24(c) was obtained with the trans-
formation functions in Fig. 6.25(b). In this case the explosives and garment
bag intensity bands were mapped by similar transformations and thus re-
ceived essentially the same color assignments. Note that this mapping allows
an observer to “see” through the explosives. The background mappings were
about the same as those used for Fig. 6.24(b), producing almost identical color
assignments. ■
www.EBooksWorld.ir
422 Chapter 6 ■ Color Image Processing
g K (x, y)
f K (x, y) Transformation TK hB (x, y)
EXAMPLE 6.6: ■ Figures 6.27(a) through (d) show four spectral satellite images of Washing-
Color coding of ton, D.C., including part of the Potomac River. The first three images are in the
multispectral visible red, green, and blue, and the fourth is in the near infrared (see Table 1.1
images.
and Fig. 1.10). Figure 6.27(e) is the full-color image obtained by combining the
first three images into an RGB image. Full-color images of dense areas are dif-
ficult to interpret, but one notable feature of this image is the difference in
color in various parts of the Potomac River. Figure 6.27(f) is a little more in-
teresting.This image was formed by replacing the red component of Fig. 6.27(e)
with the near-infrared image. From Table 1.1, we know that this band is strong-
ly responsive to the biomass components of a scene. Figure 6.27(f) shows quite
clearly the difference between biomass (in red) and the human-made features
in the scene, composed primarily of concrete and asphalt, which appear bluish
in the image.
The type of processing just illustrated is quite powerful in helping visualize
events of interest in complex images, especially when those events are beyond
our normal sensing capabilities. Figure 6.28 is an excellent illustration of this.
These are images of the Jupiter moon Io, shown in pseudocolor by combining
several of the sensor images from the Galileo spacecraft, some of which are in
spectral regions not visible to the eye. However, by understanding the physical
and chemical processes likely to affect sensor response, it is possible to combine
the sensed images into a meaningful pseudocolor map. One way to combine the
sensed image data is by how they show either differences in surface chemical
composition or changes in the way the surface reflects sunlight. For example, in
the pseudocolor image in Fig. 6.28(b), bright red depicts material newly ejected
www.EBooksWorld.ir
6.3 ■ Pseudocolor Image Processing 423
FIGURE 6.27 (a)–(d) Images in bands 1–4 in Fig. 1.10 (see Table 1.1). (e) Color a b
composite image obtained by treating (a), (b), and (c) as the red, green, blue com- c d
ponents of an RGB image. (f) Image obtained in the same manner, but using in the e f
red channel the near-infrared image in (d). (Original multispectral images courtesy
of NASA.)
www.EBooksWorld.ir
424 Chapter 6 ■ Color Image Processing
a
b
FIGURE 6.28
(a) Pseudocolor
rendition of
Jupiter Moon Io.
(b) A close-up.
(Courtesy of
NASA.)
from an active volcano on Io, and the surrounding yellow materials are older
sulfur deposits. This image conveys these characteristics much more readily
than would be possible by analyzing the component images individually. ■
www.EBooksWorld.ir