0% found this document useful (0 votes)
5 views

Module 4

Uploaded by

likheet.s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Module 4

Uploaded by

likheet.s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

4.

7 ■ The Basics of Filtering in the Frequency Domain 255

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

C d(u + Mu0, v + Nv0) - d(u - Mu0, v - Nv0) D


1
j
2
11) Cosine cos(2pu0x + 2pv0y) 3

C d(u + Mu0, v + Nv0) + d(u - Mu0, v - Nv0) D


1
2
The following Fourier transform pairs are derivable only for continuous variables,
denoted as before by t and z for spatial variables and by m and n for frequency
variables. These results can be used for DFT work by sampling the continuous forms.
0 m 0 n
12) Differentiation a b a b f(t, z) 3 (j2pm)m(j2pn)nF(m, n)
0t 0z
(The expressions
m
on the right 0 f(t, z) m
0 nf(t, z)
3 (j2pm) F(m, n); 3 (j2pn)nF(m, n)
assume that 0tm 0zn
f(; q , ; q ) = 0.)
2 2 2
+ z2) 2
+ n2)>2s2
13) Gaussian A2ps2e-2p s (t 3 Ae-(m (A is a constant)

Assumes that the functions have been extended by zero padding. Convolution and correlation are asso-
ciative, commutative, and distributive.

be used to derive the frequency-domain equivalent of the Laplacian defined in


Eq. (3.6-3) (Problem 4.26). The Gaussian pair is discussed in Section 4.7.4.
Tables 4.1 through 4.3 provide a summary of properties useful when working
with the DFT. Many of these properties are key elements in the development of
the material in the rest of this chapter, and some are used in subsequent chapters.

4.7 The Basics of Filtering in the Frequency Domain


In this section, we lay the groundwork for all the filtering techniques discussed
in the remainder of the chapter.

4.7.1 Additional Characteristics of the Frequency Domain


We begin by observing in Eq. (4.5-15) that each term of F(u, v) contains all val-
ues of f(x, y), modified by the values of the exponential terms. Thus, with the
exception of trivial cases, it usually is impossible to make direct associations be-
tween specific components of an image and its transform. However, some gen-
eral statements can be made about the relationship between the frequency

www.EBooksWorld.ir
256 Chapter 4 ■ Filtering in the Frequency Domain

components of the Fourier transform and spatial features of an image. For


instance, because frequency is directly related to spatial rates of change, it is not
difficult intuitively to associate frequencies in the Fourier transform with pat-
terns of intensity variations in an image. We showed in Section 4.6.5 that the
slowest varying frequency component (u = v = 0) is proportional to the aver-
age intensity of an image. As we move away from the origin of the transform,
the low frequencies correspond to the slowly varying intensity components of
an image. In an image of a room, for example, these might correspond to
smooth intensity variations on the walls and floor. As we move further away
from the origin, the higher frequencies begin to correspond to faster and faster
intensity changes in the image. These are the edges of objects and other compo-
nents of an image characterized by abrupt changes in intensity.
Filtering techniques in the frequency domain are based on modifying the
Fourier transform to achieve a specific objective and then computing the in-
verse DFT to get us back to the image domain, as introduced in Section
2.6.7. It follows from Eq. (4.6-15) that the two components of the transform
to which we have access are the transform magnitude (spectrum) and the
phase angle. Section 4.6.5 covered the basic properties of these two compo-
nents of the transform. We learned there that visual analysis of the phase
component generally is not very useful. The spectrum, however, provides
some useful guidelines as to gross characteristics of the image from which
the spectrum was generated. For example, consider Fig. 4.29(a), which is a
scanning electron microscope image of an integrated circuit, magnified ap-
proximately 2500 times. Aside from the interesting construction of the de-
vice itself, we note two principal features: strong edges that run
approximately at ;45° and two white, oxide protrusions resulting from
thermally-induced failure.The Fourier spectrum in Fig. 4.29(b) shows prominent
components along the ;45° directions that correspond to the edges just
mentioned. Looking carefully along the vertical axis, we see a vertical component

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).

4.7.2 Frequency Domain Filtering Fundamentals


Filtering in the frequency domain consists of modifying the Fourier transform
of an image and then computing the inverse transform to obtain the processed
result. Thus, given a digital image, f(x, y), of size M * N, the basic filtering
equation in which we are interested has the form:

g(x, y) = ᑣ-1[H(u, v)F(u, v)] (4.7-1) If H is real and symmet-


ric and f is real (as is typ-
ically the case), then the
where ᑣ-1 is the IDFT, F(u, v) is the DFT of the input image, f(x, y), H(u, v) IDFT in Eq. (4.7-1)
is a filter function (also called simply the filter, or the filter transfer function), should yield real quanti-
ties in theory. In practice,
and g(x, y) is the filtered (output) image. Functions F, H, and g are arrays of the inverse generally
size M * N, the same as the input image. The product H(u, v)F(u, v) is contains parasitic com-
plex terms from round-
formed using array multiplication, as defined in Section 2.6.1. The filter func- off and other
tion modifies the transform of the input image to yield a processed output, computational inaccura-
cies. Thus, it is customary
g(x, y). Specification of H(u, v) is simplified considerably by using functions to take the real part of
that are symmetric about their center, which requires that F(u, v) be centered the IDFT to form g.

also. As explained in Section 4.6.3, this is accomplished by multiplying the


input image by (-1)x + y prior to computing its transform.†
We are now in a position to consider the filtering process in some detail. One
of the simplest filters we can construct is a filter H(u, v) that is 0 at the center of
the transform and 1 elsewhere. This filter would reject the dc term and “pass”
(i.e., leave unchanged) all other terms of F(u, v) when we form the product
H(u, v)F(u, v). We know from Eq. (4.6-21) that the dc term is responsible for the
average intensity of an image, so setting it to zero will reduce the average intensi-
ty of the output image to zero. Figure 4.30 shows the result of this operation using
Eq. (4.7-1). As expected, the image became much darker. (An average of zero


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.

implies the existence of negative intensities. Therefore, although it illustrates the


principle, Fig. 4.30 is not a true representation of the original, as all negative in-
tensities were clipped (set to 0) for display purposes.)
As noted earlier, low frequencies in the transform are related to slowly
varying intensity components in an image, such as the walls of a room or a
cloudless sky in an outdoor scene. On the other hand, high frequencies are
caused by sharp transitions in intensity, such as edges and noise. Therefore, we
would expect that a filter H(u, v) that attenuates high frequencies while passing
low frequencies (appropriately called a lowpass filter) would blur an image,
while a filter with the opposite property (called a highpass filter) would en-
hance sharp detail, but cause a reduction in contrast in the image. Figure 4.31 il-
lustrates these effects. Note the similarity between Figs. 4.31(e) and Fig. 4.30.
The reason is that the highpass filter shown eliminates the dc term, resulting in
the same basic effect that led to Fig. 4.30. Adding a small constant to the filter
does not affect sharpening appreciably, but it does prevent elimination of the
dc term and thus preserves tonality, as Fig. 4.31(f) shows.
Equation (4.7-1) involves the product of two functions in the frequency do-
main which, by the convolution theorem, implies convolution in the spatial do-
main. We know from the discussion in Section 4.6.6 that if the functions in
question are not padded we can expect wraparound error. Consider what hap-
pens when we apply Eq. (4.7-1) without padding. Figure 4.32(a) shows a sim-
ple image, and Fig. 4.32(b) is the result of lowpass filtering the image with a
Gaussian lowpass filter of the form shown in Fig. 4.31(a). As expected, the
image is blurred. However, the blurring is not uniform; the top white edge is
blurred, but the side white edges are not. Padding the input image according to
Eqs. (4.6-31) and (4.6-32) before applying Eq. (4.7-1) results in the filtered
image in Fig. 4.32(c). This result is as expected.
Figure 4.33 illustrates the reason for the discrepancy between Figs. 4.32(b)
and (c). The dashed areas in Fig. 4.33 correspond to the image in Fig. 4.32(a).
Figure 4.33(a) shows the periodicity implicit in the use of the DFT, as ex-
plained in Section 4.6.3. Imagine convolving the spatial representation of the
blurring filter with this image. When the filter is passing through the top of the

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:

F(u, v) = R(u, v) + jI(u, v) (4.7-2)

Equation (4.7-1) then becomes

g(x, y) = ᑣ-1 C H(u, v)R(u, v) + jH(u, v)I(u, v) D (4.7-3)

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.

4.7.3 Summary of Steps for Filtering in the Frequency Domain


The material in the previous two sections can be summarized as follows:
1. Given an input image f(x, y) of size M * N, obtain the padding parame-
ters P and Q from Eqs. (4.6-31) and (4.6-32). Typically, we select P = 2M
and Q = 2N.
2. Form a padded image, fp (x, y), of size P * Q by appending the necessary
number of zeros to f(x, y).
3. Multiply fp (x, y) by ( -1)x + y to center its transform. As noted earlier, center-
ing helps in visualizing
4. Compute the DFT, F(u, v), of the image from step 3. the filtering process and
5. Generate a real, symmetric filter function, H(u, v), of size P * Q with cen- in generating the filter
ter at coordinates (P> 2, Q> 2).† Form the product G(u, v) = H(u, v)F(u, v) functions themselves, but
centering is not a funda-
using array multiplication; that is, G(i, k) = H(i, k)F(i, k). mental requirement.
6. Obtain the processed image:

gp (x, y) = E real C ᑣ-1[G(u, v)] D F (-1)x + y


where the real part is selected in order to ignore parasitic complex com-
ponents resulting from computational inaccuracies, and the subscript p in-
dicates that we are dealing with padded arrays.
7. Obtain the final processed result, g(x, y), by extracting the M * N region
from the top, left quadrant of gp (x, y).
Figure 4.36 illustrates the preceding steps. The legend in the figure explains the
source of each image. If it were enlarged, Fig. 4.36(c) would show black dots
interleaved in the image because negative intensities are clipped to 0 for dis-
play. Note in Fig. 4.36(h) the characteristic dark border exhibited by lowpass
filtered images processed using zero padding.

4.7.4 Correspondence Between Filtering in the Spatial and


Frequency Domains
The link between filtering in the spatial and frequency domains is the convo-
lution theorem. In Section 4.7.2, we defined filtering in the frequency domain
as the multiplication of a filter function, H(u, v), times F(u, v), the Fourier
transform of the input image. Given a filter H(u, v), suppose that we want to
find its equivalent representation in the spatial domain. If we let
f(x, y) = d(x, y), it follows from Table 4.3 that F(u, v) = 1. Then, from
Eq. (4.7-1), the filtered output is ᑣ-15H(u, v)6. But this is the inverse trans-
form of the frequency domain filter, which is the corresponding filter in the


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:

h(x, y) 3 H(u, v) (4.7-4)

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)

where s is the standard deviation of the Gaussian curve. The corresponding


filter in the spatial domain is obtained by taking the inverse Fourier transform
of H(u) (Problem 4.31):
2
s2x2
h(x) = 12psAe -2p (4.7-6)

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:

H(u) = A e -u >2s 1 - B e -u >2s 2


2 2 2 2
(4.7-7)

with A Ú B and s1 7 s2. The corresponding filter in the spatial domain is


2 2 2 2 2 2
h(x) = 12ps1 A e -2p s 1x - 12ps2 B e -2p s2x (4.7-8)

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. ■

4.8 Image Smoothing Using Frequency Domain Filters


The remainder of this chapter deals with various filtering techniques in the fre-
quency domain. We begin with lowpass filters. Edges and other sharp intensity
transitions (such as noise) in an image contribute significantly to the high-
frequency content of its Fourier transform. Hence, smoothing (blurring) is
achieved in the frequency domain by high-frequency attenuation; that is, by
lowpass filtering. In this section, we consider three types of lowpass filters:
ideal, Butterworth, and Gaussian. These three categories cover the range from
very sharp (ideal) to very smooth (Gaussian) filtering. The Butterworth filter
has a parameter called the filter order. For high order values, the Butterworth
filter approaches the ideal filter. For lower order values, the Butterworth filter
is more like a Gaussian filter. Thus, the Butterworth filter may be viewed as
providing a transition between two “extremes.” All filtering in this section fol-
lows 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.

4.8.1 Ideal Lowpass Filters


A 2-D lowpass filter that passes without attenuation all frequencies within a
circle of radius D0 from the origin and “cuts off” all frequencies outside this
circle is called an ideal lowpass filter (ILPF); it is specified by the function

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,

D(u, v) = C (u - P>2)2 + (v - Q>2)2 D


1/ 2
(4.8-2)

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

a = 100c a a P(u, v)>PT d (4.8-4)


u v

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.

4.8.2 Butterworth Lowpass Filters


The transfer function of a Butterworth lowpass filter (BLPF) of order n, and The transfer function of
the Butterworth lowpass
with cutoff frequency at a distance D0 from the origin, is defined as filter normally is written
as the square root of our
expression. However, our
1 interest here is in the
H(u, v) = (4.8-5)
1 + [D(u, v)>D0] 2n basic form of the filter, so
we exclude the square
root for computational
where D(u, v) is given by Eq. (4.8-2). Figure 4.44 shows a perspective plot, convenience.
image display, and radial cross sections of the BLPF function.

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. ■

A BLPF of order 1 has no ringing in the spatial domain. Ringing generally


is imperceptible in filters of order 2, but can become significant in filters of
higher order. Figure 4.46 shows a comparison between the spatial representa-
tion of BLPFs of various orders (using a cutoff frequency of 5 in all cases).
Shown also is the intensity profile along a horizontal scan line through the cen-
ter of each filter. These filters were obtained and displayed using the same pro-
cedure used to generate Fig. 4.43. To facilitate comparisons, additional
enhancing with a gamma transformation [see Eq. (3.2-3)] was applied to the
images of Fig. 4.46. The BLPF of order 1 [Fig. 4.46(a)] has neither ringing nor
negative values. The filter of order 2 does show mild ringing and small negative
values, but they certainly are less pronounced than in the ILPF. As the remain-
ing images show, ringing in the BLPF becomes significant for higher-order fil-
ters. A Butterworth filter of order 20 exhibits characteristics similar to those of
the ILPF (in the limit, both filters are identical). BLPFs of order 2 are a good
compromise between effective lowpass filtering and acceptable ringing.

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.

4.8.3 Gaussian Lowpass Filters


Gaussian lowpass filters (GLPFs) of one dimension were introduced in
Section 4.7.4 as an aid in exploring some important relationships between the
spatial and frequency domains. The form of these filters in two dimensions is
given by
2 2
H(u, v) = e-D (u, v)>2s (4.8-6)

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.

Ideal Butterworth Gaussian

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. ■

4.8.4 Additional Examples of Lowpass Filtering


In the following discussion, we show several practical applications of lowpass
filtering in the frequency domain. The first example is from the field of ma-
chine perception with application to character recognition; the second is from
the printing and publishing industry; and the third is related to processing

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.

4.9 Image Sharpening Using Frequency Domain Filters


In the previous section, we showed that an image can be smoothed by attenu-
ating the high-frequency components of its Fourier transform. Because edges
and other abrupt changes in intensities are associated with high-frequency
components, image sharpening can be achieved in the frequency domain by
highpass filtering, which attenuates the low-frequency components without
disturbing high-frequency information in the Fourier transform. As in Section

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

HHP (u, v) = 1 - HLP (u, v) (4.9-1)

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.

4.9.1 Ideal Highpass Filters


A 2-D ideal highpass filter (IHPF) is defined as

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

giving discontinuities of smaller magnitude). Looking at the “spot” size of the


spatial representation of the IHPF in Fig. 4.53(a) and keeping in mind that fil-
tering in the spatial domain is convolution of the spatial filter with the image
helps explain why the smaller objects and lines appear almost solid white.
Look in particular at the three small squares in the top row and the thin, ver-
tical bars in Fig. 4.54(a). The situation improved somewhat with D0 = 60.
Edge distortion is quite evident still, but now we begin to see filtering on the
smaller objects. Due to the now familiar inverse relationship between the fre-
quency and spatial domains, we know that the spot size of this filter is smaller
than the spot of the filter with D0 = 30. The result for D0 = 160 is closer to
what a highpass-filtered image should look like. Here, the edges are much
cleaner and less distorted, and the smaller objects have been filtered prop-
erly. Of course, the constant background in all images is zero in these
highpass-filtered images because highpass filtering is analogous to differ-
entiation in the spatial domain.

4.9.2 Butterworth Highpass Filters


A 2-D Butterworth highpass filter (BHPF) of order n and cutoff frequency D0
is defined as

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.

4.9.3 Gaussian Highpass Filters


The transfer function of the Gaussian highpass filter (GHPF) with cutoff fre-
quency locus at a distance D0 from the center of the frequency rectangle is
given by
2 2
H(u, v) = 1 - e-D (u,v)>2D0 (4.9-4)
where D(u, v) is given by Eq. (4.8-2). This expression follows directly from
Eqs. (4.8-7) and (4.9-1). The third row in Fig. 4.52 shows a perspective plot,
image, and cross section of the GHPF function. Following the same format as
for the BHPF, we show in Fig. 4.56 comparable results using GHPFs. As ex-
pected, the results obtained are more gradual than with the previous two fil-
ters. Even the filtering of the smaller objects and thin bars is cleaner with the
Gaussian filter. Table 4.5 contains a summary of the highpass filters discussed
in this section.

TABLE 4.5
Highpass filters. D0 is the cutoff frequency and n is the order of the Butterworth filter.

Ideal Butterworth Gaussian

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). ■

4.9.4 The Laplacian in the Frequency Domain


In Section 3.6.2, we used the Laplacian for image enhancement in the spatial
domain. In this section, we revisit the Laplacian and show that it yields equiv-
alent results using frequency domain techniques. It can be shown (Problem
4.26) that the Laplacian can be implemented in the frequency domain using
the filter

H(u, v) = -4p2(u2 + v2) (4.9-5)

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

H(u, v) = -4p2 C (u - P>2)2 + (v - Q>2)2 D


(4.9-6)
= -4p2D2(u, v)

where D(u, v) is the distance function given in Eq. (4.8-2). Then, the Laplacian
image is obtained as:

§2f(x, y) = ᑣ-1 E H(u, v)F(u, v) F (4.9-7)

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:

g(x, y) = f(x, y) + c§2f(x, y) (4.9-8)

Here, c = -1 because H(u, v) is negative. In Chapter 3, f(x, y) and §2f(x, y)


had comparable values. However, computing §2f(x, y) with Eq. (4.9-7) intro-
duces DFT scaling factors that can be several orders of magnitude larger than
the maximum value of f. Thus, the differences between f and its Laplacian
must be brought into comparable ranges. The easiest way to handle this prob-
lem is to normalize the values of f(x, y) to the range [0, 1] (before computing
its DFT) and divide §2f(x, y) by its maximum value, which will bring it to the
approximate range [-1, 1] (recall that the Laplacian has negative values).
Equation (4.9-8) can then be applied.
In the frequency domain, Eq. (4.9-8) is written as

g(x, y) = ᑣ-1 E F(u, v) - H(u, v)F(u, v) F

= ᑣ-1 E C 1 - H(u, v) D F(u, v) F (4.9-9)

= ᑣ-1 E C 1 + 4p2D2(u, v) D F(u, v) F

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).

4.9.5 Unsharp Masking, Highboost Filtering,


and High-Frequency-Emphasis Filtering
In this section, we discuss frequency domain formulations of the unsharp
masking and high-boost filtering image sharpening techniques introduced in
Section 3.6.3. Using frequency domain methods, the mask defined in Eq. (3.6-8)
is given by

gmask(x, y) = f(x, y) - fLP (x, y) (4.9-10)

with

fLP (x, y) = ᑣ-1 C HLP (u, v)F(u, v) D (4.9-11)

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),

g(x, y) = f(x, y) + k * gmask(x, y) (4.9-12)

This expression defines unsharp masking when k = 1 and highboost filter-


ing when k 7 1. Using the preceding results, we can express Eq. (4.9-12)
entirely in terms of frequency domain computations involving a lowpass
filter:

g(x, y) = ᑣ-1 E C 1 + k * [1 - HLP (u, v)] D F(u, v) F (4.9-13)

Using Eq. (4.9-1), we can express this result in terms of a highpass filter:

g(x, y) = ᑣ-1 E [1 + k * HHP (u, v)]F(u, v) F (4.9-14)

www.EBooksWorld.ir
4.9 ■ Image Sharpening Using Frequency Domain Filters 289

The expression contained within the square brackets is called a high-frequency-


emphasis filter. As noted earlier, highpass filters set the dc term to zero, thus
reducing the average intensity in the filtered image to 0. The high-frequency-
emphasis filter does not have this problem because of the 1 that is added to the
highpass filter. The constant, k, gives control over the proportion of high fre-
quencies that influence the final result. A slightly more general formulation of
high-frequency-emphasis filtering is the expression

g(x, y) = ᑣ-1 E [k1 + k2 * HHP (u, v)]F(u, v) F (4.9-15)

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. ■

4.9.6 Homomorphic Filtering


The illumination-reflectance model introduced in Section 2.3.4 can be used to
develop a frequency domain procedure for improving the appearance of an
image by simultaneous intensity range compression and contrast enhance-
ment. From the discussion in that section, an image f(x, y) can be expressed as
the product of its illumination, i(x, y), and reflectance, r(x, y), components:

f(x, y) = i(x, y)r(x, y) (4.9-16)

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.)

This equation cannot be used directly to operate on the frequency compo-


nents of illumination and reflectance because the Fourier transform of a prod-
uct is not the product of the transforms:
ᑣ[f(x, y)] Z ᑣ[i(x, y)] ᑣ[r(x, y)] (4.9-17)
If an image f (x, y) with However, suppose that we define
intensities in the range
[0, L - 1] has any 0 val-
ues, a 1 must be added to
z(x, y) = ln f(x, y)
every element of the (4.9-18)
image to avoid having to = ln i(x, y) + ln r(x, y)
deal with ln(0). The 1 is
then subtracted at the
end of the filtering
Then,

ᑣ 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

Z(u, v) = Fi (u, v) + Fr (u, v) (4.9-20)

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

S(u, v) = H(u, v)Z(u, v)


(4.9-21)
= H(u, v)Fi (u, v) + H(u, v)Fr (u, v)

The filtered image in the spatial domain is

s(x, y) = ᑣ-1 E S(u, v) F


(4.9-22)
= ᑣ-1 E H(u, v)Fi (u, v) F + ᑣ-1 E H(u, v)Fr (u, v) F

By defining

i¿(x, y) = ᑣ-1 E H(u, v)Fi (u, v) F (4.9-23)

and

r¿(x, y) = ᑣ-1 E H(u, v)Fr (u, v) F (4.9-24)

we can express Eq. (4.9-23) in the form

s(x, y) = i¿(x, y) + r¿(x, y) (4.9-25)

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)

= e i¿(x,y)e r¿(x,y) (4.9-26)


= i0 (x, y) r0 (x, y)

where

i0 (x, y) = e i¿(x,y) (4.9-27)

and

r0 (x, y) = e r¿(x,y) (4.9-28)

are the illumination and reflectance components of the output (processed)


image.

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

H(u, v) = (gH - gL) C 1 - e -c[D (u, v)>D0 ] D + gL


2 2
(4.9-29)

FIGURE 4.61 H (u, v)


Radial cross
section of a
circularly
symmetric
homomorphic gH
filter function.
The vertical axis is
at the center of
the frequency
rectangle and
D(u, v) is the
distance from the gL
center.

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

Others require reformulation to be consistent with the properties of the color


spaces developed in this chapter. The techniques described here are far from ex-
haustive; they illustrate the range of methods available for color image processing.

6.1 Color Fundamentals


Although the process followed by the human brain in perceiving and inter-
preting color is a physiopsychological phenomenon that is not fully under-
stood, the physical nature of color can be expressed on a formal basis
supported by experimental and theoretical results.
In 1666, Sir Isaac Newton discovered that when a beam of sunlight passes
through a glass prism, the emerging beam of light is not white but consists in-
stead of a continuous spectrum of colors ranging from violet at one end to red
at the other. As Fig. 6.1 shows, the color spectrum may be divided into six
broad regions: violet, blue, green, yellow, orange, and red. When viewed in full
color (Fig. 6.2), no color in the spectrum ends abruptly, but rather each color
blends smoothly into the next.
Basically, the colors that humans and some other animals perceive in an object
are determined by the nature of the light reflected from the object. As illustrated
in Fig. 6.2, visible light is composed of a relatively narrow band of frequencies in
the electromagnetic spectrum.A body that reflects light that is balanced in all vis-
ible wavelengths appears white to the observer. However, a body that favors re-
flectance in a limited range of the visible spectrum exhibits some shades of color.
For example, green objects reflect light with wavelengths primarily in the 500 to
570 nm range while absorbing most of the energy at other wavelengths.

FIGURE 6.1 Color


spectrum seen by
passing white
light through a
prism. (Courtesy
of the General
Electric Co.,
Lamp Business
Division.)

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

Characterization of light is central to the science of color. If the light is


achromatic (void of color), its only attribute is its intensity, or amount. Achro-
matic light is what viewers see on a black and white television set, and it has
been an implicit component of our discussion of image processing thus far. As
defined in Chapter 2, and used numerous times since, the term gray level
refers to a scalar measure of intensity that ranges from black, to grays, and fi-
nally to white.
Chromatic light spans the electromagnetic spectrum from approximately
400 to 700 nm. Three basic quantities are used to describe the quality of a
chromatic light source: radiance, luminance, and brightness. Radiance is the
total amount of energy that flows from the light source, and it is usually mea-
sured in watts (W). Luminance, measured in lumens (lm), gives a measure of
the amount of energy an observer perceives from a light source. For example,
light emitted from a source operating in the far infrared region of the spec-
trum could have significant energy (radiance), but an observer would hardly
perceive it; its luminance would be almost zero. Finally, brightness is a subjec-
tive descriptor that is practically impossible to measure. It embodies the
achromatic notion of intensity and is one of the key factors in describing
color sensation.
As noted in Section 2.1.1, cones are the sensors in the eye responsible for
color vision. Detailed experimental evidence has established that the 6 to 7 mil-
lion cones in the human eye can be divided into three principal sensing cate-
gories, corresponding roughly to red, green, and blue. Approximately 65% of all
cones are sensitive to red light, 33% are sensitive to green light, and only about
2% are sensitive to blue (but the blue cones are the most sensitive). Figure 6.3
shows average experimental curves detailing the absorption of light by the red,
green, and blue cones in the eye. Due to these absorption characteristics of the

FIGURE 6.3 445 nm 535 nm 575 nm


Absorption of
light by the red,
Absorption (arbitrary units)

green, and blue


cones in the Blue Green Red
human eye as a
function of
wavelength.

400 450 500 550 600 650 700 nm


Bluish purple

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

PRIMARY AND SECONDARY COLORS


OF LIGHT AND PIGMENT

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

tristimulus values and are denoted, X, Y, and Z, respectively. A color is then


specified by its trichromatic coefficients, defined as
X
x = (6.1-1)
X + Y + Z
Y
y = (6.1-2)
X + Y + Z
and
Z
z = (6.1-3)
X + Y + Z
It is noted from these equations that†
x + y + z = 1 (6.1-4)
For any wavelength of light in the visible spectrum, the tristimulus values
needed to produce the color corresponding to that wavelength can be ob-
tained directly from curves or tables that have been compiled from extensive
experimental results (Poynton [1996]. See also the early references by Walsh
[1958] and by Kiver [1965]).
Another approach for specifying colors is to use the CIE chromaticity dia-
gram (Fig. 6.5), which shows color composition as a function of x (red) and y
(green). For any value of x and y, the corresponding value of z (blue) is ob-
tained from Eq. (6.1-4) by noting that z = 1 - (x + y). The point marked
green in Fig. 6.5, for example, has approximately 62% green and 25% red con-
tent. From Eq. (6.1-4), the composition of blue is approximately 13%.
The positions of the various spectrum colors—from violet at 380 nm to red
at 780 nm—are indicated around the boundary of the tongue-shaped chro-
maticity diagram. These are the pure colors shown in the spectrum of Fig. 6.2.
Any point not actually on the boundary but within the diagram represents
some mixture of spectrum colors. The point of equal energy shown in Fig. 6.5
corresponds to equal fractions of the three primary colors; it represents the
CIE standard for white light. Any point located on the boundary of the chro-
maticity chart is fully saturated. As a point leaves the boundary and approach-
es the point of equal energy, more white light is added to the color and it
becomes less saturated. The saturation at the point of equal energy is zero.
The chromaticity diagram is useful for color mixing because a straight-line
segment joining any two points in the diagram defines all the different color
variations that can be obtained by combining these two colors additively. Con-
sider, for example, a straight line drawn from the red to the green points shown
in Fig. 6.5. If there is more red light than green light, the exact point represent-
ing the new color will be on the line segment, but it will be closer to the red
point than to the green point. Similarly, a line drawn from the point of equal


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.

6.2 Color Models


The purpose of a color model (also called color space or color system) is to fa-
cilitate the specification of colors in some standard, generally accepted way. In
essence, a color model is a specification of a coordinate system and a subspace
within that system where each color is represented by a single point.
Most color models in use today are oriented either toward hardware (such
as for color monitors and printers) or toward applications where color manip-
ulation is a goal (such as in the creation of color graphics for animation). In

www.EBooksWorld.ir
402 Chapter 6 ■ Color Image Processing

terms of digital image processing, the hardware-oriented models most com-


monly used in practice are the RGB (red, green, blue) model for color moni-
tors and a broad class of color video cameras; the CMY (cyan, magenta,
yellow) and CMYK (cyan, magenta, yellow, black) models for color printing;
and the HSI (hue, saturation, intensity) model, which corresponds closely with
the way humans describe and interpret color. The HSI model also has the ad-
vantage that it decouples the color and gray-scale information in an image,
making it suitable for many of the gray-scale techniques developed in this
book. There are numerous color models in use today due to the fact that color
science is a broad field that encompasses many areas of application. It is
tempting to dwell on some of these models here simply because they are inter-
esting and informative. However, keeping to the task at hand, the models dis-
cussed in this chapter are leading models for image processing. Having
mastered the material in this chapter, you will have no difficulty in under-
standing additional color models in use today.

6.2.1 The RGB Color Model


In the RGB model, each color appears in its primary spectral components of
red, green, and blue. This model is based on a Cartesian coordinate system.
The color subspace of interest is the cube shown in Fig. 6.7, in which RGB pri-
mary values are at three corners; the secondary colors cyan, magenta, and yel-
low are at three other corners; black is at the origin; and white is at the corner
farthest from the origin. In this model, the gray scale (points of equal RGB
values) extends from black to white along the line joining these two points.
The different colors in this model are points on or inside the cube, and are de-
fined by vectors extending from the origin. For convenience, the assumption
is that all color values have been normalized so that the cube shown in Fig. 6.7
is the unit cube. That is, all values of R, G, and B are assumed to be in the
range [0, 1].

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).

Gray scale (0, 1, 0)


Black G
Green

(1, 0, 0)
Red Yellow

www.EBooksWorld.ir
6.2 ■ Color Models 403

FIGURE 6.8 RGB


24-bit color cube.

Images represented in the RGB color model consist of three component


images, one for each primary color. When fed into an RGB monitor, these
three images combine on the screen to produce a composite color image, as
explained in Section 6.1. The number of bits used to represent each pixel in
RGB space is called the pixel depth. Consider an RGB image in which each of
the red, green, and blue images is an 8-bit image. Under these conditions each
RGB color pixel [that is, a triplet of values (R, G, B)] is said to have a depth of
24 bits (3 image planes times the number of bits per plane). The term full-color
image is used often to denote a 24-bit RGB color image. The total number of
colors in a 24-bit RGB image is (28)3 = 16,777,216. Figure 6.8 shows the 24-bit
RGB color cube corresponding to the diagram in Fig. 6.7.

■ 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)

While high-end display cards and monitors provide a reasonable rendition


of the colors in a 24-bit RGB image, many systems in use today are limited to
256 colors. Also, there are numerous applications in which it simply makes no
sense to use more than a few hundred, and sometimes fewer, colors. A good
example of this is provided by the pseudocolor image processing techniques
discussed in Section 6.3. Given the variety of systems in current use, it is of
considerable interest to have a subset of colors that are likely to be repro-
duced faithfully, reasonably independently of viewer hardware capabilities.
This subset of colors is called the set of safe RGB colors, or the set of all-
systems-safe colors. In Internet applications, they are called safe Web colors or
safe browser colors.
On the assumption that 256 colors is the minimum number of colors that
can be reproduced faithfully by any system in which a desired result is likely to
be displayed, it is useful to have an accepted standard notation to refer to
these colors. Forty of these 256 colors are known to be processed differently by
various operating systems, leaving only 216 colors that are common to most
systems. These 216 colors have become the de facto standard for safe colors,
especially in Internet applications. They are used whenever it is desired that
the colors viewed by most people appear the same.

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.

6.2.2 The CMY and CMYK Color Models


As indicated in Section 6.1, cyan, magenta, and yellow are the secondary colors
of light or, alternatively, the primary colors of pigments. For example, when a
surface coated with cyan pigment is illuminated with white light, no red light is
reflected from the surface. That is, cyan subtracts red light from reflected white
light, which itself is composed of equal amounts of red, green, and blue light.
Most devices that deposit colored pigments on paper, such as color printers
and copiers, require CMY data input or perform an RGB to CMY conversion
internally. This conversion is performed using the simple operation

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.

6.2.3 The HSI Color Model


As we have seen, creating colors in the RGB and CMY models and changing
from one model to the other is a straightforward process. As noted earlier,
these color systems are ideally suited for hardware implementations. In addi-
tion, the RGB system matches nicely with the fact that the human eye is
strongly perceptive to red, green, and blue primaries. Unfortunately, the
RGB, CMY, and other similar color models are not well suited for describing
colors in terms that are practical for human interpretation. For example, one
does not refer to the color of an automobile by giving the percentage of each
of the primaries composing its color. Furthermore, we do not think of color
images as being composed of three primary images that combine to form that
single image.
When humans view a color object, we describe it by its hue, saturation, and
brightness. Recall from the discussion in Section 6.1 that hue is a color at-
tribute that describes a pure color (pure yellow, orange, or red), whereas satu-
ration gives a measure of the degree to which a pure color is diluted by white
light. Brightness is a subjective descriptor that is practically impossible to mea-
sure. It embodies the achromatic notion of intensity and is one of the key fac-
tors in describing color sensation. We do know that intensity (gray level) is a
most useful descriptor of monochromatic images. This quantity definitely is
measurable and easily interpretable. The model we are about to present, called
the HSI (hue, saturation, intensity) color model, decouples the intensity com-
ponent from the color-carrying information (hue and saturation) in a color
image. As a result, the HSI model is an ideal tool for developing image pro-
cessing algorithms based on color descriptions that are natural and intuitive to
humans, who, after all, are the developers and users of these algorithms. We
can summarize by saying that RGB is ideal for image color generation (as in
image capture by a color camera or image display in a monitor screen), but its
use for color description is much more limited. The material that follows pro-
vides an effective way to do this.

www.EBooksWorld.ir
408 Chapter 6 ■ Color Image Processing

As discussed in Example 6.1, an RGB color image can be viewed as three


monochrome intensity images (representing red, green, and blue), so it should
come as no surprise that we should be able to extract intensity from an RGB
image.This becomes rather clear if we take the color cube from Fig. 6.7 and stand
it on the black (0, 0, 0) vertex, with the white vertex (1, 1, 1) directly above it, as
shown in Fig. 6.12(a). As noted in connection with Fig. 6.7, the intensity (gray
scale) is along the line joining these two vertices. In the arrangement shown in
Fig. 6.12, the line (intensity axis) joining the black and white vertices is vertical.
Thus, if we wanted to determine the intensity component of any color point in
Fig. 6.12, we would simply pass a plane perpendicular to the intensity axis and
containing the color point. The intersection of the plane with the intensity axis
would give us a point with intensity value in the range [0, 1]. We also note with a
little thought that the saturation (purity) of a color increases as a function of dis-
tance from the intensity axis. In fact, the saturation of points on the intensity axis
is zero, as evidenced by the fact that all points along this axis are gray.
In order to see how hue can be determined also from a given RGB point,
consider Fig. 6.12(b), which shows a plane defined by three points (black,
white, and cyan). The fact that the black and white points are contained in the
plane tells us that the intensity axis also is contained in the plane. Further-
more, we see that all points contained in the plane segment defined by the in-
tensity axis and the boundaries of the cube have the same hue (cyan in this
case). We would arrive at the same conclusion by recalling from Section 6.1
that all colors generated by three colors lie in the triangle defined by those col-
ors. If two of those points are black and white and the third is a color point, all
points on the triangle would have the same hue because the black and white
components cannot change the hue (of course, the intensity and saturation of
points in this triangle would be different). By rotating the shaded plane about
the vertical intensity axis, we would obtain different hues. From these concepts
we arrive at the conclusion that the hue, saturation, and intensity values re-
quired to form the HSI space can be obtained from the RGB color cube. That
is, we can convert any RGB point to a corresponding point in the HSI color
model by working out the geometrical formulas describing the reasoning out-
lined in the preceding discussion.

a b
FIGURE 6.12 White White
Conceptual
relationships
between the RGB
and HSI color Magenta Magenta
models. Cyan Yellow Cyan Yellow

Blue Red Blue Red


Green Green

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

Cyan White Red

Blue Magenta
Green Yellow Green Yellow
Green

S S
H H
Cyan Red Cyan S Yellow Cyan Red
H

Blue Magenta Blue Magenta Red Blue Magenta

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

Converting colors from RGB to HSI


Computations from RGB Given an image in RGB color format, the H component of each RGB pixel is
to HSI and back are
carried out on a per-pixel obtained using the equation
basis. We omitted the
dependence on (x, y) of u if B … G
the conversion equations H = b (6.2-2)
for notational clarity. 360 - u if B 7 G

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

The saturation component is given by


3
S = 1 - [min(R, G, B)] (6.2-3)
(R + G + B)
Finally, the intensity component is given by
1
I =
(R + G + B) (6.2-4)
3
It is assumed that the RGB values have been normalized to the range [0, 1]
and that angle u is measured with respect to the red axis of the HSI space, as
indicated in Fig. 6.13. Hue can be normalized to the range [0, 1] by dividing by
360° all values resulting from Eq. (6.2-2). The other two HSI components al-
ready are in this range if the given RGB values are in the interval [0, 1].
The results in Eqs. (6.2-2) through (6.2-4) can be derived from the geometry
shown in Figs. 6.12 and 6.13. The derivation is tedious and would not add sig-
nificantly to the present discussion. The interested reader can consult the Consult the Tutorials sec-
book’s references or Web site for a proof of these equations, as well as for the tion of the book Web site
for a detailed derivation
following HSI to RGB conversion results. of the conversion equa-
tions between RGB and
Converting colors from HSI to RGB HSI, and vice versa.

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°].

RG sector (0° … H 6 120°): When H is in this sector, the RGB components


are given by the equations
B = I(1 - S) (6.2-5)

d
S cos H
R = Ic1 + (6.2-6)
cos(60° - H)
and
G = 3I - (R + B) (6.2-7)

GB sector (120° … H 6 240°): If the given value of H is in this sector, we first


subtract 120° from it:
H = H - 120° (6.2-8)


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

Then the RGB components are


R = I(1 - S) (6.2-9)

d
S cos H
G = Ic1 + (6.2-10)
cos(60° - H)
and
B = 3I - (R + G) (6.2-11)

BR sector (240° … H … 360°): Finally, if H is in this range, we subtract 240°


from it:
H = H - 240° (6.2-12)
Then the RGB components are
G = I(1 - S) (6.2-13)

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. ■

Manipulating HSI component images


In the following discussion, we take a look at some simple techniques for ma-
nipulating HSI component images. This will help you develop familiarity with
these components and also help you deepen your understanding of the HSI color
model. Figure 6.16(a) shows an image composed of the primary and secondary
RGB colors. Figures 6.16(b) through (d) show the H, S, and I components of
this image, generated using Eqs. (6.2-2) through (6.2-4). Recall from the dis-
cussion earlier in this section that the gray-level values in Fig. 6.16(b) corre-
spond to angles; thus, for example, because red corresponds to 0°, the red
region in Fig. 6.16(a) is mapped to a black region in the hue image. Similarly,
the gray levels in Fig. 6.16(c) correspond to saturation (they were scaled to
[0, 255] for display), and the gray levels in Fig. 6.16(d) are average intensities.

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.

6.3 Pseudocolor Image Processing


Pseudocolor (also called false color) image processing consists of assigning col-
ors to gray values based on a specified criterion. The term pseudo or false color
is used to differentiate the process of assigning colors to monochrome images

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.

6.3.1 Intensity Slicing


The technique of intensity (sometimes called density) slicing and color coding is
one of the simplest examples of pseudocolor image processing. If an image is in-
terpreted as a 3-D function [see Fig. 2.18(a)], the method can be viewed as one
of placing planes parallel to the coordinate plane of the image; each plane then
“slices” the function in the area of intersection. Figure 6.18 shows an example of
using a plane at f(x, y) = li to slice the image function into two levels.
If a different color is assigned to each side of the plane shown in Fig. 6.18,
any pixel whose intensity level is above the plane will be coded with one color,
and any pixel below the plane will be coded with the other. Levels that lie on
the plane itself may be arbitrarily assigned one of the two colors. The result is
a two-color image whose relative appearance can be controlled by moving the
slicing plane up and down the intensity axis.
In general, the technique may be summarized as follows. Let [0, L - 1]
represent the gray scale, let level l0 represent black [f(x, y) = 0], and level
lL - 1 represent white [f(x, y) = L - 1]. Suppose that P planes perpendicular
to the intensity axis are defined at levels l1, l2, Á , lP. Then, assuming that
0 6 P 6 L - 1, the P planes partition the gray scale into P + 1 intervals,
V1, V2, Á , VP + 1. Intensity to color assignments are made according to the re-
lation
f(x, y) = ck if f(x, y) H Vk (6.3-1)

f (x, y) FIGURE 6.18


Intensity axis Geometric
(White) L  1
interpretation of
the intensity-
Slicing plane slicing technique.
li

(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. ■

6.3.2 Intensity to Color Transformations


Other types of transformations are more general and thus are capable of
achieving a wider range of pseudocolor enhancement results than the simple
slicing technique discussed in the preceding section. An approach that is partic-
ularly attractive is shown in Fig. 6.23. Basically, the idea underlying this ap-
proach is to perform three independent transformations on the intensity of any
input pixel. The three results are then fed separately into the red, green, and
blue channels of a color television monitor. This method produces a composite
image whose color content is modulated by the nature of the transformation

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

functions. Note that these are transformations on the intensity values of an


image and are not functions of position.
The method discussed in the previous section is a special case of the tech-
nique just described. There, piecewise linear functions of the intensity levels
(Fig. 6.19) are used to generate colors. The method discussed in this section, on
the other hand, can be based on smooth, nonlinear functions, which, as might
be expected, gives the technique considerable flexibility.

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

FIGURE 6.26 A g 1 (x, y)


pseudocolor f 1 (x, y) Transformation T1 h R (x, y)
coding approach
used when several
monochrome g 2 (x, y)
images are Additional hG (x, y)
f 2 (x, y) Transformation T2
available. processing

g K (x, y)
f K (x, y) Transformation TK hB (x, y)

The approach shown in Fig. 6.23 is based on a single monochrome image.


Often, it is of interest to combine several monochrome images into a single
color composite, as shown in Fig. 6.26. A frequent use of this approach (illus-
trated in Example 6.6) is in multispectral image processing, where different
sensors produce individual monochrome images, each in a different spectral
band. The types of additional processes shown in Fig. 6.26 can be techniques
such as color balancing (see Section 6.5.4), combining images, and selecting
the three images for display based on knowledge about response characteris-
tics of the sensors used to generate the images.

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. ■

6.4 Basics of Full-Color Image Processing


In this section, we begin the study of processing techniques applicable to full-
color images. Although they are far from being exhaustive, the techniques de-
veloped in the sections that follow are illustrative of how full-color images are
handled for a variety of image processing tasks. Full-color image processing
approaches fall into two major categories. In the first category, we process
each component image individually and then form a composite processed
color image from the individually processed components. In the second category,
we work with color pixels directly. Because full-color images have at least

www.EBooksWorld.ir

You might also like