Digital Image Processing
Second Edition
Instructorzs Manual
Rafael C. Gonzalez
Richard E. Woods
Prentice Hall
Upper Saddle River, NJ 07458
www.prenhall.com/gonzalezwoods
or
www.imageprocessingbook.com
ii
Revision history
10 9 8 7 6 5 4 3 2 1
Copyright c°19922002 by Rafael C. Gonzalez and Richard E. Woods
Preface
This manual contains detailed solutions to all problems in Digital Image Processing, 2nd
Edition. We also include a suggested set of guidelines for using the book, and discuss
the use of computer projects designed to promote a deeper understanding of the subject
matter. The notation used throughout this manual corresponds to the notation used in
the text.
The decision of what material to cover in a course rests with the instructor, and it de
pends on the purpose of the course and the background of the students. We have found
that the course outlines suggested here can be covered comfortably in the time frames
indicated when the course is being taught in an electrical engineering or computer sci
ence curriculum. In each case, no prior exposure to image processing is assumed. We
give suggested guidelines for onesemester courses at the senior and firstyear graduate
levels. It is possible to cover most of the book in a twosemester graduate sequence.
The book was completely revised in this edition, with the purpose not only of updating
the material, but just as important, making the book a better teaching aid. To this
end, the instructor will find the new organization to be much more ›exible and better
illustrated. Although the book is self contained, we recommend use of the companion
web site, where the student will find detailed solutions to the problems marked with a
star in the text, review material, suggested projects, and images from the book. One of
the principal reasons for creating the web site was to free the instructor from having to
prepare materials and handouts beyond what is required to teach from the book.
Computer projects such as those described in the web site are an important part of
a course on image processing. These projects give the student handson experience
with algorithm implementation and reinforce the material covered in the classroom.
The projects suggested at the web site can be implemented on almost any reasonably
equipped multiuser or personal computer having a hard copy output device.
1 Introduction
The purpose of this chapter is to present suggested guidelines for teaching material from
this book at the senior and firstyear graduate level. We also discuss use of the book
web site. Although the book is totally selfcontained, the web site offers, among other
things, complementary review material and computer projects that can be assigned in
conjunction with classroom work. Detailed solutions to all problems in the book also
are included in the remaining chapters of this manual.
Teaching Features of the Book
Undergraduate programs that offer digital image processing typically limit coverage to
one semester. Graduate programs vary, and can include one or two semesters of the ma
terial. In the following discussion we give general guidelines for a onesemester senior
course, a onesemester graduate course, and a fullyear course of study covering two
semesters. We assume a 15week program per semester with three lectures per week.
In order to provide ›exibility for exams and review sessions, the guidelines discussed
in the following sections are based on forty, 50minute lectures per semester. The back
ground assumed on the part of the student is seniorlevel preparation in mathematical
analysis, matrix theory, probability, and computer programming.
The suggested teaching guidelines are presented in terms of general objectives, and not
as time schedules. There is so much variety in the way image processing material is
taught that it makes little sense to attempt a breakdown of the material by class period.
In particular, the organization of the present edition of the book is such that it makes it
much easier than before to adopt significantly different teaching strategies, depending
on course objectives and student background. For example, it is possible with the new
organization to offer a course that emphasizes spatial techniques and covers little or no
transform material. This is not something we recommend, but it is an option that often
is attractive in programs that place little emphasis on the signal processing aspects of the
field and prefer to focus more on the implementation of spatial techniques.
2
Chapter 1 Introduction
The companion web site
www:prenhall:com=gonzalezwoods
or
www:imageprocessingbook:com
is a valuable teaching aid, in the sense that it includes material that previously was cov
ered in class.
In particular, the review material on probability, matrices, vectors, and
linear systems, was prepared using the same notation as in the book, and is focused on
areas that are directly relevant to discussions in the text. This allows the instructor to
assign the material as independent reading, and spend no more than one total lecture pe
riod reviewing those subjects. Another major feature is the set of solutions to problems
marked with a star in the book. These solutions are quite detailed, and were prepared
with the idea of using them as teaching support. The online availability of projects
and digital images frees the instructor from having to prepare experiments, data, and
handouts for students. The fact that most of the images in the book are available for
downloading further enhances the value of the web site as a teaching resource.
One Semester Senior Course
A basic strategy in teaching a senior course is to focus on aspects of image processing in
which both the inputs and outputs of those processes are images. In the scope of a senior
course, this usually means the material contained in Chapters 1 through 6. Depending
on instructor preferences, wavelets (Chapter 7) usually are beyond the scope of coverage
in a typical senior curriculum). However, we recommend covering at least some material
on image compression (Chapter 8) as outlined below.
We have found in more than two decades of teaching this material to seniors in electrical
engineering, computer science, and other technical disciplines, that one of the keys to
success is to spend at least one lecture on motivation and the equivalent of one lecture
on review of background material, as the need arises. The motivational material is
provided in the numerous application areas discussed in Chapter 1. This chapter was
totally rewritten with this objective in mind. Some of this material can be covered in
class and the rest assigned as independent reading. Background review should cover
probability theory (of one random variable) before histogram processing (Section 3.3).
A brief review of vectors and matrices may be required later, depending on the material
covered. The review material included in the book web site was designed for just this
purpose.
One Semester Senior Course 3
Chapter 2 should be covered in its entirety. Some of the material (such as parts of
Sections 2.1 and 2.3) can be assigned as independent reading, but a detailed explanation
of Sections 2.4 through 2.6 is time well spent.
Chapter 3 serves two principal purposes. It covers image enhancement (a topic of signif
icant appeal to the beginning student) and it introduces a host of basic spatial processing
tools used throughout the book. For a senior course, we recommend coverage of Sec
tions 3.2.1 through 3.2.2u Section 3.3.1u Section 3.4u Section 3.5u Section 3.6u Section
3.7.1, 3.7.2 (through Example 3.11), and 3.7.3. Section 3.8 can be assigned as indepen
dent reading, depending on time.
Chapter 4 also discusses enhancement, but from a frequencydomain point of view. The
instructor has significant ›exibility here. As mentioned earlier, it is possible to skip
the chapter altogether, but this will typically preclude meaningful coverage of other
areas based on the Fourier transform (such as filtering and restoration). The key in
covering the frequency domain is to get to the convolution theorem and thus develop
a tie between the frequency and spatial domains. All this material is presented in very
readable form in Section 4.2. |Light} coverage of frequencydomain concepts can be
based on discussing all the material through this section and then selecting a few simple
filtering examples (say, low and highpass filtering using Butterworth filters, as discussed
in Sections 4.3.2 and 4.4.2). At the discretion of the instructor, additional material can
include full coverage of Sections 4.3 and 4.4.
It is seldom possible to go beyond this
point in a senior course.
Chapter 5 can be covered as a continuation of Chapter 4. Section 5.1 makes this an easy
approach. Then, it is possible give the student a |›avor} of what restoration is (and still
keep the discussion brief) by covering only Gaussian and impulse noise in Section 5.2.1,
and a couple of spatial filters in Section 5.3. This latter section is a frequent source of
confusion to the student who, based on discussions earlier in the chapter, is expecting to
see a more objective approach. It is worthwhile to emphasize at this point that spatial
enhancement and restoration are the same thing when it comes to noise reduction by
spatial filtering. A good way to keep it brief and conclude coverage of restoration
is to jump at this point to inverse filtering (which follows directly from the model in
Section 5.1) and show the problems with this approach. Then, with a brief explanation
regarding the fact that much of restoration centers around the instabilities inherent in
inverse filtering, it is possible to introduce the |interactive} form of the Wiener filter in
Eq. (5.83) and conclude the chapter with Examples 5.12 and 5.13.
Chapter 6 on color image processing is a new feature of the book. Coverage of this