0% found this document useful (0 votes)
12 views6 pages

Chapter 3 problems

This chapter discusses intensity transformations and spatial filtering techniques, emphasizing their foundational role in image processing. It includes references for further reading on various topics such as histogram processing and linear spatial filtering. Additionally, it presents a series of problems related to the concepts covered, encouraging practical application and deeper understanding.
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)
12 views6 pages

Chapter 3 problems

This chapter discusses intensity transformations and spatial filtering techniques, emphasizing their foundational role in image processing. It includes references for further reading on various topics such as histogram processing and linear spatial filtering. Additionally, it presents a series of problems related to the concepts covered, encouraging practical application and deeper understanding.
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/ 6

196 Chapter 3 Intensity Transformations and Spatial Filtering

Summary, References, and Further Reading


The material in this chapter is representative of current techniques used for intensity transformations and spatial
filtering. The topics were selected for their value as fundamental material that would serve as a foundation in an
evolving field. Although most of the examples used in this chapter deal with image enhancement, the techniques
presented are perfectly general, and you will encounter many of them again throughout the remaining chapters in
contexts unrelated to enhancement.
The material in Section 3.1 is from Gonzalez [1986]. For additional reading on the material in Section 3.2, see
Schowengerdt [2006] and Poyton [1996]. Early references on histogram processing (Section 3.3) are Gonzalez and
Fittes [1977], and Woods and Gonzalez [1981]. Stark [2000] gives some interesting generalizations of histogram
equalization for adaptive contrast enhancement.
For complementary reading on linear spatial filtering (Sections 3.4-3.7), see Jain [1989], Rosenfeld and Kak
[1982], Schowengerdt [2006], Castleman [1996], and Umbaugh [2010]. For an interesting approach for generating
Gaussian kernels with integer coefficients see Padfield [2011]. The book by Pitas and Venetsanopoulos [1990] is a
good source for additional reading on median and other nonlinear spatial filters.
For details on the software aspects of many of the examples in this chapter, see Gonzalez, Woods, and Eddins
[2009].

Problems
Solutions to the problems marked with an asterisk (*) are in the DIP4E Student Support Package (consult the book
website: www.ImageProcessingPlace.com).

3.1 Give a single intensity transformation function cant bit plane (see Fig. 3.13). (Hint: Use an
for spreading the intensities of an image so the 8-bit truth table to determine the form of
lowest intensity is 0 and the highest is L − 1. each transformation function.)
3.2 Do the following: (b) How many intensity transformation functions
would there be for 16-bit images?
(a) * Give a continuous function for implement-
ing the contrast stretching transformation in (c) Is the basic approach in (a) limited to images
Fig. 3.2(a). In addition to m, your function in which the number of intensity levels is an
must include a parameter, E, for control- integer power of 2, or is the method general
ling the slope of the function as it transi- for any number of integer intensity levels?
tions from low to high intensity values. Your (d) If the method is general, how would it be dif-
function should be normalized so that its ferent from your solution in (a)?
minimum and maximum values are 0 and 1, 3.4 Do the following:
respectively.
(a) Propose a method for extracting the bit planes
(b) Sketch a family of transformations as a
of an image based on converting the value of
function of parameter E, for a fixed value
its pixels to binary.
m = L 2, where L is the number of intensity
levels in the image.. (b) Find all the bit planes of the following 4-bit
image:
3.3 Do the following:
0 1 8 6
(a) * Propose a set of intensity-slicing transforma- 2 2 1 1
tion functions capable of producing all the 1 15 14 12
individual bit planes of an 8-bit monochrome
3 6 9 10
image. For example, applying to an image a
transformation function with the property 3.5 In general:
T (r ) = 0 if r is 0 or even, and T (r ) = 1 if r is
odd, produces an image of the least signifi- (a) * What effect would setting to zero the lower-

www.EBooksWorld.ir

DIP4E_GLOBAL_Print_Ready.indb 196 6/16/2017 2:04:12 PM


Problems 197

order bit planes have on the histogram of an (a) * Find the transformation function that will
image? map the input intensity values, r, into values,
(b) What would be the effect on the histogram s, of a histogram-equalized image.
if we set to zero the higher-order bit planes (b) * Find the transformation function that (when
instead? applied to the histogram-equalized intensi-
3.6 Explain why the discrete histogram equalization ties, s) will produce an image whose intensity
technique does not yield a flat histogram in gen- PDF is pz (z) = 3z2 (L − 1)3 for 0 ≤ z ≤ L − 1
eral. and pz (z) = 0 for other values of z.

3.7 Suppose that a digital image is subjected to histo- (c) Express the transformation function from (b)
gram equalization. Show that a second pass of his- directly in terms of r, the intensities of the
togram equalization (on the histogram-equalized input image.
image) will produce exactly the same result as the 3.12 An image with intensities in the range [0, 1] has
first pass. the PDF, pr (r ), shown in the following figure. It
3.8 Assuming continuous values, show by an exam- is desired to transform the intensity levels of this
ple that it is possible to have a case in which the image so that they will have the specified pz (z)
transformation function given in Eq. (3-11) satis- shown in the figure. Assume continuous quantities,
fies conditions (a) and (b) discussed in Section 3.3, and find the transformation (expressed in terms
but its inverse may fail condition (a). of r and z) that will accomplish this.
3.9 Do the following: pr (r) pz (z)

(a) Show that the discrete transformation func-


2 2
tion given in Eq. (3-15) for histogram equal-
ization satisfies conditions (a) and (b) stated
at the beginning of Section 3.3.
(b) * Show that the inverse discrete transforma-
r z
tion in Eq. (3-16) satisfies conditions (a)
1 1
and (b) in Section 3.3 only if none of the
intensity levels rk , k = 0, 1, 2,…, L − 1, are 3.13 * In Fig. 3.25(b), the transformation function labeled (2)
missing in the original image. [G −1 ( sk ) from Eq. (3-23)] is the mirror image of
3.10 Two images, f ( x, y) and g( x, y) have unnormalized (1) [G(zq ) in Eq. (3-21)] about a line joining the
histograms hf and hg . Give the conditions (on the two end points. Does this property always hold
values of the pixels in f and g) under which you for these two transformation functions? Explain.
can determine the histograms of images formed 3.14 * The local histogram processing method discussed
as follows: in Section 3.3 requires that a histogram be com-
(a) * f ( x, y) + g( x, y) puted at each neighborhood location. Propose
a method for updating the histogram from one
(b) f ( x, y) − g( x, y) neighborhood to the next, rather than computing
(c) f ( x, y) × g( x, y) a new histogram each time.
(d) f ( x, y) ÷ g( x, y) 3.15 What is the behavior of Eq. (3-35) when a = b = 0?
Show how the histograms would be formed in Explain.
each case. The arithmetic operations are element- 3.16 You are given a computer chip that is capable of
wise operations, as defined in Section 2.6. performing linear filtering in real time, but you
3.11 Assume continuous intensity values, and sup- are not told whether the chip performs correla-
pose that the intensity values of an image have tion or convolution. Give the details of a test you
the PDF pr (r ) = 2r (L − 1)2 for 0 ≤ r ≤ L − 1, and would perform to determine which of the two
pr (r ) = 0 for other values of r. operations the chip performs.
3.17 * We mentioned in Section 3.4 that to perform con-

www.EBooksWorld.ir

DIP4E_GLOBAL_Print_Ready.indb 197 6/16/2017 2:04:13 PM


198 Chapter 3 Intensity Transformations and Spatial Filtering
volution we rotate the kernel by 180°. The rota- ⎡1 1 1 1 1⎤
tion is “built” into Eq. (3-35). Figure 3.28 corre- ⎡1 2 1⎤
⎢1
⎢ 1 1 1 1⎥⎥
w = ⎢⎢ 2 4 2 ⎥⎥
sponds to correlation. Draw the part of the figure f = ⎢1 1 1 1 1⎥
enclosed by the large ellipse, but with w rotated ⎢⎣ 1 2 1 ⎥⎦
⎢ ⎥
180°. Expand Eq. (3-35) for a general 3 × 3 kernel ⎢1 1 1 1 1⎥
⎢1
⎣ 1 1 1 1⎥⎦
and show that the result of your expansion corre-
sponds to your figure. This shows graphically that
convolution and correlation differ by the rotation (a) Give the convolution of the two.
of the kernel. (b) Does your result have a bias?
3.18 You are given the following kernel and image: 3.22 Answer the following:
(a) * If v = [1 2 1] and wT = [ 2 1 1 3] , is the
T
⎡0 0 0 0 0⎤
⎡1 2 1⎤
⎢0
⎢ 0 1 0 0 ⎥⎥ kernel formed by vwT separable?
w = ⎢⎢ 2 4 2 ⎥⎥ f = ⎢0 0 1 0 0⎥ (b) The following kernel is separable. Find w1
⎢ ⎥
⎢⎣ 1 2 1 ⎥⎦ ⎢0 0 1 0 0⎥ and w2 such that w = w1 夹 w2 .
⎢0
⎣ 0 0 0 0 ⎥⎦
⎡1 3 1 ⎤
w=⎢ ⎥
(a) * Give a sketch of the area encircled by the ⎣2 6 2⎦
large ellipse in Fig. 3.28 when the kernel is
centered at point (2, 3) (2nd row, 3rd col) of 3.23 Do the following:
the image shown above. Show specific values
(a) * Show that the Gaussian kernel, G( s, t ), in
of w and f.
Eq. (3-45) is separable. (Hint: Read the first
(b) * Compute the convolution w 夹 f using the paragraph in the discussion of separable fil-
minimum zero padding needed. Show the ter kernels in Section 3.4.)
details of your computations when the ker- (b) Because G is separable and circularly sym-
nel is centered on point (2, 3) of f; and then metric, it can be expressed in the form
show the final full convolution result. G = vvT . Assume that the kernel form in
(c) Repeat (b), but for correlation, w 夽 f . Eq. (3-46) is used, and that the function is
3.19 * Prove the validity of Eqs. (3-36) and (3-37). sampled to yield an m × m kernel. What is v
in this case?
3.20 The kernel, w, in Problem 3.18 is separable.
3.24 * Show that the product of a column vector with a
(a) * By inspection, find two kernels, w1 and w2 so row vector is equivalent to the 2-D convolution
that w = w1 夹 w2 . of the two vectors. The vectors do not have to
(b) Using the image in Problem 3.18, compute be of the same length. You may use a graphical
w1 夹 f using the minimum zero padding (see approach (as in Fig. 3.30) to support the explana-
Fig. 3.30). Show the details of your compu- tion of your proof.
tation when the kernel is centered at point 3.25 Given K, 1-D Gaussian kernels, g1 , g2 ,…, gK , with
(2, 3) (2nd row, 3rd col) of f and then show arbitrary means and standard deviations:
the full convolution.
(a) * Determine what the entries in the third col-
(c) Compute the convolution of w2 with the
umn of Table 3.6 would be for the product
result from (b). Show the details of your
g1 × g2 ×  × gK .
computation when the kernel is centered at
point (3, 3) of the result from (b), and then (b) What would the fourth column look like for
show the full convolution. Compare with the the convolution g1 夹 g2 夹 夹 gK ?
result in Problem 3.18(b). (Hint: It is easier to work with the variance; the
3.21 Given the following kernel and image: standard deviation is just the square root of your
result.)

www.EBooksWorld.ir

DIP4E_GLOBAL_Print_Ready.indb 198 6/16/2017 2:04:16 PM


Problems 199

3.26 The two images shown in the following figure are cients sum to 0. Show that the sum of the pixel
quite different, but their histograms are the same. values in the filtered image also is 0.
Suppose that each image is blurred using a 3 × 3 3.33 A single point of light can be modeled by a digital
box kernel.
image consisting of all 0’s, with a 1 in the location
(a) * Would the histograms of the blurred images of the point of light. If you view a single point of
still be equal? Explain. light through a defocused lens, it will appear as a
fuzzy blob whose size depends on the amount by
which the lens is defocused. We mentioned in Sec-
tion 3.5 that filtering an image with a box kernel
is a poor model for a defocused lens, and that a
better approximation is obtained with a Gauss-
ian kernel. Using the single-point-of-light analogy,
explain why this is so.
(b) If your answer is no, either sketch the two 3.34 In the original image used to generate the three
histograms or give two tables detailing the blurred images shown, the vertical bars are 5 pix-
histogram components. els wide, 100 pixels high, and their separation is
3.27 An image is filtered four times using a Gaussian 20 pixels. The image was blurred using square box
kernel of size 3 × 3 with a standard deviation of kernels of sizes 23, 25, and 45 elements on the side,
1.0. Because of the associative property of con- respectively. The vertical bars on the left, lower
volution, we know that equivalent results can be part of (a) and (c) are blurred, but a clear separa-
obtained using a single Gaussian kernel formed tion exists between them.
by convolving the individual kernels.
(a) * What is the size of the single Gaussian ker-
nel?
(b) What is its standard deviation?
3.28 An image is filtered with three Gaussian lowpass
kernels of sizes 3 × 3, 5 × 5, and 7 × 7, and stan-
dard deviations 1.5, 2, and 4, respectively. A com-
posite filter, w, is formed as the convolution of
(a) (b)
these three filters.
(a) * Is the resulting filter Gaussian? Explain.
(b) What is its standard deviation?
(c) What is its size?
3.29 * Discuss the limiting effect of repeatedly filtering
an image with a 3 × 3 lowpass filter kernel. You
may ignore border effects. (c)
3.30 In Fig. 3.42(b) the corners of the estimated shad-
ing pattern appear darker or lighter than their However, the bars have merged in image (b), de-
surrounding areas. Explain the reason for this. spite the fact that the kernel used to generate this
image is much smaller than the kernel that pro-
3.31 * An image is filtered with a kernel whose coeffi- duced image (c). Explain the reason for this.
cients sum to 1. Show that the sum of the pixel
values in the original and filtered images is the 3.35 Consider an application such as in Fig. 3.41, in
same. which it is desired to eliminate objects smaller
than those enclosed by a square of size q × q pix-
3.32 An image is filtered with a kernel whose coeffi- els. Suppose that we want to reduce the average

www.EBooksWorld.ir

DIP4E_GLOBAL_Print_Ready.indb 199 6/16/2017 2:04:16 PM


200 Chapter 3 Intensity Transformations and Spatial Filtering

intensity of those objects to one-tenth of their in the center yields sharper results than the one
original average value. In this way, their intensity with a −4 in the center. Explain the reason why.
will be closer to the intensity of the background
3.41 * Give a 3 × 3 kernel for performing unsharp mask-
and they can be eliminated by thresholding. Give
ing in a single pass through an image. Assume that
the (odd) size of the smallest box kernel that will
the average image is obtained using a box filter of
yield the desired reduction in average intensity in size 3 × 3.
only one pass of the kernel over the image.
3.42 Show that subtracting the Laplacian from an im-
3.36 With reference to order-statistic filters (see Sec-
age gives a result that is proportional to the un-
tion 3.5):
sharp mask in Eq. (3-55). Use the definition for
(a) * We mentioned that isolated clusters of dark the Laplacian given in Eq. (3-53).
or light (with respect to the background) pix-
els whose area is less than one-half the area 3.43 Do the following:
of a median filter are forced to the median (a) * Show that the magnitude of the gradient giv-
value of the neighbors by the filter. Assume en in Eq. (3-58) is an isotropic operation (see
a filter of size n × n (n odd) and explain why the statement of Problem 3.39).
this is so.
(b) Show that the isotropic property is lost in
(b) Consider an image having various sets of general if the gradient is computed using
pixel clusters. Assume that all points in a Eq. (3-59).
cluster are lighter or darker than the back-
3.44 Are any of the following highpass (sharpening)
ground (but not both simultaneously in the
kernels separable? For those that are, find vectors
same cluster), and that the area of each clus-
v and w such that vwT equals the kernel(s).
ter is less than or equal to n2 2. In terms of
n, under what condition would one or more (a) The Laplacian kernels in Figs. 3.45(a) and (b).
of these clusters cease to be isolated in the
(b) The Roberts cross-gradient kernels shown in
sense described in part (a)?
Figs. 3.50(b) and (c).
3.37 Do the following:
(c) * The Sobel kernels in Figs. 3.50(d) and (e).
(a) * Develop a procedure for computing the median
of an n × n neighborhood. 3.45 In a character recognition application, text pages
(b) Propose a technique for updating the median are reduced to binary using a thresholding trans-
as the center of the neighborhood is moved formation function of the form in Fig. 3.2(b). This
from pixel to pixel. is followed by a procedure that thins the charac-
ters until they become strings of binary 1’s on a
3.38 In a given application, a smoothing kernel is background of 0’s. Due to noise, binarization and
applied to input images to reduce noise, then a thinning result in broken strings of characters
Laplacian kernel is applied to enhance fine details. with gaps ranging from 1 to 3 pixels. One way
Would the result be the same if the order of these to “repair” the gaps is to run a smoothing kernel
operations is reversed? over the binary image to blur it, and thus create
3.39 * Show that the Laplacian defined in Eq. (3-50) is bridges of nonzero pixels between gaps.
isotropic (invariant to rotation). Assume continu-
(a) * Give the (odd) size of the smallest box ker-
ous quantities. From Table 2.3, coordinate rota-
nel capable of performing this task.
tion by an angle u is given by
x = x cos u − y sin u and y = x sin u + y cos u (b) After bridging the gaps, the image is thresh-
olded to convert it back to binary form. For
your answer in (a), what is the minimum val-
where ( x, y) and ( x, y) are the unrotated and
ue of the threshold required to accomplish
rotated coordinates, respectively.
this, without causing the segments to break
3.40 * You saw in Fig. 3.46 that the Laplacian with a −8 up again?

www.EBooksWorld.ir

DIP4E_GLOBAL_Print_Ready.indb 200 6/16/2017 2:04:17 PM


Problems 201

3.46 A manufacturing company purchased an imag- mination of the scene changes from natural day-
ing system whose function is to either smooth light to artificial lighting. At no time is the scene
or sharpen images. The results of using the sys- without illumination, so it is always possible to
tem on the manufacturing floor have been poor, obtain an acceptable image. Because the range of
and the plant manager suspects that the system illumination is such that it is always in the linear
is not smoothing and sharpening images the way operating range of the camera, it is decided not
it should. You are hired as a consultant to deter- to employ any compensating mechanisms on the
mine if the system is performing these functions camera itself. Rather, it is decided to use image
properly. How would you determine if the system processing techniques to post-process, and thus
is working correctly? (Hint: Study the statements normalize, the images to the equivalent of con-
of Problems 3.31 and 3.32). stant illumination. Propose a method to do this.
You are at liberty to use any method you wish,
3.47 A CCD TV camera is used to perform a long-term
but state clearly all the assumptions you made in
study by observing the same area 24 hours a day, for
arriving at your design.
30 days. Digital images are captured and transmit-
ted to a central location every 5 minutes. The illu-

www.EBooksWorld.ir

DIP4E_GLOBAL_Print_Ready.indb 201 6/16/2017 2:04:17 PM

You might also like