Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: Digital image Processing
Description: Image processing is a method to convert an image into digital form and perform some operations on it

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


GONZFM-i-xxii
...


5-10-2001

14:22

Page iv

Vice-President and Editorial Director, ECS: Marcia J
...
Riccardi
Executive Managing Editor: Vince O’Brien
Managing Editor: David A
...

Director of Creative Services: Paul Belfanti
Creative Director: Carole Anson
Art Director and Cover Designer: Heather Scott
Art Editor: Greg Dulles
Manufacturing Manager: Trudy Pisciotti
Manufacturing Buyer: Lisa McDowell
Senior Marketing Manager: Jennie Burger
© 2002 by Prentice-Hall, Inc
...
No part of this book may be
reproduced, in any form or by any means,
without permission in writing from the publisher
...
These efforts
include the development, research, and testing of the theories and programs to determine their
effectiveness
...
The author and publisher shall not be liable in
any event for incidental or consequential damages in connection with, or arising out of, the furnishing,
performance, or use of these programs
...
, London
Pearson Education Australia Pty
...
Ltd
...
, Hong Kong
Pearson Education Canada, Ltd
...
A
...
V
...
Ltd
...


5-10-2001

14:22

Page xv

Preface
When something can be read without effort,
great effort has gone into its writing
...
As the 1977 and 1987 editions by Gonzalez
and Wintz, and the 1992 edition by Gonzalez and Woods, the present edition was
prepared with students and instructors in mind
...
To achieve these
objectives, we again focused on material that we believe is fundamental and
has a scope of application that is not limited to the solution of specialized problems
...

The present edition was influenced significantly by a recent market survey
conducted by Prentice Hall
...
A need for more motivation in the introductory chapter regarding the spectrum of applications of digital image processing
...
A simplification and shortening of material in the early chapters in order
to “get to the subject matter” as quickly as possible
...
A more intuitive presentation in some areas, such as image transforms and
image restoration
...
Individual chapter coverage of color image processing, wavelets, and image
morphology
...
An increase in the breadth of problems at the end of each chapter
...
The major changes made in the book are as
follows
...
The main focus of the current treatment
is on examples of areas that use digital image processing
...

Chapter 2 is totally new also
...


xvi

5-10-2001

14:22

Page xvi

I Preface

sampling, aliasing, Moiré patterns, and image zooming and shrinking
...

Chapters 3 though 6 in the current edition cover the same concepts as Chapters 3 through 5 in the previous edition, but the scope is expanded and the presentation is totally different
...
One of the major changes in the book is that
image transforms are now introduced when they are needed
...
Chapters 3 and 4 in the
current edition deal with image enhancement, as opposed to a single chapter
(Chapter 4) in the previous edition
...
Rather,
we used it as an avenue to introduce spatial methods for image processing
(Chapter 3), as well as the Fourier transform, the frequency domain, and image
filtering (Chapter 4)
...
This organization also gives instructors flexibility in the amount of frequency-domain material they wish to
cover
...
The
coverage of this topic in earlier editions of the book was based on matrix theory
...
The new presentation covers essentially the
same ground, but the discussion does not rely on matrix theory and is much
easier to understand, due in part to numerous new examples
...
On balance, however, we believe that readers (especially beginners) will find the new treatment much more appealing and easier to follow
...

Chapter 6 dealing with color image processing is new
...
Our treatment of this topic represents
a significant expansion of the material from previous editions
...
In addition to a number of signal processing applications, interest in this area is motivated by the need for more
sophisticated methods for image compression, a topic that in turn is motivated
by a increase in the number of images transmitted over the Internet or stored
in Web servers
...
Several image transforms, previously
covered in Chapter 3 and whose principal use is compression, were moved to
this chapter
...


5-10-2001

14:22

Page xvii

I Preface

Chapter 9, dealing with image morphology, is new
...
Chapter 10, dealing with image segmentation, has the same basic structure as before, but numerous new examples
were included and a new section on segmentation by morphological watersheds
was added
...

New examples were added and the Hotelling transform (description by principal components), previously included in Chapter 3, was moved to this chapter
...
Experience since the last edition of Digital Image Processing indicates that
the new, shortened coverage of object recognition is a logical place at which to
conclude the book
...
For students following a formal course of study or individuals embarked
on a program of self study, the site contains a number of tutorial reviews on
background material such as probability, statistics, vectors, and matrices, prepared at a basic level and written using the same notation as in the book
...
For
instruction, the site contains suggested teaching outlines, classroom presentation
materials, laboratory experiments, and various image databases (including most
images from the book)
...
A downloadable instructor’s manual containing
sample curricula, solutions to sample laboratory experiments, and solutions to
all problems in the book is available to instructors who have adopted the book
for classroom use
...
As is usual in
a project such as this, progress continues after work on the manuscript stops
...
We have tried to observe that same principle in
preparing this edition of the book
...
C
...

R
...
W
...


5-10-2001

14:22

Page xxii

GONZFM-i-xxii
...


5-10-2001

14:22

Page iv

Library of Congress Cataloging-in-Pubblication Data
Gonzalez, Rafael C
...
Woods
p
...

Includes bibliographical references
ISBN 0-201-18075-8
1
...
2
...
I
...

TA1632
...
3—dc21

2001

2001035846
CIP

Vice-President and Editorial Director, ECS: Marcia J
...
Riccardi
Executive Managing Editor: Vince O’Brien
Managing Editor: David A
...

Director of Creative Services: Paul Belfanti
Creative Director: Carole Anson
Art Director and Cover Designer: Heather Scott
Art Editor: Greg Dulles
Manufacturing Manager: Trudy Pisciotti
Manufacturing Buyer: Lisa McDowell
Senior Marketing Manager: Jennie Burger

All rights reserved
...

The author and publisher of this book have used their best efforts in preparing this book
...
The author and publisher make no warranty of any kind, expressed or implied, with regard to
these programs or the documentation contained in this book
...

Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
ISBN: 0-201-18075-8
Pearson Education Ltd
...
, Limited, Sydney
Pearson Education Singapore, Pte
...

Pearson Education North Asia Ltd
...
, Toronto
Pearson Education de Mexico, S
...
de C
...

Pearson Education—Japan, Tokyo
Pearson Education Malaysia, Pte
...

Pearson Education, Upper Saddle River, New Jersey

GONZFM-i-xxii
...
1
1
...
3

1
...
5

2

2
...
2
2
...
4

Introduction

15

What Is Digital Image Processing? 15
The Origins of Digital Image Processing 17
Examples of Fields that Use Digital Image Processing 21
1
...
1 Gamma-Ray Imaging 22
1
...
2 X-ray Imaging 23
1
...
3 Imaging in the Ultraviolet Band 25
1
...
4 Imaging in the Visible and Infrared Bands 26
1
...
5 Imaging in the Microwave Band 32
1
...
6 Imaging in the Radio Band 34
1
...
7 Examples in which Other Imaging Modalities Are Used
Fundamental Steps in Digital Image Processing 39
Components of an Image Processing System 42
Summary 44
References and Further Reading 45

Digital Image Fundamentals

34

34

Elements of Visual Perception 34
2
...
1 Structure of the Human Eye 35
2
...
2 Image Formation in the Eye 37
2
...
3 Brightness Adaptation and Discrimination 38
Light and the Electromagnetic Spectrum 42
Image Sensing and Acquisition 45
2
...
1 Image Acquisition Using a Single Sensor 47
2
...
2 Image Acquisition Using Sensor Strips 48
2
...
3 Image Acquisition Using Sensor Arrays 49
2
...
4 A Simple Image Formation Model 50
Image Sampling and Quantization 52
2
...
1 Basic Concepts in Sampling and Quantization 52
2
...
2 Representing Digital Images 54
2
...
3 Spatial and Gray-Level Resolution 57
2
...
4 Aliasing and Moiré Patterns 62
2
...
5 Zooming and Shrinking Digital Images 64

vii

GONZFM-i-xxii
...
5

2
...
1
3
...
3

3
...
5
3
...
7

3
...
1

Some Basic Relationships Between Pixels 66
2
...
1 Neighbors of a Pixel 66
2
...
2 Adjacency, Connectivity, Regions, and Boundaries
2
...
3 Distance Measures 68
2
...
4 Image Operations on a Pixel Basis 69
Linear and Nonlinear Operations 70
Summary 70
References and Further Reading 70
Problems 71

66

Image Enhancement in the Spatial Domain

75

Background 76
Some Basic Gray Level Transformations 78
3
...
1 Image Negatives 78
3
...
2 Log Transformations 79
3
...
3 Power-Law Transformations 80
3
...
4 Piecewise-Linear Transformation Functions 85
Histogram Processing 88
3
...
1 Histogram Equalization 91
3
...
2 Histogram Matching (Specification) 94
3
...
3 Local Enhancement 103
3
...
4 Use of Histogram Statistics for Image Enhancement 103
Enhancement Using Arithmetic/Logic Operations 108
3
...
1 Image Subtraction 110
3
...
2 Image Averaging 112
Basics of Spatial Filtering 116
Smoothing Spatial Filters 119
3
...
1 Smoothing Linear Filters 119
3
...
2 Order-Statistics Filters 123
Sharpening Spatial Filters 125
3
...
1 Foundation 125
3
...
2 Use of Second Derivatives for Enhancement–
The Laplacian 128
3
...
3 Use of First Derivatives for Enhancement—The Gradient 134
Combining Spatial Enhancement Methods 137
Summary 141
References and Further Reading 142
Problems 142

Image Enhancement in the Frequency
Domain 147
Background

148

GONZFM-i-xxii
...
2

4
...
4

4
...
6

5

5
...
2

5
...
2
...
2
...
2
...
2
...
3
...
3
...
3
...
3
...
4
...
4
...
4
...
4
...
4
...
6
...
6
...
6
...
6
...
6
...
6
...
6
...
2
...
2
...
2
...
2
...
3
...
3
...
3
...


x

5-10-2001

14:22

Page x

I Contents

5
...
4
...
4
...
4
...
4
...
5 Linear, Position-Invariant Degradations 254
5
...
6
...
6
...
6
...
7 Inverse Filtering 261
5
...
9 Constrained Least Squares Filtering 266
5
...
11 Geometric Transformations 270
5
...
1 Spatial Transformations 271
5
...
2 Gray-Level Interpolation 272
Summary 276
References and Further Reading 277
Problems 278

6

6
...
2

6
...
4
6
...
6
6
...
2
...
2
...
2
...
3
...
3
...
5
...
5
...
5
...
5
...
5
...
6
...
6
...
7
...
7
...
7
...


5-10-2001

14:22

Page xi

I Contents

6
...
9

7

7
...
2

7
...
4
7
...
6

8

8
...
2
8
...
4

Noise in Color Images 339
Color Image Compression 342
Summary 343
References and Further Reading
Problems 344

344

Wavelets and Multiresolution Processing
Background 350
7
...
1 Image Pyramids 351
7
...
2 Subband Coding 354
7
...
3 The Haar Transform 360
Multiresolution Expansions 363
7
...
1 Series Expansions 364
7
...
2 Scaling Functions 365
7
...
3 Wavelet Functions 369
Wavelet Transforms in One Dimension 372
7
...
1 The Wavelet Series Expansions 372
7
...
2 The Discrete Wavelet Transform 375
7
...
3 The Continuous Wavelet Transform 376
The Fast Wavelet Transform 379
Wavelet Transforms in Two Dimensions 386
Wavelet Packets 394
Summary 402
References and Further Reading 404
Problems 404

Image Compression

409

Fundamentals 411
8
...
1 Coding Redundancy 412
8
...
2 Interpixel Redundancy 414
8
...
3 Psychovisual Redundancy 417
8
...
4 Fidelity Criteria 419
Image Compression Models 421
8
...
1 The Source Encoder and Decoder 421
8
...
2 The Channel Encoder and Decoder 423
Elements of Information Theory 424
8
...
1 Measuring Information 424
8
...
2 The Information Channel 425
8
...
3 Fundamental Coding Theorems 430
8
...
4 Using Information Theory 437
Error-Free Compression 440
8
...
1 Variable-Length Coding 440

349

xi

GONZFM-i-xxii
...
5

8
...
1
9
...
3
9
...
5

9
...
4
...
4
...
4
...
5
...
5
...
5
...
6
...
6
...
6
...
1
...
1
...
2
...
2
...
5
...
5
...
5
...
5
...
5
...
5
...
5
...
5
...
5
...
6
...
6
...
6
...
6
...


5-10-2001

14:22

Page xiii

I Contents

10 Image Segmentation

567

10
...
1
...
1
...
1
...
2 Edge Linking and Boundary Detection 585
10
...
1 Local Processing 585
10
...
2 Global Processing via the Hough Transform 587
10
...
3 Global Processing via Graph-Theoretic Techniques 591
10
...
3
...
3
...
3
...
3
...
3
...
3
...
3
...
4 Region-Based Segmentation 612
10
...
1 Basic Formulation 612
10
...
2 Region Growing 613
10
...
3 Region Splitting and Merging 615
10
...
5
...
5
...
5
...
5
...
6 The Use of Motion in Segmentation 626
10
...
1 Spatial Techniques 626
10
...
2 Frequency Domain Techniques 630
Summary 634
References and Further Reading 634
Problems 636

11 Representation and Description

11
...
1
...
1
...
1
...
1
...
1
...


xiv

5-10-2001

14:22

Page xiv

I Contents

11
...
2
...
2
...
2
...
2
...
3 Regional Descriptors 660
11
...
1 Some Simple Descriptors 661
11
...
2 Topological Descriptors 661
11
...
3 Texture 665
11
...
4 Moments of Two-Dimensional Functions 672
11
...
5 Relational Descriptors 683
Summary 687
References and Further Reading 687
Problems 689

12 Object Recognition

693

12
...
2 Recognition Based on Decision-Theoretic Methods
12
...
1 Matching 698
12
...
2 Optimum Statistical Classifiers 704
12
...
3 Neural Networks 712
12
...
3
...
3
...
3
...
3
...


5-10-2001

14:22

Page xxii

GONZ01-001-033
...

Anonymous

Preview
Interest in digital image processing methods stems from two principal application areas: improvement of pictorial information for human interpretation; and
processing of image data for storage, transmission, and representation for autonomous machine perception
...


1
...
When
x, y, and the amplitude values of f are all finite, discrete quantities, we call the
image a digital image
...
Note that a digital image is composed of a finite number of elements, each of which has a particular location and

1

GONZ01-001-033
...
These elements are referred to as picture elements, image elements, pels,
and pixels
...
We consider these definitions in more formal terms in Chapter 2
...
However, unlike
humans, who are limited to the visual band of the electromagnetic (EM) spectrum, imaging machines cover almost the entire EM spectrum, ranging from
gamma to radio waves
...
These include ultrasound, electron microscopy, and computer-generated images
...

There is no general agreement among authors regarding where image processing stops and other related areas, such as image analysis and computer vision, start
...
We believe
this to be a limiting and somewhat artificial boundary
...
On the other hand, there are fields such as computer vision whose ultimate goal is to use computers to emulate human vision, including learning
and being able to make inferences and take actions based on visual inputs
...
The field of AI is in its earliest stages of infancy in terms
of development, with progress having been much slower than originally anticipated
...

There are no clear-cut boundaries in the continuum from image processing
at one end to computer vision at the other
...
Low-level processes involve primitive operations such as image preprocessing to reduce noise, contrast enhancement, and
image sharpening
...
Mid-level processing on images involves
tasks such as segmentation (partitioning an image into regions or objects),
description of those objects to reduce them to a form suitable for computer
processing, and classification (recognition) of individual objects
...
g
...
Finally, higher-level processing involves
“making sense” of an ensemble of recognized objects, as in image analysis,
and, at the far end of the continuum, performing the cognitive functions normally associated with vision
...
Thus, what we call in this book digital
image processing encompasses processes whose inputs and outputs are images

GONZ01-001-033
...
2 I The Origins of Digital Image Processing

3

and, in addition, encompasses processes that extract attributes from images, up
to and including the recognition of individual objects
...
The
processes of acquiring an image of the area containing the text, preprocessing
that image, extracting (segmenting) the individual characters, describing the
characters in a form suitable for computer processing, and recognizing those
individual characters are in the scope of what we call digital image processing
in this book
...
” As will become
evident shortly, digital image processing, as we have defined it, is used successfully in a broad range of areas of exceptional social and economic value
...


1
...
Introduction of the Bartlane cable picture transmission system in the
early 1920s reduced the time required to transport a picture across the Atlantic
from more than a week to less than three hours
...
Figure 1
...

Some of the initial problems in improving the visual quality of these early digital pictures were related to the selection of printing procedures and the distribution of intensity levels
...
1
...
Figure 1
...
The improvements over Fig
...
1 are evident, both in tonal quality and in resolution
...
1 A

digital picture
produced in 1921
from a coded tape
by a telegraph
printer with
special type faces
...
†)



References in the Bibliography at the end of the book are listed in alphabetical order by authors’ last
names
...
II

4

29-08-2001

14:42

Page 4

Chapter 1 I Introduction

FIGURE 1
...

Some errors are
visible
...
)

The early Bartlane systems were capable of coding images in five distinct
levels of gray
...
Figure 1
...

During this period, introduction of a system for developing a film plate via light
beams that were modulated by the coded picture tape improved the reproduction process considerably
...
Thus, the history of digital image
processing is intimately tied to the development of the digital computer
...

The idea of a computer goes back to the invention of the abacus in Asia
Minor, more than 5000 years ago
...

However, the basis for what we call a modern digital computer dates back to only
the 1940s with the introduction by John von Neumann of two key concepts:
(1) a memory to hold a stored program and data, and (2) conditional branching
...
Starting with von Neumann, there were
FIGURE 1
...

(McFarlane
...
II

29-08-2001

14:42

Page 5

1
...
Briefly, these advances may be summarized as follows:
(1) the invention of the transistor by Bell Laboratories in 1948; (2) the development in the 1950s and 1960s of the high-level programming languages
COBOL (Common Business-Oriented Language) and FORTRAN (Formula
Translator); (3) the invention of the integrated circuit (IC) at Texas Instruments
in 1958; (4) the development of operating systems in the early 1960s; (5) the development of the microprocessor (a single chip consisting of the central processing unit, memory, and input and output controls) by Intel in the early 1970s;
(6) introduction by IBM of the personal computer in 1981; and (7) progressive
miniaturization of components, starting with large scale integration (LI) in the
late 1970s, then very large scale integration (VLSI) in the 1980s, to the present
use of ultra large scale integration (ULSI)
...

The first computers powerful enough to carry out meaningful image processing tasks appeared in the early 1960s
...
It took the combination of those
two developments to bring into focus the potential of digital image processing
concepts
...
Figure 1
...
M
...
This also is the
first image of the moon taken by a U
...
spacecraft
...

FIGURE 1
...
S
...

Ranger 7 took this
image on July 31,
1964 at 9 : 09 A
...

EDT, about 17
minutes before
impacting the
lunar surface
...
)

GONZ01-001-033
...
The invention in the early 1970s of computerized axial tomography (CAT), also called computerized tomography (CT) for
short, is one of the most important events in the application of image processing in
medical diagnosis
...
The X-rays pass through the object and are
collected at the opposite end by the corresponding detectors in the ring
...
Tomography consists of algorithms that
use the sensed data to construct an image that represents a “slice” through the object
...
Tomography was invented independently by Sir Godfrey
N
...
Cormack, who shared the 1979 Nobel Prize
in Medicine for their invention
...
These two inventions, nearly 100 years apart, led to some of the
most active application areas of image processing today
...
In addition to applications in medicine and the space program, digital
image processing techniques now are used in a broad range of applications
...
Geographers use the same or similar techniques
to study pollution patterns from aerial and satellite imagery
...
In archeology, image
processing methods have successfully restored blurred pictures that were the only
available records of rare artifacts lost or damaged after being photographed
...
Similarly successful applications of image processing concepts can be found in astronomy,
biology, nuclear medicine, law enforcement, defense, and industrial applications
...
The second major area of application of digital image processing techniques
mentioned at the beginning of this chapter is in solving problems dealing with
machine perception
...
Often,
this information bears little resemblance to visual features that humans use in
interpreting the content of an image
...
Typical problems in machine perception
that routinely utilize image processing techniques are automatic character recognition, industrial machine vision for product assembly and inspection, military
recognizance, automatic processing of fingerprints, screening of X-rays and blood
samples, and machine processing of aerial and satellite imagery for weather

GONZ01-001-033
...
3 I Examples of Fields that Use Digital Image Processing

7

prediction and environmental assessment
...

Some of these application areas are illustrated in the following section
...
3

Examples of Fields that Use Digital Image Processing

Today, there is almost no area of technical endeavor that is not impacted in
some way by digital image processing
...
However, limited as
it is, the material presented in this section will leave no doubt in the reader’s
mind regarding the breadth and importance of digital image processing
...
Many of the images shown in this section are used later in one or more of
the examples given in the book
...

The areas of application of digital image processing are so varied that some
form of organization is desirable in attempting to capture the breadth of this
field
...
g
...
The principal energy source for images in use today
is the electromagnetic energy spectrum
...
Synthetic images, used for modeling and visualization, are
generated by computer
...
Methods for converting images into digital form are discussed in the next chapter
...
Electromagnetic waves can be conceptualized as propagating sinusoidal waves of varying
wavelengths, or they can be thought of as a stream of massless particles, each
traveling in a wavelike pattern and moving at the speed of light
...
Each bundle of energy is called a photon
...
1
...
The
bands are shown shaded to convey the fact that bands of the EM spectrum are
not distinct but rather transition smoothly from one to the other
...
5 The electromagnetic spectrum arranged according to energy per photon
...
II

8

29-08-2001

14:42

Page 8

Chapter 1 I Introduction

1
...
1 Gamma-Ray Imaging
Major uses of imaging based on gamma rays include nuclear medicine and astronomical observations
...
Images are
produced from the emissions collected by gamma ray detectors
...
6(a)
shows an image of a complete bone scan obtained by using gamma-ray imaging
...
Figure 1
...
The principle is the same
a b
c d
FIGURE 1
...
(a) Bone
scan
...
(c) Cygnus
Loop
...

(Images courtesy
of (a) G
...

Medical Systems,
(b) Dr
...
Casey, CTI
PET Systems,
(c) NASA,
(d) Professors
Zhong He and
David K
...
)

GONZ01-001-033
...
3 I Examples of Fields that Use Digital Image Processing

as with X-ray tomography, mentioned briefly in Section 1
...
However, instead
of using an external source of X-ray energy, the patient is given a radioactive isotope that emits positrons as it decays
...
These are detected and a tomographic image is created using the basic principles of tomography
...
1
...
This image shows a tumor in the brain and one in the lung,
easily visible as small white masses
...
Figure 1
...
Unlike the two examples shown in Figs
...
6(a)
and (b), this image was obtained using the natural radiation of the object being
imaged
...
1
...
An area of strong radiation is seen in the lower, left side of
the image
...
3
...
The
best known use of X-rays is medical diagnostics, but they also are used extensively in industry and other areas, like astronomy
...
The cathode is heated, causing free electrons to be
released
...

When the electrons strike a nucleus, energy is released in the form of X-ray radiation
...
Figure 1
...
The intensity of the X-rays is modified by absorption
as they pass through the patient, and the resulting energy falling on the film develops it, much in the same way that light develops photographic film
...
The light signal in turn is captured by a light-sensitive digitizing system
...

Angiography is another major application in an area called contrastenhancement radiography
...
A catheter (a small, flexible, hollow tube) is inserted, for example, into an artery or vein in the groin
...
When the catheter
reaches the site under investigation, an X-ray contrast medium is injected
through the catheter
...
Figure 1
...
The catheter can be seen being inserted into the
large blood vessel on the lower left of the picture
...
II

10

29-08-2001

14:42

Page 10

Chapter 1 I Introduction

a
d
b
c e

FIGURE 1
...
(a) Chest X-ray
...
(c) Head

CT
...
(e) Cygnus Loop
...
David
R
...
of Radiology & Radiological Sciences, Vanderbilt University Medical
Center, (b) Dr
...
Gest, Division of Anatomical Sciences, University of Michigan Medical School, (d) Mr
...
Pascente, Lixi, Inc
...
)

GONZ01-001-033
...
3 I Examples of Fields that Use Digital Image Processing

large vessel as the contrast medium flows up in the direction of the kidneys,
which are also visible in the image
...

Perhaps the best known of all uses of X-rays in medical imaging is computerized axial tomography
...
As noted in Section 1
...
Numerous slices are generated as the patient
is moved in a longitudinal direction
...
Figure 1
...

Techniques similar to the ones just discussed, but generally involving higherenergy X-rays, are applicable in industrial processes
...
7(d) shows an
X-ray image of an electronic circuit board
...

Industrial CAT scans are useful when the parts can be penetrated by X-rays,
such as in plastic assemblies, and even large bodies, like solid-propellant rocket motors
...
7(e) shows an example of X-ray imaging in astronomy
...
1
...


1
...
3 Imaging in the Ultraviolet Band
Applications of ultraviolet “light” are varied
...
We illustrate imaging in this band with examples from microscopy and
astronomy
...
Fluorescence is a phenomenon discovered in the middle of the nineteenth century, when it was first observed that the mineral
fluorspar fluoresces when ultraviolet light is directed upon it
...
Subsequently, the excited electron relaxes to a lower level
and emits light in the form of a lower-energy photon in the visible (red) light region
...
Thus, only the emission
light reaches the eye or other detector
...
The
darker the background of the nonfluorescing material, the more efficient the
instrument
...

Figures 1
...
II

12

29-08-2001

14:42

Page 12

Chapter 1 I Introduction

a b
c
FIGURE 1
...

(a) Normal corn
...

(c) Cygnus Loop
...
Michael
W
...
)

microscopy
...
8(a) shows a fluorescence microscope image of normal
corn, and Fig
...
8(b) shows corn infected by “smut,” a disease of cereals, corn,
grasses, onions, and sorghum that can be caused by any of more than 700 species
of parasitic fungi
...
As another illustration, Fig
...
8(c) shows
the Cygnus Loop imaged in the high-energy region of the ultraviolet band
...
3
...
The infrared band

GONZ01-001-033
...
3 I Examples of Fields that Use Digital Image Processing

often is used in conjunction with visual imaging, so we have grouped the visible and infrared bands in this section for the purpose of illustration
...

Figure 1
...

The examples range from pharmaceuticals and microinspection to materials
characterization
...
It is not difficult to conceptualize the types of processes one
might apply to these images, ranging from enhancement to measurements
...
9 Examples of light microscopy images
...
(b) Cholesterol—40 µ
...
(d) Nickel oxide thin film—600
µ
...
(f) Organic superconductor—450 µ
...
Michael W
...
)

13

GONZ01-001-033
...
1
Thematic bands
in NASA’s
LANDSAT
satellite
...


Name

Wavelength (?m)

Characteristics and Uses
Maximum water
penetration
Good for measuring plant
vigor
Vegetation discrimination
Biomass and shoreline
mapping
Moisture content of soil
and vegetation
Soil moisture; thermal
mapping
Mineral mapping

1

Visible blue

0
...
52

2

Visible green

0
...
60

3
4

Visible red
Near infrared

0
...
69
0
...
90

5

Middle infrared

1
...
75

6

Thermal infrared

10
...
5

7

Middle infrared

2
...
35

Another major area of visual processing is remote sensing, which usually
includes several bands in the visual and infrared regions of the spectrum
...
1 shows the so-called thematic bands in NASA’s LANDSAT satellite
...
The bands are expressed in terms of wavelength, with 1 ?m
being equal to 10–6 m (we discuss the wavelength regions of the electromagnetic spectrum in more detail in Chapter 2)
...

In order to develop a basic appreciation for the power of this type of multispectral imaging, consider Fig
...
10, which shows one image for each of the spec1

4

2

5

3

6

7

FIGURE 1
...
C
...
The numbers refer to the thematic
bands in Table 1
...
(Images courtesy of NASA
...
II

29-08-2001

14:42

Page 15

1
...
11

15

Multispectral
image of
Hurricane
Andrew taken by
NOAA GEOS
(Geostationary
Environmental
Operational
Satellite) sensors
...
)

tral bands in Table 1
...
The area imaged is Washington D
...
, which includes features such as buildings, roads, vegetation, and a major river (the Potomac) going
though the city
...
The differences between visual and infrared image features are quite noticeable in these images
...

Weather observation and prediction also are major applications of multispectral imaging from satellites
...
1
...
The eye of the hurricane
is clearly visible in this image
...
12 and 1
...
These images
are part of the Nighttime Lights of the World data set, which provides a global inventory of human settlements
...
The infrared imaging system operates in the band 10
...
4 ?m, and has the unique capability to observe faint sources of visiblenear infrared emissions present on the Earth’s surface, including cities, towns,
villages, gas flares, and fires
...


GONZ01-001-033
...
12

Infrared satellite
images of the
Americas
...

(Courtesy of
NOAA
...
Figure 1
...
Figure 1
...
A typical image processing task with
products like this is to inspect them for missing parts (the black square on the top,
right quadrant of the image is an example of a missing component)
...
14(b)
is an imaged pill container
...
Figure 1
...
Figure 1
...
II

29-08-2001

14:42

Page 17

1
...
13

17

Infrared satellite
images of the
remaining
populated part of
the world
...

(Courtesy of
NOAA
...
Detecting
anomalies like these is a major theme of industrial inspection that includes other
products such as wood and cloth
...
14(e) shows a batch of cereal during inspection for color and the presence of anomalies such as burned flakes
...
1
...
A “structured light” illumination technique was used to highlight for
easier detection flat lens deformations toward the center of the lens
...
Most of the other small speckle detail is debris
...

As a final illustration of image processing in the visual spectrum, consider
Fig
...
15
...
15(a) shows a thumb print
...
Figure 1
...
Applications of digital image processing in this area
include automated counting and, in law enforcement, the reading of the serial
number for the purpose of tracking and identifying bills
...
1
...


GONZ01-001-033
...
14

Some examples of
manufactured
goods often
checked using
digital image
processing
...

(b) Packaged pills
...

(d) Bubbles in
clear-plastic
product
...

(f) Image of
intraocular
implant
...
(f) courtesy
of Mr
...
)

The light rectangles indicate the area in which the imaging system detected the
plate
...
License plate and other applications of character recognition are used extensively for traffic monitoring and surveillance
...
3
...
The unique
feature of imaging radar is its ability to collect data over virtually any region at
any time, regardless of weather or ambient lighting conditions
...
II

29-08-2001

14:42

Page 19

1
...
15

Some additional
examples of
imaging in the
visual spectrum
...

(b) Paper
currency
...
Automated
license plate
reading
...

Figures (c) and
(d) courtesy of
Dr
...
)

waves can penetrate clouds, and under certain conditions can also see through
vegetation, ice, and extremely dry sand
...
An imaging radar works like
a flash camera in that it provides its own illumination (microwave pulses) to illuminate an area on the ground and take a snapshot image
...
In a radar image, one can see only the microwave energy that was reflected back toward the radar antenna
...
16 shows a spaceborne radar image covering a rugged mountainous area of southeast Tibet, about 90 km east of the city of Lhasa
...
Mountains in this
area reach about 5800 m (19,000 ft) above sea level, while the valley floors lie
about 4300 m (14,000 ft) above sea level
...


GONZ01-001-033
...
16

Spaceborne radar
image of
mountains in
southeast Tibet
...
)

1
...
6 Imaging in the Radio Band
As in the case of imaging at the other end of the spectrum (gamma rays), the
major applications of imaging in the radio band are in medicine and astronomy
...

This technique places a patient in a powerful magnet and passes radio waves
through his or her body in short pulses
...
The location from which
these signals originate and their strength are determined by a computer, which
produces a two-dimensional picture of a section of the patient
...
Figure 1
...

The last image to the right in Fig
...
18 shows an image of the Crab Pulsar in
the radio band
...
Note that each
image gives a totally different “view” of the Pulsar
...
3
...
Specifically,
we discuss in this section acoustic imaging, electron microscopy, and synthetic
(computer-generated) imaging
...
Geological applications use sound in the low end of the sound spectrum (hundreds of Hertz) while imaging in other areas use ultrasound (millions
of Hertz)
...
For image acquisition over land, one
of the main approaches is to use a large truck and a large flat steel plate
...
II

29-08-2001

14:42

Page 21

1
...
17 MRI images of a human (a) knee, and (b) spine
...
Thomas R
...
David R
...
)

quency spectrum up to 100 Hz
...
These
are analyzed by computer, and images are generated from the resulting analysis
...
Returning sound waves are detected by hydrophones
placed in cables that are either towed behind the ship, laid on the bottom of
the ocean, or hung from buoys (vertical cables)
...
The constant motion of the ship provides a transversal direction of motion that, together with the returning sound
waves, is used to generate a 3-D map of the composition of the Earth below
the bottom of the ocean
...
19 shows a cross-sectional image of a well-known 3-D model against
which the performance of seismic imaging algorithms is tested
...
This target is brighter than the surrounding layers because of the change in density in the target region is larger
...
18 Images of the Crab Pulsar (in the center of images) covering the electromagnetic spectrum
...
)

GONZ01-001-033
...
19

Cross-sectional
image of a seismic
model
...

(Courtesy of
Dr
...
)

Seismic interpreters look for these “bright spots” to find oil and gas
...
Many seismic reconstruction algorithms have difficulty imaging this target because of the faults above it
...

A byproduct of this examination is determining the sex of the baby
...
The ultrasound system (a computer, ultrasound probe consisting of a source
and receiver, and a display) transmits high-frequency (1 to 5 MHz) sound
pulses into the body
...
The sound waves travel into the body and hit a boundary between tissues
(e
...
, between fluid and soft tissue, soft tissue and bone)
...

3
...

4
...

5
...

In a typical ultrasound image, millions of pulses and echoes are sent and received each second
...
Figure 1
...

We continue the discussion on imaging modalities with some examples of
electron microscopy
...
The operation of electron microscopes involves the following basic
steps: A stream of electrons is produced by an electron source and accelerated
toward the specimen using a positive electrical potential
...
II

29-08-2001

14:42

Page 23

1
...
20

Examples of
ultrasound
imaging
...

(2) Another view
of baby
...

(d) Muscle layers
showing lesion
...
,
Ultrasound
Group
...
This beam is focused onto the sample using a magnetic lens
...
These interactions and effects are detected and transformed into an
image, much in the same way that light is reflected from, or absorbed by, objects
in a scene
...

A transmission electron microscope (TEM) works much like a slide projector
...
This transmitted beam is then projected onto the viewing screen, forming an enlarged
image of the slide
...
The fraction of the beam
transmitted through the specimen is projected onto a phosphor screen
...
A scanning electron microscope (SEM), on the other hand, actually scans the electron beam and records the interaction of beam and sample
at each location
...
A complete image
is formed by a raster scan of the bean through the sample, much like a TV camera
...
SEMs are
suitable for “bulky” samples, while TEMs require very thin samples
...
While light microscopy is limited to magnifications on the order 1000 *, electron microscopes

GONZ01-001-033
...
21 (a) 250 * SEM image of a tungsten filament following thermal failure
...
The white fibers are oxides resulting from thermal destruction
...
Michael Shaffer, Department of Geological Sciences, University of Oregon, Eugene; (b) courtesy of Dr
...
M
...
)

can achieve magnification of 10,000 * or more
...
21 shows two SEM images of specimen failures due to thermal overload
...
Instead, they are generated
by computer
...
Basically, a fractal is nothing more than an iterative reproduction of a
basic pattern according to some mathematical rules
...
A square can be subdivided into
four square subregions, each of which can be further subdivided into four smaller square regions, and so on
...
Of course, the geometry can be arbitrary
...
Figure 1
...
The reader will recognize this image as the theme image used
in the beginning page of each chapter in this book, selected because of its artistic simplicity and abstract analogy to a human eye
...
22(b) shows another fractal (a “moonscape”) that provides an interesting analogy to the images
of space used as illustrations in some of the preceding sections
...
They are useful sometimes as
random textures
...
This is an area that provides an important intersection
between image processing and computer graphics and is the basis for many 3-D
visualization systems (e
...
, flight simulators)
...
22(c) and (d) show examples of computer-generated images
...
Images of this type can be used for medical training and for a
host of other applications, such as criminal forensics and special effects
...
II

29-08-2001

14:42

Page 25

1
...
22

(a) and (b) Fractal
images
...

(Figures (a) and
(b) courtesy of
Ms
...
Binde,
Swarthmore
College, (c) and
(d) courtesy of
NASA
...
4

Fundamental Steps in Digital Image Processing

It is helpful to divide the material covered in the following chapters into the
two broad categories defined in Section 1
...
This organization is summarized in
Fig
...
23
...

Rather, the intention is to convey an idea of all the methodologies that can be
applied to images for different purposes and possibly with different objectives
...

Image acquisition is the first process shown in Fig
...
23
...
3 gave some hints regarding the origin of digital images
...
Note
that acquisition could be as simple as being given an image that is already in digital form
...

Image enhancement is among the simplest and most appealing areas of digital image processing
...
A familiar example of enhancement is when we increase the contrast of an image because “it looks better
...
II

14:42

Page 26

Chapter 1 I Introduction

FIGURE 1
...


CHAPTER 6

CHAPTER 7

CHAPTER 8

CHAPTER 9

Color image
processing

Wavelets and
multiresolution
processing

Compression

Morphological
processing

CHAPTER 5

CHAPTER 10

Image
restoration

Segmentation

CHAPTER 11

CHAPTERS 3 & 4

Image
enhancement

Knowledge base

Representation
& description

CHAPTER 2

Problem
domain

CHAPTER 12

Image
acquisition

Object
recognition

Outputs of these processes generally are image attributes

26

29-08-2001

enhancement is a very subjective area of image processing
...
Thus, rather
than having a chapter dedicated to mathematical preliminaries, we introduce a
number of needed mathematical concepts by showing how they apply to enhancement
...
A good example of this is the Fourier
transform, which is introduced in Chapter 4 but is used also in several of the
other chapters
...
However, unlike enhancement, which is subjective, image restoration is objective, in the sense that restoration techniques tend to be based on
mathematical or probabilistic models of image degradation
...

Color image processing is an area that has been gaining in importance because of the significant increase in the use of digital images over the Internet
...
Color is used also in later chapters as the
basis for extracting features of interest in an image
...
In particular, this material is used in this book for image data compression and for pyramidal representation, in which images are subdivided successively into smaller regions
...
II

29-08-2001

14:42

Page 27

1
...
Although storage technology has improved significantly over the past decade, the
same cannot be said for transmission capacity
...
Image
compression is familiar (perhaps inadvertently) to most users of computers in
the form of image file extensions, such as the jpg file extension used in the JPEG
(Joint Photographic Experts Group) image compression standard
...
The material in
this chapter begins a transition from processes that output images to processes
that output image attributes, as indicated in Section 1
...

Segmentation procedures partition an image into its constituent parts or objects
...
A rugged segmentation procedure brings the process
a long way toward successful solution of imaging problems that require objects
to be identified individually
...
In general, the more accurate the segmentation, the more likely recognition is to succeed
...
e
...
In either case, converting the data to a form
suitable for computer processing is necessary
...
Boundary representation is appropriate when the focus is on external shape characteristics, such as corners and inflections
...
In some applications, these representations complement each other
...
A
method must also be specified for describing the data so that features of interest are highlighted
...

Recognition is the process that assigns a label (e
...
, “vehicle”) to an object
based on its descriptors
...
1, we conclude our coverage
of digital image processing with the development of methods for recognition of
individual objects
...
1
...
Knowledge about a problem domain is coded into an image processing system in the form of a knowledge database
...
The knowledge base also can be quite complex, such as an interrelated list of all major possible defects in a materials inspection problem or an

27

GONZ01-001-033
...
In addition to guiding the operation
of each processing module, the knowledge base also controls the interaction
between modules
...
1
...

Although we do not discuss image display explicitly at this point, it is important to keep in mind that viewing the results of image processing can take place
at the output of any stage in Fig
...
23
...
1
...
In fact, not
even all those modules are needed in some cases
...
1
...
In general, however, as the complexity of an image processing
task increases, so does the number of processes required to solve the problem
...
5

Components of an Image Processing System

As recently as the mid-1980s, numerous models of image processing systems
being sold throughout the world were rather substantial peripheral devices that
attached to equally substantial host computers
...
In addition to lowering costs, this market shift also served as a catalyst for a significant number of
new companies whose specialty is the development of software written specifically for image processing
...
Figure 1
...
The function of each component is discussed in the following paragraphs,
starting with image sensing
...
The first is a physical device that is sensitive to the energy radiated by the
object we wish to image
...
For instance, in
a digital video camera, the sensors produce an electrical output proportional
to light intensity
...
These topics are covered in some detail in Chapter 2
...
One example of how an ALU is used is in averaging images as quickly as they are digitized, for the purpose of noise reduction
...
II

29-08-2001

14:42

Page 29

1
...
24

Network

29

Components of a
general-purpose
image processing
system
...
In other words, this unit performs functions
that require fast data throughputs (e
...
, digitizing and averaging video images
at 30 frames?s) that the typical main computer cannot handle
...
In dedicated applications, sometimes specially designed computers are used to achieve a required level of performance, but our interest here is on general-purpose image processing systems
...

Software for image processing consists of specialized modules that perform
specific tasks
...
More sophisticated software packages allow the integration of those modules and general-purpose software commands from at least one computer language
...
An image
of size 1024*1024 pixels, in which the intensity of each pixel is an 8-bit quantity, requires one megabyte of storage space if the image is not compressed
...
Digital storage for

GONZ01-001-033
...
Storage is
measured in bytes (eight bits), Kbytes (one thousand bytes), Mbytes (one million bytes), Gbytes (meaning giga, or one billion, bytes), and Tbytes (meaning
tera, or one trillion, bytes)
...
Another
is by specialized boards, called frame buffers, that store one or more images and
can be accessed rapidly, usually at video rates (e
...
, at 30 complete images per
second)
...
Frame buffers usually are
housed in the specialized image processing hardware unit shown in Fig
...
24
...
The key factor characterizing on-line storage is frequent access to the stored
data
...
Magnetic tapes and optical disks housed in
“jukeboxes” are the usual media for archival applications
...
Monitors are driven by the outputs of image and graphics display cards that
are an integral part of the computer system
...
In some cases, it is necessary to have
stereo displays, and these are implemented in the form of headgear containing
two small displays embedded in goggles worn by the user
...
Film provides the highest possible resolution, but paper is the
obvious medium of choice for written material
...
The latter approach is gaining acceptance as the standard for image
presentations
...

Because of the large amount of data inherent in image processing applications,
the key consideration in image transmission is bandwidth
...
Fortunately, this situation is improving
quickly as a result of optical fiber and other broadband technologies
...
Although the coverage of these
topics in this chapter was necessarily incomplete due to space limitations, it should have
left the reader with a clear impression of the breadth and practical scope of digital image
processing
...
II

29-08-2001

14:42

Page 31

I References and Further Reading

on the utility and promise of these techniques
...


References and Further Reading
References at the end of later chapters address specific topics discussed in those chapters, and are keyed to the Bibliography at the end of the book
...
We also provide a list of books
from which the reader can readily develop a historical and current perspective of activities in this field
...

Major refereed journals that publish articles on image processing and related topics
include: IEEE Transactions on Image Processing; IEEE Transactions on Pattern Analysis and Machine Intelligence; Computer Vision, Graphics, and Image Processing (prior
to 1991); Computer Vision and Image Understanding; IEEE Transactions on Systems,
Man and Cybernetics; Artificial Intelligence; Pattern Recognition; Pattern Recognition
Letters; Journal of the Optical Society of America (prior to 1984); Journal of the Optical
Society of America—A: Optics, Image Science and Vision; Optical Engineering; Applied
Optics—Information Processing; IEEE Transactions on Medical Imaging; Journal of
Electronic Imaging; IEEE Transactions on Information Theory; IEEE Transactions on
Communications; IEEE Transactions on Acoustics, Speech and Signal Processing; Proceedings of the IEEE; and issues of the IEEE Transactions on Computers prior to 1980
...

The following books, listed in reverse chronological order (with the number of books
being biased toward more recent publications), contain material that complements our
treatment of digital image processing
...
They range from textbooks, which cover foundation material; to handbooks, which
give an overview of techniques; and finally to edited books, which contain material representative of current research in the field
...
O
...
E
...
G
...
Pattern Classification, 2nd ed
...

Ritter, G
...
and Wilson, J
...
[2001]
...

Shapiro, L
...
and Stockman, G
...
[2001]
...

Dougherty, E
...
(ed
...
Random Processes for Image and Signal Processing, IEEE
Press, NY
...
K
...
(eds
...
Fuzzy Techniques in Image Processing,
Springer-Verlag, NY
...
, and Bloomberg, D
...
(eds
...
Mathematical Morphology
and Its Applications to Image and Signal Processing, Kluwer Academic Publishers,
Boston, MA
...
H
...
Computational Vision, The MIT Press, Cambridge, MA
...
and Sharaiha, Y
...
[2000]
...


31

GONZ01-001-033
...
K
...
L
...
) [2000]
...

Edelman, S
...
Representation and Recognition in Vision,The MIT Press, Cambridge,
MA
...
M
...
W
...
Remote Sensing and Image Interpretation, John
Wiley & Sons, NY
...
M
...
Computer Processing of Remotely Sensed Images: An Introduction,
John Wiley & Sons, NY
...
and Bosdogianni, P
...
Image Processing: The Fundamentals, John Wiley
& Sons, UK
...
C
...
The Image Processing Handbook, 3rd ed
...

Smirnov, A
...
Processing of Multidimensional Signals, Springer-Verlag, NY
...
, Hlavac, V
...
[1999]
...

Umbaugh, S
...
[1998]
...

Haskell, B
...
and Netravali, A
...
[1997]
...

Jahne, B
...
Digital Image Processing: Concepts, Algorithms, and Scientific Applications, Springer-Verlag, NY
...
R
...
Digital Image Processing, 2nd ed
...

Geladi, P
...
[1996]
...

Bracewell, R
...
[1995]
...

Sid-Ahmed, M
...
[1995]
...

Jain, R
...
, and Schunk, B
...
Computer Vision, McGraw-Hill, NY
...
[1994]
...

Baxes, G
...
[1994]
...

Gonzalez, R
...
and Woods, R
...
[1992]
...

Haralick, R
...
and Shapiro, L
...
[1992]
...
1 & 2,
Addison-Wesley, Reading, MA
...
K
...
, Wiley-Interscience, NY
...
S
...
Two-Dimensional Signal and Image Processing, Prentice Hall, Upper
Saddle River, NJ
...
K
...
Fundamentals of Digital Image Processing, Prentice Hall, Upper Saddle
River, NJ
...
J
...
Digital Image Processing and Computer Vision, John Wiley &
Sons, NY
...
R
...
R
...
Morphological Methods in Image and Signal Processing, Prentice Hall, Upper Saddle River, NJ
...
II

29-08-2001

14:42

Page 33

I References and Further Reading

Levine, M
...
[1985]
...

Serra, J
...
Image Analysis and Mathematical Morphology, Academic Press, NY
...
H
...
M
...
Computer Vision, Prentice Hall, Upper Saddle
River, NJ
...
S
...
Syntactic Pattern Recognition and Applications, Prentice Hall, Upper
Saddle River, NJ
...
[1982]
...

Pavlidis, T
...
Algorithms for Graphics and Image Processing, Computer Science
Press, Rockville, MD
...
and Kak, A
...
[1982]
...
, vols
...

Hall, E
...
[1979]
...

Gonzalez, R
...
and Thomason, M
...
[1978]
...

Andrews, H
...
and Hunt, B
...
[1977]
...

Pavlidis, T
...
Structural Pattern Recognition, Springer-Verlag, NY, 1977
...
T
...
C
...
Pattern Recognition Principles, Addison-Wesley,
Reading, MA, 1974
...
C
...
Computer Techniques in Image Processing, Academic Press, NY
...
II

29-08-2001

2

13:35

Page 34

Digital Image
Fundamentals
Those who wish to succeed must ask the right preliminary questions
...
Section 2
...
Section 2
...
Section 2
...
Section 2
...
Additional
topics discussed in that section include digital image representation, the effects
of varying the number of samples and gray levels in an image, some important
phenomena associated with sampling, and techniques for image zooming and
shrinking
...
5 deals with some basic relationships between pixels that are
used throughout the book
...
6 defines the conditions for linear
operations
...


2
...
II

29-08-2001

13:35

Page 35

2
...
Hence, developing a basic understanding of human visual perception as a first step in our journey through this
book is appropriate
...
In particular, our interest lies in the mechanics and parameters related to how images are
formed in the eye
...
Thus, factors such as how human and electronic imaging compare in terms
of resolution and ability to adapt to changes in illumination are not only interesting, they also are important from a practical point of view
...
1
...
1 shows a simplified horizontal cross section of the human eye
...
Three
membranes enclose the eye: the cornea and sclera outer cover; the choroid; and
the retina
...
1

Cornea
Iris

Ciliary muscle

C

ili

ar

y

bo

dy

Anterior chamber

Lens
Ciliary fibers

Visual axis

Vitreous humor
Retina

Blind spot
Sclera
Choroid

N er

ve &

sh e

a th

Fovea

Simplified
diagram of a cross
section of the
human eye
...
II

36

29-08-2001

13:35

Page 36

Chapter 2 I Digital Image Fundamentals

surface of the eye
...

The choroid lies directly below the sclera
...

Even superficial injury to the choroid, often not deemed serious, can lead to severe eye damage as a result of inflammation that restricts blood flow
...
At
its anterior extreme, the choroid is divided into the ciliary body and the iris
diaphragm
...
The central opening of the iris (the pupil) varies in diameter
from approximately 2 to 8 mm
...

The lens is made up of concentric layers of fibrous cells and is suspended by
fibers that attach to the ciliary body
...
The lens is colored by a slightly yellow pigmentation that increases with age
...
The lens absorbs approximately 8% of the visible light spectrum, with relatively higher absorption at shorter
wavelengths
...

The innermost membrane of the eye is the retina, which lines the inside of the
wall’s entire posterior portion
...
Pattern vision is afforded by the
distribution of discrete light receptors over the surface of the retina
...
The cones in each eye number between 6
and 7 million
...
Humans can resolve fine details with these cones largely because each one is connected to its own nerve end
...
Cone vision is called photopic or bright-light vision
...
The larger area of distribution and the fact that several rods are connected to a single nerve end reduce the amount of detail discernible by these receptors
...
They are not involved in color vision and are sensitive to low levels of illumination
...
This phenomenon is known as scotopic or dim-light vision
...
2 shows the density of rods and cones for a cross section of the right
eye passing through the region of emergence of the optic nerve from the eye
...
2
...
Except for this region, the distribution of receptors is radially symmetric about the fovea
...


GONZ02-034-074
...
1 I Elements of Visual Perception
FIGURE 2
...
of rods or cones per mm2

Blind spot

Distribution of
rods and cones in
the retina
...
2
...
Note also that rods increase in density from the center
out to approximately 20° off axis and then decrease in density out to the extreme
periphery of the retina
...
5 mm in diameter
...
Thus, by taking some liberty
in interpretation, we can view the fovea as a square sensor array of size
1
...
5 mm
...
Based on these approximations, the number
of cones in the region of highest acuity in the eye is about 337,000 elements
...
While the ability of humans to integrate intelligence and experience with vision makes this type of comparison dangerous
...


2
...
2 Image Formation in the Eye
The principal difference between the lens of the eye and an ordinary optical
lens is that the former is flexible
...
2
...
The shape of the lens is controlled by tension in the fibers of the
ciliary body
...
Similarly, these muscles allow the lens to become
thicker in order to focus on objects near the eye
...
When the eye

GONZ02-034-074
...
3

Graphical
representation of
the eye looking at
a palm tree
...


C
15 m

100 m

17 mm

focuses on an object farther away than about 3 m, the lens exhibits its lowest refractive power
...
This information makes it easy to calculate the size of the retinal
image of any object
...
2
...
If h is the height in mm of that object in the
retinal image, the geometry of Fig
...
3 yields 15/100=h/17 or h=2
...
As
indicated in Section 2
...
1, the retinal image is reflected primarily in the area of
the fovea
...


2
...
3 Brightness Adaptation and Discrimination
Because digital images are displayed as a discrete set of intensities, the eye’s
ability to discriminate between different intensity levels is an important consideration in presenting image-processing results
...
Experimental evidence indicates that subjective brightness (intensity as perceived by the human visual
system) is a logarithmic function of the light intensity incident on the eye
...
4, a plot of light intensity versus subjective brightness, illustrates this char-

Adaptation range

Glare limit

Subjective brightness

FIGURE 2
...


Ba
Bb

Scotopic
Scotopic
threshold

Photopic
–6 –4 –2
0
2
4
Log of intensity (mL)

GONZ02-034-074
...
1 I Elements of Visual Perception

39

acteristic
...
In photopic vision alone, the range is about 106
...
001 to 0
...

The essential point in interpreting the impressive dynamic range depicted
in Fig
...
4 is that the visual system cannot operate over such a range simultaneously
...
The total range of
distinct intensity levels it can discriminate simultaneously is rather small when
compared with the total adaptation range
...
2
...
The short
intersecting curve represents the range of subjective brightness that the eye can
perceive when adapted to this level
...

The upper (dashed) portion of the curve is not actually restricted but, if extended too far, loses its meaning because much higher intensities would simply
raise the adaptation level higher than Ba
...
A classic experiment
used to determine the capability of the human visual system for brightness discrimination consists of having a subject look at a flat, uniformly illuminated
area large enough to occupy the entire field of view
...
To this field is added an increment of illumination, ?I, in the form of a short-duration flash that appears as a circle in the
center of the uniformly illuminated field, as Fig
...
5 shows
...
As ?I gets stronger, the subject may give a positive response of “yes,” indicating a perceived change
...
The quantity ¢Ic?I, where ¢Ic is the increment of illumination discriminable 50% of the time with background illumination I, is called the Weber ratio
...
This represents “good” brightness
discrimination
...
This represents “poor” brightness discrimination
...
5 Basic
I+¢I

I

experimental
setup used to
characterize
brightness
discrimination
...
II

40

29-08-2001

13:35

Page 40

Chapter 2 I Digital Image Fundamentals

FIGURE 2
...
0

Typical Weber
ratio as a function
of intensity
...
5

log ¢Ic /I

0
– 0
...
0
–1
...
0
–4

–3

–2

–1

0

1

2

3

4

log I

A plot of log ¢Ic?I, as a function of log I has the general shape shown in
Fig
...
6
...
The two branches in the
curve reflect the fact that at low levels of illumination vision is carried out by
activity of the rods, whereas at high levels (showing better discrimination) vision is the function of cones
...
Roughly, this result is related to the number of different intensities a person can see at any one
point in a monochrome image
...
The net consequence is that the eye is capable of a much broader range
of overall intensity discrimination
...
4
...

Two phenomena clearly demonstrate that perceived brightness is not a simple function of intensity
...
Figure 2
...
Although the intensity of the stripes is constant, we actually perceive a brightness
pattern that is strongly scalloped, especially near the boundaries [Fig
...
7(b)]
...

The second phenomenon, called simultaneous contrast, is related to the fact
that a region’s perceived brightness does not depend simply on its intensity, as
Fig
...
8 demonstrates
...


GONZ02-034-074
...
1 I Elements of Visual Perception

41

a
b
FIGURE 2
...
The
relative vertical
positions between
the two profiles in
(b) have no
special
significance; they
were chosen for
clarity
...
A more familiar example is a piece of paper that seems white when lying
on a desk, but can appear totally black when used to shield the eyes while looking directly at a bright sky
...
8 Examples of simultaneous contrast
...


GONZ02-034-074
...
9 Some

well-known
optical illusions
...
Some examples are shown in Fig
...
9
...
2
...
The same effect, this time with a circle, can be seen
in Fig
...
9(b); note how just a few lines are sufficient to give the illusion of a
complete circle
...
2
...
Finally, all lines in Fig
...
9(d)
that are oriented at 45° are equidistant and parallel
...
Optical illusions
are a characteristic of the human visual system that is not fully understood
...
2

Light and the Electromagnetic Spectrum

The electromagnetic spectrum was introduced in Section 1
...
We now consider
this topic in more detail
...
II

29-08-2001

13:35

Page 43

43

2
...
4*10 –6
0
...
6*10 –6
0
...
10 The electromagnetic spectrum
...


white but consists instead of a continuous spectrum of colors ranging from violet at one end to red at the other
...
2
...
On one end of the spectrum are radio waves with wavelengths billions
of times longer than those of visible light
...

The electromagnetic spectrum can be expressed in terms of wavelength, frequency, or energy
...
2-1)

where c is the speed of light (2
...
The energy of the various components of the electromagnetic spectrum is given by the expression
E=hn

(2
...
The units of wavelength are meters, with the terms
microns (denoted ?m and equal to 10–6 m) and nanometers (10–9 m) being used
just as frequently
...
A commonly used unit of energy is the electron-volt
...
II

44

29-08-2001

13:35

Page 44

Chapter 2 I Digital Image Fundamentals

FIGURE 2
...


Electromagnetic waves can be visualized as propagating sinusoidal waves with
wavelength l (Fig
...
11), or they can be thought of as a stream of massless particles, each traveling in a wavelike pattern and moving at the speed of light
...
Each bundle
of energy is called a photon
...
(2
...
Thus, radio waves have photons with low
energies, microwaves have more energy than radio waves, infrared still more, then
visible, ultraviolet, X-rays, and finally gamma rays, the most energetic of all
...

Light is a particular type of electromagnetic radiation that can be seen and
sensed by the human eye
...
2
...
The visible band of the electromagnetic spectrum spans the range from
approximately 0
...
79 ?m (red)
...
No color (or other component of the electromagnetic spectrum) ends abruptly, but rather each range blends smoothly into the next, as shown in Fig
...
10
...
A body that reflects light and is relatively balanced in all visible wavelengths appears white to the observer
...
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
...
The
only attribute of such light is its intensity, or amount
...
Chromatic light spans the electromagnetic energy spectrum from approximately 0
...
79 ?m, as noted previously
...
Radiance is the total amount of energy that
flows from the light source, and it is usually measured in watts (W)
...
For example, light emitted from a source operating in the far infrared region of the spectrum could have significant energy
(radiance), but an observer would hardly perceive it; its luminance would be
almost zero
...
1, brightness is a subjective descriptor of light perception that is practically impossible to measure
...
II

29-08-2001

13:35

Page 45

2
...

Continuing with the discussion of Fig
...
10, we note that at the short-wavelength end of the electromagnetic spectrum, we have gamma rays and hard
X-rays
...
3
...

Hard (high-energy) X-rays are used in industrial applications
...
The soft X-ray band transitions into
the far ultraviolet light region, which in turn blends with the visible spectrum at
longer wavelengths
...
” The part of the infrared band close to the
visible spectrum is called the near-infrared region
...
This latter region blends with the microwave
band
...
Finally, the radio
wave band encompasses television as well as AM and FM radio
...
Examples of images in most of the bands just discussed
are given in Section 1
...

In principle, if a sensor can be developed that is capable of detecting energy
radiated by a band of the electromagnetic spectrum, we can image events of interest in that band
...
For example, a water molecule has a diameter on
the order of 10–10 m
...
This limitation, along with
the physical properties of the sensor material, establishes the fundamental limits on the capability of imaging sensors, such as visible, infrared, and other sensors in use today
...
For example,
as discussed in Section 1
...
7, sound reflected from objects can be used to form
ultrasonic images
...


2
...
We enclose illumination and scene in quotes to emphasize the fact that they are considerably more
general than the familiar situation in which a visible light source illuminates a
common everyday 3-D (three-dimensional) scene
...
II

46

29-08-2001

13:35

Page 46

Chapter 2 I Digital Image Fundamentals

or X-ray energy
...

Similarly, the scene elements could be familiar objects, but they can just as easily be molecules, buried rock formations, or a human brain
...
Depending on the nature of the
source, illumination energy is reflected from, or transmitted through, objects
...
An example in the second category is when X-rays pass through a patient’s body for the
purpose of generating a diagnostic X-ray film
...
g
...
Electron microscopy
and some applications of gamma imaging use this approach
...
12 shows the three principal sensor arrangements used to transform
illumination energy into digital images
...
12

(a) Single imaging
sensor
...

(c) Array sensor
...
II

29-08-2001

13:35

Page 47

2
...
The output voltage waveform is the response of the sensor(s), and a digital quantity is obtained from each sensor by digitizing its response
...

Image digitizing is discussed in Section 2
...


2
...
1 Image Acquisition Using a Single Sensor
Figure 2
...
Perhaps the most familiar sensor of this type is the photodiode, which is constructed of silicon materials and whose output voltage waveform is proportional to light
...
For example, a green (pass) filter in front of a light sensor favors light in the green band of the color spectrum
...

In order to generate a 2-D image using a single sensor, there has to be relative displacements in both the x- and y-directions between the sensor and the
area to be imaged
...
13 shows an arrangement used in high-precision
scanning, where a film negative is mounted onto a drum whose mechanical rotation provides displacement in one dimension
...
Since mechanical motion can be controlled with high precision, this method is an inexpensive (but slow) way to obtain high-resolution images
...
These types of mechanical digitizers sometimes are referred to as
microdensitometers
...
Moving mirrors are used to control the outgoing beam
in a scanning pattern and to direct the reflected laser signal onto the sensor
...


Film

Rotation

Sensor

Linear motion
One image line out
per increment of rotation
and full linear displacement
of sensor from left to right
...
13 Combining a single sensor with motion to generate a 2-D image
...
II

48

29-08-2001

13:35

Page 48

Chapter 2 I Digital Image Fundamentals

2
...
2 Image Acquisition Using Sensor Strips
A geometry that is used much more frequently than single sensors consists of
an in-line arrangement of sensors in the form of a sensor strip, as Fig
...
12(b)
shows
...
Motion perpendicular to the strip provides imaging in the other direction, as shown in
Fig
...
14(a)
...
Sensing devices with 4000 or more in-line sensors are possible
...
One-dimensional imaging sensor strips that respond to various bands of the electromagnetic spectrum are mounted
perpendicular to the direction of flight
...
Lenses or other focusing schemes are used to project the area to be scanned onto the sensors
...
2
...
A rotating X-ray source provides illumination and the por-

One image line out per
increment of linear motion
Imaged area
Image
reconstruction

Linear motion

Cross-sectional images
of 3-D object

Sensor strip

3-D object
X-ray source

ea
L in

rm

o t io

n

Sensor ring

a b
FIGURE 2
...
(b) Image acquisition using a circular sensor strip
...
II

29-08-2001

13:35

Page 49

2
...
This is
the basis for medical and industrial computerized axial tomography (CAT)
imaging as indicated in Sections 1
...
3
...
It is important to note that the output of the sensors must be processed by reconstruction algorithms whose objective is to transform the sensed data into meaningful cross-sectional images
...
A 3-D digital volume consisting of
stacked images is generated as the object is moved in a direction perpendicular to the sensor ring
...
The illumination sources, sensors, and types of images are different, but
conceptually they are very similar to the basic imaging approach shown in
Fig
...
14(b)
...
3
...
12(c) shows individual sensors arranged in the form of a 2-D array
...
This is also the predominant arrangement found
in digital cameras
...
CCD sensors are used widely in digital cameras and other light sensing instruments
...
Noise reduction is achieved by letting the
sensor integrate the input light signal over minutes or even hours (we discuss
noise reduction by integration in Chapter 3)
...
2
...
Motion obviously is not necessary, as is the case with the sensor arrangements discussed in the preceding two sections
...
2
...

This figure shows the energy from an illumination source being reflected from
a scene element, but, as mentioned at the beginning of this section, the energy
also could be transmitted through the scene elements
...
2
...
If the illumination is light, the front end
of the imaging system is a lens, which projects the viewed scene onto the lens
focal plane, as Fig
...
15(d) shows
...
Digital and analog circuitry sweep these outputs and convert
them to a video signal, which is then digitized by another section of the imaging system
...
2
...
Conversion of an image into digital form is the topic of Section 2
...


49

GONZ02-034-074
...
15 An example of the digital image acquisition process
...
(b) An el-

ement of a scene
...
(d) Projection of the scene onto the image plane
...


2
...
4 A Simple Image Formation Model
As introduced in Section 1
...
The value or amplitude of f at spatial coordinates
(x, y) is a positive scalar quantity whose physical meaning is determined by
the source of the image
...
2
...
g
...
As a consequence, f(x, y) must be nonzero and
finite; that is,
0 ...
3-1)

The function f(x, y) may be characterized by two components: (1) the
amount of source illumination incident on the scene being viewed, and (2) the
amount of illumination reflected by the objects in the scene
...
The two functions combine as a product to
form f(x, y):

GONZ02-034-074
...
3 I Image Sensing and Acquisition

f(x, y)=i(x, y)r(x, y)

(2
...
3-3)

0 ...
3-4)

where

and

Equation (2
...
The nature of i(x, y) is determined by the illumination
source, and r(x, y) is determined by the characteristics of the imaged objects
...
In this
case, we would deal with a transmissivity instead of a reflectivity function, but the
limits would be the same as in Eq
...
3-4), and the image function formed would
be modeled as the product in Eq
...
3-2)
...
(2
...
3-4) are theoretical bounds
...
On a clear day, the sun may produce in excess of 90,000 lm?m2 of
illumination on the surface of the Earth
...
On a clear evening, a full moon yields about
0
...
The typical illumination level in a commercial office
is about 1000 lm?m2
...
01 for black velvet, 0
...
80 for flat-white wall paint, 0
...
93 for snow
...
2, we call the intensity of a monochrome image at any
coordinates Ax0 , y0 B the gray level (/) of the image at that point
...
3-5)

From Eqs
...
3-2) through (2
...
3-6)

In theory, the only requirement on Lmin is that it be positive, and on Lmax that it
be finite
...
Using the preceding average office illumination and range of reflectance values as guidelines, we may
expect Lmin≠10 and Lmax≠1000 to be typical limits for indoor values in the
absence of additional illumination
...
Common practice is to shift
this interval numerically to the interval [0, L-1], where /=0 is considered
black and /=L-1 is considered white on the gray scale
...


EXAMPLE 2
...


GONZ02-034-074
...
4

Image Sampling and Quantization

From the discussion in the preceding section, we see that there are numerous
ways to acquire images, but our objective in all is the same: to generate digital
images from sensed data
...
To create a digital image, we need to convert the
continuous sensed data into digital form
...


2
...
1 Basic Concepts in Sampling and Quantization
The basic idea behind sampling and quantization is illustrated in Fig
...
16
...
16(a) shows a continuous image, f(x, y), that we want to convert to digital form
...
To convert it to digital form, we have to sample the function in both coordinates and in amplitude
...
Digitizing the amplitude values is called quantization
...
2
...
2
...
The random variations are due to image noise
...
2
...
The
location of each sample is given by a vertical tick mark in the bottom part of the
figure
...
The set of these discrete locations gives the sampled function
...
In order to form a digital function, the gray-level values also must be converted (quantized) into discrete quantities
...
2
...
The vertical tick marks indicate the specific value assigned to each of the
eight gray levels
...
The assignment is made
depending on the vertical proximity of a sample to a vertical tick mark
...
2
...
Starting at the top of the image and carrying out this procedure
line by line produces a two-dimensional digital image
...
In practice, the
method of sampling is determined by the sensor arrangement used to generate
the image
...
2
...
However, sampling is accomplished by selecting
the number of individual mechanical increments at which we activate the sensor to collect data
...
However, practical limits are established by imperfections in the optics used to focus on the

GONZ02-034-074
...
4 I Image Sampling and Quantization

A

A

B

A

B

B

B

Quantization

A

Sampling

a b
c d
FIGURE 2
...
(a) Continuous image
...
(c) Sampling and quantization
...


sensor an illumination spot that is inconsistent with the fine resolution achievable with mechanical displacements
...
Mechanical
motion in the other direction can be controlled more accurately, but it makes
little sense to try to achieve sampling density in one direction that exceeds the

GONZ02-034-074
...
17 (a) Continuos image projected onto a sensor array
...


sampling limits established by the number of sensors in the other
...

When a sensing array is used for image acquisition, there is no motion and
the number of sensors in the array establishes the limits of sampling in both directions
...
Figure 2
...
Figure 2
...
Figure 2
...
Clearly, the quality of a digital image is determined to a large degree by
the number of samples and discrete gray levels used in sampling and quantization
...
4
...


2
...
2 Representing Digital Images
The result of sampling and quantization is a matrix of real numbers
...
Assume that an image
f(x, y) is sampled so that the resulting digital image has M rows and N columns
...
For notational clarity and convenience, we shall use integer values for these discrete coordinates
...

The next coordinate values along the first row of the image are represented as
(x, y)=(0, 1)
...
It does not mean that these are
the actual values of physical coordinates when the image was sampled
...
18 shows the coordinate convention used throughout this book
...
II

29-08-2001

13:35

Page 55

2
...



...
18

Coordinate
convention used
in this book to
represent digital
images
...


...



...


...

o
f(M - 1, N - 1)

(2
...
Each element of
this matrix array is called an image element, picture element, pixel, or pel
...

In some discussions, it is advantageous to use a more traditional matrix notation to denote a digital image and its elements:
a 0, 0
a
A = D 1, 0
o
a M - 1, 0

a 0, 1
a 1, 1
o
a M - 1, 1

p
p
p

a 0, N - 1
a 1, N - 1
T
...
4-2)

a M - 1, N - 1

Clearly, aij=f(x=i, y=j)=f(i, j), so Eqs
...
4-1) and (2
...

Expressing sampling and quantization in more formal mathematical terms
can be useful at times
...
The sampling process may be viewed as partitioning the xy plane into a grid, with the coordinates of the center of each grid
being a pair of elements from the Cartesian product Z2, which is the set of all
ordered pairs of elements Azi , zj B, with zi and zj being integers from Z
...
This functional assignment

GONZ02-034-074
...
If the gray levels also are
integers (as usually is the case in this and subsequent chapters), Z replaces R,
and a digital image then becomes a 2-D function whose coordinates and amplitude values are integers
...
There are no requirements on M and N, other than that they have to be positive integers
...


(2
...
Sometimes the range of values spanned by the gray
scale is called the dynamic range of an image, and we refer to images whose gray
levels span a significant portion of the gray scale as having a high dynamic range
...
Conversely, an image with low dynamic range tends to have a dull,
washed out gray look
...
3
...
4-4)

b=M*N*k
...


(2
...
1 shows the number of bits required to store square images with various values of N and k
...
When an image can have 2k gray levels, it is common practice to refer to the image as a “k-bit image
...
Note that storage requirements for 8-bit images of size 1024*1024 and higher are not insignificant
...
1
Number of storage bits for various values of N and k
...
II

29-08-2001

13:35

Page 57

2
...
4
...
Basically, spatial resolution is the smallest discernible detail in an image
...
A line pair consists of one such line and its adjacent space
...

A widely used definition of resolution is simply the smallest number of discernible
line pairs per unit distance; for example, 100 line pairs per millimeter
...
1
...
We have considerable discretion regarding
the number of samples used to generate a digital image, but this is not true for
the number of gray levels
...

The most common number is 8 bits, with 16 bits being used in some applications where enhancement of specific gray-level ranges is necessary
...

When an actual measure of physical resolution relating pixels and the level
of detail they resolve in the original scene are not necessary, it is not uncommon
to refer to an L-level digital image of size M*N as having a spatial resolution
of M*N pixels and a gray-level resolution of L levels
...


I Figure 2
...
The other images shown in Fig
...
19 are the results of

EXAMPLE 2
...

64

32

128
256

512

1024

FIGURE 2
...
The number of allowable

gray levels was kept at 256
...
II

58

29-08-2001

13:35

Page 58

Chapter 2 I Digital Image Fundamentals

subsampling the 1024*1024 image
...

For example, the 512*512 image was obtained by deleting every other row and
column from the 1024*1024 image
...
The
number of allowed gray levels was kept at 256
...
The simplest way to compare these
effects is to bring all the subsampled images up to size 1024*1024 by row and
column pixel replication
...
2
...
Figure 2
...
2
...

Compare Fig
...
20(a) with the 512*512 image in Fig
...
20(b) and note that
it is virtually impossible to tell these two images apart
...
20 (a) 1024*1024, 8-bit image
...
(c) through (f) 256*256, 128*128, 64*64, and 32*32 images resampled into
1024*1024 pixels
...
II

29-08-2001

13:36

Page 59

2
...
Next, the 256*256 image in Fig
...
20(c) shows a very slight fine
checkerboard pattern in the borders between flower petals and the black background
...
These effects are much more visible in the 128*128 image
in Fig
...
20(d), and they become pronounced in the 64*64 and 32*32 images
in Figs
...
20(e) and (f), respectively
...
Figure 2
...
Images such as this
are obtained by fixing the X-ray source in one position, thus producing a 2-D image

59

EXAMPLE 2
...


a b
c d
FIGURE 2
...

(b)–(d) Image
displayed in 128,
64, and 32 gray
levels, while
keeping the
spatial resolution
constant
...
II

60

29-08-2001

13:36

Page 60

Chapter 2 I Digital Image Fundamentals

in any desired direction
...

Figures 2
...
The 256-, 128-, and 64-level images are visually identical for all practical
purposes
...
2
...
This effect, caused by the use of an insufficient number of gray levels in smooth areas of a digital image, is called false contouring,
so called because the ridges resemble topographic contours in a map
...
2
...

e f
g h
FIGURE 2
...
(Original
courtesy of
Dr
...
Pickens,
Department of
Radiology &
Radiological
Sciences,
Vanderbilt
University
Medical Center
...
II

29-08-2001

13:36

Page 61

2
...

I
The results in Examples 2
...
3 illustrate the effects produced on image
quality by varying N and k independently
...

An early study by Huang [1965] attempted to quantify experimentally the effects on image quality produced by varying N and k simultaneously
...
Images similar to those shown in
Fig
...
22 were used
...

Sets of these three types of images were generated by varying N and k, and
observers were then asked to rank them according to their subjective quality
...
2
...
2
...
Each point in the Nk-plane represents an image having values of N and k equal to the coordinates of that point
...
It was found in the course of the experiments that the isopreference
curves tended to shift right and upward, but their shapes in each of the three
image categories were similar to those shown in Fig
...
23
...

The key point of interest in the context of the present discussion is that isopreference curves tend to become more vertical as the detail in the image increases
...
22 (a) Image with a low level of detail
...
(c) Image with a rel-

atively large amount of detail
...
)

GONZ02-034-074
...
23

Representative
isopreference
curves for the
three types of
images in
Fig
...
22
...
For example, the isopreference curve in
Fig
...
23 corresponding to the crowd is nearly vertical
...
2
...
It is also of interest to note that perceived quality in the other two
image categories remained the same in some intervals in which the spatial resolution was increased, but the number of gray levels actually decreased
...


2
...
4 Aliasing and Moiré Patterns
As discussed in more detail in Chapter 4, functions whose area under the curve
is finite can be represented in terms of sines and cosines of various frequencies
...
Suppose that this highest frequency is finite and that the function is of unlimited duration (these functions are called
band-limited functions)
...
If the function is undersampled, then a phenomenon called
aliasing corrupts the sampled image
...
These
are called aliased frequencies
...

As it turns out, except for a special case discussed in the following paragraph,
it is impossible to satisfy the sampling theorem in practice
...
We can model the process of convert-

GONZ02-034-074
...
4 I Image Sampling and Quantization

FIGURE 2
...


ing a function of unlimited duration into a function of finite duration simply by
multiplying the unlimited function by a “gating function” that is valued 1 for
some interval and 0 elsewhere
...
Thus, the very act of limiting the duration
of a band-limited function causes it to cease being band limited, which causes
it to violate the key condition of the sampling theorem
...
However, aliasing is always present in a sampled image
...

There is one special case of significant importance in which a function of infinite duration can be sampled over a finite interval without violating the sampling theorem
...
This special case allows us to illustrate vividly the Moiré effect
...
24 shows two identical periodic patterns of equally spaced vertical bars, rotated in opposite directions and then superimposed on
each other by multiplying the two images
...
2
...
A similar pattern can appear when images are digitized (e
...
, scanned) from a printed page, which consists of periodic ink dots
...


63

GONZ02-034-074
...
4
...
This topic is related to image sampling and quantization because zooming may be viewed as oversampling, while
shrinking may be viewed as undersampling
...

Zooming requires two steps: the creation of new pixel locations, and the
assignment of gray levels to those new locations
...
Suppose that we have an image of size 500*500 pixels and we want
to enlarge it 1
...
Conceptually, one of the easiest
ways to visualize zooming is laying an imaginary 750*750 grid over the original image
...
In order to perform gray-level
assignment for any point in the overlay, we look for the closest pixel in the
original image and assign its gray level to the new pixel in the grid
...
This method of gray-level assignment is called nearest neighbor interpolation
...
)
Pixel replication, the method used to generate Figs
...
20(b) through (f), is a
special case of nearest neighbor interpolation
...
For
instance, to double the size of an image, we can duplicate each column
...
Then, we duplicate each row
of the enlarged image to double the size in the vertical direction
...
Duplication is just done the required number of times to
achieve the desired size
...

Although nearest neighbor interpolation is fast, it has the undesirable feature
that it produces a checkerboard effect that is particularly objectionable at high
factors of magnification
...
20(e) and (f) are good examples of this
...
Let (x¿, y¿)
denote the coordinates of a point in the zoomed image (think of it as a point on
the grid described previously), and let v(x¿, y¿) denote the gray level assigned
to it
...
4-6)

where the four coefficients are determined from the four equations in four unknowns that can be written using the four nearest neighbors of point (x¿, y¿)
...
The
equivalent process of pixel replication is row-column deletion
...
We can use the zooming grid analogy to visualize the concept of shrinking by a noninteger factor, except

GONZ02-034-074
...
4 I Image Sampling and Quantization

65

that we now expand the grid to fit over the original image, do gray-level nearest
neighbor or bilinear interpolation, and then shrink the grid back to its original specified size
...
Blurring of digital images is discussed in Chapters 3 and 4
...
Using more neighbors
implies fitting the points with a more complex surface, which generally gives
smoother results
...
(1999)], but the extra computational burden seldom is justifiable for general-purpose digital image zooming and shrinking, where bilinear
interpolation generally is the method of choice
...
20(d) through (f) are shown again in the top row of Fig
...
25
...
The equivalent results using bilinear interpolation are shown in the second row of Fig
...
25
...
4:
Image zooming
using bilinear
interpolation
...
25 Top row: images zoomed from 128*128, 64*64, and 32*32 pixels to 1024*1024 pixels,

using nearest neighbor gray-level interpolation
...


GONZ02-034-074
...
The 32*32 to 1024*1024 image is blurry, but keep in mind that
this image was zoomed by a factor of 32
...
2
...
2
...

I

2
...
As mentioned before, an image is denoted by f(x, y)
...


2
...
1 Neighbors of a Pixel
A pixel p at coordinates (x, y) has four horizontal and vertical neighbors whose
coordinates are given by
(x+1, y), (x-1, y), (x, y+1), (x, y-1)
This set of pixels, called the 4-neighbors of p, is denoted by N4(p)
...

The four diagonal neighbors of p have coordinates
(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
and are denoted by ND(p)
...
As before, some of the points in
ND(p) and N8(p) fall outside the image if (x, y) is on the border of the image
...
5
...
To establish if two pixels are connected, it must be determined if they are neighbors and
if their gray levels satisfy a specified criterion of similarity (say, if their gray levels are equal)
...

Let V be the set of gray-level values used to define adjacency
...
In a grayscale image, the idea is the same, but set V typically contains more elements
...
We consider three types
of adjacency:
(a) 4-adjacency
...

(b) 8-adjacency
...


GONZ02-034-074
...
5 I Some Basic Relationships Between Pixels

(c) m-adjacency (mixed adjacency)
...

Mixed adjacency is a modification of 8-adjacency
...
For example, consider the pixel arrangement shown in Fig
...
26(a) for V={1}
...
2
...
This ambiguity is removed by using m-adjacency, as shown in
Fig
...
26(c)
...
It is understood here and in the following definitions
that adjacent means 4-, 8-, or m-adjacent
...
In this case, n is the length of the path
...
We can define 4-, 8-, or m-paths depending on the type of adjacency specified
...
2
...
2
...
Note the absence of ambiguity in the m-path
...
Two pixels p and q are said to
be connected in S if there exists a path between them consisting entirely of pixels in S
...
If it only has one connected component,
then set S is called a connected set
...
We call R a region of the image if R
is a connected set
...
If R happens to be an entire image (which we recall is a rectangular set of
pixels), then its boundary is defined as the set of pixels in the first and last rows
and columns of the image
...
Normally, when we refer to a region, we are
0

1

1

0

1

1

0

1

1

0

1

0

0

1

0

0

1

0

0

0

1

0

0

1

0

0

1

a b c
FIGURE 2
...


67

GONZ02-034-074
...

The concept of an edge is found frequently in discussions dealing with regions and boundaries
...
The boundary of a finite region forms a closed path (Problem 2
...
As discussed in detail in Chapter 10, edges are formed
from pixels with derivative values that exceed a preset threshold
...
It is possible to link edge points into edge segments, and sometimes these segments are linked in such a way that correspond to boundaries,
but this is not always the case
...
Depending on the type of connectivity and edge
operators used (we discuss these in Chapter 10), the edge extracted from a binary region will be the same as the region boundary
...
Conceptually, until we arrive at Chapter 10, it is helpful to think of edges as intensity
discontinuities and boundaries as closed paths
...
5
...


p=qB,

The Euclidean distance between p and q is defined as
1

De(p, q) = C (x - s)2 + (y - t)2 D 2
...
5-1)

For this distance measure, the pixels having a distance less than or equal to some
value r from (x, y) are the points contained in a disk of radius r centered at (x, y)
...


(2
...
For example, the pixels with
D4 distance ? 2 from (x, y) (the center point) form the following contours of
constant distance:

2

2
1
2

2
1
0
1
2

2
1
2

2

The pixels with D4=1 are the 4-neighbors of (x, y)
...
II

29-08-2001

13:36

Page 69

2
...


(2
...
For example, the pixels with D8 distance ? 2
from (x, y) (the center point) form the following contours of constant distance:
2
2
2
2
2

2
1
1
1
2

2
1
0
1
2

2
1
1
1
2

2
2
2
2
2

The pixels with D8=1 are the 8-neighbors of (x, y)
...
If we elect to consider m-adjacency, however, the
Dm distance between two points is defined as the shortest m-path between the
points
...
For instance, consider the following arrangement of pixels and assume that p, p2 , and
p4 have value 1 and that p1 and p3 can have a value of 0 or 1:
p1
p

p3
p2

p4

Suppose that we consider adjacency of pixels valued 1 (i
...
, V={1})
...
If p1 is 1, then p2 and p will no longer be m-adjacent (see the definition of
m-adjacency) and the length of the shortest m-path becomes 3 (the path goes
through the points pp1 p2 p4)
...
Finally, if both p1 and p3 are
1 the length of the shortest m-path between p and p4 is 4
...


2
...
4 Image Operations on a Pixel Basis
Numerous references are made in the following chapters to operations between
images, such as dividing one image by another
...
(2
...
As we know, matrix division is not defined
...
Thus, for example, if f and g are images, the first element
of the image formed by “dividing” f by g is simply the first pixel in f divided
by the first pixel in g; of course, the assumption is that none of the pixels in g
have value 0
...


69

GONZ02-034-074
...
6

Linear and Nonlinear Operations

Let H be an operator whose input and output are images
...


(2
...
For example, an operator whose function is to compute the sum of K images is a linear operator
...
An operator that fails the test of Eq
...
6-1) is by definition nonlinear
...
Although nonlinear operations sometimes offer better performance,
they are not always predictable, and for the most part are not well understood
theoretically
...
Our treatment of the human visual system, although brief, provides a basic idea
of the capabilities of the eye in perceiving pictorial information
...
Similarly, the image model developed in Section 2
...
4
is used in the Chapter 4 as the basis for an image enhancement technique called homomorphic filtering, and again in Chapter 10 to explain the effect of illumination on the
shape of image histograms
...
4 are the foundation for many of the digitizing phenomena likely to be encountered in practice
...
A detailed discussion of the frequency domain is given in Chapter 4
...

The concepts introduced in Section 2
...
As shown in the following chapter and in
Chapter 5, neighborhood processing methods are at the core of many image enhancement and restoration procedures
...
Finally, the concept of a linear
operator and the theoretical and conceptual power associated with it will be used extensively in the following three chapters
...
1 regarding the structure of the human
eye may be found in Atchison and Smith [2000], and Oyster [1999]
...
The book by Hubel [1988]
and the now classic book by Cornsweet [1970] also are of interest
...
II

29-08-2001

13:36

Page 71

I Problems

71

is a basic reference that discusses light in terms of electromagnetic theory
...

The area of image sensing is quite broad and very fast moving
...
The following are representative publications by the SPIE in
this area: Blouke et al
...

The image model presented in Section 2
...
4 is from Oppenheim, Schafer, and Stockham [1968]
...
For additional reading on image sampling and
some of its effects, such as aliasing, see Bracewell [1995]
...
4
...
The issue of reducing the number of samples and
gray levels in an image while minimizing the ensuing degradation is still of current interest, as exemplified by Papamarkos and Atsalakis [2000]
...
[1995], Umbaugh [1998], and
Lehmann et al
...
For further reading on the topics covered in Section 2
...
Additional reading on linear systems in the context of image processing may
be found in Castleman [1996]
...
1

Using the background information provided in Section 2
...
2 m away from the eyes
...
Assume further that the fovea can be modeled as a square array of dimensions 1
...
5 mm, and that the cones and
spaces between the cones are distributed uniformly throughout this array
...
2

When you enter a dark theater on a bright day, it takes an appreciable interval
of time before you can see well enough to find an empty seat
...
1 is at play in this situation?

# 2
...
2
...
Commercial alternating current in the United States
has a frequency of 60 Hz
...
4

You are hired to design the front end of an imaging system for studying the boundary shapes of cells, bacteria, viruses, and protein
...
The diameters of circles required to enclose individual specimens in each of these categories
are 50, 1, 0
...
01 ?m, respectively
...
Identify the camera as being a color camera, farinfrared camera, or whatever appropriate name corresponds to the illumination source
...
The site
also contains suggested
projects based on the material in this chapter
...
II

72

29-08-2001

13:36

Page 72

Chapter 2 I Digital Image Fundamentals
and cameras as requested in part (a)
...

2
...
5 m away
...

(Hint: Model the imaging process as in Fig
...
3, with the focal length of the camera lens substituting for the focal length of the eye
...
6

An automobile manufacturer is automating the placement of certain components
on the bumpers of a limited-edition line of sports cars
...
Models come in only four colors: blue, green, red,
and white
...
How would you
solve the problem of automatically determining the color of each car, keeping in
mind that cost is the most important consideration in your choice of components?

2
...


Assume for simplicity that the reflectance of the area is constant and equal to
1
...
If the resulting image is digitized with k bits of intensity resolution, and the eye can detect an abrupt change of eight shades of intensity between adjacent pixels, what value of k will cause visible false contouring?
2
...
9

Sketch the image in Problem 2
...

A common measure of transmission for digital data is the baud rate, defined as
the number of bits transmitted per second
...
Using these facts, answer the following:
(a) How many minutes would it take to transmit a 1024*1024 image with 256
gray levels using a 56K baud modem?
(b) What would the time be at 750K baud, a representative speed of a phone
DSL (digital subscriber line) connection?

2
...
The widthto-height aspect ratio of the images is 16 : 9
...
A company has designed an
image capture system that generates digital images from HDTV images
...
Each
pixel in the color image has 24 bits of intensity resolution, 8 pixels each for a red,
a green, and a blue image
...
How
many bits would it take to store a 2-hour HDTV program?

# 2
...
For
V={1}, determine whether these two subsets are (a) 4-adjacent, (b) 8-adjacent,
or (c) m-adjacent
...
II

29-08-2001

13:36

Page 73

I Problems
S1

S2

0

0

0

0

0

0

0

1

1

0

1

0

0

1

0

0

1

0

0

1

1

0

0

1

0

1

1

0

0

0

0

0

1

1

1

0

0

0

0

0

0

0

1

1

1

0

0

1

1

1

# 2
...


2
...


2
...
5
...


# 2
...

(a) Let V={0, 1} and compute the lengths of the shortest 4-, 8-, and m-path between p and q
...

(b) Repeat for V={1, 2}
...
16

1

0

1

2

(a) Give the condition(s) under which the D4 distance between two points p and
q is equal to the shortest 4-path between these points
...
17

Repeat Problem 2
...


# 2
...
Show that these are linear operators
...
19

The median, z, of a set of numbers is such that half the values in the set are below
z and the other half are above it
...
Show that an operator that computes the median of
a subimage area, S, is nonlinear
...
20

A plant produces a line of translucent miniature polymer squares
...
Inspection is semiautomated
...

The image completely fills a viewing screen measuring 80*80 mm
...
8 mm or larger,
as measured on the scale of the screen
...
She
also believes that success in this project will aid her climb up the corporate ladder
...
II

74

29-08-2001

13:36

Page 74

Chapter 2 I Digital Image Fundamentals
camera into an image processing system capable of detecting the blobs, measuring
their diameter, and activating the accept/reject buttons previously operated by an
inspector
...
The manager hires
you to help her specify the camera and lens system, but requires that you use offthe-shelf components
...
For the cameras, it means resolutions
of 512*512, 1024*1024, or 2048*2048 pixels
...
For this application, the cameras cost much more than the
lenses, so the problem should be solved with the lowest-resolution camera possible,
based on the choice of lenses
...

Use the same imaging geometry suggested in Problem 2
...


GONZ03-075-146
...

David Lindsay

Preview
The principal objective of enhancement is to process an image so that the result is more suitable than the original image for a specific application
...
Thus, for example, a
method that is quite useful for enhancing X-ray images may not necessarily be
the best approach for enhancing pictures of Mars transmitted by a space probe
...

Image enhancement approaches fall into two broad categories: spatial domain
methods and frequency domain methods
...
Frequency domain processing techniques are based
on modifying the Fourier transform of an image
...
Enhancement techniques based on various combinations of methods from these
two categories are not unusual
...

There is no general theory of image enhancement
...
II

76

29-08-2001

13:42

Page 76

Chapter 3 I Image Enhancement in the Spatial Domain

a particular method works
...
When the problem is one of processing images for machine perception, the evaluation task is somewhat easier
...

However, even in situations when a clear-cut criterion of performance can be
imposed on the problem, a certain amount of trial and error usually is required
before a particular image enhancement approach is selected
...
1

Background

As indicated previously, the term spatial domain refers to the aggregate of
pixels composing an image
...
Spatial domain processes will be denoted by the
expression
g(x, y) = T C f(x, y) D

(3
...
In addition, T can operate on a set of input images, such as performing the pixel-by-pixel sum of K
images for noise reduction, as discussed in Section 3
...
2
...
3
...

The center of the subimage is moved from pixel to pixel starting, say, at the top
left corner
...
The process utilizes only the pixels in the area of the image
spanned by the neighborhood
...
1 A

3*3
neighborhood
about a point
(x, y) in an image
...
II

29-08-2001

13:42

Page 77

3
...

The simplest form of T is when the neighborhood is of size 1*1 (that is, a
single pixel)
...
1-2)

where, for simplicity in notation, r and s are variables denoting, respectively,
the gray level of f(x, y) and g(x, y) at any point (x, y)
...
3
...
In this technique,
known as contrast stretching, the values of r below m are compressed by the
transformation function into a narrow range of s, toward black
...
In the limiting case shown in Fig
...
2(b),
T(r) produces a two-level (binary) image
...
Some fairly simple, yet powerful, processing approaches
can be formulated with gray-level transformations
...

Larger neighborhoods allow considerably more flexibility
...
One of the principal approaches in
this formulation is based on the use of so-called masks (also referred to as filters,
kernels, templates, or windows)
...
3
...
Enhancement techniques based on this type of approach often are referred to as
mask processing or filtering
...
5
...
2 Gray-

T(r)

Dark

Dark

T(r)

level
transformation
functions for
contrast
enhancement
...
II

78

29-08-2001

13:42

Page 78

Chapter 3 I Image Enhancement in the Spatial Domain

3
...
These are among the simplest of all image enhancement
techniques
...
As indicated in the previous section, these values are related
by an expression of the form s=T(r), where T is a transformation that maps a
pixel value r into a pixel value s
...
For an 8-bit environment, a lookup table containing the values of T will have 256 entries
...
3
...
The
identity function is the trivial case in which output intensities are identical to
input intensities
...


3
...
1 Image Negatives
The negative of an image with gray levels in the range [0, L-1] is obtained by using
the negative transformation shown in Fig
...
3, which is given by the expression
s = L - 1 - r
...


L-1
Negative
nth root
3L/4

Output gray level, s

FIGURE 3
...
2-1)

Log
nth power
L/2

L/4

Inverse log

Identity
0

0

L/4

L/2
Input gray level, r

3L/4

L-1

GONZ03-075-146
...
2 I Some Basic Gray Level Transformations

79

a b
FIGURE 3
...

(b) Negative
image obtained
using the negative
transformation in
Eq
...
2-1)
...
E
...
)

Reversing the intensity levels of an image in this manner produces the equivalent of a photographic negative
...
An example is shown in
Fig
...
4
...
In
spite of the fact that the visual content is the same in both images, note how
much easier it is to analyze the breast tissue in the negative image in this particular case
...
2
...
3
...
2-2)

where c is a constant, and it is assumed that r ? 0
...
3
...
The opposite is true
of higher values of input levels
...
The opposite is true of the inverse log transformation
...
3
...
In fact,
the power-law transformations discussed in the next section are much more
versatile for this purpose than the log transformation
...
A classic illustration of an application
in which pixel values have a large dynamic range is the Fourier spectrum, which
will be discussed in Chapter 4
...
It is not unusual to encounter spectrum values

GONZ03-075-146
...
5

(a) Fourier
spectrum
...
(3
...


that range from 0 to 106 or higher
...
The net effect
is that a significant degree of detail will be lost in the display of a typical Fourier spectrum
...
3
...
5*106
...
The effect of this
dominance is illustrated vividly by the relatively small area of the image in
Fig
...
5(a) that is not perceived as black
...
(3
...
2, a more manageable
number
...
5(b) shows the result of scaling this new range linearly and displaying the spectrum in the same 8-bit display
...
Most of the Fourier spectra seen in image processing publications have
been scaled in just this manner
...
2
...
2-3)

where c and g are positive constants
...
(3
...
However, offsets typically are an issue of display calibration and
as a result they are normally ignored in Eq
...
2-3)
...
3
...
As in the case of the log transformation,
power-law curves with fractional values of g map a narrow range of dark input
values into a wider range of output values, with the opposite being true for high-

GONZ03-075-146
...
2 I Some Basic Gray Level Transformations

FIGURE 3
...


g=0
...
10

Output gray level, s

3L/4

g=0
...
40
g=0
...
5
g=2
...
0
g=10
...
0

0

81

0

L/4

L/2
Input gray level, r

3L/4

L-1

er values of input levels
...
As expected, we see in Fig
...
6 that curves generated with values of g>1 have exactly the opposite effect as those generated with values of g<1
...
(3
...

A variety of devices used for image capture, printing, and display respond according to a power law
...
(3
...
The process
used to correct this power-law response phenomena is called gamma correction
...
8 to 2
...
With reference to the curve for g=2
...
3
...
This effect is illustrated in Fig
...
7
...
7(a) shows a simple
gray-scale linear wedge input into a CRT monitor
...
3
...
Gamma correction in this case is straightforward
...
5 = r 0
...
The result is shown in Fig
...
7(c)
...
3
...
A similar analysis would

GONZ03-075-146
...
7

(a) Linear-wedge
gray-scale image
...

(c) Gammacorrected wedge
...


Monitor

Gamma
correction
Image as viewed on monitor

Monitor

EXAMPLE 3
...


apply to other imaging devices such as scanners and printers
...

Gamma correction is important if displaying an image accurately on a computer screen is of concern
...
Trying to reproduce colors
accurately also requires some knowledge of gamma correction because varying
the value of gamma correction changes not only the brightness, but also the ratios of red to green to blue
...
It is not unusual that images created for a popular Web site will be viewed by millions of people, the majority of whom will
have different monitors and/or monitor settings
...
Also, current image standards do not
contain the value of gamma with which an image was created, thus complicating the issue further
...


I In addition to gamma correction, power-law transformations are useful for
general-purpose contrast manipulation
...
8(a) shows a magnetic resonance (MR) image of an upper thoracic human spine with a fracture dislocation

GONZ03-075-146
...
2 I Some Basic Gray Level Transformations

83

a b
c d
FIGURE 3
...

(b)–(d) Results of
applying the
transformation in
Eq
...
2-3) with
c=1 and
g=0
...
4, and
0
...

(Original image
for this example
courtesy of Dr
...
Pickens,
Department of
Radiology and
Radiological
Sciences,
Vanderbilt
University
Medical Center
...
The fracture is visible near the vertical center of
the spine, approximately one-fourth of the way down from the top of the picture
...
This can be accomplished with a power-law transformation with
a fractional exponent
...
3
...
(3
...

The values of gamma corresponding to images (b) through (d) are 0
...
4, and
0
...
We note that, as gamma decreased from 0
...
4, more detail became visible
...
II

84

29-08-2001

13:42

Page 84

Chapter 3 I Image Enhancement in the Spatial Domain

to 0
...
By comparing all results, we see that the
best enhancement in terms of contrast and discernable detail was obtained with
g=0
...
A value of g=0
...

I
EXAMPLE 3
...


a b
c d
FIGURE 3
...

(b)–(d) Results of
applying the
transformation in
Eq
...
2-3) with
c=1 and
g=3
...
0, and
5
...

(Original image
for this example
courtesy of
NASA
...
9(a) shows the opposite problem of Fig
...
8(a)
...
This can be accomplished with Eq
...
2-3) using values of g
greater than 1
...
3
...
0, 4
...
0
are shown in Figs
...
9(b) through (d)
...
0 and 4
...
The result obtained with g=5
...
The dark region to the left of the main road
in the upper left quadrant is an example of such an area
...
II

29-08-2001

13:42

Page 85

3
...
2
...
The principal advantage of piecewise
linear functions over the types of functions we have discussed thus far is that the
form of piecewise functions can be arbitrarily complex
...
The principal disadvantage of piecewise functions is that their specification requires considerably more user input
...
Low-contrast images can result from poor illumination, lack of dynamic range in the imaging sensor, or even wrong setting of a lens aperture
during image acquisition
...

Figure 3
...

The locations of points Ar1 , s1 B and Ar2 , s2 B control the shape of the transformation
a b
c d

L-1

FIGURE 3
...

(a) Form of
transformation
function
...
(c) Result
of contrast
stretching
...

(Original image
courtesy of
Dr
...
)

GONZ03-075-146
...
If r1=s1 and r2=s2 , the transformation is a linear function that produces no changes in gray levels
...
3
...
Intermediate values of Ar1 , s1 B and Ar2 , s2 B produce various degrees
of spread in the gray levels of the output image, thus affecting its contrast
...
This condition preserves the order of gray levels, thus
preventing the creation of intensity artifacts in the processed image
...
10(b) shows an 8-bit image with low contrast
...
3
...
Thus, the transformation function stretched
the levels linearly from their original range to the full range [0, L-1]
...
3
...
The original image
on which these results are based is a scanning electron microscope image of
pollen, magnified approximately 700 times
...
Applications include enhancing features such as masses of water in satellite imagery
and enhancing flaws in X-ray images
...
One approach is to display a high value for all gray levels in the range of interest and a low value for
all other gray levels
...
3
...
The second approach, based on the transformation shown in Fig
...
11(b),
brightens the desired range of gray levels but preserves the background and
gray-level tonalities in the image
...
11(c) shows a gray-scale image, and
Fig
...
11(d) shows the result of using the transformation in Fig
...
11(a)
...
3
...


Bit-plane slicing
Instead of highlighting gray-level ranges, highlighting the contribution made to
total image appearance by specific bits might be desired
...
Imagine that the image is composed
of eight 1-bit planes, ranging from bit-plane 0 for the least significant bit to bitplane 7 for the most significant bit
...
Figure 3
...
3
...
3
...
Note that the
higher-order bits (especially the top four) contain the majority of the visually significant data
...

Separating a digital image into its bit planes is useful for analyzing the relative
importance played by each bit of the image, a process that aids in determining
the adequacy of the number of bits used to quantize each pixel
...


GONZ03-075-146
...
2 I Some Basic Gray Level Transformations
L-1

87

a b
c d

L-1

FIGURE 3
...

(b) This
transformation
highlights range
[A, B] but
preserves all
other levels
...

(d) Result of
using the
transformation
in (a)
...
The binary image
for bit-plane 7 in Fig
...
14 was obtained in just this manner
...
3) to obtain the gray-level transformation functions that would
yield the other bit planes
...
12

Bit-plane
representation of
an 8-bit image
...
II

88

29-08-2001

13:42

Page 88

Chapter 3 I Image Enhancement in the Spatial Domain

FIGURE 3
...
(A fractal is an image generated from mathematical

expressions)
...
Melissa D
...
)

3
...


Histogram Processing

The histogram of a digital image with gray levels in the range [0, L-1] is a discrete function hArk B=nk , where rk is the kth gray level and nk is the number
of pixels in the image having gray level rk
...
Thus, a normalized histogram is given by pArk B=nk?n,
for k=0, 1, p , L-1
...
Note that the sum of all components of a
normalized histogram is equal to 1
...

Histogram manipulation can be used effectively for image enhancement, as
shown in this section
...
Histograms are simple to calculate in software and also lend
themselves to economic hardware implementations, thus making them a popular tool for real-time image processing
...
3
...
3
...
The
right side of the figure shows the histograms corresponding to these images
...

The vertical axis corresponds to values of hArk B=nk or pArk B=nk?n if the
values are normalized
...


GONZ03-075-146
...
3 I Histogram Processing

FIGURE 3
...
3
...
The number at the bottom,

right of each image identifies the bit plane
...
Similarly, the components of
the histogram of the bright image are biased toward the high side of the gray
scale
...
For a monochrome image this
implies a dull, washed-out gray look
...
Intuitively, it is reasonable to
conclude that an image whose pixels tend to occupy the entire range of possible gray levels and, in addition, tend to be distributed uniformly, will have an appearance of high contrast and will exhibit a large variety of gray tones
...
It will be shown shortly that it is possible to develop a transformation function that can automatically achieve this effect, based only on
information available in the histogram of the input image
...
II

90

29-08-2001

13:42

Page 90

Chapter 3 I Image Enhancement in the Spatial Domain

Dark image

Bright image

Low-contrast image

High-contrast image

a b
FIGURE 3
...
(Original image courtesy of Dr
...
)

GONZ03-075-146
...
3 I Histogram Processing

91

3
...
1 Histogram Equalization
Consider for a moment continuous functions, and let the variable r represent the
gray levels of the image to be enhanced
...
Later, we consider a discrete formulation and allow pixel values to be in the interval [0, L-1]
...
3-1)

that produce a level s for every pixel value r in the original image
...

The requirement in (a) that T(r) be single valued is needed to guarantee that the
inverse transformation will exist, and the monotonicity condition preserves
the increasing order from black to white in the output image
...
While this may be a desirable effect in some cases, that is
not what we are after in the present discussion
...
Figure 3
...
The inverse transformation from s back to r is denoted
r = T-1(s)

(3
...


It can be shown by example (Problem 3
...

FIGURE 3
...


t

sk=T(rk)

T(r)

0

rk

1

r

GONZ03-075-146
...
One of the most fundamental descriptors of a random variable is
its probability density function (PDF)
...
A basic result
from an elementary probability theory is that, if pr(r) and T(r) are known and
T-1(s) satisfies condition (a), then the probability density function ps(s) of the
transformed variable s can be obtained using a rather simple formula:
ps(s) = pr(r) 2

dr
2
...
3-3)

Thus, the probability density function of the transformed variable, s, is determined by the gray-level PDF of the input image and by the chosen transformation function
...
3-4)

where w is a dummy variable of integration
...
(3
...

Since probability density functions are always positive, and recalling that the integral of a function is the area under the function, it follows that this transformation function is single valued and monotonically increasing, and, therefore,
satisfies condition (a)
...

Given transformation function T(r), we find ps(s) by applying Eq
...
3-3)
...

In other words,
dT(r)
ds
=
dr
dr
r
d
p (w) dw d
c
dr 3 r
0
= pr(r)
...
3-5)

Substituting this result for dr?ds into Eq
...
3-3), and keeping in mind that all
probability values are positive, yields
ps(s) = pr(r) 2
= pr(r) 2

= 1

dr
2
ds

1
2
pr(r)

0 ? s ? 1
...
3-6)

GONZ03-075-146
...
3 I Histogram Processing

Because ps(s) is a probability density function, it follows that it must be zero outside the interval [0, 1] in this case because its integral over all values of s must
equal 1
...
(3
...
Simply stated, we have demonstrated that performing
the transformation function given in Eq
...
3-4) yields a random variable s characterized by a uniform probability density function
...
(3
...
(3
...

For discrete values we deal with probabilities and summations instead of
probability density functions and integrals
...
3-7)

where, as noted at the beginning of this section, n is the total number of pixels
in the image, nk is the number of pixels that have gray level rk , and L is the total
number of possible gray levels in the image
...
(3
...
3-8)

j=0

k = 0, 1, 2, p , L - 1
...
(3
...
As indicated earlier, a plot of pr Ark B versus rk is called a histogram
...
(3
...
It is not difficult to show (Problem 3
...
(3
...

Unlike its continuos counterpart, it cannot be proved in general that this discrete transformation will produce the discrete equivalent of a uniform probability density function, which would be a uniform histogram
...
(3
...

We discussed earlier in this section the many advantages of having gray-level
values that cover the entire gray scale
...
” In other words, given an image, the process of histogram
equalization consists simply of implementing Eq
...
3-8), which is based on information that can be extracted directly from the given image, without the need
for further parameter specifications
...

The inverse transformation from s back to r is denoted by
rk = T-1 Ask B

k = 0, 1, 2, p , L - 1

(3
...
II

94

29-08-2001

13:42

Page 94

Chapter 3 I Image Enhancement in the Spatial Domain

It can be shown (Problem 3
...
(3
...
Although
the inverse transformation is not used in histogram equalization, it plays a central role in the histogram-matching scheme developed in the next section
...

EXAMPLE 3
...


I Figure 3
...
3
...
3
...
The first
three results (top to bottom) show significant improvement
...
The transformation functions used to generate the images in
Fig
...
17(b) are shown in Fig
...
18
...
3
...
(3
...
Note that
transformation (4) has a basic linear shape, again indicating that the gray levels in the fourth input image are nearly uniformly distributed
...

The histograms of the equalized images are shown in Fig
...
17(c)
...
This is not unexpected
because the difference between the images in the left column is simply one of
contrast, not of content
...
Given the significant contrast differences of the images in the left column,
this example illustrates the power of histogram equalization as an adaptive enhancement tool
...
3
...
When automatic enhancement is desired, this is
a good approach because the results from this technique are predictable and the
method is simple to implement
...
In particular, it is useful sometimes to be able to specify the
shape of the histogram that we wish the processed image to have
...


Development of the method
Let us return for a moment to continuous gray levels r and z (considered
continuous random variables), and let pr(r) and pz(z) denote their corresponding continuos probability density functions
...
II

29-08-2001

13:42

Page 95

3
...
17 (a) Images from Fig
...
15
...
(c) Cor-

responding histograms
...
II

96

29-08-2001

13:42

Page 96

Chapter 3 I Image Enhancement in the Spatial Domain

FIGURE 3
...
3
...
(3
...


1
...
75
(4)

(1)
0
...
25

0

0

128

64

192

255

the gray levels of the input and output (processed) images, respectively
...

Let s be a random variable with the property
s = T(r) =

0
3

r

pr(w) dw

(3
...
We recognize this expression as the
continuos version of histogram equalization given in Eq
...
3-4)
...
3-11)

where t is a dummy variable of integration
...


(3
...
(3
...
Similarly, the transformation function G(z)
can be obtained using Eq
...
3-11) because pz(z) is given
...
(3
...
3-12) show that an image with a specified probability density function can be obtained from an input image by using
the following procedure: (1) Obtain the transformation function T(r) using
Eq
...
3-10)
...
(3
...

(3) Obtain the inverse transformation function G–1
...
II

29-08-2001

13:42

Page 97

3
...
(3
...
The result of this procedure will be an image whose gray levels, z, have the specified probability density function pz(z)
...
Fortunately, this problem is simplified considerably in the case of discrete
values
...
In spite of this, however,
some very useful results can be obtained even with crude approximations
...
(3
...
(3
...
3-13)

k = 0, 1, 2, p , L - 1

where n is the total number of pixels in the image, nj is the number of pixels with
gray level rj , and L is the number of discrete gray levels
...
(3
...


(3
...

The variable vk was added here for clarity in the discussion that follows
...
(3
...
3-15)

or, from Eq
...
3-13),
zk = G -1 Ask B

k = 0, 1, 2, p , L - 1
...
3-16)

Equations (3
...
3-16) are the foundation for implementing
histogram matching for digital images
...
3-13) is a mapping from the
levels in the original image into corresponding levels sk based on the histogram
of the original image, which we compute from the pixels in the image
...
3-14) computes a transformation function G from the given histogram pz(z)
...
(3
...
(3
...
The first two equations
can be implemented easily because all the quantities are known
...
(3
...


Implementation
We start by noting the following: (1) Each set of gray levels Erj F, Esj F, and Ezj F,
j=0, 1, 2, p , L-1, is a one-dimensional array of dimension L*1
...
II

98

29-08-2001

13:42

Page 98

Chapter 3 I Image Enhancement in the Spatial Domain

pixel value and these arrays
...
(4) We need to be concerned only with integer pixel values
...
This implies that we now
work with gray level values in the interval [0, L-1] instead of the normalized
interval [0, 1] that we used before to simplify the development of histogram
processing techniques
...
3
...
3
...
Figure 3
...
The first gray level in
the image, r1 , maps to s1 ; the second gray level, r2 , maps to s2 ; the kth level rk
maps to sk ; and so on (the important point here is the ordered correspondence
between these values)
...
(3
...
This process
is particularly easy because we are dealing with integers
...
If we
stopped here and mapped the value of each pixel of an input image by the
a b
c
FIGURE 3
...

(b) Mapping of zq
to its
corresponding
value vq via G(z)
...


v

s
1

1

sk

G(z)
vq

T(r)

0

0

rk

r

0

L-1

z
0 zq

L-1

v
1
sk

0

G(z)

0

zk

L-1

z

GONZ03-075-146
...
3 I Histogram Processing

method just described, the output would be a histogram-equalized image, according to Eq
...
3-8)
...

Figure 3
...
(3
...
For any zq , this transformation
function yields a corresponding value vq
...
3
...
Conversely, given any value vq , we would find the corresponding value zq from G–1
...

However, we know from the definition in Eq
...
3-14) that v=s for corresponding subscripts, so we can use exactly this process to find the zk corresponding to any value sk that we computed previously from the equation
sk=TArk B
...
3
...

Since we really do not have the z’s (recall that finding these values is precisely the objective of histogram matching), we must resort to some sort of iterative scheme to find z from s
...
Basically, because vk=sk , we have from
Eq
...
3-14) that the z’s for which we are looking must satisfy the equation
GAzk B=sk , or AGAzk B-sk B=0
...
This is the same thing as Eq
...
3-16), except that we
do not have to find the inverse of G because we are going to iterate on z
...


(3
...
3
...
(3
...
Repeating this process for all values of k
would yield all the required mappings from s to z, which constitutes the imˆ
plementation of Eq
...
3-16)
...
Thus,
ˆ
for k=k+1, we would start with z = zk and increment in integer values
from there
...
Obtain the histogram of the given image
...
Use Eq
...
3-13) to precompute a mapped level sk for each level rk
...
Obtain the transformation function G from the given pz(z) using
Eq
...
3-14)
...
Precompute zk for each value of sk using the iterative scheme defined in connection with Eq
...
3-17)
...
For each pixel in the original image, if the value of that pixel is rk , map this
value to its corresponding level sk ; then map level sk into the final level zk
...


99

GONZ03-075-146
...
The first mapping is nothing more than histogram equalization
...

Finally, we note that, even in the discrete case, we need to be concerned about
G–1 satisfying conditions (a) and (b) of the previous section
...
9) that the only way to guarantee that G–1 be single valued and
monotonic is to require that G be strictly monotonic (i
...
, always increasing),
which means simply that none of the values of the specified histogram pz Azi B in
Eq
...
3-14) can be zero
...
20(a) shows an image of the Mars moon, Phobos, taken by NASA’s
Mars Global Surveyor
...
20(b) shows the histogram of Fig
...
20(a)
...
At first
glance, one might conclude that histogram equalization would be a good approach to enhance this image, so that details in the dark areas become more
visible
...

Figure 3
...
(3
...
3-13)] obtained from the histogram shown in Fig
...
20(b)
...
This is caused by the large concentration of pixels in
the input histogram having levels very near 0
...
Because numerous pixels in the input
image have levels precisely in this interval, we would expect the result to be an

7
...
4:
Comparison
between
histogram
equalization and
histogram
matching
...
25
3
...
75
0
0

64

128
Gray level

192

255

a b
FIGURE 3
...
(b) Histogram
...
)

GONZ03-075-146
...
3 I Histogram Processing

a b
c

Output gray levels

255

FIGURE 3
...
00
5
...
50
1
...
As shown in Fig
...
21(b), this is indeed the case
...
3
...
Note how all
the gray levels are biased toward the upper one-half of the gray scale
...
3
...
Figure 3
...
Sampling this function into 256
equally spaced discrete values produced the desired specified histogram
...
(3
...
3
...
Similarly, the inverse transformation
G–1(s) from Eq
...
3-16) [obtained using the iterative technique discussed in
connection with Eq
...
3-17)] is labeled transformation (2) in Fig
...
22(b)
...
3
...
3
...
The improvement of the
histogram-specified image over the result obtained by histogram equalization is
evident by comparing these two images
...
The histogram of Fig
...
22(c) is shown in
Fig
...
22(d)
...

I

(a) Transformation
function for
histogram
equalization
...

(c) Histogram
of (b)
...
II

13:42

Page 102

Chapter 3 I Image Enhancement in the Spatial Domain

(a) Specified
histogram
...
(3
...
(3
...

(c) Enhanced
image using
mappings from
curve (2)
...


Number of pixels (*104)

FIGURE 3
...
00
5
...
50
1
...
00
Number of pixels (*104)

102

29-08-2001

5
...
50
1
...

One can use guidelines learned from the problem at hand, just as we did in the
preceding example
...
In cases such as these, histogram specification becomes a
straightforward process
...


GONZ03-075-146
...
3 I Histogram Processing

103

3
...
3 Local Enhancement
The histogram processing methods discussed in the previous two sections are
global, in the sense that pixels are modified by a transformation function based
on the gray-level content of an entire image
...
The number of pixels in these areas
may have negligible influence on the computation of a global transformation
whose shape does not necessarily guarantee the desired local enhancement
...

Although processing methods based on neighborhoods are the topic of Section
3
...
The reader will have no difficulty in following the discussion
...
The procedure is to define a square or rectangular
neighborhood and move the center of this area from pixel to pixel
...
This function is finally used to map the gray level of the pixel centered in the neighborhood
...
Since only one new
row or column of the neighborhood changes during a pixel-to-pixel translation
of the region, updating the histogram obtained in the previous location with
the new data introduced at each motion step is possible (Problem 3
...
This approach has obvious advantages over repeatedly computing the histogram over
all pixels in the neighborhood region each time the region is moved one pixel
location
...


I Figure 3
...
6
...
Figure 3
...
As is often the case when this technique
is applied to smooth, noisy areas, Fig
...
23(b) shows considerable enhancement
of the noise, with a slight increase in contrast
...
However, local histogram equalization
using a 7*7 neighborhood revealed the presence of small squares inside the
larger dark squares
...
Note also the finer noise texture in Fig
...
23(c), a result of
I
local processing using relatively small neighborhoods
...
3
...
Let r
denote a discrete random variable representing discrete gray-levels in the range

EXAMPLE 3
...


GONZ03-075-146
...
23 (a) Original image
...
(c) Result of local histogram

equalization using a 7*7 neighborhood about each pixel
...
As indicated previously in this section, we may
view pAri B as an estimate of the probability of occurrence of gray level ri
...
3-18)

i=0

where m is the mean value of r (its average gray level):
m = a ri pAri B
...
3-19)

i=0

It follows from Eqs
...
3-18) and (3
...
The second
moment is given by
m2(r) = a Ari - mB pAri B
...
3-20)

i=0

We recognize this expression as the variance of r, which is denoted conventionally by s2(r)
...
We will revisit moments in Chapter 11 in connection with image
description
...

We consider two uses of the mean and variance for enhancement purposes
...
A much
more powerful use of these two measures is in local enhancement, where the
local mean and variance are used as the basis for making changes that depend
on image characteristics in a predefined region about each pixel in the image
...
II

29-08-2001

13:42

Page 105

3
...
From Eq
...
3-19)
the mean value mSxy of the pixels in Sxy can be computed using the expression
mSxy =

a rs, t pArs, t B

(3
...
Similarly, from Eq
...
3-20), the gray-level variance of the pixels in region Sxy is given by
s2 xy =
S

a C rs, t - mSxy D pArs, t B
...
3-22)

(s, t)HSxy

The local mean is a measure of average gray level in neighborhood Sxy , and the
variance (or standard deviation) is a measure of contrast in that neighborhood
...
We illustrate these characteristics by means
of an example
...
24 shows an SEM (scanning electron microscope) image of a tungsten filament wrapped around a support
...
There is another filament structure on the right side of the image, but it is much darker and its size
and other features are not as easily discernable
...

In this particular case, the problem is to enhance dark areas while leaving the
light area as unchanged as possible since it does note require enhancement
...
A measure of whether an area
is relatively light or dark at a point (x, y) is to compare the local average gray
level mSxy to the average image gray level, called the global mean and denoted
MG
...

Thus, we have the first element of our enhancement scheme: We will consider
the pixel at a point (x, y) as a candidate for processing if mSxy ? k0 MG , where
k0 is a positive constant with value less than 1
...
Since we are interested in enhancing areas that have low contrast, we also need a measure to determine
whether the contrast of an area makes it a candidate for enhancement
...
The value of this constant will be greater than 1
...
0 for dark areas
...
6:
Enhancement
based on local
statistics
...
II

106

29-08-2001

13:42

Page 106

Chapter 3 I Image Enhancement in the Spatial Domain

the lowest values of contrast we are willing to accept, otherwise the procedure
would attempt to enhance even constant areas, whose standard deviation is
zero
...
A pixel at (x, y) that meets all the conditions for local enhancement is processed simply by multiplying it by a specified
constant, E, to increase (or decrease) the value of its gray level relative to the
rest of the image
...

A summary of the enhancement method is as follows
...
Then
g(x, y) = b

E ? f(x, y)
f(x, y)

if mSxy ? k0 MG
otherwise

AND

k1 DG ? sSxy ? k2 DG

where, as indicated previously, E, k0 , k1 , and k2 are specified parameters; MG is
the global mean of the input image; and DG is its global standard deviation
...
In this
case, the following values were selected: E=4
...
4, k1=0
...
4
...
0 for E was chosen so that, when it was
multiplied by the levels in the areas being enhanced (which are dark), the result would still tend toward the dark end of the scale, and thus preserve the general visual balance of the image
...
A similar analysis led to the choice of values for k1 and k2
...
24 SEM

image of a
tungsten filament
and support,
magnified
approximately
130 *
...
Michael
Shaffer,
Department of
Geological
Sciences,
University of
Oregon, Eugene)
...
II

29-08-2001

13:42

Page 107

3
...
25 (a) Image formed from all local means obtained from Fig
...
24 using Eq
...
3-21)
...
3
...
(3
...
(c) Image formed from
all multiplication constants used to produce the enhanced image shown in Fig
...
26
...
Finally, the choice of size for the local area should be as small as possible
in order to preserve detail and keep the computational burden as low as possible
...

Figure 3
...
Since the value
of mSxy for each (x, y) is the average of the neighboring pixels in a 3*3 area
centered at (x, y), we expect the result to be similar to the original image, but
FIGURE 3
...
Compare
with Fig
...
24
...


GONZ03-075-146
...
This indeed is the case in Fig
...
25(a)
...
25(b) shows in
image formed using all the values of sSxy
...

Since the values are either 1 or E, the image is binary, as shown in Fig
...
25(c)
...
Thus, any light point in
Fig
...
25(c) signifies a coordinate pair (x, y) at which the enhancement procedure multiplied f(x, y) by E to produce an enhanced pixel
...

The enhanced image obtained with the method just described is shown in
Fig
...
26
...
3
...
It is worthwhile to point out that the unenhanced portions of the image (the light areas) were
left intact for the most part
...
These are undesirable artifacts
created by the enhancement technique
...

Introduction of artifacts is a definite drawback of a method such as the one just described because of the nonlinear way in which they process an image
...

I
It is not difficult to imagine the numerous ways in which the example just
given could be adapted or extended to other situations in which local enhancement is applicable
...
4

Enhancement Using Arithmetic/Logic Operations

Arithmetic/logic operations involving images are performed on a pixel-by-pixel
basis between two or more images (this excludes the logic operation NOT, which
is performed on a single image)
...
Depending
on the hardware and/or software being used, the actual mechanics of implementing arithmetic/logic operations can be done sequentially, one pixel at a
time, or in parallel, where all operations are performed simultaneously
...
We need only
be concerned with the ability to implement the AND, OR, and NOT logic operators because these three operators are functionally complete
...
When dealing with logic operations on gray-scale images, pixel values
are processed as strings of binary numbers
...
Similarly, aORb is 0 when both variables are 0; otherwise the result is 1
...


GONZ03-075-146
...
4 I Enhancement Using Arithmetic/Logic Operations

109

a b c
d e f
FIGURE 3
...
(b) AND
image mask
...
(d) Original
image
...

(f) Result of
operation OR on
images (d) and
(e)
...
Intermediate values are processed the same way, changing all 1’s to 0’s and vice versa
...
(3
...
The AND and OR operations are used for masking; that is, for selecting subimages in an image, as illustrated in Fig
...
27
...
Masking sometimes is referred to as region of
interest (ROI) processing
...
This is done to highlight that area and differentiate it from the rest of the image
...

Of the four arithmetic operations, subtraction and addition (in that order) are
the most useful for image enhancement
...
Aside from
the obvious operation of multiplying an image by a constant to increase its average gray level, image multiplication finds use in enhancement primarily as a
masking operation that is more general than the logical masks discussed in the
previous paragraph
...
We give an example in Section 3
...
In the
remainder of this section, we develop and illustrate methods based on subtraction and addition for image enhancement
...


GONZ03-075-146
...
4
...
4-1)

is obtained by computing the difference between all pairs of corresponding pixels from f and h
...
We illustrate this concept by returning briefly to the
discussion in Section 3
...
4, where we showed that the higher-order bit planes of
an image carry a significant amount of visually relevant detail, while the lower
planes contribute more to fine (often imperceptible) detail
...
28(a) shows
the fractal image used earlier to illustrate the concept of bit planes
...
28(b)
shows the result of discarding (setting to zero) the four least significant bit planes
of the original image
...
3
...
The pixel-by-pixel difference between
these two images is shown in Fig
...
28(c)
...
28

(a) Original
fractal image
...

(c) Difference
between (a) and
(b)
...

(Original image
courtesy of Ms
...
Binde,
Swarthmore
College,
Swarthmore, PA)
...
II

29-08-2001

13:42

Page 111

3
...
In order to bring out more detail, we can perform a contrast stretching
transformation, such as those discussed in Sections 3
...
3
...
The result is shown in Fig
...
28(d)
...


I One of the most commercially successful and beneficial uses of image subtraction is in the area of medical imaging called mask mode radiography
...
The procedure consists of injecting a contrast medium into
the patient’s bloodstream, taking a series of images of the same anatomical region as h(x, y), and subtracting this mask from the series of incoming images
after injection of the contrast medium
...
Because images can be captured at TV rates, this procedure in essence
gives a movie showing how the contrast medium propagates through the various arteries in the area being observed
...
29(a) shows an X-ray image of the top of a patient’s head prior to
injection of an iodine medium into the bloodstream
...
As a reference
point, the bright spot in the lower one-third of the image is the core of the spinal
column
...
29(b) shows the difference between the mask (Fig
...
29a) and
an image taken some time after the medium was introduced into the bloodstream
...
3
...
These arteries appear quite bright because they are not
subtracted out (that is, they are not part of the mask image)
...
3
...
Note, for instance, that the spinal cord, which is bright
in Fig
...
29(a), appears quite dark in Fig
...
29(b) as a result of subtraction
...
7:
Use of image
subtraction in
mask mode
radiography
...
29

Enhancement by
image subtraction
...

(b) An image
(taken after
injection of a
contrast medium
into the
bloodstream) with
mask subtracted
out
...
II

112

29-08-2001

13:43

Page 112

Chapter 3 I Image Enhancement in the Spatial Domain

A few comments on implementation are an order before we leave this section
...
Thus, we expect image values
not to be outside the range from 0 to 255
...
There are two principal ways to scale a difference
image
...
It is not
guaranteed that the values will cover the entire 8-bit range from 0 to 255, but
all pixel values definitely will be within this range
...

If more accuracy and full coverage of the 8-bit range are desired, then we can
resort to another approach
...
Then, all the
pixels in the image are scaled to the interval [0, 255] by multiplying each pixel
by the quantity 255?Max, where Max is the maximum pixel value in the modified difference image
...

Before leaving this section we note also that change detection via image subtraction finds another major application in the area of segmentation, which is
the topic of Chapter 10
...
Image subtraction for segmentation is used when the criterion is “changes
...
What is left should be the moving elements in the image, plus noise
...
4
...
4-2)

where the assumption is that at every pair of coordinates (x, y) the noise is uncorrelated† and has zero average value
...

If the noise satisfies the constraints just stated, it can be shown (Problem

3
...
4-3)

Recall that the variance of a random variable x with mean m is defined as EC(x-m)2 D, where EE?F is
the expected value of the argument
...
If the variables are uncorrelated, their covariance is 0
...
II

29-08-2001

13:43

Page 113

3
...
4-4)

and
s2– (x, y) =
g

1 2
s
K h(x, y)

(3
...
The standard deviation at any
variances of g
point in the average image is

sg(x, y) =

1
sh(x, y)
...
4-6)

As K increases, Eqs
...
4-5) and (3
...
Because E E g(x, y) F = f(x, y),
– (x, y) approaches f(x, y) as the number of noisy images used
this means that g
in the averaging process increases
...


I An important application of image averaging is in the field of astronomy,
where imaging with very low light levels is routine, causing sensor noise frequently to render single images virtually useless for analysis
...
30(a)
shows an image of a galaxy pair called NGC 3314, taken by NASA’s Hubble
Space Telescope with a wide field planetary camera
...
The bright stars forming a pinwheel shape near the center of
the front galaxy have formed recently from interstellar gas and dust
...
30(b) shows the same image, but corrupted by uncorrelated Gaussian
noise with zero mean and a standard deviation of 64 gray levels
...
Figures 3
...
We see that the result obtained
with K=128 is reasonably close to the original in visual appearance
...
3
...
This figure
shows the difference images between the original [Fig
...
30(a)] and each of the
averaged images in Figs
...
30(c) through (f)
...
As usual, the vertical scale
in the histograms represents number of pixels and is in the range C0, 2
...

The horizontal scale represents gray level and is in the range [0, 255]
...
This is as expected because, according to Eqs
...
4-3) and
(3
...
We can
also see the effect of a decreasing mean in the difference images on the left column of Fig
...
31, which become darker as the K increases
...
8:
Noise reduction
by image
averaging
...
II

114

29-08-2001

13:43

Page 114

Chapter 3 I Image Enhancement in the Spatial Domain

a b
c d
e f
FIGURE 3
...
(b) Image corrupted by additive Gaussian noise with zero mean and a standard deviation of 64 gray levels
...
(Original image courtesy of NASA
...
In astronomical
observations, a process equivalent to the method just described is to use the integrating capabilities of CCD or similar sensors for noise reduction by observing the
same scene over long periods of time
...
Cooling the sensor further reduces its noise level
...
II

29-08-2001

13:43

Page 115

3
...
31

(a) From top to
bottom:
Difference images
between
Fig
...
30(a) and
the four images in
Figs
...
30(c)
through (f),
respectively
...


As in the case of image subtraction, adding two or more 8-bit images requires
special care when it comes to displaying the result on an 8-bit display
...
Scaling back to 8 bits in
this case consists simply of dividing the result by K
...


GONZ03-075-146
...
In fact, in the example just given, this
was precisely the case because Gaussian random variables with zero mean and
nonzero variance have negative as well as positive values
...
That is, the minimum value in a given average image was obtained and its negative was added to the image
...


3
...
1, some neighborhood operations work with the values of the image pixels in the neighborhood and the corresponding values of a
subimage that has the same dimensions as the neighborhood
...
The values in a filter subimage are referred to
as coefficients, rather than pixels
...
This topic is discussed in
more detail in Chapter 4
...
We use the
term spatial filtering to differentiate this type of process from the more traditional frequency domain filtering
...
3
...
The process consists simply of moving the filter mask from point to point in an image
...
For linear spatial filtering (see Section 2
...
For the 3*3
mask shown in Fig
...
32, the result (or response), R, of linear filtering with the
filter mask at a point (x, y) in the image is
R = w(-1, -1)f(x - 1, y - 1) + w(-1, 0)f(x - 1, y) + p
+ w(0, 0)f(x, y) + p + w(1, 0)f(x + 1, y) + w(1, 1)f(x + 1, y + 1),
which we see is the sum of products of the mask coefficients with the corresponding pixels directly under the mask
...
For a mask
of size m*n, we assume that m=2a+1 and n=2b+1, where a and b are
nonnegative integers
...


GONZ03-075-146
...
5 I Basics of Spatial Filtering

117

FIGURE 3
...

The magnified
drawing shows a
3*3 mask and
the image section
directly under it;
the image section
is shown
displaced out
from under the
mask for ease of
readability
...
5-1)

s = -a t = -b

where, from the previous paragraph, a=(m-1)?2 and b=(n-1)?2
...
In this way, we are assured that the

GONZ03-075-146
...
It is easily verified when m=n=3 that
this expression reduces to the example given in the previous paragraph
...
(3
...
For this reason,
linear spatial filtering often is referred to as “convolving a mask with an image
...
The term convolution kernel also is in common use
...
5-2)

mn

i=1

where the w’s are mask coefficients, the z’s are the values of the image gray
levels corresponding to those coefficients, and mn is the total number of coefficients in the mask
...
3
...


(3
...

Nonlinear spatial filters also operate on neighborhoods, and the mechanics
of sliding a mask past an image are the same as was just outlined
...
(3
...
5-2)
...
6
...
Computation
of the median is a nonlinear operation, as is computation of the variance, which
we used in Section 3
...
4
...
33

Another
representation of
a general 3*3
spatial filter mask
...
II

29-08-2001

13:43

Page 119

3
...
Consider for simplicity a square mask of size
n*n
...
If the center of the mask moves any closer to the
border, one or more rows or columns of the mask will be located outside the
image plane
...
The simplest is to
limit the excursions of the center of the mask to be at a distance no less than
(n-1)?2 pixels from the border
...
If the result is required to be the same size as the
original, then the approach typically employed is to filter all pixels only with the
section of the mask that is fully contained in the image
...
Other approaches include “padding” the image by adding
rows and columns of 0’s (or other constant gray level), or padding by replicating rows or columns
...

This keeps the size of the filtered image the same as the original, but the values
of the padding will have an effect near the edges that becomes more prevalent
as the size of the mask increases
...


3
...
Blurring is used
in preprocessing steps, such as removal of small details from an image prior to
(large) object extraction, and bridging of small gaps in lines or curves
...


3
...
1 Smoothing Linear Filters
The output (response) of a smoothing, linear spatial filter is simply the average
of the pixels contained in the neighborhood of the filter mask
...
For reasons explained in Chapter 4, they
also are referred to a lowpass filters
...
By replacing the value
of every pixel in an image by the average of the gray levels in the neighborhood defined by the filter mask, this process results in an image with reduced
“sharp” transitions in gray levels
...
However, edges (which almost always are desirable features of
an image) also are characterized by sharp transitions in gray levels, so averaging filters have the undesirable side effect that they blur edges
...
II

120

29-08-2001

13:43

Page 120

Chapter 3 I Image Enhancement in the Spatial Domain

a b
1

3*3 smoothing
(averaging) filter
masks
...


1
–*
9

1

1

1

1

1

1

FIGURE 3
...
4
...

A major use of averaging filters is in the reduction of “irrelevant” detail in an
image
...
This latter application is illustrated later in this section
...
34 shows two 3*3 smoothing filters
...
This can best be seen by substituting the coefficients of the mask into Eq
...
5-3):
R =

1 9
z,
9 ia i
=1

which is the average of the gray levels of the pixels in the 3*3 neighborhood
defined by the mask
...
The idea here is that it is computationally more efficient to have
coefficients valued 1
...
An m*n mask would have a normalizing constant equal to 1?mn
...

The second mask shown in Fig
...
34 is a little more interesting
...
In the mask shown in Fig
...
34(b) the pixel
at the center of the mask is multiplied by a higher value than any other, thus giving this pixel more importance in the calculation of the average
...
The diagonal terms are further away from the center than the orthogonal neighbors (by a factor of 12) and, thus, are weighed less than these immediate neighbors of the center pixel
...
We could have picked other weights to accomplish the
same general objective
...
3
...
In practice, it is difficult in general to see differences between images smoothed by using either of the masks in Fig
...
34, or
similar arrangements, because the area these masks span at any one location in
an image is so small
...
II

29-08-2001

13:43

Page 121

3
...
(3
...
6-1)

s = -a t = -b

The parameters in this equation are as defined in Eq
...
5-1)
...
(3
...
The denominator in
Eq
...
6-1) is simply the sum of the mask coefficients and, therefore, it is a constant that needs to be computed only once
...


I The effects of smoothing as a function of filter size are illustrated in Fig
...
35,
which shows an original image and the corresponding smoothed results obtained
using square averaging filters of sizes n=3, 5, 9, 15, and 35 pixels, respectively
...
For example, the 3*3 and 5*5 squares, the small letter “a,” and the fine
grain noise show significant blurring when compared to the rest of the image
...
Note that the jagged borders
of the characters and gray circles have been pleasingly smoothed
...
For n=9 we see considerably more blurring, and the 20% black circle is not nearly as distinct from the background as in the previous three images,
illustrating the blending effect that blurring has on objects whose gray level
content is close to that of its neighboring pixels
...
The results for n=15 and 35 are extreme
with respect to the sizes of the objects in the image
...
For instance, the
three small squares, two of the circles, and most of the noisy rectangle areas
have been blended into the background of the image in Fig
...
35(f)
...
This is a result of padding the border of the original image with 0’s (black) and then trimming off the padded
area
...

I
As mentioned earlier, an important application of spatial averaging is to blur
an image for the purpose getting a gross representation of objects of interest,
such that the intensity of smaller objects blends with the background and larger objects become “bloblike” and easy to detect
...

As an illustration, consider Fig
...
36(a), which is an image from the Hubble telescope in orbit around the Earth
...
36(b) shows the result of applying a

EXAMPLE 3
...


GONZ03-075-146
...
35 (a) Original image, of size 500*500 pixels
...
The black
squares at the top are of sizes 3, 5, 9, 15, 25, 35, 45, and 55 pixels, respectively; their borders are 25 pixels apart
...
The vertical bars are 5 pixels wide and 100 pixels high; their separation is 20 pixels
...
The background of the image is 10% black
...


GONZ03-075-146
...
6 I Smoothing Spatial Filters

123

a b c
FIGURE 3
...
(b) Image processed by a 15*15 averaging mask
...
(Original image courtesy of NASA
...
We see that a number of objects have either blended with the background or their intensity has diminished considerably
...
The result of using the thresholding function of
Fig
...
2(b) with a threshold value equal to 25% of the highest intensity in the
blurred image is shown in Fig
...
36(c)
...


3
...
2 Order-Statistics Filters
Order-statistics filters are nonlinear spatial filters whose response is based on
ordering (ranking) the pixels contained in the image area encompassed by
the filter, and then replacing the value of the center pixel with the value determined by the ranking result
...
Median filters are
quite popular because, for certain types of random noise, they provide excellent noise-reduction capabilities, with considerably less blurring than linear
smoothing filters of similar size
...

The median, j, of a set of values is such that half the values in the set are less
than or equal to j, and half are greater than or equal to j
...
For example, in a 3*3 neighborhood the median is the 5th largest value,
in a 5*5 neighborhood the 13th largest value, and so on
...
II

124

29-08-2001

13:43

Page 124

Chapter 3 I Image Enhancement in the Spatial Domain

in a neighborhood are the same, all equal values are grouped
...

These values are sorted as (10, 15, 20, 20, 20, 20, 20, 25, 100), which results in a
median of 20
...
In fact, isolated clusters
of pixels that are light or dark with respect to their neighbors, and whose area
is less than n2?2 (one-half the filter area), are eliminated by an n*n median
filter
...
Larger clusters are affected considerably less
...
The median represents the
50th percentile of a ranked set of numbers, but the reader will recall from basic
statistics that ranking lends itself to many other possibilities
...
The response of a 3*3 max filter is given by
R=max Ezk | k=1, 2, p , 9F
...
Median, max, and mean filters are considered in more
detail in Chapter 5
...
37(a) shows an X-ray image of a circuit board heavily corrupted by
EXAMPLE 3
...


salt-and-pepper noise
...
3
...
3
...
The image processed
with the averaging filter has less visible noise, but the price paid is significant
blurring
...
In general, median filtering is much better suited than averaging for the removal of additive salt-and-pepper noise
...
37 (a) X-ray image of circuit board corrupted by salt-and-pepper noise
...
(c) Noise reduction with a 3*3 median filter
...
Joseph
E
...
)

GONZ03-075-146
...
7 I Sharpening Spatial Filters

3
...
Uses of image sharpening vary and include applications ranging from electronic printing and medical imaging to industrial inspection and autonomous guidance in military systems
...
Since averaging is analogous to integration, it is logical to conclude that sharpening could be accomplished by spatial differentiation
...
Fundamentally, the strength of the response of a derivative operator is proportional to the degree of discontinuity of
the image at the point at which the operator is applied
...


3
...
1 Foundation
In the two sections that follow, we consider in some detail sharpening filters that
are based on first- and second-order derivatives, respectively
...
To simplify the explanation, we
focus attention on one-dimensional derivatives
...
These types of discontinuities can be used to model noise points,
lines, and edges in an image
...

The derivatives of a digital function are defined in terms of differences
...
However, we require that any definition we use for a first derivative (1) must be zero in flat segments (areas of
constant gray-level values); (2) must be nonzero at the onset of a gray-level
step or ramp; and (3) must be nonzero along ramps
...
Since we are dealing with digital quantities whose values are
finite, the maximum possible gray-level change also is finite, and the shortest distance over which that change can occur is between adjacent pixels
...

0x
We used a partial derivative here in order to keep the notation the same as
when we consider an image function of two variables, f(x, y), at which time we

125

GONZ03-075-146
...
Use of a partial derivative in the present discussion does not affect in any way the nature of
what we are trying to accomplish
...


It is easily verified that these two definitions satisfy the conditions stated previously regarding derivatives of the first and second order
...
3
...

Figure 3
...
Figure 3
...
This
profile is the one-dimensional function we will use for illustrations regarding this
figure
...
38(c) shows a simplification of the profile, with just enough numa b
c
FIGURE 3
...
(b) 1-D
horizontal graylevel profile along
the center of the
image and
including the
isolated noise
point
...

7
6
5
4
3
2
1
0

Isolated point
Ramp

Thin line

Step

Flat segment

Image strip 5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7
First Derivative –1 –1 –1 –1 –1 0 0 6 –6 0 0 0 1 2 –2 –1 0 0 0 7 0 0 0
Second Derivative –1 0 0 0 0 1 0 6 –12 6 0 0 1 1 –4 1 1 0 0 7 –7 0 0

GONZ03-075-146
...
7 I Sharpening Spatial Filters

bers to make it possible for us to analyze how the first- and second-order derivatives behave as they encounter a noise point, a line, and then the edge of an
object
...
The number of gray levels was simplified to only eight levels
...
First, we note that the first-order derivative
is nonzero along the entire ramp, while the second-order derivative is nonzero
only at the onset and end of the ramp
...
Next we encounter the isolated
noise point
...
Of course, this is not unexpected
...
Thus, we can expect a second-order
derivative to enhance fine detail (including noise) much more than a first-order
derivative
...
If the maximum gray level of the line had
been the same as the isolated point, the response of the second derivative would
have been stronger for the latter
...
We also note that
the second derivative has a transition from positive back to negative
...
This “double-edge” effect is an issue that
will be important in Chapter 10, where we use derivatives for edge detection
...

In summary, comparing the response between first- and second-order derivatives, we arrive at the following conclusions
...
(2) Second-order derivatives have a
stronger response to fine detail, such as thin lines and isolated points
...
(4) Second-order derivatives produce a double response at step changes in gray level
...

In most applications, the second derivative is better suited than the first derivative for image enhancement because of the ability of the former to enhance
fine detail
...
First-order derivatives are discussed in Section 3
...
3
...
In fact, we show in Section 3
...


127

GONZ03-075-146
...
7
...
The approach basically consists of defining a discrete formulation of the second-order derivative and then constructing
a filter mask based on that formulation
...
In other words, isotropic filters are rotation invariant, in the sense that rotating the image and then applying the filter gives the
same result as applying the filter to the image first and then rotating the result
...


(3
...

In order to be useful for digital image processing, this equation needs to be
expressed in discrete form
...
Whatever the definition, however, it has to satisfy the
properties of a second derivative outlined in Section 3
...
1
...
Taking into
account that we now have two variables, we use the following notation for the
partial second-order derivative in the x-direction:
0 2f
0 2x 2

= f(x + 1, y) + f(x - 1, y) - 2f(x, y)

(3
...
7-3)

The digital implementation of the two-dimensional Laplacian in Eq
...
7-1) is
obtained by summing these two components:
§ 2f = C f(x + 1, y) + f(x - 1, y) + f(x, y + 1) + f(x, y - 1) D
- 4f(x, y)
...
7-4)

This equation can be implemented using the mask shown in Fig
...
39(a), which
gives an isotropic result for rotations in increments of 90°
...
(3
...
6
...
We simply are using different coefficients here
...
(3
...
The form of each new term is the same as either Eq
...
7-2)

GONZ03-075-146
...
7 I Sharpening Spatial Filters

0

1

0

1

1

a b
c d

1

1

–4

1

1

–8

1

0

1

1

–1

0

–1

–1

–1

–1

4

–1

–1

8

–1

0

–1

0

–1

–1

(a) Filter mask
used to
implement the
digital Laplacian,
as defined in
Eq
...
7-4)
...
(c) and
(d) Two other
implementations
of the Laplacian
...
39

1

0

–1

or (3
...
Since each diagonal term
also contains a –2f(x, y) term, the total subtracted from the difference terms
now would be –8f(x, y)
...
3
...
This mask yields isotropic results for increments of 45°
...
3
...

They are based on a definition of the Laplacian that is the negative of the one
we used here
...

Because the Laplacian is a derivative operator, its use highlights gray-level
discontinuities in an image and deemphasizes regions with slowly varying gray
levels
...
Background
features can be “recovered” while still preserving the sharpening effect of the
Laplacian operation simply by adding the original and Laplacian images
...
If the definition used has a negative center coefficient, then we subtract, rather than add, the Laplacian image to obtain a
sharpened result
...


Use of this equation is illustrated next
...
7-5)

GONZ03-075-146
...
11:
Imaging
sharpening with
the Laplacian
...
40

(a) Image of the
North Pole of the
moon
...

(c) Laplacian
image scaled for
display purposes
...
(3
...

(Original image
courtesy of
NASA
...
40(a) shows an image of the North Pole of the moon
...
40(b)
shows the result of filtering this image with the Laplacian mask in Fig
...
39(b)
...
4
...
Sometimes one encounters the absolute value being used for this purpose, but this really is not correct because it produces double lines of nearly equal magnitude,
which can be confusing
...
3
...
Note that the dominant features of the image are edges and
sharp gray-level discontinuities of various gray-level values
...
This grayish appearance
is typical of Laplacian images that have been scaled properly
...
3
...
II

29-08-2001

13:43

Page 131

3
...
(3
...
The detail in this image is unmistakably clearer and sharper than in the original image
...

The net result is an image in which small details were enhanced and the background tonality was perfectly preserved
...

I

Simplifications
In the previous example, we implemented Eq
...
7-5) by first computing the
Laplacian-filtered image and then subtracting it from the original image
...
In
practice, Eq
...
7-5) is usually implemented with one pass of a single mask
...
(3
...
(3
...


(3
...
3
...
The
mask shown in Fig
...
41(b) would be used if the diagonal neighbors also were
included in the calculation of the Laplacian
...
(3
...
(3
...


I The results obtainable with the mask containing the diagonal terms usually
are a little sharper than those obtained with the more basic mask of Fig
...
41(a)
...
3
...
3
...
By comparing the filtered images with the original image shown
in Fig
...
41(c), we note that both masks produced effective enhancement, but the
result using the mask in Fig
...
41(b) is visibly sharper
...
41(c) is a scanning electron microscope (SEM) image of a tungsten filament following thermal failure; the magnification is approximately 250 *
...
3
...
(3
...
That is, f(x, y) be may viewed
as itself processed with a mask that has a unit coefficient in the center and zeros
elsewhere
...
3
...
Due to linearity, the result obtained in
Eq
...
7-5) with the unit-center mask and one of those Laplacian masks would
be the same as the result obtained with a single mask formed by subtracting
(adding) the Laplacian mask from (to) the unity-center mask
...
12:
Image
enhancement
using a composite
Laplacian mask
...
II

132

29-08-2001

13:43

Page 132

Chapter 3 I Image Enhancement in the Spatial Domain

0

–1

0

–1

5

–1

0

–1

0

–1

–1

–1

9

–1

–1

a b c
d e

–1

–1

–1

FIGURE 3
...
(b) A second composite mask
...
(d) and (e) Results of filtering with the masks in (a) and (b),
respectively
...
(Original image courtesy of Mr
...
)

Unsharp masking and high-boost filtering
A process used for many years in the publishing industry to sharpen images
consists of subtracting a blurred version of an image from the image itself
...
7-7)
where fs(x, y) denotes the sharpened image obtained by unsharp masking, and

f (x, y) is a blurred version of f(x, y)
...

A slight further generalization of unsharp masking is called high-boost
filtering
...
7-8)

GONZ03-075-146
...
7 I Sharpening Spatial Filters

133

a b
0

–1

0

–1

–1

–1

A+4

–1

–1

A+8

–1

0

–1

0

–1

–1

FIGURE 3
...



where A ? 1 and, as before, f is a blurred version of f
...

(3
...
(3
...
7-10)

as the expression for computing a high-boost-filtered image
...
7-10) is applicable in general and does not state explicitly how
the sharp image is obtained
...
(3
...
In this case, Eq
...
7-10) becomes
fhb = d

Af(x, y) - § 2f(x, y)

if the center coefficient of the
Laplacian mask is negative

Af(x, y) + § 2f(x, y)

if the center coefficient of the
Laplacian mask is positive
...
7-11)

High-boost filtering can be implemented with one pass using either of the two
masks shown in Fig
...
42
...
As the value of A increases past 1, the contribution of the sharpening process becomes less and less important
...


I One of the principal applications of boost filtering is when the input image is
darker than desired
...
Figure 3
...
Part (a) of this figure is
a darker version of the image in Fig
...
41(c)
...
43(b) shows the Laplacian
computed using the mask in Fig
...
42(b), with A=0
...
43(c) was obtained
using the mask in Fig
...
42(b) with A=1
...
Finally, Fig
...
43(d) shows the result of using A=1
...
This is a much more acceptable result, in which the average
gray level has increased, thus making the image lighter and more natural
...
13:
Image
enhancement with
a high-boost filter
...
II

134

29-08-2001

13:43

Page 134

Chapter 3 I Image Enhancement in the Spatial Domain

a b
c d
FIGURE 3
...
3
...

(a) Laplacian of
(a) computed with
the mask in
Fig
...
42(b) using
A=0
...
3
...
(d) Same
as (c), but using
A=1
...


3
...
3 Use of First Derivatives for Enhancement—The Gradient
First derivatives in image processing are implemented using the magnitude of
the gradient
...

0f
Gy
0y

(3
...

0x
0y

(3
...
II

29-08-2001

13:43

Page 135

3
...
On the other hand, the partial derivatives in Eq
...
7-12) are not rotation invariant (isotropic), but the magnitude of the gradient vector is
...
In keeping with tradition, we will use this term in the
following discussions, explicitly referring to the vector or its magnitude only in
cases where confusion is likely
...
(3
...


(3
...
However, as in
the case of the Laplacian, the isotropic properties of the digital gradient defined in the following paragraph are preserved only for a limited number of rotational increments that depend on the masks used to approximate the
derivatives
...

These results are independent of whether Eq
...
7-13) or (3
...

As in the case of the Laplacian, we now define digital approximations to the
preceding equations, and from there formulate the appropriate filter masks
...
3
...
For example, the center
point, z5 , denotes f(x, y), z1 denotes f(x-1, y-1), and so on
...
7
...

Two other definitions proposed by Roberts [1965] in the early development of
digital image processing use cross differences:
Gx = Az9 - z5 B

and

Gy = Az8 - z6 B
...
7-15)

If we elect to use Eq
...
7-13), then we compute the gradient as
2

2 1?2

§f = C Az9 - z5 B + Az8 - z6 B D

(3
...
(3
...
(3
...


(3
...
3
...
These masks are referred to as the Roberts cross-gradient operators
...
The smallest filter mask in
which we are interested is of size 3*3
...


(3
...
II

136

29-08-2001

13:43

Page 136

Chapter 3 I Image Enhancement in the Spatial Domain

a
b c
d e

z1

z2

z3

z4

z5

z6

z7

z8

z9

FIGURE 3
...

All masks
coefficients sum
to zero, as
expected of a
derivative
operator
...
The masks
shown in Figs
...
44(d) and (e), called the Sobel operators, can be used to implement Eq
...
7-18) via the mechanics given in Eq
...
5-1)
...
Note that
the coefficients in all the masks shown in Fig
...
44 sum to 0, indicating that they
would give a response of 0 in an area of constant gray level, as expected of a derivative operator
...
14:
Use of the
gradient for edge
enhancement
...
We will have more to say about this in Chapters
10 and 11
...
In this particular example, the enhancement is used as a preprocessing step for automated inspection, rather than for
human analysis
...
45(a) shows an optical image of a contact lens, illuminated by a lighting arrangement designed to highlight imperfections, such as the two edge

GONZ03-075-146
...
8 I Combining Spatial Enhancement Methods

137

a b
FIGURE 3
...

(b) Sobel
gradient
...
Pete Sites,
Perceptics
Corporation
...
Figure 3
...
(3
...
3
...
The edge defects also are quite visible in this image, but with the added
advantage that constant or slowly varying shades of gray have been eliminated, thus simplifying considerably the computational task required for automated inspection
...
The ability to enhance small discontinuities in an otherwise flat gray
field is another important feature of the gradient
...
8

Combining Spatial Enhancement Methods

With a few exceptions, like combining blurring with thresholding in Section 3
...
1,
we have focused attention thus far on individual enhancement approaches
...
In
this section we illustrate by means of an example how to combine several of the
approaches developed in this chapter to address a difficult enhancement task
...
3
...
Our objective is to enhance
this image by sharpening it and by bringing out more of the skeletal detail
...
The strategy we will follow is to utilize the Laplacian to
highlight fine detail, and the gradient to enhance prominent edges
...
4 regarding masking)
...

Figure 3
...
3
...
This image was scaled (for display only) using the
same technique as in Fig
...
40
...
II

138

29-08-2001

13:43

Page 138

Chapter 3 I Image Enhancement in the Spatial Domain

a b
c d
FIGURE 3
...

(b) Laplacian of
(a)
...
(d) Sobel of
(a)
...
II

29-08-2001

13:43

Page 139

3
...
46

(Continued)
(e) Sobel image
smoothed with a
5*5 averaging
filter
...

(g) Sharpened
image obtained
by the sum of (a)
and (f)
...
Compare (g)
and (h) with (a)
...
E
...
)

GONZ03-075-146
...
3
...
(3
...

Just by looking at the noise level in (b), we would expect a rather noisy sharpened image if we added Figs
...
46(a) and (b), a fact that is confirmed by the
result shown in Fig
...
46(c)
...
However, median filtering is a nonlinear process capable of removing image features
...

An alternate approach is to use a mask formed from a smoothed version of
the gradient of the original image
...
7
...
The Laplacian, being a second-order derivative operator,
has the definite advantage that it is superior in enhancing fine detail
...
This noise is most
objectionable in smooth areas, where it tends to be more visible
...
The response of the gradient to noise
and fine detail is lower than the Laplacian’s and can be lowered further by
smoothing the gradient with an averaging filter
...
In this context, we may view
the smoothed gradient as a mask image
...
This process can
be viewed roughly as combining the best features of the Laplacian and the gradient
...

Figure 3
...
(3
...
Components Gx and Gy were obtained using the masks in
Figs
...
44(d) and (e), respectively
...
7
...

The smoothed gradient image shown in Fig
...
46(e) was obtained by using an
averaging filter of size 5*5
...
Because the smallest possible
value of a gradient image is 0, the background is black in the scaled gradient images, rather than gray as in the scaled Laplacian
...
3
...
3
...

The product of the Laplacian and smoothed-gradient image is shown in
Fig
...
46(f)
...
Adding the product image to the original resulted in
the sharpened image shown in Fig
...
46(g)
...
This type of improvement would
not have been possible by using the Laplacian or gradient alone
...
Thus, the final step in our

GONZ03-075-146
...
As
we discussed in some detail in Sections 3
...
3, there are a number of graylevel transformation functions that can accomplish this objective
...
3
...
Histogram specification could be a solution, but the dark characteristics
of the images with which we are dealing lend themselves much better to a powerlaw transformation
...
(3
...
After a few trials with this equation we arrived
at the result shown in Fig
...
46(h), obtained with g=0
...
Comparing this image with Fig
...
46(g), we see that significant new detail is visible in
Fig
...
46(h)
...
The skeletal bone structure also is much more pronounced, including the arm and leg bones
...
Bringing out detail of this nature by expanding
the dynamic range of the gray levels also enhanced noise, but Fig
...
46(h) represents a significant visual improvement over the original image
...
The way in which the results are used depends on the application
...
For a number of reasons that are beyond the scope of our discussion,
physicians are unlikely to rely on enhanced results to arrive at a diagnosis
...

In other areas, the enhanced result may indeed be the final product
...


Summary
The material presented in this chapter is representative of spatial domain techniques
commonly used in practice for image enhancement
...
For this reason, the topics included in this chapter were selected for their value as fundamental material that
would serve as a foundation for understanding the state of the art in enhancement
techniques, as well as for further study in this field
...
In the following chapter, we deal with enhancement from a complementary viewpoint in the frequency domain
...
The fact that these tools were introduced in the
context of image enhancement is likely to aid in the understanding of how they operate on digital images
...
II

142

29-08-2001

13:43

Page 142

Chapter 3 I Image Enhancement in the Spatial Domain

References and Further Reading
The material in Section 3
...
Additional reading for the material in Section 3
...

See also the paper by Tsujii et al
...

Early references on histogram processing are Hummel [1974], Gonzalez and Fittes [1977],
and Woods and Gonzalez [1981]
...
Other approaches for contrast enhancement are exemplified by Centeno and Haertel [1997] and Cheng and Xu
[2000]
...

For extensions of the local histogram equalization method, see Caselles et al
...
[1999]
...
Kim et al
...

Image subtraction (Section 3
...
1) is a generic image processing tool widely used for
change detection
...
The problem of motion during image subtraction has
received significant attention over the years, as exemplified in the survey article by Meijering et al
...
The method of noise reduction by image averaging (Section 3
...
2) was
first proposed by Kohler and Howell [1963]
...

For additional reading on linear spatial filters and their implementation, see Umbaugh [1998], Jain [1989], and Rosenfeld and Kak [1982]
...
Wilburn [1998] discusses generalizations of rank-order
filters
...
A special issue of IEEE Transactions in Image Processing [1996]
is dedicated to the topic of nonlinear image processing
...
We will encounter again many of the spatial filters
introduced in this chapter in discussions dealing with image restoration (Chapter 5) and
edge detection (Chapter 10)
...
1

See inside front cover

Detailed solutions to the
problems marked with a
star can be found in the
book web site
...


2

Exponentials of the form e-ar , with a a positive constant, are useful for constructing smooth gray-level transformation functions
...
The constants shown are input parameters, and your proposed transformations must include them in their specification
...
)
s=T(r)

s=T(r)

A

B

A/2

s=T(r)

B/2

L0

(a)

r

D

r

L0

(b)

C

r

0

(c)

GONZ03-075-146
...
2 # (a) Give a continuous function for implementing the contrast stretching transformation shown in Fig
...
2(a)
...
Your function should be normalized so that its minimum and maximum values are 0 and 1, respectively
...

(c) What is the smallest value of s that will make your function effectively perform as the function in Fig
...
2(b)? In other words, your function does not
have to be identical to Fig
...
2(b)
...
Assume that you are working with 8-bit images, and
let m=128
...

3
...
(For example, a transformation function with the property T(r)=0 for r in the range [0, 127], and
T(r)=255 for r in the range [128, 255] produces an image of the 7th bit plane
in an 8-bit image
...
4 # (a) What effect would setting to zero the lower-order bit planes have on the histogram of an image in general?
(b) What would be the effect on the histogram if we set to zero the higherorder bit planes instead?
# 3
...


3
...
Show that a
second pass of histogram equalization will produce exactly the same result as the
first pass
...
7

In some applications it is useful to model the histogram of input images as Gaussian probability density functions of the form
pr(r) =

(r - m)
1
e 2s2
12ps

2

where m and s are the mean and standard deviation of the Gaussian PDF
...
What is the transformation function you would use for histogram
equalization?
# 3
...
(3
...
3
...


3
...
(3
...
3
...

(b) Show by example that this does not hold in general for the inverse discrete
transformation function given in Eq
...
3-9)
...
(3
...
3
...


143

GONZ03-075-146
...
10

An image has the gray level PDF pr(r) shown in the following diagram
...
Assume continuous quantities and find the transformation (in
terms of r and z) that will accomplish this
...
11
3
...
13

# 3
...
15
3
...
3
...

Two images, f(x, y) and g(x, y), have histograms hf and hg
...
Explain how to obtain the histogram in each case
...

(a) Discuss the limiting effect of repeatedly subtracting image (b) from image (a)
...
The approach is to store a “golden” image
that corresponds to a correct assembly; this image is then subtracted from incoming images of the same product
...
Difference images for products with
missing components would be nonzero in the area where they differ from the
golden image
...
(3
...
4-5)
...
The objective is to look for voids in the castings, which
typically appear as small blobs in the image
...
In computing the average, it is important to
keep the number of images as small as possible to reduce the time the parts have
to remain stationary during imaging
...
If the imaging device can produce 30 frames?s, how long would the castings have to remain
stationary during imaging to achieve the desired decrease in variance? Assume
that the noise is uncorrelated and has zero mean
...
II

29-08-2001

13:43

Page 145

I Problems

3
...
5)
...

# (a) Formulate such an algorithm for an n*n filter, showing the nature of the
computations involved and the scanning sequence used for moving the mask
around the image
...
Obtain the computational
advantage in this case and plot it as a function of n for n>1
...
Assume that the image has an outer border of
zeros that is thick enough to allow you to ignore border effects in your analysis
...
18

Discuss the limiting effect of repeatedly applying a 3*3 lowpass spatial filter to
a digital image
...


3
...
6
...
Assume a filter of size n*n, with n odd, and explain why this is so
...
Assume that all points
in a cluster are lighter or darker than the background (but not both simultaneously in the same cluster), and that the area of each cluster is less than or
equal to n2?2
...
20

(a) Develop a procedure for computing the median of an n*n neighborhood
...


3
...
3
...

This is followed by a procedure that thins the characters until they become
strings of binary 1’s on a background of 0’s
...
One way to “repair” the gaps is to run an averaging
mask over the binary image to blur it, and thus create bridges of nonzero pixels between gaps
...

(b) After bridging the gaps, it is desired to threshold the image in order to convert it back to binary form
...
22

The three images shown were blurred using square averaging masks of sizes
n=23, 25, and 45, respectively
...
However, the bars

145

GONZ03-075-146
...
Explain this
...
23

Consider an application such as the one shown in Fig
...
36, in which it is desired
to eliminate objects smaller than those enclosed in a square of size q*q pixels
...
In this way, those objects will be closer to the
gray level of the background and they can then be eliminated by thresholding
...


3
...
Would the
result be the same if the order of these operations were reversed?

# 3
...
(3
...
You will need the following equations relating coordinates after axis rotation by an angle u:
x=x¿ cos u-y¿ sin u
y=x¿ sin u+y¿ cos u
where (x, y) are the unrotated and (x¿, y¿) are the rotated coordinates
...
26

Give a 3*3 mask for performing unsharp masking in a single pass through an
image
...
27

Show that subtracting the Laplacian from an image is proportional to unsharp
masking
...
(3
...


3
...
(3
...
(See Problem 3
...
)
(b) Show that the isotropic property is lost in general if the gradient is computed using Eq
...
7-14)
...
29

A CCD TV camera is used to perform a long-term study by observing the same area
24 hours a day, for 30 days
...
The illumination of the scene changes from natural
daylight to artificial lighting
...
Because the range of illumination is such that it
is always in the linear operating range of the camera, it is decided not to employ any
compensating mechanisms on the camera itself
...
Propose a method to do this
...


Digital Image Processing
Second Edition

Instructor’s Manual
(Evaluation copy–Contains only representative, partial problem solutions)

Rafael C
...
Woods

Prentice Hall
Upper Saddle River, NJ 07458
www
...
com/gonzalezwoods
or
www
...
com

ii

Revision history
10 9 8 7 6 5 4 3 2 1

c
Copyright °1992-2002 by Rafael C
...
Woods

Preface
This manual contains detailed solutions to all problems in Digital Image Processing, 2nd
Edition
...
The notation used throughout this manual corresponds to the notation used in
the text
...
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 science curriculum
...
We
give suggested guidelines for one-semester courses at the senior and first-year graduate
levels
...

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

Computer projects such as those described in the web site are an important part of
a course on image processing
...

The projects suggested at the web site can be implemented on almost any reasonablyequipped multi-user or personal computer having a hard copy output device
...
We also discuss use of the book
web site
...
Detailed solutions to all problems in the book also
are included in the remaining chapters of this manual
...
Graduate programs vary, and can include one or two semesters of the material
...
We assume a 15-week program per semester with three lectures per week
...
The background assumed on the part of the student is senior-level preparation in mathematical
analysis, matrix theory, probability, and computer programming
...
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
...
For example, it is possible with the new
organization to offer a course that emphasizes spatial techniques and covers little or no
transform material
...


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 covered in class
...
This allows the instructor to
assign the material as independent reading, and spend no more than one total lecture period reviewing those subjects
...
These solutions are quite detailed, and were prepared
with the idea of using them as teaching support
...
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
...
In the scope of a senior
course, this usually means the material contained in Chapters 1 through 6
...
However, we recommend covering at least some material
on image compression (Chapter 8) as outlined below
...
The motivational material is
provided in the numerous application areas discussed in Chapter 1
...
Some of this material can be covered in
class and the rest assigned as independent reading
...
3)
...
The review material included in the book web site was designed for just this
purpose
...
Some of the material (such as parts of
Sections 2
...
3) can be assigned as independent reading, but a detailed explanation
of Sections 2
...
6 is time well spent
...
It covers image enhancement (a topic of significant appeal to the beginning student) and it introduces a host of basic spatial processing
tools used throughout the book
...
2
...
2
...
3
...
4; Section 3
...
6; Section
3
...
1, 3
...
2 (through Example 3
...
7
...
Section 3
...

Chapter 4 also discusses enhancement, but from a frequency-domain point of view
...
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)
...
All this material is presented in very
readable form in Section 4
...
“Light” coverage of frequency-domain 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
...
2 and 4
...
2)
...
3 and 4
...
It is seldom possible to go beyond this
point in a senior course
...
Section 5
...
Then, it is possible give the student a “flavor” of what restoration is (and still
keep the discussion brief) by covering only Gaussian and impulse noise in Section 5
...
1,
and a couple of spatial filters in Section 5
...
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
...
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
...
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
...
8-3) and conclude the chapter with Examples 5
...
13
...
Coverage of this

4

Chapter 1 Introduction
chapter also can be brief at the senior level by focusing on enough material to give the
student a foundation on the physics of color (Section 6
...
3)
...
Interest on this topic has increased significantly as a result of
the heavy use of images and graphics over the Internet, and students usually are easily
motivated by the topic
...
1
...
1
...
2, and Section 8
...
1
...


One Semester Graduate Course (No Background in DIP)
The main difference between a senior and a first-year graduate course in which neither
group has formal background in image processing is mostly in the scope of material
covered, in the sense that we simply go faster in a graduate course, and feel much freer
in assigning independent reading
...

Coverage of histogram matching (Section 3
...
2) is added
...
3, 4
...
5
are covered in full
...
6 is touched upon briefly regarding the fact that implementation of discrete Fourier transform techniques requires non-intuitive concepts such
as function padding
...
In Chapter 5 we add Sections 5
...
8
...
3
...
4, and Section 6
...
A nice introduction to wavelets (Chapter 7) can be achieved by a combination
of classroom discussions and independent reading
...
1, 7
...
3, and 7
...
Finally, in Chapter 8 we add coverage of Sections 8
...
4
...
5
...
16), Section 8
...
2 (through Example 8
...
5
...

If additional time is available, a natural topic to cover next is morphological image
processing (Chapter 9)
...
1
...
1 through 9
...
5
...
In this case, it is possible to cover material from the
first eleven chapters of the book
...
Given that students have the
appropriate background on the subject, independent reading assignments can be used to
control the schedule
...
3
...
Sections 4,3, 4
...
5, and 4
...
This strengthens the student’s background in frequency-domain concepts
...
2
...
3
...
4
...
5, 5
...
8
...
4
through 6
...
Chapters 7 and 8 are covered as in the previous section
...
As a minimum, we recommend coverage of binary morphology:
Sections 9
...
4, and some of the algorithms in Section 9
...
Mention should
be made about possible extensions to gray-scale images, but coverage of this material
may not be possible, depending on the schedule
...
1, 10
...
1 and 10
...
2, 10
...
1 through 10
...
4, 10
...
5
...
1 through 11
...


Two Semester Graduate Course (No Background in DIP)
A full-year graduate course consists of the material covered in the one semester undergraduate course, the material outlined in the previous section, and Sections 12
...
2,
12
...
1, and 12
...
2
...
It has been our experience that students truly enjoy and benefit
from judicious use of computer projects to complement the material covered in class
...
In order to facilitate grading,
we try to achieve uniformity in the way project reports are prepared
...

¢ Project title
¢ Project number
¢ Course number
¢ Student’s name
¢ Date due
¢ Date handed in
¢ Abstract (not to exceed 1/2 page)
Page 2: One to two pages (max) of technical discussion
...
One to two pages (max)
...
All images must
contain a number and title referred to in the discussion of results
...
For
brevity, functions and routines provided to the student are referred to by name, but the
code is not included
...
g
...

Project resources available in the book web site include a sample project, a list of suggested projects from which the instructor can select, book and other images, and MATLAB functions
...


2

Problem Solutions

Problem 2
...
P2
...
That is,
(x=2)
(d=2)
=
0:2
0:014
which gives x = 0:07d
...
1
...
Assuming
equal spacing between elements, this gives 580 elements and 579 spaces on a line 1
...
The size of each element and each space is then s = [(1:5mm)=1; 159] =
1:3 £ 10¡6 m
...
In other words,
the eye will not detect a dot if its diameter, d, is such that 0:07(d) < 1:3 £ 10¡6 m, or
d < 18:6 £ 10¡6 m
...
1

8

Chapter 2 Problem Solutions

Problem 2
...


Problem 2
...
The strongest
camera response determines the color
...
A faster system would utilize three different cameras, each equipped
with an individual filter
...
This system would be a little more expensive, but it would be faster and
more reliable
...
e
...
Otherwise further analysis would be
required to isolate the region of uniform color, which is all that is of interest in solving
this problem]
...
9
(a) The total amount of data (including the start and stop bit) in an 8-bit, 1024 £ 1024
image, is (1024)2 £ [8 + 2] bits
...
1 min
...


Problem 2
...
P2
...
Then, (a) S1 and S2 are not 4-connected because
q is not in the set N4 (p); (b) S1 and S2 are 8-connected because q is in the set N8 (p);
(c) S1 and S2 are m-connected because (i) q is in ND (p), and (ii) the set N4 (p) \ N4 (q)
is empty
...
12

9

10

Chapter 2 Problem Solutions
get from p to q by traveling along points that are both 4-adjacent and also have values
from V
...
15(a) shows this condition; it is not possible to get to q
...
P2
...
In this case the length of shortest mand 8-paths is the same
...
(b) One
possibility for the shortest 4-path when V = f1; 2g is shown in Fig
...
15(c); its length
is 6
...

One possibility for the shortest 8-path (it is not unique) is shown in Fig
...
15(d); its
length is 4
...


Problem 2
...
2
(a)
s = T (r) =

1
:
1 + (m=r)E

Problem 3
...
Since the number of pixels
would not change, this would cause the height some of the remaining histogram peaks
to increase in general
...


Problem 3
...
To obtain a uniform (flat) histogram would require in general that pixel intensities
be actually redistributed so that there are L groups of n=L pixels with the same intensity,
where L is the number of allowed discrete intensity levels and n is the total number of
pixels in the input image
...


Problem 3
...

Consider the probability density function shown in Fig
...
8(a)
...
(3
...

P3
...
Because pr (r) is a probability density function we know from the discussion

14

Chapter 3 Problem Solutions
in Section 3
...
1 that the transformation T (r) satisfies conditions (a) and (b) stated in
that section
...
P3
...
It is important to note that the reason the inverse transformation
function turned out not to be single valued is the gap in pr (r) in the interval [1=4; 3=4]
...
14

15

for k = 1; 2; : : : ; K ¡ 1;where nk is the number of pixels having gray level value rk , n
is the total number of pixels in the neighborhood, and K is the total number of possible
gray levels
...
This deletes
the leftmost column and introduces a new column on the right
...
The preceding equation can
be written also as
1
p0 (rk ) = pr (rk ) + [nRk ¡ nLk ]
r
n
for k = 0; 1; : : : ; K ¡ 1: The same concept applies to other modes of neighborhood
motion:
1
p0 (rk ) = pr (rk ) + [bk ¡ ak ]
r
n
for k = 0; 1; : : : ; K ¡ 1, where ak is the number of pixels with value rk in the neighborhood area deleted by the move, and bk is the corresponding number introduced by the
move
...
The various
¾2 i are simply samples of the noise, which is has variance ¾2
...
(3
...


Problem 3
...
Change detection via subtraction is based on
computing the simple difference d(x; y) = g(x; y) ¡ f (x; y)
...
One way is use a
pixel-by-pixel analysis
...
Usually, the same value of threshold is

16

Chapter 3 Problem Solutions
used for both negative and positive differences, in which case we have a band [¡T; T ]
in which all pixels of d(x; y) must fall in order for f (x; y) to be declared acceptable
...
Note that the absolute value needs to be used to avoid errors
cancelling out
...

There are three fundamental factors that need tight control for difference-based inspection to work: (1) proper registration, (2) controlled illumination, and (3) noise levels
that are low enough so that difference values are not affected appreciably by variations
due to noise
...
Two images can be identical, but if they are
displaced with respect to each other, comparing the differences between them makes
no sense
...
One approach often used in conjunction with illumination control is
intensity scaling based on actual conditions
...

Finally, the noise content of a difference image needs to be low enough so that it does
not materially affect comparisons between the golden and input images
...
Another (sometimes
complementary) approach is to implement image processing techniques (e
...
, image
averaging) to reduce noise
...
For example, additional intelligence in the form of tests that are more sophisticated than pixel-bypixel threshold comparisons can be implemented
...


Problem 3
...
Since all the coefficients are 1 (we are ignoring the 1/9

Problem 3
...
Initially, it takes 8 additions to produce the response of the mask
...
The new response can be computed as
Rnew = Rold ¡ C1 + C3

where C1 is the sum of pixels under the first column of the mask before it was moved,
and C3 is the similar sum in the column it picked up after it moved
...
For a 3 £ 3 mask it takes 2 additions to get C3
(C1 was already computed)
...
Thus, a total of 4 arithmetic operations are needed to update the response after
one move
...
When we get to the end of a row, we move down one pixel (the nature of the
computation is the same) and continue the scan in the opposite direction
...
A brute-force implementation would require n2 ¡ 1
additions after each move
...
19
(a) There are n2 points in an n £ n median filter mask
...
However, since the area
A (number of points) in the cluster is less than one half n2 , and A and n are integers,
it follows that A is always less than or equal to (n2 ¡ 1)=2
...

Therefore, if the center point in the mask is a cluster point, it will be set to the median
value, which is a background shade, and thus it will be “eliminated” from the cluster
...


18

Chapter 3 Problem Solutions

Problem 3
...
The median is
³ = [(n2 + 1)=2]-th largest value
...


Problem 3
...
3
...
The phenomenon in question is related to the horizontal separation between
bars, so we can simplify the problem by considering a single scan line through the bars
in the image
...
Consider the scan line shown in Fig
...
22
...
The response of the mask is the average of the pixels that it encompasses
...
In fact, the number of pixels belonging to the vertical bars and contained
within the mask does not change, regardless of where the mask is located (as long as it
is contained within the bars, and not near the edges of the set of bars)
...
Note that this constant response does not happen with the 23 £ 23
or the 45 £ 45 masks because they are not ”synchronized” with the width of the bars and
their separation
...
25

19

Problem 3
...
It is given that

@2 f
@2 f
+ 2
@x2
@y
@2 f
@2f
+ 02 :
@x02 @y

x = x0 cos µ ¡ y 0 sin µ and y = x0 sin µ + y 0 cos µ

where µ is the angle of rotation
...
We start with
@f
=
@x0

@f @x
@f @y
+
0
@x @x
@y @x0
@f
@f
=
cos µ +
sin µ
@x
@y
Taking the partial derivative of this expression again with respect to x0 yields
@2 f
@2 f
@
=
cos2 µ +
02
2
@x
@x
@x

µ

@f
@y



sin µ cos µ +

@
@y

µ

@f
@x



cos µ sin µ +

@2 f
sin2 µ
@y 2

Next, we compute
@f
@y 0

@f @x
@f @y
+
@x @y0
@y @y 0
@f
@f
= ¡
sin µ +
cos µ
@x
@y
Taking the derivative of this expression again with respect to y 0 gives
=

µ ¶
µ ¶
@2 f
@2 f
@ @f
@ @f
@ 2f
2
=
sin µ ¡
cos µ sin µ ¡
sin µ cos µ + 2 cos2 µ
@y02
@x2
@x @y
@y @x
@y
Adding the two expressions for the second derivatives yields
@2 f
@2 f
@ 2f
@2 f
+ 02 =
+ 2
@x02
@y
@x2
@y
which proves that the Laplacian operator is independent of rotation
...
27
Consider the following equation:

20

Chapter 3 Problem Solutions
f(x; y) ¡ r2 f (x; y) = f (x; y) ¡ [f (x + 1; y) + f (x ¡ 1; y) + f (x; y + 1)
+f (x; y ¡ 1) ¡ 4f (x; y)]
= 6f (x; y) ¡ [f (x + 1; y) + f(x ¡ 1; y) + f (x; y + 1)
+f (x; y ¡ 1) + f (x; y)]
= 5 f1:2f(x; y)¡
1
[f (x + 1; y) + f(x ¡ 1; y) + f (x; y + 1)
5
+f (x; y ¡ 1) + f(x; y)]g
£
¤
= 5 1:2f (x; y) ¡ f (x; y)

where f (x; y) denotes the average of f (x; y) in a predefined neighborhood that is centered at (x; y) and includes the center pixel and its four immediate neighbors
...
(3
...
Thus, it has been demonstrated that subtracting the Laplacian from an
image is proportional to unsharp masking
Title: Digital image Processing
Description: Image processing is a method to convert an image into digital form and perform some operations on it