100% found this document useful (3 votes)
111 views

(Ebook PDF) Digital Image Processing, Global Edition 4th Edition 2024 Scribd Download

Digital

Uploaded by

yiawsoso
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
111 views

(Ebook PDF) Digital Image Processing, Global Edition 4th Edition 2024 Scribd Download

Digital

Uploaded by

yiawsoso
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Download the full version of the ebook now at ebooksecure.

com

(eBook PDF) Digital Image Processing, Global


Edition 4th Edition

https://ebooksecure.com/product/ebook-pdf-digital-
image-processing-global-edition-4th-edition/

Explore and download more ebook at https://ebooksecure.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

(eBook PDF) Digital Image Processing 4th Edition by Rafael


C. Gonzalez

https://ebooksecure.com/product/ebook-pdf-digital-image-
processing-4th-edition-by-rafael-c-gonzalez/

ebooksecure.com

Digital Image Processing Using MATLAB 1st edition - eBook


PDF

https://ebooksecure.com/download/digital-image-processing-using-
matlab-ebook-pdf/

ebooksecure.com

(eBook PDF) Image Operators: Image Processing in Python

https://ebooksecure.com/product/ebook-pdf-image-operators-image-
processing-in-python/

ebooksecure.com

(Original PDF) PP0952 - Learning Statistics and EXCEL in


Tandem

https://ebooksecure.com/product/original-pdf-pp0952-learning-
statistics-and-excel-in-tandem/

ebooksecure.com
(eBook PDF) Cornerstones for Community College Success 2nd
Edition

https://ebooksecure.com/product/ebook-pdf-cornerstones-for-community-
college-success-2nd-edition/

ebooksecure.com

(eBook PDF) Contract Law: Text, Cases, and Materials 9th


Edition

https://ebooksecure.com/product/ebook-pdf-contract-law-text-cases-and-
materials-9th-edition/

ebooksecure.com

(eBook PDF) Financial Institutions Markets and Money 12th


Edition

https://ebooksecure.com/product/ebook-pdf-financial-institutions-
markets-and-money-12th-edition/

ebooksecure.com

(eBook PDF) Mastering Organizational Behavior Version 14.0

https://ebooksecure.com/product/ebook-pdf-mastering-organizational-
behavior-version-14-0/

ebooksecure.com

(eBook PDF) Introduction to World Philosophy: A


Multicultural Reader 1st Edition

https://ebooksecure.com/product/ebook-pdf-introduction-to-world-
philosophy-a-multicultural-reader-1st-edition/

ebooksecure.com
Biochemistry of Lipids, Lipoproteins and Membranes 7th
Edition Neale Ridgway (Editor) - eBook PDF

https://ebooksecure.com/download/biochemistry-of-lipids-lipoproteins-
and-membranes-ebook-pdf/

ebooksecure.com
GLOBAL GLOBAL
EDITION EDITION

For these Global Editions, the editorial team at Pearson has

Digital Image Processing


collaborated with educators across the world to address a
wide range of subjects and requirements, equipping students
with the best possible learning tools. This Global Edition
preserves the cutting-edge approach and pedagogy of the
original, but also features alterations, customization, and
adaptation from the North American version.
Digital Image Processing
FOURTH EDITION

Rafael C. Gonzalez • Richard E. Woods

EDITION
FOURTH
This is a special edition of an established
title widely used by colleges and universities

Woods
Gonzalez
throughout the world. Pearson published this
exclusive edition for the benefit of students
outside the United States and Canada. If
you purchased this book within the United
States or Canada, you should be aware that
it has been imported without the approval of
EDITION
GLOBAL
the Publisher or Author. The Global Edition
is not supported in the United States and
Canada.

Pearson Global Edition

Gonzalez_04_1292223049_Final.indd 1 11/08/17 5:27 PM


6 Contents

4 Filtering in the Frequency


Domain 203
Background 204
Preliminary Concepts 207
Sampling and the Fourier Transform of Sampled
Functions 215
The Discrete Fourier Transform of One Variable 225
Extensions to Functions of Two Variables 230
Some Properties of the 2-D DFT and IDFT 240
The Basics of Filtering in the Frequency Domain 260
Image Smoothing Using Lowpass Frequency Domain
Filters 272
Image Sharpening Using Highpass Filters 284
Selective Filtering 296
The Fast Fourier Transform 303

5 Image Restoration
and Reconstruction 317
A Model of the Image Degradation/Restoration
process 318
Noise Models 318
Restoration in the Presence of Noise Only—Spatial Filtering 327
Periodic Noise Reduction Using Frequency Domain Filtering 340
Linear, Position-Invariant Degradations 348
Estimating the Degradation Function 352
Inverse Filtering 356
Minimum Mean Square Error (Wiener) Filtering 358
Constrained Least Squares Filtering 363
Geometric Mean Filter 367
Image Reconstruction from Projections 368

6 Color Image Processing 399


Color Fundamentals 400
Color Models 405
Pseudocolor Image Processing 420
Basics of Full-Color Image Processing 429
Color Transformations 430

DIP4E_GLOBAL_Print_Ready.indb 6 6/16/2017 2:01:57 PM


Contents 7

Color Image Smoothing and Sharpening 442


Using Color in Image Segmentation 445
Noise in Color Images 452
Color Image Compression 455

7 Wavelet and Other Image Transforms 463


Preliminaries 464
Matrix-based Transforms 466
Correlation 478
Basis Functions in the Time-Frequency Plane 479
Basis Images 483
Fourier-Related Transforms 484
Walsh-Hadamard Transforms 496
Slant Transform 500
Haar Transform 502
Wavelet Transforms 504

8 Image Compression and


Watermarking 539
Fundamentals 540
Huffman Coding 553
Golomb Coding 556
Arithmetic Coding 561
LZW Coding 564
Run-length Coding 566
Symbol-based Coding 572
Bit-plane Coding 575
Block Transform Coding 576
Predictive Coding 594
Wavelet Coding 614
Digital Image Watermarking 624

9 Morphological Image Processing 635


Preliminaries 636
Erosion and Dilation 638
Opening and Closing 644
The Hit-or-Miss Transform 648

DIP4E_GLOBAL_Print_Ready.indb 7 6/16/2017 2:01:57 PM


8 Contents

Some Basic Morphological Algorithms 652


Morphological Reconstruction 667
Summary of Morphological Operations on Binary Images 673
Grayscale Morphology 674

10 Image Segmentation 699


Fundamentals 700
Point, Line, and Edge Detection 701
Thresholding 742
Segmentation by Region Growing and by Region Splitting and
Merging 764
Region Segmentation Using Clustering and
Superpixels 770
Region Segmentation Using Graph Cuts 777
Segmentation Using Morphological Watersheds 786
The Use of Motion in Segmentation 796

11 Feature Extraction 811


Background 812
Boundary Preprocessing 814
Boundary Feature Descriptors 831
Region Feature Descriptors 840
Principal Components as Feature Descriptors 859
Whole-Image Features 868
Scale-Invariant Feature Transform (SIFT) 881

12 Image Pattern Classification 903


Background 904
Patterns and Pattern Classes 906
Pattern Classification by Prototype Matching 910
Optimum (Bayes) Statistical Classifiers 923
Neural Networks and Deep Learning 931
Deep Convolutional Neural Networks 964
Some Additional Details of Implementation 987

Bibliography 995
Index 1009

DIP4E_GLOBAL_Print_Ready.indb 8 7/12/2017 10:23:39 AM


Preface
When something can be read without effort, great effort has gone into its writing.
Enrique Jardiel Poncela

This edition of Digital Image Processing is a major revision of the book. As in


the 1977 and 1987 editions by Gonzalez and Wintz, and the 1992, 2002, and 2008
editions by Gonzalez and Woods, this sixth-generation edition was prepared
with students and instructors in mind. The principal objectives of the book
continue to be to provide an introduction to basic concepts and methodologies
applicable to digital image processing, and to develop a foundation that can
be used as the basis for further study and research in this field. To achieve
these objectives, we focused again on material that we believe is fundamental
and whose scope of application is not limited to the solution of specialized
problems. The mathematical complexity of the book remains at a level well
within the grasp of college seniors and first-year graduate students who have
introductory preparation in mathematical analysis, vectors, matrices, probability,
statistics, linear systems, and computer programming. The book website pro-
vides tutorials to support readers needing a review of this background material.
One of the principal reasons this book has been the world leader in its field for
40 years is the level of attention we pay to the changing educational needs of our
readers. The present edition is based on an extensive survey that involved faculty,
students, and independent readers of the book in 150 institutions from 30 countries.
The survey revealed a need for coverage of new material that has matured since the
last edition of the book. The principal findings of the survey indicated a need for:

• Expanded coverage of the fundamentals of spatial filtering.


• A more comprehensive and cohesive coverage of image transforms.
• A more complete presentation of finite differences, with a focus on edge detec-
tion.
• A discussion of clustering, superpixels, and their use in region segmentation.
• Coverage of maximally stable extremal regions.
• Expanded coverage of feature extraction to include the Scale Invariant Feature
Transform (SIFT).
• Expanded coverage of neural networks to include deep neural networks, back-
propagation, deep learning, and, especially, deep convolutional neural networks.
• More homework exercises at the end of the chapters.

The new and reorganized material that resulted in the present edition is our
attempt at providing a reasonable balance between rigor, clarity of presentation,
and the findings of the survey. In addition to new material, earlier portions of the
text were updated and clarified. This edition contains 241 new images, 72 new draw-
ings, and 135 new exercises.

DIP4E_GLOBAL_Print_Ready.indb 9 6/16/2017 2:01:57 PM


10 Preface

New to This Edition


The highlights of this edition are as follows.
Chapter 1: Some figures were updated, and parts of the text were rewritten to cor-
respond to changes in later chapters.
Chapter 2: Many of the sections and examples were rewritten for clarity. We
added 14 new exercises.
Chapter 3: Fundamental concepts of spatial filtering were rewritten to include a
discussion on separable filter kernels, expanded coverage of the properties of low-
pass Gaussian kernels, and expanded coverage of highpass, bandreject, and band-
pass filters, including numerous new examples that illustrate their use. In addition to
revisions in the text, including 6 new examples, the chapter has 59 new images, 2 new
line drawings, and 15 new exercises.
Chapter 4: Several of the sections of this chapter were revised to improve the clar-
ity of presentation. We replaced dated graphical material with 35 new images and 4
new line drawings. We added 21 new exercises.
Chapter 5: Revisions to this chapter were limited to clarifications and a few cor-
rections in notation. We added 6 new images and 14 new exercises,
Chapter 6: Several sections were clarified, and the explanation of the CMY and
CMYK color models was expanded, including 2 new images.
Chapter 7: This is a new chapter that brings together wavelets, several new trans-
forms, and many of the image transforms that were scattered throughout the book.
The emphasis of this new chapter is on the presentation of these transforms from a
unified point of view. We added 24 new images, 20 new drawings, and 25 new exer-
cises.
Chapter 8: The material was revised with numerous clarifications and several
improvements to the presentation.
Chapter 9: Revisions of this chapter included a complete rewrite of several sec-
tions, including redrafting of several line drawings. We added 16 new exercises
Chapter 10: Several of the sections were rewritten for clarity. We updated the
chapter by adding coverage of finite differences, K-means clustering, superpixels,
and graph cuts. The new topics are illustrated with 4 new examples. In total, we
added 29 new images, 3 new drawings, and 6 new exercises.
Chapter 11: The chapter was updated with numerous topics, beginning with a more
detailed classification of feature types and their uses. In addition to improvements in
the clarity of presentation, we added coverage of slope change codes, expanded the
explanation of skeletons, medial axes, and the distance transform, and added sev-
eral new basic descriptors of compactness, circularity, and eccentricity. New mate-
rial includes coverage of the Harris-Stephens corner detector, and a presentation of
maximally stable extremal regions. A major addition to the chapter is a comprehen-
sive discussion dealing with the Scale-Invariant Feature Transform (SIFT). The new
material is complemented by 65 new images, 15 new drawings, and 12 new exercises.

DIP4E_GLOBAL_Print_Ready.indb 10 6/16/2017 2:01:57 PM


Preface 11

Chapter 12: This chapter underwent a major revision to include an extensive


rewrite of neural networks and deep learning, an area that has grown significantly
since the last edition of the book. We added a comprehensive discussion on fully
connected, deep neural networks that includes derivation of backpropagation start-
ing from basic principles. The equations of backpropagation were expressed in “tra-
ditional” scalar terms, and then generalized into a compact set of matrix equations
ideally suited for implementation of deep neural nets. The effectiveness of fully con-
nected networks was demonstrated with several examples that included a compari-
son with the Bayes classifier. One of the most-requested topics in the survey was
coverage of deep convolutional neural networks. We added an extensive section on
this, following the same blueprint we used for deep, fully connected nets. That is, we
derived the equations of backpropagation for convolutional nets, and showed how
they are different from “traditional” backpropagation. We then illustrated the use of
convolutional networks with simple images, and applied them to large image data-
bases of numerals and natural scenes. The written material is complemented by 23
new images, 28 new drawings, and 12 new exercises.
Also for the first time, we have created student and faculty support packages that
can be downloaded from the book website. The Student Support Package contains
many of the original images in the book and answers to selected exercises The Fac-
ulty Support Package contains solutions to all exercises, teaching suggestions, and all
the art in the book in the form of modifiable PowerPoint slides. One support pack-
age is made available with every new book, free of charge.
The book website, established during the launch of the 2002 edition, continues to
be a success, attracting more than 25,000 visitors each month. The site was upgraded
for the launch of this edition. For more details on site features and content, see The
Book Website, following the Acknowledgments section.
This edition of Digital Image Processing is a reflection of how the educational
needs of our readers have changed since 2008. As is usual in an endeavor such as
this, progress in the field continues after work on the manuscript stops. One of the
reasons why this book has been so well accepted since it first appeared in 1977 is its
continued emphasis on fundamental concepts that retain their relevance over time.
This approach, among other things, attempts to provide a measure of stability in a
rapidly evolving body of knowledge. We have tried to follow the same principle in
preparing this edition of the book.

R.C.G.
R.E.W.

DIP4E_GLOBAL_Print_Ready.indb 11 6/16/2017 2:01:57 PM


12 Acknowledgments

Acknowledgments
We are indebted to a number of individuals in academic circles, industry, and gov-
ernment who have contributed to this edition of the book. In particular, we wish
to extend our appreciation to Hairong Qi and her students, Zhifei Zhang and
Chengcheng Li, for their valuable review of the material on neural networks, and for
their help in generating examples for that material. We also want to thank Ernesto
Bribiesca Correa for providing and reviewing material on slope chain codes, and
Dirk Padfield for his many suggestions and review of several chapters in the book.
We appreciate Michel Kocher’s many thoughtful comments and suggestions over
the years on how to improve the book. Thanks also to Steve Eddins for his sugges-
tions on MATLAB and related software issues.
Numerous individuals have contributed to material carried over from the previ-
ous to the current edition of the book. Their contributions have been important in so
many different ways that we find it difficult to acknowledge them in any other way
but alphabetically. We thank Mongi A. Abidi, Yongmin Kim, Bryan Morse, Andrew
Oldroyd, Ali M. Reza, Edgardo Felipe Riveron, Jose Ruiz Shulcloper, and Cameron
H.G. Wright for their many suggestions on how to improve the presentation and/or
the scope of coverage in the book. We are also indebted to Naomi Fernandes at the
MathWorks for providing us with MATLAB software and support that were impor-
tant in our ability to create many of the examples and experimental results included
in this edition of the book.
A significant percentage of the new images used in this edition (and in some
cases their history and interpretation) were obtained through the efforts of indi-
viduals whose contributions are sincerely appreciated. In particular, we wish to
acknowledge the efforts of Serge Beucher, Uwe Boos, Michael E. Casey, Michael
W. Davidson, Susan L. Forsburg, Thomas R. Gest, Daniel A. Hammer, Zhong He,
Roger Heady, Juan A. Herrera, John M. Hudak, Michael Hurwitz, Chris J. Johannsen,
Rhonda Knighton, Don P. Mitchell, A. Morris, Curtis C. Ober, David. R. Pickens,
Michael Robinson, Michael Shaffer, Pete Sites, Sally Stowe, Craig Watson, David
K. Wehe, and Robert A. West. We also wish to acknowledge other individuals and
organizations cited in the captions of numerous figures throughout the book for
their permission to use that material.
We also thank Scott Disanno, Michelle Bayman, Rose Kernan, and Julie Bai for
their support and significant patience during the production of the book.

R.C.G.
R.E.W.

DIP4E_GLOBAL_Print_Ready.indb 12 6/16/2017 2:01:57 PM


The Book Website
www.ImageProcessingPlace.com
Digital Image Processing is a completely self-contained book. However, the compan-
ion website offers additional support in a number of important areas.
For the Student or Independent Reader the site contains
• Reviews in areas such as probability, statistics, vectors, and matrices.
• A Tutorials section containing dozens of tutorials on topics relevant to the mate-
rial in the book.
• An image database containing all the images in the book, as well as many other
image databases.
For the Instructor the site contains
• An Instructor’s Manual with complete solutions to all the problems.
• Classroom presentation materials in modifiable PowerPoint format.
• Material removed from previous editions, downloadable in convenient PDF
format.
• Numerous links to other educational resources.
For the Practitioner the site contains additional specialized topics such as
• Links to commercial sites.
• Selected new references.
• Links to commercial image databases.
The website is an ideal tool for keeping the book current between editions by includ-
ing new topics, digital images, and other relevant material that has appeared after
the book was published. Although considerable care was taken in the production
of the book, the website is also a convenient repository for any errors discovered
between printings.

The DIP4E Support Packages


In this edition, we created support packages for students and faculty to organize
all the classroom support materials available for the new edition of the book into
one easy download. The Student Support Package contains many of the original
images in the book, and answers to selected exercises, The Faculty Support Package
contains solutions to all exercises, teaching suggestions, and all the art in the book
in modifiable PowerPoint slides. One support package is made available with every
new book, free of charge. Applications for the support packages are submitted at
the book website.

DIP4E_GLOBAL_Print_Ready.indb 13 6/16/2017 2:01:57 PM


About the Authors
RAFAEL C. GONZALEZ
R. C. Gonzalez received the B.S.E.E. degree from the University of Miami in 1965
and the M.E. and Ph.D. degrees in electrical engineering from the University of
Florida, Gainesville, in 1967 and 1970, respectively. He joined the Electrical and
Computer Science Department at the University of Tennessee, Knoxville (UTK) in
1970, where he became Associate Professor in 1973, Professor in 1978, and Distin-
guished Service Professor in 1984. He served as Chairman of the department from
1994 through 1997. He is currently a Professor Emeritus at UTK.
Gonzalez is the founder of the Image & Pattern Analysis Laboratory and the
Robotics & Computer Vision Laboratory at the University of Tennessee. He also
founded Perceptics Corporation in 1982 and was its president until 1992. The last
three years of this period were spent under a full-time employment contract with
Westinghouse Corporation, who acquired the company in 1989.
Under his direction, Perceptics became highly successful in image processing,
computer vision, and laser disk storage technology. In its initial ten years, Perceptics
introduced a series of innovative products, including: The world’s first commercially
available computer vision system for automatically reading license plates on moving
vehicles; a series of large-scale image processing and archiving systems used by the
U.S. Navy at six different manufacturing sites throughout the country to inspect the
rocket motors of missiles in the Trident II Submarine Program; the market-leading
family of imaging boards for advanced Macintosh computers; and a line of trillion-
byte laser disk products.
He is a frequent consultant to industry and government in the areas of pattern
recognition, image processing, and machine learning. His academic honors for work
in these fields include the 1977 UTK College of Engineering Faculty Achievement
Award; the 1978 UTK Chancellor’s Research Scholar Award; the 1980 Magnavox
Engineering Professor Award; and the 1980 M.E. Brooks Distinguished Professor
Award. In 1981 he became an IBM Professor at the University of Tennessee and
in 1984 he was named a Distinguished Service Professor there. He was awarded a
Distinguished Alumnus Award by the University of Miami in 1985, the Phi Kappa
Phi Scholar Award in 1986, and the University of Tennessee’s Nathan W. Dougherty
Award for Excellence in Engineering in 1992.
Honors for industrial accomplishment include the 1987 IEEE Outstanding Engi-
neer Award for Commercial Development in Tennessee; the 1988 Albert Rose
National Award for Excellence in Commercial Image Processing; the 1989 B. Otto
Wheeley Award for Excellence in Technology Transfer; the 1989 Coopers and
Lybrand Entrepreneur of the Year Award; the 1992 IEEE Region 3 Outstanding
Engineer Award; and the 1993 Automated Imaging Association National Award for
Technology Development.
Gonzalez is author or co-author of over 100 technical articles, two edited books,
and four textbooks in the fields of pattern recognition, image processing, and robot-
ics. His books are used in over 1000 universities and research institutions throughout

DIP4E_GLOBAL_Print_Ready.indb 14 6/16/2017 2:01:57 PM


Visit https://testbankfan.com
now to explore a rich
collection of testbank or
solution manual and enjoy
exciting offers!
the world. He is listed in the prestigious Marquis Who’s Who in America, Marquis
Who’s Who in Engineering, Marquis Who’s Who in the World, and in 10 other national
and international biographical citations. He is the co-holder of two U.S. Patents, and
has been an associate editor of the IEEE Transactions on Systems, Man and Cyber-
netics, and the International Journal of Computer and Information Sciences. He is a
member of numerous professional and honorary societies, including Tau Beta Pi, Phi
Kappa Phi, Eta Kappa Nu, and Sigma Xi. He is a Fellow of the IEEE.

RICHARD E. WOODS
R. E. Woods earned his B.S., M.S., and Ph.D. degrees in Electrical Engineering from
the University of Tennessee, Knoxville in 1975, 1977, and 1980, respectively. He
became an Assistant Professor of Electrical Engineering and Computer Science in
1981 and was recognized as a Distinguished Engineering Alumnus in 1986.
A veteran hardware and software developer, Dr. Woods has been involved in
the founding of several high-technology startups, including Perceptics Corporation,
where he was responsible for the development of the company’s quantitative image
analysis and autonomous decision-making products; MedData Interactive, a high-
technology company specializing in the development of handheld computer systems
for medical applications; and Interapptics, an internet-based company that designs
desktop and handheld computer applications.
Dr. Woods currently serves on several nonprofit educational and media-related
boards, including Johnson University, and was recently a summer English instructor
at the Beijing Institute of Technology. He is the holder of a U.S. Patent in the area
of digital image processing and has published two textbooks, as well as numerous
articles related to digital signal processing. Dr. Woods is a member of several profes-
sional societies, including Tau Beta Pi, Phi Kappa Phi, and the IEEE.

DIP4E_GLOBAL_Print_Ready.indb 15 6/16/2017 2:01:57 PM


This page intentionally left blank

DIP4E_GLOBAL_Print_Ready.indb 4 6/16/2017 2:01:57 PM


1 Introduction

One picture is worth more than ten thousand words.


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 tasks such as storage,
transmission, and extraction of pictorial information. This chapter has several objectives: (1) to define
the scope of the field that we call image processing; (2) to give a historical perspective of the origins of
this field; (3) to present an overview of the state of the art in image processing by examining some of
the principal areas in which it is applied; (4) to discuss briefly the principal approaches used in digital
image processing; (5) to give an overview of the components contained in a typical, general-purpose
image processing system; and (6) to provide direction to the literature where image processing work is
reported. The material in this chapter is extensively illustrated with a range of images that are represen-
tative of the images we will be using throughout the book.

Upon completion of this chapter, readers should:


Understand the concept of a digital image. Be aware of the different fields in which digi-
Have a broad overview of the historical under- tal image processing methods are applied.
pinnings of the field of digital image process- Be familiar with the basic processes involved
ing. in image processing.
Understand the definition and scope of digi- Be familiar with the components that make
tal image processing. up a general-purpose digital image process-
ing system.
Know the fundamentals of the electromag-
netic spectrum and its relationship to image Be familiar with the scope of the literature
generation. where image processing work is reported.

17

DIP4E_GLOBAL_Print_Ready.indb 17 6/16/2017 2:01:58 PM


18 Chapter 1 Introduction

1.1 WHAT IS DIGITAL IMAGE PROCESSING?


1.1

An image may be defined as a two-dimensional function, f ( x, y), where x and y are


spatial (plane) coordinates, and the amplitude of f at any pair of coordinates ( x, y)
is called the intensity or gray level of the image at that point. When x, y, and the
intensity values of f are all finite, discrete quantities, we call the image a digital image.
The field of digital image processing refers to processing digital images by means of
a digital computer. Note that a digital image is composed of a finite number of ele-
ments, each of which has a particular location and value. These elements are called
picture elements, image elements, pels, and pixels. Pixel is the term used most widely
to denote the elements of a digital image. We will consider these definitions in more
formal terms in Chapter 2.
Vision is the most advanced of our senses, so it is not surprising that images
play the single most important role in human perception. 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.
They can operate on images generated by sources that humans are not accustomed
to associating with images. These include ultrasound, electron microscopy, and com-
puter-generated images. Thus, digital image processing encompasses a wide and var-
ied field of applications.
There is no general agreement among authors regarding where image process-
ing stops and other related areas, such as image analysis and computer vision, start.
Sometimes, a distinction is made by defining image processing as a discipline in
which both the input and output of a process are images. We believe this to be a
limiting and somewhat artificial boundary. For example, under this definition, even
the trivial task of computing the average intensity of an image (which yields a sin-
gle number) would not be considered an image processing operation. On the other
hand, there are fields such as computer vision whose ultimate goal is to use comput-
ers to emulate human vision, including learning and being able to make inferences
and take actions based on visual inputs. This area itself is a branch of artificial intel-
ligence (AI) whose objective is to emulate human intelligence. The field of AI is in its
earliest stages of infancy in terms of development, with progress having been much
slower than originally anticipated. The area of image analysis (also called image
understanding) is in between image processing and computer vision.
There are no clear-cut boundaries in the continuum from image processing at
one end to computer vision at the other. However, one useful paradigm is to con-
sider three types of computerized processes in this continuum: low-, mid-, and high-
level processes. Low-level processes involve primitive operations such as image
preprocessing to reduce noise, contrast enhancement, and image sharpening. A low-
level process is characterized by the fact that both its inputs and outputs are images.
Mid-level processing of 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. A mid-level process is characterized by the fact that its inputs generally
are images, but its outputs are attributes extracted from those images (e.g., edges,
contours, and the identity of individual objects). Finally, higher-level processing

DIP4E_GLOBAL_Print_Ready.indb 18 6/16/2017 2:01:58 PM


1.2 The Origins of Digital Image Processing 19

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 human vision.
Based on the preceding comments, we see that a logical place of overlap between
image processing and image analysis is the area of recognition of individual regions
or objects in an image. Thus, what we call in this book digital image processing encom-
passes processes whose inputs and outputs are images and, in addition, includes pro-
cesses that extract attributes from images up to, and including, the recognition of
individual objects. As an illustration to clarify these concepts, consider the area of
automated analysis of text. The processes of acquiring an image of the area con-
taining 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. Making sense of the content of the page may be viewed as
being in the domain of image analysis and even computer vision, depending on the
level of complexity implied by the statement “making sense of.” As will become
evident shortly, digital image processing, as we have defined it, is used routinely in a
broad range of areas of exceptional social and economic value. The concepts devel-
oped in the following chapters are the foundation for the methods used in those
application areas.

1.2 THE ORIGINS OF DIGITAL IMAGE PROCESSING


1.2

One of the earliest applications of digital images was in the newspaper industry,
when pictures were first sent by submarine cable between London and New York.
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. Specialized printing equipment coded pictures for
cable transmission, then reconstructed them at the receiving end. Figure 1.1 was
transmitted in this way and reproduced on a telegraph printer fitted with typefaces
simulating a halftone pattern.
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

FIGURE 1.1 A digital picture produced in 1921 from a coded tape by a telegraph printer with
special typefaces. (McFarlane.) [References in the bibliography at the end of the book are
listed in alphabetical order by authors’ last names.]

DIP4E_GLOBAL_Print_Ready.indb 19 6/16/2017 2:01:58 PM


Exploring the Variety of Random
Documents with Different Content
The Mechanics of Reason
Aristotle fathered the syllogism, or at least was first to investigate it
rigorously. He defined it as a formal argument in which the
conclusion follows logically from the premises. There are four
common statements of this type:
All S (for subject) is P (for
predicate)
No S (for subject) is P
Some S (for is P
subject)
Some S (for is not P
subject)
Thus, Aristotle might say “All men are mortal” or “No men are
immortal” as his subject. Adding an M (middle term), “Aristotle is a
man,” as a minor premise, he could logically go on and conclude
“Aristotle, being a man, is thus mortal.” Of course the syllogism
unwisely used, as it often is, can lead to some ridiculously silly
answers. “All tables have four legs. Two men have four legs. Thus,
two men equal a table.”
Despite the weaknesses of the syllogism, nevertheless it led
eventually to the science of symbolic logic. The pathway was
circuitous, even devious at times, but slowly the idea of putting
thought down as letters or numbers to be logically manipulated to
reach proper conclusions gained force and credence. While the
Greeks did not have the final say, they did have words for the subject
as they did for nearly everything else.
Let us leave the subject of pure logic for a moment and talk of
another kind of computing machine, that of the mechanical doer of
work. In the Iliad, Homer has Hephaestus, the god of natural fire and
metalworking, construct twenty three-wheeled chariots which propel
themselves to and fro bringing back messages and instructions from
the councils of the gods. These early automatons boasted pure gold
wheels, and handles of “curious cunning.”
Man has apparently been a lazy cuss from the start and began
straightway to dream of mechanical servants to do his chores. In an
age of magic and fear of the supernatural his dreams were fraught
with such machines that turned into evil monsters. The Hebrew
“golem” was made in the shape of man, but without a soul, and often
got out of hand. Literature has perpetuated the idea of machines
running amok, as the broom in “The Sorcerer’s Apprentice,” but
there have been benevolent machines too. Tik-Tok, a latter-day
windup man in The Road to Oz, could think and talk and do many
other things men could do. He was not alive, of course, but he had
the saving grace of always doing just what he “was wound up to do.”
Having touched on the subject of mechanical men, let us now
return to mechanical logic. Since the Greeks, many men have
traveled the road of reason, but some stand out more brightly, more
colorfully, than others. Such a standout was the Spanish monk
Ramón Lull. Lull was born in 1232. A court page, he rose in
influence, married young, and had two children, but did not settle
down to married domesticity. A wildly reckless romantic, he was
given to such stunts as galloping his horse into church in pursuit of
some lady who caught his eye. One such escapade led to a
remorseful re-examination of himself, and dramatic conversion to
Christianity.
He began to write books in conventional praise of Christ, but early
in his writings a preoccupation with numbers appears. His Book of
Contemplation, for example, actually contains five books for the five
wounds of the Saviour, and forty subdivisions for the days He spent
in the wilderness. There are 365 chapters for daily reading, plus one
for reading only in leap years! Each chapter has ten paragraphs,
symbolizing the ten commandments, and three parts to each
chapter. These multiplied give thirty, for the pieces of silver. Beside
religious and mystical connotations, geometric terms are also used,
and one interesting device is the symbolizing of words and even
phrases by letters. This ties in neatly with syllogism. A sample
follows:
… diversity is shown in the demonstration that the D makes of the E and the F
and the G with the I and the K, therefore the H has certain scientific knowledge of
Thy holy and glorious Trinity.

This was only prologue to the Ars Magna, the “Great Art” of
Ramón Lull. In 1274, the devout pilgrim climbed Mount Palma in
search of divine help in his writings. The result was the first recorded
attempt to use diagrams to discover and to prove non-mathematical
truths. Specifically, Lull determined that he could construct
mechanical devices that would perform logic to prove the validity of
God’s word. Where force, in the shape of the Crusades, had failed,
Lull was convinced that logical argument would win over the infidels,
and he devoted his life to the task.
Renouncing his estate, including his wife and children, Lull
devoted himself thenceforth solely to his Great Art. As a result of
dreams he had on Mount Palma, the basis for this work was the
assumption of simple premises or principles that are unquestionable.
Lull arranged these premises on rotating concentric circles. The first
of these wheels of logic was called A, standing for God. Arranged
about the circumference of the wheel were sixteen other letters
symbolizing attributes of God. The outer wheel also contained these
letters. Rotating them produced 240 two-term combinations telling
many things about God and His good. Other wheels prepared
sermons, advised physicians and scientists, and even tackled such
stumpers as “Where does the flame go when the candle is put out?”
From the Enciclopedia universal
illustrada,
Barcelona, 1923

Lull’s wheel.

Unfortunately for Lull, even divine help did not guarantee him
success. He was stoned to death by infidels in Bugia, Africa, at the
age of eighty-three. All his wheelspinning logic was to no avail in
advancing the cause of Christianity there, and most mathematicians
since have scoffed at his naïve devices as having no real merit. Far
from accepting the Ars Magna, most scholars have been “Lulled into
a secure sense of falsity,” finding it as specious as indiscriminate
syllogism.
Yet Lull did leave his mark, and many copies of his wheels have
been made and found useful. Where various permutations of
numbers or other symbols are required, such a mechanical tool is
often the fastest way of pairing them up. Even in the field of writing, a
Lullian device was popular a few decades ago in the form of the “Plot
Genii.” With this gadget the would-be author merely spun the wheels
to match up various characters with interesting situations to arrive at
story ideas. Other versions use cards to do the same job, and one
called Plotto was used by its inventor William Wallace Cook to plot
countless stories. Although these were perhaps not ideas for great
literature, eager writers paid as much as $75 for the plot boiler.
Not all serious thinkers relegated Lull to the position of fanatic
dreamer and gadgeteer. No less a mind that Gottfried Wilhelm von
Leibnitz found much to laud in Lull’s works. The Ars Magna might
well lead to a universal “algebra” of all knowledge, thought Leibnitz.
“If controversies were to arise,” he then mused, “there would be no
more reason for philosophers to dispute than there would for
accountants!”
Leibnitz applied Lull’s work to formal logic, constructed tables of
syllogisms from which he eliminated the false, and carried the work
of the “gifted crank” at bit nearer to true symbolic logic. Leibnitz also
extended the circle idea to that of overlapping them in early attempts
at logical manipulation that foreshadowed the work that John Venn
would do later. Leibnitz also saw in numbers a powerful argument for
the existence of God. God, he saw as the numeral 1, and 0 was the
nothingness from which He created the world. There are those,
including Voltaire whose Candide satirized the notion, who question
that it is the best of all possible worlds, but none can question that in
the seventeenth century Leibnitz foresaw the coming power of the
binary system. He also built arithmetical computers that could add
and subtract, multiply and divide.
A few years earlier than Leibnitz, Blaise Pascal was also
interested in computing machines. As a teen-ager working in his
father’s tax office, Pascal wearied of adding the tedious figures so he
built himself a gear-driven computer that would add eight columns of
numbers. A tall figure in the scientific world, Pascal had fathered
projective geometry at age sixteen and later established
hydrodynamics as a science. To assist a gambler friend, he also
developed the theory of probability which led to statistical science.
Another mathematical innovation of the century was that of placing
logarithms on a stick by the Scot, John Napier. What he had done, of
course, was to make an analog, or scale model of the arithmetical
numbers. “Napier’s bones” quickly became what we now call slide
rules, forerunners of a whole class of analog computers that solve
problems by being actual models of size or quantity. Newton joined
Leibnitz in contributing another valuable tool that would be used in
the computer, that of the calculus.
The Computer in Literature
Even as Plato had viewed with suspicion the infringement of
mechanical devices on man’s domain of higher thought, other men
have continued to eye the growth of “mechanisms” with mounting
alarm. The scientist and inventor battled not merely technical
difficulties, but the scornful satire and righteous condemnation of
some of their fellow men. Jonathan Swift, the Irish satirist who took a
swipe at many things that did not set well with his views, lambasted
the computing machine as a substitute for the brain. In Chapter V,
Book Three, of Gulliver’s Travels, the good dean runs up against a
scheming scientist in Laputa:
The first Professor I saw was in a very large Room, with Forty
Pupils about him. After Salutation, observing me to look earnestly
upon a Frame, which took up the greatest part of both the Length
and Breadth of the Room; he said, perhaps I might wonder to see
him employed in a Project for improving speculative knowledge by
practical and mechanical Operations. But the World would soon be
sensible of its Usefulness; and he flattered himself, that a more
noble exalted Thought never sprang in any other Man’s Head. Every
one knew how laborious the usual Method is of attaining to Arts and
Sciences; whereas by his Contrivance, the most ignorant Person at
a reasonable Charge, and with a little bodily Labour, may write
Books in Philosophy, Poetry, Politicks, Law, Mathematicks, and
Theology, without the least Assistance from Genius or Study. He
then led me to the Frame, about the Sides whereof all his Pupils
stood in Ranks. It was a Twenty Foot Square, placed in the Middle of
the Room. The Superfices was composed of several Bits of Wood,
about the Bigness of a Dye, but some larger than others. They were
all linked together by slender Wires. These Bits of Wood were
covered on every Square with Papers pasted on them; and on these
Papers were written all the Words of their Language in their several
Moods, Tenses, and Declensions, but without any Order. The
Professor then desired me to observe, for he was going to set his
Engine to work. The Pupils at his Command took each the hold of an
Iron Handle, whereof there were Forty fixed round the Edges of the
Frame; and giving them a sudden Turn, the whole Disposition of the
Words was entirely changed. He then commanded Six and Thirty of
the Lads to read the several Lines softly as they appeared upon the
Frame; and where they found three or four Words together that
might make Part of a Sentence, they dictated to the four remaining
Boys who were Scribes. This work was repeated three or four Times,
and at every Turn the Engine was so contrived, that the Words
shifted into new Places, as the square Bits of Wood moved upside
down.
Six hours a-day the young Students were employed in this Labour;
and the Professor showed me several Volumes in large Folio already
collected, of broken Sentences, which he intended to piece together,
and out of those rich Materials to give the World a compleat Body of
Art and Sciences; which however might be still improved, and much
expedited, if the Publick would raise a Fund for making and
employing five Hundred such Frames in Lagado....
Fortunately for Swift, who would have been horrified by it, he
never heard Russell Maloney’s classic story, “Inflexible Logic,” about
six monkeys pounding away at typewriters and re-creating the world
great literature. Gulliver’s Travels is not listed in their
accomplishments.
The French Revolution prompted no less an orator than Edmund
Burke to deliver in 1790 an address titled “Reflections on the French
Revolution,” in which he extols the virtues of the dying feudal order in
Europe. It galled Burke that “The Age of Chivalry is gone. That of
sophists, economists, and calculators has succeeded, and the glory
of Europe is extinguished forever.”
Seventy years later another eminent Englishman named Darwin
published a book called On the Origin of Species that in the eyes of
many readers did little to glorify man himself. Samuel Butler, better
known for his novel, The Way of All Flesh, wrote too of the
mechanical being, and was one of the first to point out just what sort
of future Darwin was suggesting. In the satirical Erewhon, he
described the machines of this mysterious land in some of the most
prophetic writing that has been done on the subject. It was almost a
hundred years ago that Butler wrote the first version, called “Darwin
Among the Machines,” but the words ring like those of a 1962 worrier
over the electronic brain. Butler’s character warns:
There is no security against the ultimate development of mechanical
consciousness in the fact of machines possessing little consciousness now.
Reflect upon the extraordinary advance which machines have made during the last
few hundred years, and note how slowly the animal and vegetable kingdoms are
advancing. The more highly organized machines are creatures not so much of
yesterday, as of the last five minutes, so to speak, in comparison with past time.
Do not let me be misunderstood as living in fear of any actually existing
machine; there is probably no known machine which is more than a prototype of
future mechanical life. The present machines are to the future as the early
Saurians to man ... what I fear is the extraordinary rapidity with which they are
becoming something very different to what they are at present.

Butler envisioned the day when the present rude cries with which
machines call out to one another will have been developed to a
speech as intricate as our own. After all, “... take man’s vaunted
power of calculation. Have we not engines which can do all manner
of sums more quickly and correctly than we can? What prizeman in
Hypothetics at any of our Colleges of Unreason can compare with
some of these machines in their own line?”
Noting another difference in man and his creation, Butler says,
... Our sum-engines never drop a figure, nor our looms a stitch; the machine is
brisk and active, when the man is weary, it is clear-headed and collected, when the
man is stupid and dull, it needs no slumber.... May not man himself become a sort
of parasite upon the machines? An affectionate machine-tickling aphid?
It can be answered that even though machines should hear never so well and
speak never so wisely, they will still always do the one or the other for our
advantage, not their own; that man will be the ruling spirit and the machine the
servant.... This is all very well. But the servant glides by imperceptible approaches
into the master, and we have come to such a pass that, even now, man must
suffer terribly on ceasing to benefit the machines. If all machines were to be
annihilated ... man should be left as it were naked upon a desert island, we should
become extinct in six weeks.
Is it not plain that the machines are gaining ground upon us, when we reflect on
the increasing number of those who are bound down to them as slaves, and of
those who devote their whole souls to the advancement of the mechanical
kingdom?

Butler considers the argument that machines at least cannot


copulate, since they have no reproductive system. “If this be taken to
mean that they cannot marry, and that we are never likely to see a
fertile union between two vapor-engines with the young ones playing
about the door of the shed, however greatly we might desire to do
so, I will readily grant it. [But] surely if a machine is able to reproduce
another machine systematically, we may say that it has a
reproductive system.”
Butler repeats his main theme. “... his [man’s] organization never
advanced with anything like the rapidity with which that of the
machine is advancing. This is the most alarming feature of the case,
and I must be pardoned for insisting on it so frequently.”
Then there is a startlingly clear vision of the machines “regarded
as a part of man’s own physical nature, being really nothing but
extra-corporeal limbs. Man ... as a machinate mammal.” This was
feared as leading to eventual weakness of man until we finally found
“man himself being nothing but soul and mechanism, an intelligent
but passionless principle of mechanical action.” And so the
Erewhonians in self-defense destroyed all inventions discovered in
the preceding 271 years!
Early Mechanical Devices
During the nineteenth century, weaving was one of the most
competitive industries in Europe, and new inventions were often
closely guarded secrets. Just such an idea was that of Frenchman
Joseph M. Jacquard, an idea that automated the loom and would
later become the basis for the first modern computers. A big problem
in weaving was how to control a multiplicity of flying needles to
create the desired pattern in the material. There were ways of doing
this, of course, but all of them were unwieldy and costly. Then
Jacquard hit on a clever scheme. If he took a card and punched
holes in it where he wanted the needles to be actuated, it was simple
to make the needles do his bidding. To change the pattern took only
another card, and cards were cheap. Patented in 1801, there were
soon thousands of Jacquard looms in operation, doing beautiful and
accurate designs at a reasonable price.
To show off the scope of his wonderful punched cards, Jacquard
had one of his looms weave a portrait of him in silk. The job took
20,000 cards, but it was a beautiful and effective testimonial. And
fatefully a copy of the silk portrait would later find its way into the
hands of a man who would do much more with the oddly punched
cards.
At about this same time, a Hungarian named Wolfgang von
Kempelen decided that machines could play games as well as work
in factories. So von Kempelen built himself a chess-playing machine
called the Maelzel Chess Automaton with which he toured Europe.
The inventor and his machine played a great game, but they didn’t
play fair. Hidden in the innards of the Maelzel Automaton was a
second human player, but this disillusioning truth was not known for
some time. Thus von Kempelen doubtless spurred other inventors to
the task, and in a short while machines would actually begin to play
the royal game. For instance, a Spaniard named L. Torres y
Quevedo built a chess-playing machine in 1914. This device played
a fair “end game” using several pieces, and its inventor predicted
future work in this direction using more advanced machines.
Charles Babbage was an English scientist with a burning desire
for accuracy. When some mathematical tables prepared for the
Astronomical Society proved to be full of errors, he angrily
determined to build a machine that would do the job with no
mistakes. Of course calculating machines had been built before; but
the machine Babbage had in mind was different. In fact, he called it
a “difference engine” because it was based on the difference tables
of the squares of numbers. The first of the “giant computers,” it was
to have hundreds of gears and shafts, ratchets and counters. Any
arithmetic problem could be set into it, and when the proper cranks
were turned, out would come an answer—the right answer because
the machine could not make a mistake. After doing some preliminary
work on his difference engine, Babbage interested the government in
his project since even though he was fairly well-to-do he realized it
would cost more money than he could afford to sink into the project.
Babbage was a respected scientist, Lucasian Professor of
Mathematics at Cambridge, and because of his reputation and the
promise of the machine, the Chancellor of the Exchequer promised
to underwrite the project.
For four years Babbage and his mechanics toiled. Instead of
completing his original idea, the scientist had succeeded only in
designing a far more complicated machine, one which would when
finished weigh about two tons. Because the parts he needed were
advanced beyond the state of the art of metalworking, Babbage was
forced to design and build them himself. In the process he decided
that industry was being run all wrong, and took time out to write a
book. It was an excellent book, a sort of forerunner to the modern
science of operations research, and Babbage’s machine shop was
doing wonders for the metalworking art.
Undaunted by the lack of progress toward a concrete result,
Babbage was thinking bigger and bigger. He was going to scrap the
difference engine, or rather put it in a museum, and build a far better
computer—an “analytical engine.” If Jacquard’s punched cards could
control the needles on a loom, they could also operate the gears and
other parts of a calculating machine. This new engine would be one
that could not only add, subtract, multiply, and divide; it would be
designed to control itself. And as the answers started to come out,
they would be fed back to do more complex problems with no further
work on the operator’s part. “Having the machine eat its own tail!”
Babbage called this sophisticated bit of programming. This
mechanical cannibalism was the root of the “feedback” principle
widely used in machines today. Echoing Watt’s steam governor, it
prophesied the coming control of machines by the machines
themselves. Besides this innovation, the machine would have a
“store,” or memory, of one thousand fifty-digit numbers that it could
draw on, and it would actually exercise judgment in selection of the
proper numbers. And as if that weren’t enough, it would print out the
correct answers automatically on specially engraved copper plates!
Space Technology Laboratories

“As soon as an Analytical Engine exists, it will


necessarily guide the future course of science.
Whenever any result is sought by its aid, the question
will then arise—by what course of calculation can
these results be arrived at by the machine in the
shortest time?” Charles Babbage—The Life of a
Philosopher, 1861.

It was a wonderful dream; a dream that might have become an


actuality in Babbage’s own time if machine technology had been as
advanced as his ideas. But for Babbage it remained only a dream, a
dream that never did work successfully. The government spent
£17,000, a huge sum for that day and time, and bowed out. Babbage
fumed and then put his own money into the machine. His mechanics
left him and became leaders in the machine-tool field, having trained
in Babbage’s workshops. In despair, he gave up on the analytical
engine and designed another difference engine. An early model of
this one would work to five accurate places, but Babbage had his
eyes on a much better goal—twenty-place accuracy. A lesser man
would have aimed more realistically and perhaps delivered workable
computers to the mathematicians and businessmen of the day.
There is a legend that his son did finish one of the simpler machines
and that it was used in actuarial accounting for many years. But
Babbage himself died in 1871 unaware of how much he had done for
the computer technology that would begin to flower a few short
decades later.
Singlehandedly he had given the computer art the idea of
programming and of sequential control, a memory in addition to the
arithmetic unit he called a “mill,” and even an automatic readout such
as is now standard on modern computers. Truly, the modern
computer was “Babbage’s dream come true.”
Symbolic Logic
Concurrently with the great strides being made with mechanical
computers that could handle mathematics, much work was also
being done with the formalizing of the logic. As hinted vaguely in the
syllogisms of the early philosophers, thinking did seem amenable to
being diagrammed, much like grammar. Augustus De Morgan
devised numerical logic systems, and George Boole set up the logic
system that has come to be known as Boolean algebra in which
reasoning becomes positive or negative terms that can be
manipulated algebraically to give valid answers.
John Venn put the idea of logic into pictures, and simple pictures
at that. His symbology looks for all the world like the three
interlocking rings of a well-known ale. These rings stand for the
subject, midterm, and predicate of the older Aristotelian syllogism.
By shading the various circles according to the major and minor
premises, the user of Venn circles can see the logical result by
inspection. Implicit in the scheme is the possibility of a mechanical or
electrical analogy to this visual method, and it was not long until
mathematicians began at least on the mechanical kind. Among these
early logic mechanizers, surprisingly, was Lewis Carroll who of
course was mathematician Charles L. Dodgson before he became a
writer.
Carroll, who was a far busier man than most of us ever guess,
marketed a “Game of Logic,” with a board and colored cardboard
counters that handled problems like the following:

All teetotalers like sugar.


No nightingale drinks wine.

By arranging the counters on Carroll’s game board so that: All M are


X, and No Y is not-M, we learn that No Y is not-X! This tells the
initiate logician that no nightingale dislikes sugar; a handy piece of
information for bird-fancier and sugar-broker alike.
Lewis Carroll’s “Symbolic Logic.”

Charles, the third Earl Stanhope, was only slightly less


controversial than his prime minister, William Pitt. Scientifically he
was far out too, writing books on electrical theory, inventing
steamboats, microscopes, and printing presses among an odd
variety of projects; he also became interested in mechanical logic
and designed the “Stanhope Demonstrator,” a contrivance like a
checkerboard with sliding panels. By properly manipulating the
demonstrator he could solve such problems as:

Eight of ten children are bright.


Four of these children are boys.

What are the minimum and maximum number of bright boys? A


simple sliding of scales on the Stanhope Demonstrator shows that
two must be boys and as many as four may be. This clever device
could also work out probability problems such as how many heads
and tails will come up in so many tosses of a coin.
In 1869 William S. Jevons, an English economist and expert
logician, built a logic machine. His was not the first, of course, but it
had a unique distinction in that it solved problems faster than the
human brain could! Using Boolean algebra principles, he built a
“logical abacus” and then even a “logical piano.” By simply pressing
the keys of this machine, the user could make the answer appear on
its face. It is of interest that Jevons thought his machine of no
practical use, since complex logical questions seldom arose in
everyday life! Life, it seems, was simpler in 1869 than it is today, and
we should be grateful that Jevons pursued his work through sheer
scientific interest.
More sophisticated than the Jevons piano, the logic machine
invented in America by Allan Marquand could handle four terms and
do problems like the following:
There are four schoolgirls, Anna, Bertha, Cora, and Dora.
When Anna or Bertha, or both, remain home, Cora is at home.
When Bertha is out, Anna is out.
Whenever Cora is at home, Anna is too.
What can we tell about Dora?

The machine is smart enough to tell us that when Dora is at home


the other three girls are all at home or out. The same thing is true
when Dora is out.
The Census Taker
Moving from the sophistication of such logic devices, we find a
tremendous advance in mechanical computers spurred by such a
mundane chore as the census. The 1880 United States census
required seven years for compiling; and that with only 50 million
heads to reckon. It was plain to see that shortly a ten-year census
would be impossible of completion unless something were done to
cut the birth rate or speed the counting. Dr. Herman Hollerith was the
man who did something about it, and as a result the 1890 census,
with 62 million people counted, took only one-third the time of the
previous tally.
Hollerith, a statistician living in Buffalo, New York, may or may not
have heard the old saw about statistics being able to support
anything—including the statisticians, but there was a challenge in the
rapid growth of population that appealed to the inventor in him and
he set to work. He came up with a card punched with coded holes, a
card much like that used by Jacquard on his looms, and by Babbage
on the dream computer that became a nightmare. But Hollerith did
not meet the fate of his predecessors. Not stoned, or doomed to die
a failure, Hollerith built his card machines and contracted with the
government to do the census work. “It was a good paying business,”
he said. It was indeed, and his early census cards would some day
be known generically as “IBM cards.”
While Jacquard and Babbage of necessity used mechanical
devices with their punched cards, Hollerith added the magic of
electricity to his card machine, building in essence the first electrical
computing machine. The punched cards were floated across a pool
of mercury, and telescoping pins in the reading head dropped
through the holes. As they contacted the mercury, an electrical circuit
was made and another American counted. Hollerith did not stop with
census work. Sagely he felt there must be commercial applications
for his machines and sold two of the leading railroads on a punched-
card accounting system. His firm merged with others to become the
Computing-Tabulating-Recording Company, and finally International
Business Machines. The term “Hollerith Coding” is still familiar today.

You might also like