Chapter 2 Problems
Chapter 2 Problems
Problems
Solutions to the problems marked with an asterisk (*) are in the DIP4E Student Support Package (consult the book
website: www.ImageProcessingPlace.com).
2.1 If you use a sheet of white paper to shield your 2.4 You are hired to design the front end of an imag-
eyes when looking directly at the sun, the side of ing system for studying the shapes of cells, bacteria,
the sheet facing you appears black. Which of the viruses, and proteins. The front end consists in
visual processes discussed in Section 2.1 is respon- this case of the illumination source(s) and cor-
sible for this? responding imaging camera(s).The diameters of
2.2 * Using the background information provided in circles required to fully enclose individual speci-
Section 2.1, and thinking purely in geometrical mens in each of these categories are 50, 1, 0.1, and
terms, estimate the diameter of the smallest 0.01 mm, respectively. In order to perform auto-
printed dot that the eye can discern if the page mated analysis, the smallest detail discernible on a
on which the dot is printed is 0.2 m away from the specimen must be 0.001 mm.
eyes. Assume for simplicity that the visual system (a) * Can you solve the imaging aspects of this
ceases to detect the dot when the image of the dot problem with a single sensor and camera?
on the fovea becomes smaller than the diameter If your answer is yes, specify the illumina-
of one receptor (cone) in that area of the retina. tion wavelength band and the type of camera
Assume further that the fovea can be modeled as needed. By “type,” we mean the band of the
a square array of dimension 1.5 mm on the side, electromagnetic spectrum to which the cam-
and that the cones and spaces between the cones era is most sensitive (e.g., infrared).
are distributed uniformly throughout this array.
(b) If your answer in (a) is no, what type of illu-
2.3 Although it is not shown in Fig. 2.10, alternating mination sources and corresponding imaging
current is part of the electromagnetic spectrum. sensors would you recommend? Specify the
Commercial alternating current in the United light sources and cameras as requested in
States has a frequency of 60 Hz. What is the wave- part (a). Use the minimum number of illumi-
length in kilometers of this component of the nation sources and cameras needed to solve
spectrum? the problem. (Hint: From the discussion in
www.EBooksWorld.ir
Section 2.2, the illumination required to “see” 2.9 A common measure of transmission for digital
an object must have a wavelength the same data is the baud rate, defined as symbols (bits in
size or smaller than the object.) our case) per second. As a minimum, transmission
is accomplished in packets consisting of a start
2.5 You are preparing a report and have to insert in it
bit, a byte (8 bits) of information, and a stop bit.
an image of size 2048 × 2048 pixels.
Using these facts, answer the following:
(a) * Assuming no limitations on the printer, what (a) * How many seconds would it take to transmit
would the resolution in line pairs per mm a sequence of 500 images of size 1024 × 1024
have to be for the image to fit in a space of pixels with 256 intensity levels using a 3
size 5 × 5 cm? M-baud (106 bits/sec) baud modem? (This
(b) What would the resolution have to be in dpi is a representative medium speed for a DSL
for the image to fit in 2 × 2 inches? (Digital Subscriber Line) residential line.
(b) What would the time be using a 30 G-baud
2.6 * A CCD camera chip of dimensions 7 × 7 mm and
(10 9 bits/sec) modem? (This is a represen-
1024 × 1024 sensing elements, is focused on a
tative medium speed for a commercial line.)
square, flat area, located 0.5 m away. The camera
is equipped with a 35-mm lens. How many line 2.10 * High-definition television (HDTV) generates
pairs per mm will this camera be able to resolve? images with 1125 horizontal TV lines interlaced
(Hint: Model the imaging process as in Fig. 2.3, (i.e., where every other line is “painted” on the
with the focal length of the camera lens substitut- screen in each of two fields, each field being
ing for the focal length of the eye.) 1 60th of a second in duration). The width-to-
height aspect ratio of the images is 16:9. The
2.7 An automobile manufacturer is automating the fact that the number of horizontal lines is fixed
placement of certain components on the bumpers determines the vertical resolution of the images.
of a limited-edition line of sports cars. The com- A company has designed a system that extracts
ponents are color-coordinated, so the assembly digital images from HDTV video. The resolution
robots need to know the color of each car in order of each horizontal line in their system is propor-
to select the appropriate bumper component. tional to vertical resolution of HDTV, with the
Models come in only four colors: blue, green, red, proportion being the width-to-height ratio of the
and white. You are hired to propose a solution images. Each pixel in the color image has 24 bits
based on imaging. How would you solve the prob- of intensity, 8 bits each for a red, a green, and a
lem of determining the color of each car, keeping blue component image. These three “primary”
in mind that cost is the most important consider- images form a color image. How many bits would
ation in your choice of components? it take to store the images extracted from a two-
2.8 * Suppose that a given automated imaging applica- hour HDTV movie?
tion requires a minimum resolution of 5 line pairs 2.11 When discussing linear indexing in Section 2.4,
per mm to be able to detect features of interest we arrived at the linear index in Eq. (2-14) by
in objects viewed by the camera. The distance inspection. The same argument used there can be
between the focal center of the camera lens and extended to a 3-D array with coordinates x, y, and
the area to be imaged is 1 m. The area being z, and corresponding dimensions M, N, and P. The
imaged is 0.5 × 0.5 m. You have available a 200 linear index for any ( x, y, z) is
mm lens, and your job is to pick an appropriate
CCD imaging chip. What is the minimum number s = x + M( y + Nz)
of sensing elements and square size, d × d, of the
Start with this expression and
CCD chip that will meet the requirements of this
application? (Hint: Model the imaging process (a) * Derive Eq. (2-15).
as in Fig. 2.3, and assume for simplicity that the (b) Derive Eq. (2-16).
imaged area is square.)
2.12 * Suppose that a flat area with center at ( x0 , y0 ) is
www.EBooksWorld.ir
illuminated by a light source with intensity distri- 2.18 Consider the image segment shown in the figure
bution that follows.
(a) * As in Section 2.5, let V = {0, 1} be the set
2
+ ( y − y0 )2 ]
i( x, y) = Ke −[( x − x0 )
of intensity values used to define adjacency.
Assume for simplicity that the reflectance of Compute the lengths of the shortest 4-, 8-,
the area is constant and equal to 1.0, and let and m-path between p and q in the follow-
K = 255. If the intensity of the resulting image is ing image. If a particular path does not exist
quantized using k bits, and the eye can detect an between these two points, explain why.
abrupt change of eight intensity levels between
adjacent pixels, what is the highest value of k that 3 1 2 1 (q)
will cause visible false contouring?
2 2 0 2
2.13 Sketch the image in Problem 2.12 for k = 2. 1 2 1 1
2.14 Consider the two image subsets, S1 and S2 in the (p) 1 0 1 2
following figure. With reference to Section 2.5,
and assuming that V = {1} , determine whether
(b) Repeat (a) but using V = {1, 2}.
these two subsets are:
(a) * 4-adjacent. 2.19 Consider two points p and q.
(b) 8-adjacent. (a) * State the condition(s) under which the D4
distance between p and q is equal to the
(c) m-adjacent.
shortest 4-path between these points.
S1 S2 (b) Is this path unique?
0 0 0 0 0 0 0 1 1 0 2.20 Repeat problem 2.19 for the D8 distance.
1 0 0 1 0 0 1 0 0 1
2.21 Consider two one-dimensional images f and g of
1 0 0 1 0 1 1 0 0 0
the same size. What has to be true about the ori-
0 0 1 1 1 0 0 0 0 0 entation of these images for the elementwise and
0 0 1 1 1 0 0 1 1 1 matrix products discussed in Section 2.6 to make
sense? Either of the two images can be first in
forming the product.
2.15 * Develop an algorithm for converting a one-pixel-
thick 8-path to a 4-path. 2.22 * In the next chapter, we will deal with operators
2.16 Develop an algorithm for converting a one-pixel- whose function is to compute the sum of pixel val-
thick m-path to a 4-path. ues in a small subimage area, Sxy , as in Eq. (2-43).
Show that these are linear operators.
2.17 Refer to the discussion toward the end of Sec-
tion 2.5, where we defined the background of an 2.23 Refer to Eq. (2-24) in answering the following:
image as (Ru )c, the complement of the union of (a) * Show that image summation is a linear opera-
all the regions in the image. In some applications, tion.
it is advantageous to define the background as the
subset of pixels of (Ru )c that are not hole pixels (b) Show that image subtraction is a linear oper-
(informally, think of holes as sets of background ation.
pixels surrounded by foreground pixels). How (c) * Show that image multiplication in a nonlinear
would you modify the definition to exclude hole operation.
pixels from (Ru )c ? An answer such as “the back-
ground is the subset of pixels of (Ru )c that are not (d) Show that image division is a nonlinear opera-
hole pixels” is not acceptable. (Hint: Use the con- tion.
cept of connectivity.) 2.24 The median, z, of a set of numbers is such that
www.EBooksWorld.ir
half the values in the set are below z and the oth- image, such that K results in a scaled image
er half are above it. For example, the median of whose intensities span the full k-bit range.
the set of values {2, 3, 8, 20, 21, 25, 31} is 20. Show (b) Find K for 16- and 32-bit images.
that an operator that computes the median of a
2.30 Give Venn diagrams for the following expres-
subimage area, S, is nonlinear. (Hint: It is suffi-
sions:
cient to show that z fails the linearity test for a
simple numerical example.) (a) * ( A ¨ C ) − ( A ¨ B ¨ C ).
2.25 * Show that image averaging can be done recur- (b) ( A ¨ C ) ´ (B ¨ C ).
sively. That is, show that if a(k )is the average of (c) B − [( A ¨ B) − ( A ¨ B ¨ C )]
k images, then the average of k + 1 images can
be obtained from the already-computed average, (d) B − B ¨ ( A ´ C ); Given that A ¨ C = ∅.
a(k ), and the new image, fk+1 . 2.31 Use Venn diagrams to prove the validity of the
following expressions:
2.26 With reference to Example 2.5:
(a) * ( A ¨ B) ´ [ ( A ¨ C ) − A ¨ B ¨ C ] = A ¨ (B ´ C )
(a) * Prove the validity of Eq. (2-27).
(b) ( A ´ B ´ C )c = Ac ¨ Bc ¨ C c
(b) Prove the validity of Eq. (2-28). (c) ( A ´ C )c ¨ B = (B − A) − C
For part (b) you will need the following facts from (d) ( A ¨ B ¨ C )c = Ac ´ Bc ´ C c
probability: (1) the variance of a constant times a 2.32 Give expressions (in terms of sets A, B, and C)
random variable is equal to the constant squared for the sets shown shaded in the following figures.
times the variance of the random variable. (2) The The shaded areas in each figure constitute one set,
variance of the sum of uncorrelated random vari- so give only one expression for each of the four
ables is equal to the sum of the variances of the figures.
individual random variables.
2.27 Consider two 8-bit images whose intensity levels A
span the full range from 0 to 255.
(a) * Discuss the limiting effect of repeatedly sub-
tracting image (2) from image (1). Assume
that the results have to be represented also B
in eight bits. C
(b) Would reversing the order of the images (a)* (b) (c) (d)
yield a different result?
2.33 With reference to the discussion on sets in Section
2.28 * Image subtraction is used often in industrial appli- 2.6, do the following:
cations for detecting missing components in prod-
uct assembly. The approach is to store a “golden” (a) * Let S be a set of real numbers ordered by the
image that corresponds to a correct assembly; this relation “less than or equal to” ( ≤ ). Show
image is then subtracted from incoming images of that S is a partially ordered set; that is, show
the same product. Ideally, the differences would that the reflexive, transitive, and antisymmet-
be zero if the new products are assembled cor- ric properties hold.
rectly. Difference images for products with miss- (b) * Show that changing the relation “less than or
ing components would be nonzero in the area equal to” to “less than” ( < ) produces a strict
where they differ from the golden image. What ordered set.
conditions do you think have to be met in prac-
tice for this method to work? (c) Now let S be the set of lower-case letters in
the English alphabet. Show that, under ( < ),
2.29 With reference to Eq. (2-32),
S is a strict ordered set.
(a) * Give a general formula for the value of K
2.34 For any nonzero integers m and n, we say that m
as a function of the number of bits, k, in an
www.EBooksWorld.ir
is divisible by n, written m n , if there exists an (a) * Find the inverse scaling transformation.
integer k such that kn = m. For example, 42 (m) (b) Find the inverse translation transformation.
is divisible by 7 (n) because there exists an inte- (c) Find the inverse vertical and horizontal
ger k = 6 such that kn = m. Show that the set of shearing transformations.
positive integers is a partially ordered set under
the relation “divisible by.” In other words, do the (d) * Find the inverse rotation transformation.
following: (e) * Show a composite inverse translation/rota-
tion transformation.
(a) * Show that the property of reflectivity holds
under this relation. 2.38 What are the equations, analogous to Eqs. (2-46)
and (2-47), that would result from using triangu-
(b) Show that the property of transitivity holds.
lar instead of quadrilateral regions?
(c) Show that anti symmetry holds. 2.39 Do the following.
2.35 In general, what would the resulting image, g( x, y), (a) * Prove that the Fourier kernel in Eq. (2-59) is
look like if we modified Eq. (2-43), as follows: separable and symmetric.
1
g( x, y) = ∑ T [ f (r, c)]
mn (r , c ) H Sxy
(b) Repeat (a) for the kernel in Eq. (2-60).
2.40 * Show that 2-D transforms with separable, sym-
where T is the intensity transformation function metric kernels can be computed by: (1) comput-
in Fig. 2.38(b)? ing 1-D transforms along the individual rows (col-
umns) of the input image; and (2) computing 1-D
2.36 With reference to Table 2.3, provide single, com- transforms along the columns (rows) of the result
posite transformation functions for performing from step (1).
the following operations:
2.41 A plant produces miniature polymer squares that
(a) * Scaling and translation. have to undergo 100% visual inspection. Inspec-
(b) * Scaling, translation, and rotation. tion is semi-automated. At each inspection sta-
tion, a robot places each polymer square over an
(c) Vertical shear, scaling, translation, and rota-
optical system that produces a magnified image
tion.
of the square. The image completely fills a view-
(d) Does the order of multiplication of the indi- ing screen of size 80 × 80 mm. Defects appear as
vidual matrices to produce a single transfor- dark circular blobs, and the human inspector’s job
mations make a difference? Give an example is to look at the screen and reject any sample that
based on a scaling/translation transforma- has one or more dark blobs with a diameter of 0.8
tion to support your answer. mm or greater, as measured on the scale of the
2.37 We know from Eq. (2-45) that an affine transfor- screen. The manufacturing manager believes that
mation of coordinates is given by if she can find a way to fully automate the process,
profits will increase by 50%, and success in this
⎡ x′⎤ ⎡ x ⎤ ⎡ a11 a12 a13 ⎤ ⎡ x ⎤ project will aid her climb up the corporate ladder.
⎢ y ′ ⎥ = A ⎢ y ⎥ = ⎢a a22 a23 ⎥⎥ ⎢⎢ y ⎥⎥ After extensive investigation, the manager decides
⎢ ⎥ ⎢ ⎥ ⎢ 21 that the way to solve the problem is to view each
⎢⎣ 1 ⎥⎦ ⎢⎣ 1 ⎥⎦ ⎢⎣ 0 0 1 ⎥⎦ ⎢⎣ 1 ⎥⎦ inspection screen with a CCD TV camera and feed
the output of the camera into an image processing
where ( x ′, y ′) are the transformed coordinates, system capable of detecting the blobs, measuring
( x, y) are the original coordinates, and the ele- their diameter, and activating the accept/reject
ments of A are given in Table 2.3 for various button previously operated by a human inspec-
types of transformations. The inverse transforma- tor. She is able to find a suitable system, provided
tion, A −1 , to go from the transformed back to the that the smallest defect occupies an area of at
original coordinates is just as important for per- least 2 × 2 pixels in the digital image. The manager
forming inverse mappings. hires you to help her specify the camera and lens
www.EBooksWorld.ir
system to satisfy this requirement, using off-the- cost much more than the lenses, so you should use
shelf components. Available off-the-shelf lenses the lowest-resolution camera possible, consistent
have focal lengths that are integer multiples of with a suitable lens. As a consultant, you have
25 mm or 35 mm, up to 200 mm. Available cam- to provide a written recommendation, showing
eras yield image sizes of 512 × 512, 1024 × 1024, in reasonable detail the analysis that led to your
or 2048 × 2048 pixels. The individual imaging choice of components. Use the imaging geometry
elements in these cameras are squares measuring suggested in Problem 2.6.
8 × 8 mm, and the spaces between imaging ele-
ments are 2 mm. For this application, the cameras
www.EBooksWorld.ir