100% found this document useful (1 vote)
22 views73 pages

Digital Image Processing 1st Edition A. Baskar Instant Download

The book 'Digital Image Processing' by A. Baskar and others provides a comprehensive overview of both theoretical and practical aspects of image processing. It covers fundamental concepts, applications, tools, and includes practical implementation examples using OpenCV and MATLAB, along with quizzes and review questions for enhanced learning. This resource is aimed at graduate students, researchers, and anyone interested in the fields of image processing and computer vision.

Uploaded by

calefaltano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
22 views73 pages

Digital Image Processing 1st Edition A. Baskar Instant Download

The book 'Digital Image Processing' by A. Baskar and others provides a comprehensive overview of both theoretical and practical aspects of image processing. It covers fundamental concepts, applications, tools, and includes practical implementation examples using OpenCV and MATLAB, along with quizzes and review questions for enhanced learning. This resource is aimed at graduate students, researchers, and anyone interested in the fields of image processing and computer vision.

Uploaded by

calefaltano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Digital Image Processing 1st Edition A.

Baskar
install download

https://ebookmeta.com/product/digital-image-processing-1st-
edition-a-baskar/

Download more ebook from https://ebookmeta.com


Digital Image Processing
This book provides a mix of theoretical and practical perceptions of the
related concepts pertaining to image processing. The primary objectives are
to offer an overview of the elementary concepts and practices appropriate
to digital imaging processing as well as to provide theoretical exposition.
The book starts with an expanded coverage of the fundamentals to provide
a more comprehensive and cohesive coverage of the topics including but not
limited to:

• Applications and tools for image processing, and fundamentals with


several implementation examples
• Concepts of image formation
• OpenCV installation with step-by-step screenshots
• Concepts behind intensity, brightness and contrast, and color models
• Ways by which noises are created in an image and the possible
remedial measures
• Edge detection, image segmentation, classification, regression, and
classification algorithms
• Importance of frequency domain in the image processing field
• Relevant code snippets and the MATLAB® codes, and several inter-
esting sets of simple programs in OpenCV and Python to aid learn-
ing and for complete understanding

The video lectures by the authors for specific topics through YouTube enable
easy inference for the readers to apply the learned theory into practice. The
addition of contents at the end of each chapter such as quizzes and review
questions fully prepare readers for further study.
Graduate students, postgraduate students, researchers, and anyone in
general interested in image processing, computer vision, machine learning
domains, etc. will find this book an excellent starting point for information
and an able ally.
Digital Image Processing

A Baskar, Muthaiah Rajappa,


Shriram K Vasudevan,
and T S Murugesh
MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks
does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of
MATLAB® software or related products does not constitute endorsement or sponsorship by The
MathWorks of a particular pedagogical approach or particular use of the MATLAB® software.

First edition published 2023


by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
and by CRC Press
4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC

© 2023: A Baskar, Muthaiah Rajappa, Shriram. K Vasudevan, T S Murugesh

Reasonable efforts have been made to publish reliable data and information, but the author and pub-
lisher cannot assume responsibility for the validity of all materials or the consequences of their use.
The authors and publishers have attempted to trace the copyright holders of all material reproduced
in this publication and apologize to copyright holders if permission to publish in this form has not
been obtained. If any copyright material has not been acknowledged please write and let us know so
we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information
storage or retrieval system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work, access www​.copyright​
.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. For works that are not available on CCC please contact mpkbookspermissions​@tandf​
.co​​.uk

Trademark notice: Product or corporate names may be trademarks or registered trademarks and are
used only for identification and explanation without intent to infringe.

Library of Congress Cataloging‑in‑Publication Data


Names: Baskar, A., author. | Rajappa, Muthaiah, author. | Vasudevan,
Shriram K., author. | Murugesh, T. S., author.
Title: Digital image processing / A. Baskar, Muthaiah Rajappa, Shriram K.
Vasudevan, T. S. Murugesh.
Description: First edition. | Boca Raton : Chapman & Hall/CRC Press, [2023]
| Includes bibliographical references and index. | Summary: “The book
augurs to be a mix of theoretical and practical perceptions of the
related concepts pertaining to image processing. The primary objectives
orient to offer an overview to the elementary concepts and practices
appropriate to DIP as well as to provide theoretical exposition. It
starts with an expanded coverage of the fundamentals to provide a more
comprehensive and cohesive coverage of the topics”-- Provided by publisher.
Identifiers: LCCN 2022052363 (print) | LCCN 2022052364 (ebook) | ISBN
9781032108575 (hbk) | ISBN 9781032478678 (pbk) | ISBN 9781003217428
(ebk)
Subjects: LCSH: Image processing--Digital techniques.
Classification: LCC TA1637 .P374 2023 (print) | LCC TA1637 (ebook) | DDC
006.4/2--dc23/eng/20221110
LC record available at https://lccn.loc.gov/2022052363
LC ebook record available at https://lccn.loc.gov/2022052364

ISBN: 9781032108575 (hbk)


ISBN: 9781032478678 (pbk)
ISBN: 9781003217428 (ebk)

DOI: 10.1201/9781003217428

Typeset in Palatino
by Deanta Global Publishing Services, Chennai, India
Contents

Preface����������������������������������������������������������������������������������������������������������������������ix
Authors��������������������������������������������������������������������������������������������������������������������xi

1 Introduction to Image Processing: Fundamentals First������������������������� 1


Learning Objectives����������������������������������������������������������������������������������������� 1
1.1 Introduction������������������������������������������������������������������������������������������� 1
1.2 What Is an Image?���������������������������������������������������������������������������������2
1.3 What Is Image Processing?������������������������������������������������������������������2
1.4 What is a Pixel?��������������������������������������������������������������������������������������3
1.5 Types of Images�������������������������������������������������������������������������������������4
1.6 Applications of Image Processing������������������������������������������������������ 8
1.7 Tools for Image Processing���������������������������������������������������������������� 11
1.7.1 OpenCV for Windows: Installation Procedure����������������� 12
1.8 Prerequisites to Learn Image Processing���������������������������������������� 19
1.9 Quiz������������������������������������������������������������������������������������������������������� 19
1.9.1 Answers����������������������������������������������������������������������������������� 20
1.10 Review Questions������������������������������������������������������������������������������� 20
1.10.1 Answers����������������������������������������������������������������������������������� 21
Further Reading��������������������������������������������������������������������������������������������� 22

2 Image Processing Fundamentals��������������������������������������������������������������� 23


Learning Objectives��������������������������������������������������������������������������������������� 23
2.1 Introduction����������������������������������������������������������������������������������������� 23
2.2 Concept of Image Formation������������������������������������������������������������� 24
2.3 Bits per Pixel���������������������������������������������������������������������������������������� 29
2.4 Intensity, Brightness, and Contrast: Must-Know Concepts����������30
2.5 Pixel Resolution and Pixel Density�������������������������������������������������� 31
2.6 Understanding the Color Models�����������������������������������������������������34
2.6.1 What Is a Color Model?���������������������������������������������������������34
2.6.2 RGB Color Model and CMY Color Model��������������������������34
2.6.3 HSV Color Model������������������������������������������������������������������� 36
2.6.4 YUV Color Model������������������������������������������������������������������ 37
2.7 Characteristics of Image Operations������������������������������������������������44
2.7.1 Types of Operations���������������������������������������������������������������44
2.7.2 Types of Neighborhoods������������������������������������������������������� 45
2.8 Different Types of Image Formats���������������������������������������������������� 46
2.8.1 TIFF (Tag Image File Format)����������������������������������������������� 47
2.8.2 JPEG (Joint Photographic Experts Group)�������������������������� 47
2.8.3 GIF (Graphics Interchange Format)������������������������������������� 48

 v
vi Contents

2.8.4 PNG (Portable Network Graphic)���������������������������������������� 49


2.8.5 RAW Format��������������������������������������������������������������������������� 49
2.9 Steps in Digital Image Processing���������������������������������������������������� 49
2.10 Elements of Digital Image Processing System�������������������������������� 51
2.11 Quiz������������������������������������������������������������������������������������������������������� 53
2.11.1 Answers�����������������������������������������������������������������������������������54
2.12 Review Questions�������������������������������������������������������������������������������54
2.12.1 Answers����������������������������������������������������������������������������������� 55
Further Reading��������������������������������������������������������������������������������������������� 58

3 Image Noise: A Clear Understanding������������������������������������������������������ 61


Learning Objectives��������������������������������������������������������������������������������������� 61
3.1 Introduction����������������������������������������������������������������������������������������� 61
3.2 Photoelectronic Noise�������������������������������������������������������������������������63
3.2.1 Photon Noise (Also Called Shot Noise or
Poisson Noise)������������������������������������������������������������������������63
3.2.2 Thermal Noise������������������������������������������������������������������������64
3.2.3 How to Overcome Photoelectronic Noise?
(Thermal Noise/Photon Noise)�������������������������������������������64
3.3 Impulse Noise��������������������������������������������������������������������������������������65
3.3.1 Salt-and-Pepper Noise����������������������������������������������������������� 66
3.3.2 How to Overcome Impulse Noise?������������������������������������� 66
3.4 Structured Noise��������������������������������������������������������������������������������� 67
3.5 Quiz������������������������������������������������������������������������������������������������������� 69
3.5.1 Answers����������������������������������������������������������������������������������� 69
3.6 Review Questions������������������������������������������������������������������������������� 69
3.6.1 Answers����������������������������������������������������������������������������������� 70
Further Reading��������������������������������������������������������������������������������������������� 70

4 Edge Detection: From a Clear Perspective����������������������������������������������� 73


Learning Objectives��������������������������������������������������������������������������������������� 73
4.1 Introduction����������������������������������������������������������������������������������������� 73
4.2 Why Detect Edges?����������������������������������������������������������������������������� 74
4.3 Modeling Intensity Changes/Types of Edges: A Quick Lesson�� 74
4.4 Steps in Edge Detection���������������������������������������������������������������������77
4.5 Sobel Operator������������������������������������������������������������������������������������� 79
4.6 Prewitt Edge Detector������������������������������������������������������������������������83
4.7 Robinson Edge Detector��������������������������������������������������������������������� 86
4.8 Krisch Edge Detector�������������������������������������������������������������������������� 88
4.9 Canny Edge Detection������������������������������������������������������������������������ 91
4.10 Laplacian: The Second-Order Derivatives������������������������������������� 100
4.11 Review Questions����������������������������������������������������������������������������� 104
4.11.1 Answers��������������������������������������������������������������������������������� 104
Further Reading������������������������������������������������������������������������������������������� 105
Contents vii

5 Frequency Domain Processing���������������������������������������������������������������� 107


Learning Objectives������������������������������������������������������������������������������������� 107
5.1 Introduction��������������������������������������������������������������������������������������� 107
5.2 Frequency Domain Flow������������������������������������������������������������������ 109
5.3 Low-Pass Filters: A Deeper Dive���������������������������������������������������� 110
5.3.1 Ideal Low-Pass Filter����������������������������������������������������������� 110
5.3.2 Butterworth Low-Pass Filter����������������������������������������������� 113
5.3.3 Gaussian Low-Pass Filter���������������������������������������������������� 115
5.4 High-Pass Filters/Sharpening Filters��������������������������������������������� 119
5.4.1 Ideal High-Pass Filter���������������������������������������������������������� 119
5.4.2 Butterworth High-Pass Filter��������������������������������������������� 121
5.4.3 Gaussian High-Pass Filter��������������������������������������������������� 123
5.5 Quiz����������������������������������������������������������������������������������������������������� 127
5.5.1 Answers��������������������������������������������������������������������������������� 128
5.6 Review Questions����������������������������������������������������������������������������� 128
5.6.1 Answers��������������������������������������������������������������������������������� 128
Further Reading������������������������������������������������������������������������������������������� 129

6 Image Segmentation: A Clear Analysis and Understanding������������ 131


Learning Objectives������������������������������������������������������������������������������������� 131
6.1 Introduction��������������������������������������������������������������������������������������� 131
6.2 Types of Segmentation��������������������������������������������������������������������� 134
6.3 Thresholding Method���������������������������������������������������������������������� 136
6.3.1 Segmentation Algorithm Based on a Global
Threshold������������������������������������������������������������������������������ 136
6.3.2 Segmentation Algorithm Based on Multiple
Thresholds���������������������������������������������������������������������������� 142
6.4 Histogram-Based Segmentation����������������������������������������������������� 142
6.4.1 Segmentation Algorithm Based on a Variable
Threshold������������������������������������������������������������������������������ 143
6.4.2 Variable Thresholding through Image Partitioning������� 144
6.5 Region-Based Segmentation������������������������������������������������������������ 145
6.5.1 Region-Growing Method���������������������������������������������������� 145
6.5.2 Region Split-and-Merge Technique����������������������������������� 147
6.6 Edge-Based Segmentation��������������������������������������������������������������� 150
6.7 Clustering-Based Segmentation������������������������������������������������������ 150
6.8 Morphological Transforms-Based Segmentation������������������������� 150
6.8.1 Dilation and Erosion����������������������������������������������������������� 151
6.8.2 Opening and Closing���������������������������������������������������������� 158
6.8.3 Hit-or-Miss Transform�������������������������������������������������������� 159
6.9 Review Questions����������������������������������������������������������������������������� 160
6.9.1 Answers��������������������������������������������������������������������������������� 161
Further Reading������������������������������������������������������������������������������������������� 162
viii Contents

7 Classification: A Must-Know Concept��������������������������������������������������� 163


Learning Objectives�������������������������������������������������������������������������������������163
7.1 Introduction��������������������������������������������������������������������������������������� 163
7.2 Support Vector Machine (SVM)������������������������������������������������������ 164
7.2.1 Hyperplane��������������������������������������������������������������������������� 164
7.2.2 Support Vectors�������������������������������������������������������������������� 165
7.2.3 Margin����������������������������������������������������������������������������������� 165
7.3 How SVMs Work?����������������������������������������������������������������������������� 165
7.4 k-Nearest Neighbor (k-NN)������������������������������������������������������������� 166
7.5 Clustering: An Interesting Concept to Know������������������������������� 170
7.5.1 k-Means Clustering������������������������������������������������������������� 170
7.6 Quiz����������������������������������������������������������������������������������������������������� 175
Further Reading�������������������������������������������������������������������������������������������175

8 Playing with OpenCV and Python��������������������������������������������������������� 177


8.1 Introduction��������������������������������������������������������������������������������������� 177
8.2 Ubuntu and OpenCV Installation�������������������������������������������������� 177
8.3 Image Resizing���������������������������������������������������������������������������������� 179
8.4 Image Blurring���������������������������������������������������������������������������������� 180
8.5 Image Borders������������������������������������������������������������������������������������ 182
8.6 Image Conversion to Grayscale Format with OpenCV��������������� 183
8.7 Edge Detection with OpenCV��������������������������������������������������������� 183
8.8 Counting Objects with OpenCV����������������������������������������������������� 185
8.9 Predicting Forest Fire with OpenCV��������������������������������������������� 185

Index...................................................................................................................... 191
Preface

Image processing, a rapidly growing technology, is a type of signal process-


ing where some operations are performed on an image, so as to obtain an
enhanced image or to extract some valuable information from it.
Digital image processing (DIP) is a constantly evolving field with new
algorithms and techniques and is certainly worth learning if one is interested
in image processing, computer vision, machine learning, etc. Learners who
wish to get started with image processing can find this book an able ally to
learn DIP from scratch. The popularity of DIP includes many reasons starting
from enhancing the quality of digital images, image restoration techniques,
removing noise from digital images, and compressing digital images thereby
conserving memory space be it on a computer or storage device. The primary
objectives of this book orient to offer an overview to the elementary concepts
and practices appropriate to DIP as well as to provide theoretical exposition.
This book starts with an expanded coverage of the fundamentals, image
types, applications, and tools for image processing. Later, the vistas are
extended to the concepts of image formation, unraveling the concepts behind
intensity, brightness and contrast, and color models, and details the steps in
DIP as well as its components. The following chapter deals with noise in
an image and types of image noise, addresses the ways by which noise is
created in an image, and deals with the possible remedial measures.
The subsequent chapters deal with edge detection and its operators followed
by frequency domain processing, which, along with all the MATLAB codes,
provide more comprehensive and cohesive coverage of the topics under
purview. This book then moves toward image segmentation to deliver a
clear analysis and for a thorough understanding, and then introduces the
must-know concepts of classification and regression and also explains the
concepts of a few frequently used classification algorithms. Finally, the
readers are presented with several interesting sets of simple programs in
OpenCV and Python to help enhance their understanding. Also, the same
has been presented as video lectures through YouTube by the authors to
enable the readers to apply the theory they have learned into practice. The
addition of content at the end of each chapter such as quizzes and review
questions fully prepare readers for further study.

ix
Authors

A Baskar is a seasoned academician with close to two decades of experience


in teaching and research. He is currently associated with the Department of
Computer Science and Engineering, Amrita School of Computing, Amrita
Vishwa Vidyapeetham, Coimbatore, India. He is an expert in the areas of
image and video processing, Internet of Things, and computer vision. Baskar
has guided over 15 master’s projects and many undergraduate projects.
Baskar also has many published articles with refereed international jour-
nals. He has presented papers at international and national conferences. He
is also associated with boards of studies in many colleges of high repute. He
has also won awards from the likes of Infosys and Accenture for his teaching
and research skills.
Muthaiah Rajappa is a professor and associate dean in information
technology and information communication technology at the School of
Computing, Shanmugha Arts, Science, Technology & Research Academy
(SASTRA) (deemed-to-be-university), Thanjavur, India. He obtained his
bachelor’s degree in electronics and instrumentation engineering from
Annamalai University, Tamil Nadu, India, in 1989. He completed his master’s
degree in power electronics from Shanmuga College of Engineering, Tamil
Nadu, India, in 1997. He was awarded a doctorate in the area of image com-
pression by SASTRA in 2008. Rajappa has published more than 100 research
articles in many reputed journals. He also has contributed through paper
publications, and review and chairing sessions in many conferences. He has
completed multiple funded projects from organizations of high repute and
national importance.
Shriram K Vasudevan obtained his bachelor’s degree in electronics and
instrumentation from Annamalai University, Tamil Nadu, in 2004, master’s
degree in embedded systems from the Shanmugha Arts, Science, Technology
& Research Academy (deemed-to-be-university), Thanjavur, India, in 2007,
and doctorate in embedded systems from Ponnaiyah Ramajayam Institute
of Science and Technology (PRIST) University, Tamil Nadu, India, in 2015.
He earned his master of business administration degree in human resource
management and marketing from Periyar Maniammai University, Tamil
Nadu, India, in 2008. Over the course of 16 years, he has obtained a blend of
industrial and teaching experience. He has authored/coauthored 45 books
for reputed publishers across the globe. He has authored 140 research papers
in revered international journals and 30 papers in international/national
conferences. He is currently associated with Intel, India. Prior, he was
associated with Wipro Technologies, VIT University, Aricent Technologies,
Amrita University, and L&T Technology Services. He holds the Corporate
Fellow Membership in IETE and is an ACM Distinguished Speaker, CSI

xi
xii Authors

Distinguished Speaker, NASSCOM Prime Ambassador, NVIDIA DLI, and


Intel Software Innovator. He has a YouTube channel bearing his name
through which he teaches thousands of people all around the world. He has
been recognized/honored for his technical expertise by Factana, Accumulate,
Telecommunications and the Digital Government Regulatory Authority
(United Arab Emirates), ZyBooks (Wiley Brand), AOTMP, Adani Digital,
NASSCOM Foundation, World Summit on the Information Society (WSIS),
De-Nora, IIT Kharagpur E Cell, Huawei, NVIDIA, Cubestop, IETE, Datastax,
Honda, Wiley, AGBI, ACM, Uletkz, The Hindu (Tamil), Exact Sciences Corp,
Proctor and Gamble Innovation Centre (India), Dinamalar, AWS (Amazon
Web Services), Sabre Technologies, IEEE Compute, Syndicate Bank, MHRD,
Elsevier, Bounce, IncubateInd, Smart India Hackathon, Stop the Bleed,
HackHarvard (Harvard University), Accenture Digital (India), NEC (Nippon
Electric Company, Japan), Thought Factory (Axis Bank Innovation Lab),
Rakuten (Japan), Titan, Future Group, Institution of Engineers of India (IEI),
Ministry of Food Processing Industries (MoFPI – Government of India), Intel,
Microsoft, Wipro, Infosys, IBM India, SoS Ventures (USA), VIT University,
Amrita University, Computer Society of India, TBI–TIDE, ICTACT, Times
of India, Nehru Group of Institutions, Texas Instruments, IBC Cambridge,
Cisco, CII (Confederation of Indian Industries), Indian Air Force, DPSRU
Innovation & Incubation Foundation, and EL Equipments (Coimbatore). He
is a certified Scrum Master. He is also listed in many famous biographical
databases. He has delivered talks at various international conferences and
forums of high repute. Vasudevan has also been granted many patents.
He is a hackathon enthusiast and has won about 50 hackathons, including
HackHarvard 2019.
T S Murugesh obtained his bachelor’s degree in electronics and instru-
mentation in 1999, master’s degree in process control and instrumentation
in 2005, and doctorate in instrumentation engineering in 2015, all from
Annamalai University, Tamil Nadu, India. He possesses a vast experience of
nearly 23 years in academia in the field of analog and digital electronics, auto-
mation and control, IoT, system design, instrumentation, image processing,
and computational bioengineering. After a tenure of almost 19 years with
the Department of Electronics and Instrumentation Engineering, belong-
ing to the Faculty of Engineering and Technology, Annamalai University,
he is currently an associate professor in the Department of Electronics
and Communication Engineering, Government College of Engineering
Srirangam, Tiruchirappalli, Tamil Nadu, India.
He has delivered four talks at international conferences of high repute
such as the 3rd Edition of International Conference on Materials Science and
Engineering (MAT 2022) organized by Magnus Group LLC, Chicago, Illinois,
as well as at the 5th Virtual Congress on Materials Science and Engineering,
“Materials Info 2022” organized by Mind Authors, Inc., Beaverton, Oregon.
He has delivered invited lectures at the national level in various institutions
including Sastra University, Annamalai University, Manakula Vinayagar
Authors xiii

Institute of Technology – Puducherry, Government College of Engineering


Srirangam, Madurai Institute of Engineering and Technology, and P.A.
College of Engineering and Technology – Pollachi and Viswajyothi College
of Engineering and Technology, Kerala. He has delivered invited lectures in
faculty development programs organized by the Faculty Training Centre,
Government College of Technology, Coimbatore, in association with the
Government College of Engineering – Thanjavur, and another one with
Government College of Engineering – Salem, and also in a national-level
webinar conducted on behalf of “Unnat Bharat Abhiyan”, a flagship program
of the Ministry of Education, Government of India.
To his credit, he has around three dozen peer-reviewed indexed publica-
tions including Springer Nature, Elsevier, and Inderscience; has organized a
one-week AICTE Training And Learning (ATAL) Academy-sponsored FDP;
conducted a few workshops at the national level; and is a reviewer for IEEE,
Inderscience, and a few other peer-reviewed journals. He has acted as a pri-
mary evaluator for the Government of India’s Smart India Hackathon 2022
(Software & Hardware Edition) as well as Toycathon 2021 and also as a judge
in the grand finale for the Government of India’s Toycathon 2021, an inter-
ministerial initiative organized by the Ministry of Education’s Innovation
Cell with support from AICTE (All India Council for Technical Education).
He is an AICTE and NITTTR-certified mentor under the National Initiative
for Technical Teachers Training and also a Certified Microsoft Educator
Academy Professional. He is also a reviewer of B.E / B.Tech Technical
Books in Regional Language scheme of AICTE coordinated by the Centre
for Development of Tamil in Engineering and Technology, Anna University,
Tamil Nadu, India. He is a Master Assessor for the prestigious Naan
Mudhalvan Program devised by the Government of Tamil Nadu. He was
appreciated by Huawei for his academic collaboration and was issued a
Huawei developers certification. Murugesh mentored the team that won
first prize for the problem statement “Employment tracking and traceability
system – Organized sector”, given by the Ministry of Labour Employment,
Government of India, during the grand finale of Smart India Hackathon 2022
Software Edition. He is a hackathon enthusiast and his team has won the
FIRST Prize in the 2022, Cloud Fest Hackathon 2 presented by Google Cloud
as well as in the DigitalGov Hack, the Hackathon by WSIS Forum 2023 and
Digital Government Authority, Saudi Arabia and also bagged the second
Prize in the IFG x TA Hub Hackathon 2022. He is a conference committee
member as well as a publishing committee member for the International
Association of Applied Science and Technology. He also holds the edito-
rial board membership of American Journal of Embedded Systems and
Applications. He has authored two books for CRC Press/Taylor & Francis
Group (UK) and is authoring a book for Nova Science Publishers, Inc. (USA)
and 2 more books for CRC Press. He is a professional body member of the
Institution of Engineers (India).
1
Introduction to Image Processing:
Fundamentals First

Learning Objectives
After reading this chapter, the reader should have a clear understanding
about:

• What an image is all about?


• Why an image is processed?
• What makes an image?
• Potential applications of image processing
• Prerequisites for deeper learning
• Tools available for image processing

1.1 Introduction
There is a general saying: “A picture is worth a thousand words”. In this book
we are going to learn out-and-out about images. Image processing is one of
the evergreen fields of computer science and engineering. It keeps evolving,
and researchers are consistently working on developing image processing
techniques that provide more features and better accuracy with increased
speed. A special mention goes to the high-speed processing engines that are
available and affordable nowadays. Also, image storage has become much
cheaper. The following discussion should enable the reader to understand
what an image is, what can be understood from an image, how much infor-
mation can be retrieved from an image, and what sort of applications can be
developed from the available information. Stay tuned! Fun awaits you!

DOI: 10.1201/9781003217428-1 1
2 Digital Image Processing

1.2 What Is an Image?
Before dwelling deeper, it is important to understand the fundamentals.
Being strong in the fundamentals will help you throughout this learning
journey.
Disclaimer: We have titled the book “digital image processing”. Hence, we
shall deal with digital images.
According to dictionary definitions, an image, be it digital or still, is only
a binary representation of some visual information. The visual information
can be a simple drawing, photograph, recorded graphs, organization logos,
or anything of this sort. All these images have something in common. If they
are digital images, they all can be stored and saved for future use electroni-
cally on any storage device. Figure 1.1 presents a sample image with infor-
mation inside it. This image is a traffic sign, which gives information about
the signals and signage for drivers. This is a digital image and can be stored
in any digital storage medium. To be more precise, this image was shot with
a digital camera.

1.3 What Is Image Processing?


Assume someone sees the signage in Figure 1.1 on a road. Immediately, their
eyes will start capturing the content, and the brain interprets what the sig-
nals signify. Based on the understanding, one would move farther. In digital
image processing, the same image can be fed as input into the system, and

FIGURE 1.1
The first image – image with information – digital Image.
Introduction to Image Processing 3

FIGURE 1.2
The “image” processing.

the system would interpret and understand the content to let further actions
happen. The algorithms developed play a major role in understanding the
content with higher accuracy.
Image processing helps users understand the content and context from
any image. Appropriate processing techniques are to be chosen to get the
best results.

To summarize: Image processing enables us to perform the required


operations on a particular image that could help in either enhancing
the image or extracting information from the image. Image process-
ing can be categorized as one of the fields of signal processing. For an
image processing system, like any other system, there should be input
(an image) and output as well. The output enhances the image or fea-
tures/characteristics from the image, which help in precisely identify-
ing the contents.

Being this is an image processing book, it is always a good idea to rep-


resent any concept through an image. Refer to Figure 1.2 that presents the
image processing concept in a nutshell.

1.4 What is a Pixel?
One should understand that an image is nothing but an array or a matrix of
multiple pixels properly arranged in columns and rows. Now, it is also good
to understand what a pixel is. The word pixel originates from “picture ele-
ment”. A pixel is the smallest unit in a digital image. Multiple pixels arranged
in rows and columns form an image. An image is fully composed of pixels.
Figure 1.3 has a picture on the left-hand side (LHS) and the right-hand side
(RHS); the pixels from a particular region of the image can be seen. This will
help you understand that multiple pixels are arranged appropriately to get
4 Digital Image Processing

FIGURE 1.3
Pixels.

a meaningful digital image. The LHS is a complete image, whereas the RHS
represents a part of the same but in the form of pixels. The boxes highlighted
on the RHS image represent the individual pixels. Such multiple individual
pixels are there in the real image. To make it concise, pixels are the smallest
units that form an image. Many more technical details on pixels are pre-
sented in Chapter 2.

1.5 Types of Images
The next very important area of discussion is the types of images. They are
as follows:

1. Binary image.
As one could have guessed, binary is all about 0s and 1s. A binary
will contain only two colors: white and black. Black is represented by
0 and white is represented by 1. Each pixel in this type of image will
have either a value of 0 or 1, representing black or white, respectively
(Figure 1.4). In the binary image, each pixel needs only 1 bit of storage
space. Be it white or black, what we need is just 1 bit to store that pixel.
This is an important aspect to be remembered and this will help in
distinguishing the binary image from the black-and-white image.
2. Black-and-white image.
Most beginners are confused about what a binary image is and
what a black-and-white image is. There is a very fundamental differ-
ence that differentiates the two. When it comes to black-and-white
images, each pixel needs 8 bits of storage space. Each of these pixels
can have a 0 or 1. Again, 0 represents black and 1 represents white.
Multiple 0s and 1s are in an image, but the storage requirement for
the pixels is much higher. This gives smoothness and enriched qual-
ity to the image (Figure 1.5).
Introduction to Image Processing 5

FIGURE 1.4
A binary image.

FIGURE 1.5
A typical black-and-white image.

3. Grayscale image.
The next type of image to be discussed is the grayscale image. It
is a special image that has a range of shades from black to white, i.e.,
the shades should be between white and black. Often people regard
this as no color and they refer to the shades of white and black. The
most commonly used format is the 8-bit format and it accommodates
6 Digital Image Processing

256 different shades. The range of these shades is from 0 (black) to


255 (white) and in-between are the different shades. Figure 1.6 pres-
ents the grayscale shading pattern. A sample grayscale image is pre-
sented in Figure 1.7.
4. Color image.
Each pixel in a color image has color information. Each pixel in a
color image is composed of three channels, and they are most com-
monly regarded as R, G, and B, representing the colors red, green,
and blue, respectively. In this type of image, one should again visual-
ize the image as a matrix. Each box (pixel) in the matrix is composed
of three components: R, G, and B channels. Each of these channels
needs 8 bits for storage, hence each pixel is 24 bits. Hence, it should
be understood that R, G, and B together constitute a pixel in a color
image. The shade of each of the pixels vary based on the intensity of
R or G or B. Each of these R or G or B channels individually has 256
shades in it. With all these shades we could produce a beautiful color
image with all good colors captured.

FIGURE 1.6
Grayscale shading pattern.
Introduction to Image Processing 7

FIGURE 1.7
A sample grayscale image.

FIGURE 1.8
Sample input image.

A sample image has been taken, as shown in Figure 1.8. R, G, and


B have been extracted. This should help readers understand that R,
G, and B constitute a color image. Also, in Figure 1.9, the intensity of
R, G, and B are presented individually.
The types of images have been explained. The next topic to be dis-
cussed is the applications of image processing and it should provide
a detailed view of where this learning is helpful.
8 Digital Image Processing

FIGURE 1.9
RGB composition.

1.6 Applications of Image Processing


The applications of image processing are wide-ranging and some of them
are described in the following.
The first sector where image processing has enormous application poten-
tial is in agriculture. Image processing techniques can be used to develop
applications for sorting fruits, grading fruit quality, identifying disease in
crops, locating weeds, and identifying species, for example (Figure 1.10).
In the automobile sector, image processing has many applications and is
particularly used in critical safety applications. Applications include lane
detection, license plate detection, toll collection systems, accident impact
assessment, driver assistance systems, and rear and front cameras for park-
ing applications. Many researchers are actively working toward building safer
and smarter image processing–based automobile applications (Figure 1.11).
As far as industry is concerned, image processing has numerous appli-
cations. They include quality control applications, inspection applications,
fault detection, robotic guidance and control, defective parts identification,
and color identification. Machine vision is a boom that is completely based
on image processing. Figure 1.12 shows common applications of image pro-
cessing in industry.
Image processing has found some fantastic applications in the medical
field. Image processing can be used for diagnostic purposes. X-ray or scan
images can be read and understood to see the variations or symptoms of
many diseases. Recent developments have ensured that robots can perform
surgeries, of which image processing is a very important component. Cancer
cell detection, tumor detection, and stent placement are other major areas
where image processing is highly useful (Figure 1.13).
Introduction to Image Processing 9

FIGURE 1.10
Image processing and agriculture.

FIGURE 1.11
Image processing and automobiles.
10 Digital Image Processing

FIGURE 1.12
Image processing and industry.

FIGURE 1.13
Image processing and medicine.
Introduction to Image Processing 11

FIGURE 1.14
Image processing and defense.

Image processing has vast applications in the defense industry and is


frequently employed in defense and security-related applications. A few
applications include target detection and target tracking, missile guidance,
navigation, surveillance, and object recognition. Also, during a war or cri-
sis, drones, which have image processing techniques embedded within their
cameras, are used for recovery operations (Figure 1.14).
Having learned the applications one can have for image processing, it is
time to learn the tools and support available for implementing and building
image processing–based systems.

1.7 Tools for Image Processing


Three of the most prominent tools one should use/learn to work on image
processing are MATLAB, OpenCV, and Python.
Since MATLAB installation is not a challenging task, we have focused
on providing the guidelines for OpenCV installation. Also, installation of
Python is provided. Though the Ubuntu variant of both the OpenCV and
12 Digital Image Processing

Python are available, we are sticking to Windows, as it is used by most


researchers and learners.

1.7.1 OpenCV for Windows: Installation Procedure


Following are the steps for OpenCV installation. OpenCV cannot be installed
standalone; it needs additional packages to be installed alongside. The sec-
tion enumerates the software packages that are to be installed to complete
OpenCV installation.
First, the platform Anaconda has to be installed. The installation files can
be downloaded from www​.anaconda​.com​/distribution/. As you may be
aware, Anaconda is an open-source distribution for Python and it is widely
used for applications that involve voluminous data. Variants are available for
download for almost all operating systems, including Mac, Windows, and
Linux. Anaconda is said to have more than 10 million users worldwide and
is still gaining popularity.
Since the focus is on Windows, we are moving ahead with the installation
guidelines for a Windows-based machine.
Upon opening the website, the following screen, as in Figure 1.15, should
appear.
Scrolling down to where the other operating systems are listed, choose
your installer (Figure 1.16).
After clicking the download button, as in Figure 1.15, users are directed to
the screen as shown in Figure 1.17, upon which the Python 3.9 version, 64-Bit
Graphical Installer (594 MB) is downloaded.

FIGURE 1.15
Welcome screen of Anaconda site.
Introduction to Image Processing 13

FIGURE 1.16
Anaconda installers.

FIGURE 1.17
Python version.

The installation can be started once the download is complete. Once the
extraction is done from the executable files, the screen in Figure 1.18 should
be visible.
Agree to the license requirements (Figure 1.19), then proceed to the next
step.
14 Digital Image Processing

FIGURE 1.18
Anaconda installation screen.

FIGURE 1.19
License agreement.
Introduction to Image Processing 15

The user is prompted to select the mode of availability of Anaconda: for


everyone or just the user who has logged in. Select the appropriate choice
(see Figure 1.20).
Next, select the destination folder; 3 GB of space is required. Hence, choose
the folder wisely (Figure 1.21).
The next screen presents the advanced installation options (Figure 1.22). It
is best to go with both options presented.
Once done, click install and installation continues. One can follow the
progress, as shown in Figure 1.23. This process should take time.
Once done, a screen with a message as shown in Figure 1.24 appears.
Once this is done, we are all set to go! The content in Figure 1.25 will be
displayed if installation has gone well.
That’s it. Anaconda is installed. But, the game is not yet over.
One should test whether the installation has been done properly. For that,
go to the command prompt. Typing “cmd” should bring up the command
prompt. In that command window, type the command “python”. The confir-
mation of correct installation is shown (Figure 1.26).
Upon successful installation of Python, it is important to install OpenCV
with the command “pip install opencv-python” in the Anaconda prompt
(Figure 1.27).
One can also validate if the OpenCV has been installed successfully,
through the sequence in the command prompt in Figure 1.28.

FIGURE 1.20
Installation options.
16 Digital Image Processing

FIGURE 1.21
Installation directory.

FIGURE 1.22
Advanced installation options.
Introduction to Image Processing 17

FIGURE 1.23
The progress.

FIGURE 1.24
Anaconda DataSpell IDE.
18 Digital Image Processing

FIGURE 1.25
Anaconda installation complete.

FIGURE 1.26
Verification of installation through the command prompt.

FIGURE 1.27
Command to install OpenCV.
Introduction to Image Processing 19

FIGURE 1.28
Confirmation of successful OpenCV installation.

1.8 Prerequisites to Learn Image Processing


The fundamental prerequisite to learning more about image processing is
interest. Following is a list of desirable learner qualities to make the learning
process faster and better.
An image is represented using math, thus the subject can’t be ignored.
Fundamental know-how of the following is beneficial:

1. Linear algebra
2. Probability and statistics
3. Signals and systems
4. Differential equations
5. Digital electronics
6. Programming skills (or the logic)

Do not be intimidated by the list! We will make sure the learning is imparted
in the way that is practical.
It is hoped that this chapter refreshed your must-know fundamentals
of image processing. It’s time to move on to learning the basic concepts of
image formation, characteristics of image operations, and image types in the
next chapter.

1.9 Quiz
1. Every image has some information inside. True or false?
2. All images must be even sized. True or false?
3. Image processing is all about understanding the _____ and _____ of
an image.
4. Image processing techniques are meant to only understand the
image. True or false?
20 Digital Image Processing

5. A _____ is the fundamental component of an image.


6. An image is fully composed of multiple _____.
7. The binary image is a combination of _____ and _____.
8. The size of each pixel in a binary image is _____.
9. A black-and-white image is a combination of _____ and _____.
10. The size of the black-and-white pixel in a black-and-white image is
_____.
11. A grayscale image is a combination of _____.
12. A color image has _____, _____, and _____ pixels.

1.9.1 Answers

1. True
2. False
3. Context and content
4. False. It can be used to enhance the image.
5. Pixel
6. Pixels.
7. 0s and 1s (representing black and white)
8. One bit.
9. Black and white (0s and 1s).
10. 8 bits
11. Range of colors between black and white
12. Red, green, and blue

1.10 Review Questions
1. Define image.
2. Define image processing.
3. Why process an image?
4. What is a pixel and how is it important for an image?
5. What are the types of images you know?
6. Are the black-and-white and grayscale images the same in terms of
the content? Explain.
7. How is a binary image different from a black-and-white image?
Introduction to Image Processing 21

8. Explain the way color images are constructed.


9. List the storage requirements for all the image types.
10. Name some sectors that use image processing applications.

1.10.1 Answers

1. An image, be it digital or still, is a binary representation of some


visual information. The visual information can be a simple drawing,
photograph, recorded graphs, organization logos, or anything of this
sort.
2. Image processing enables us to perform the required operations on
a particular image, which could help in either enhancing the image
or extracting information from the image. One can categorize image
processing as one of the fields of signal processing. Like any other
system, for an image processing system there should be input (an
image), and there will be output as well. The output will enhance the
image or features/characteristics of the image, which should help in
precisely identifying the contents.
3. Image processing helps users in understanding the content and
context from any image. Appropriate processing techniques are to
be chosen to get the best results.
4. One should understand that an image is nothing but an array or a
matrix of multiple pixels that are properly arranged in columns and
rows. Now, it is also good to understand what a pixel is. Pixel is a
word formed from “picture element”. A pixel is the smallest unit in
a digital image. Multiple pixels arranged in rows and columns actu-
ally form an image. An image is fully composed of pixels.
5. Binary, black and white, grayscale, and color.
6. No. Both are different. Black-and-white images are composed of only
black or white. But, grayscale is a combination of different shades of
black or white (256 shades).
7. Binary image needs 1 bit per pixel storage and the pixel is either
black or white. But, a black-and-white image needs 8 bits per pixel
for storage. Black-and-white images will be dense and render better
quality.
8. Each pixel in the color image has color information. Each pixel in the
color image is composed of three channels and they are most com-
monly regarded as R, G, and B, which represent red, green, and blue
colors, respectively. In this type of image, one should again visual-
ize the image as a matrix to gain better understanding. Each box
(pixel) in the matrix is composed of three components: R, G, and B
channels. Each of these channels needs 8 bits for storage, hence, 24
22 Digital Image Processing

bits for each pixel. It should be understood that R, G, and B together


constitute a pixel in a color image.
9. Binary – 1 bit per pixel.
Black and white – 8 bits per pixel.
Grayscale – 8 bits per pixel.
Color – 24 bits per pixel (R, G, and B channels together).
10. Many sectors use image processing applications, including defense,
agriculture, medicine, education, space science, and industrial
applications.

Further Reading
Abràmoff, M.D., Magalhães, P.J. and Ram, S.J., 2004. Image processing with ImageJ.
Biophotonics International, 11(7), pp. 36–42.
Jain, A.K., 1989. Fundamentals of digital image processing. Englewood Cliffs, NJ: Prentice
Hall.
Petrou, M. and Petrou, C., 2010. Image processing: The fundamentals. John Wiley & Sons.
Russ, J.C., 2016. The image processing handbook. CRC Press.
Sonka, M., Hlavac, V. and Boyle, R., 2014. Image processing, analysis, and machine vision.
Cengage Learning.
Weeks, A.R., 1996. Fundamentals of electronic image processing (pp. 316–414). Bellingham:
SPIE Optical Engineering Press.
Young, I.T., Gerbrands, J.J. and Van Vliet, L.J., 1998. Fundamentals of image processing
(Vol. 841). Delft: Delft University of Technology.
2
Image Processing Fundamentals

Learning Objectives
After reading this chapter, the reader should have a clear understanding
about:

• Image formation
• Concept of bits per pixel
• Brightness, contrast, and intensity
• Pixel resolution and pixel density
• Color models
• Characteristics of image operations
• Types of images
• Steps in digital image processing
• Elements of digital image processing

2.1 Introduction
The previous chapter just hinted at information about pixels and the type
of images at a very elementary level and may not be sufficient for an aspir-
ing image processing enthusiast. However, this chapter will enhance under-
standing of the fundamentals of image processing. This chapter provides
clear-cut information about pixels, including more technical details. Also,
this chapter dives deeper with some implementation examples for the con-
cepts being dealt with. This chapter is a mix of theoretical and practical
understanding of the concepts. Again, it is very important for the reader
to have installed the software packages detailed in Chapter 1. This chapter
concludes with analyzing color models followed by the complete analysis of
the steps involved in digital image processing.

DOI: 10.1201/9781003217428-2 23
24 Digital Image Processing

2.2 Concept of Image Formation


As discussed earlier, pixels are the very fundamental and basic unit in any
image. But the concept has many technicalities embedded in it and is a must-
know for any aspirant who loves to work with image processing. This chap-
ter is meant to give more clarity, and it starts with image formation and will
navigate to pixels.
It is helpful to compare human eyes with cameras. Both work on the same
principles, and in fact the eyes are indeed better. Eyes are the motivation for
scientists to invent and improve cameras to capture images. For example,
in image processing, the PC or a microcontroller is the central processing
unit, whereas for human eyes, it is the brain. The fundamental principle
behind the functioning of human eyes and cameras is reflection. Here, phys-
ics comes into play. When a light ray falls on any object, the basic tendency
is to reflect it back. We should realize that eyes have a lens as well, just like a
camera (Figure 2.1), which enables eyes to see the object of focus.
Let’s get somewhat technical now. As a first step, it is important to under-
stand the image formation process. This involves a bit of physics as well.
Hence, if you have some physics knowledge, it would really be helpful. Have
a close look at Figure 2.2. The image formation process is explained in a dia-
grammatical way for clear understanding. Assume that the camera focuses
on the tree with fruits as shown in the figure.
The process of image formation essentially involves the conversion of a 3D
scene to a 2D image. Imaging process is generally defined as the mapping
process of a scene (what you see in front, which is to be captured, through

FIGURE 2.1
Fundamental principle of reflection.
Image Processing Fundamentals 25

the camera) to an image plane. (An image plane is the surface where the
image is rendered.)
Image formation can be described as occurring in three phases. The first
phase is the scene getting illuminated (lighted) by a source. In Figure 2.2
the light source is the sun. In the second phase, the scene that is illuminated
reflects the radiations to the camera in focus (Figure 2.3). The third phase
happens through the sensors in the camera, which can sense the radiations
(Figure 2.4) completing the whole process.

FIGURE 2.2
Image formation: Phase 1.

FIGURE 2.3
Image formation: Phase 2.
26 Digital Image Processing

FIGURE 2.4
Image formation sequence.

The incoming light radiation to the camera will further be processed.


This input is fed into the charge-coupled device (CCD), which is an array
of sensors arranged together in a structure. The incoming light radiation is
a mix of multiple frequencies. The sensor array is capable of collecting the
red, blue, and green frequencies perfectly out of the incoming light radiation
through the camera.
The CCD is a very sensitive photon detector. It is actually broken into
smaller areas that can be used to build an image of the focused scene. A
photon, a particle representing a quantum of light, that falls within the area
defined by one of the pixels will be transformed to electrons, and the number
of electrons accumulated will be proportional to the intensity of the scene at
each pixel. The number of electrons in each pixel is measured and the scene
gets reconstructed. The intensity of the photons of light falling on the CCD is
the core point to be understood. If the photon of light is higher, the number
of electrons on the CCD formed will be higher. If the intensity of the photon
falling is mild, the number of electrons will be minimal.
The RGB matrix shown inside the CCD (Figure 2.4) is referred to as the
Bayer filter mosaic. It is a color filter array (CFA) in which the RGB color
filters are arranged as a square grid of photo sensors (the matrix-like struc-
ture). This setup is used most commonly in digital cameras to help in the
process of creation of the color image. There is a unique pattern also being
followed in this mosaic structure with respect to filling the RGB sensors. The
filter pattern is 50% green, 25% red, and 25% blue (in the inset of the 2 × 2
matrix, there are two tiles of green, one red tile, and one blue tile). There are
some alternate arrangements available for this setup. But, this Bayer filter is
the most frequently followed pattern. The complete functioning of this mod-
ule is explained next with appropriate examples.
Image Processing Fundamentals 27

FIGURE 2.5
Bayer mosaic.

Let us understand the functioning with a simple example. Assume that


the incoming radiation is fed into the CCD array. The incoming radiation is
a mixture of R, G, and B components. A sample Bayer filter pattern is pre-
sented in Figure 2.5. The incoming light will have the RGB components and
the R filter will filter only the red components; the G filter does the same with
the green components followed by the B filter with the blue components. The
combination of the three together forms the image. One should remember
that G is 50% of the total content, and the other two carry 25% each. Refer to
Figure 2.6 to get a clear idea.

FOOD FOR THOUGHT


By now, you may have a query in mind. Why G is given more weight
than R and B? What makes it so special?
Human eyes have greater sensitivity to the green color over red and
blue. To replicate the same behavior, the Bayer filter is 50% green, while
giving 25% each for blue and red.

The output from this phase, i.e., from the Bayer mosaic, is analog in nature
and needs conversion. The conversion becomes mandatory as the analog
signals cannot be processed digitally. Also, for storage it has to be a digital
signal. Hence, the conversion from an analog to digital signal is mandatory.
This is represented diagrammatically in Figure 2.7.
The continuous data has to be converted to the digital form with the fol-
lowing two steps:

a. Sampling – digitization of coordinate values.


b. Quantization – digitization of amplitude values.

For enhanced understanding of these two terms, see Figure 2.8.


Let’s move on to the next topic of interest! The exciting journey has just
begun.
28 Digital Image Processing

FIGURE 2.6
Image formation with Bayer filters.

FIGURE 2.7
Analog to digital conversion.
Image Processing Fundamentals 29

FIGURE 2.8
Quantization and sampling.

2.3 Bits per Pixel


A small introduction to pixels was provided in the previous chapter. Here,
we will enhance the topic. Bits per pixel is normally abbreviated as bpp.
It is the number of bits of information stored in each pixel of any image.
People also define it as color depth. Yes, this has a strong connection with
color.
The more the number of bits, obviously, one can expect more colors to be
represented. But, as we know, this would require more memory for storage.
As the image gets denser, it needs more memory. But the more the number
of bits per pixel, the better the image quality.
The number of bits per pixel determines the number of colors to be accom-
modated in an image. See Table 2.1 for a reference.

TABLE 2.1
Bits Per Pixel versus Number of Colors
Bits per Pixel (bpp) Number of Colors
1 bpp 2 colors
2 bpp 4 colors
3 bpp 8 colors
4 bpp 16 colors
5 bpp 32 colors
6 bpp 64 colors
7 bpp 128 colors
8 bpp 256 colors
10 bpp 1024 colors
16 bpp 65,536 colors
24 bpp 16,777,216 colors (16.7 million colors)
32 bpp 4,294,967,296 colors (4294 million colors)
30 Digital Image Processing

The number of colors is actually derived through a simple formula:

Number of colors = 2bpp

Now, let’s try substituting the values for bpp. For 1, the formula will give 21
= 2. Hence, it is 2 colors. Similarly, let’s substitute a higher number for bpp: 28
= 256 colors is present per pixel.
But, the point to remember is that all of the colors are none other than a
variant (shade) of R, G, and B. This is how all colors are derived.
The next topic to be discussed is intensity.

2.4 Intensity, Brightness, and Contrast: Must-Know Concepts


You have come across the term intensity already. But, not in a technical man-
ner as it has to be covered. The intensity of a pixel can be defined as the value
corresponding to the pixel in consideration. If you refer to an 8-bit grayscale
image, then there are 256 gray levels for any pixel considered. Let’s refer to
the grayscale image representation at this juncture. The shade for any pixel
can range from 0 to 255, as represented in Figure 2.9.

FIGURE 2.9
Image intensity. Note: All the boxes in the matrix represent the transition that happened from
black to white.
Another Random Scribd Document
with Unrelated Content
Tinteniac’s wound, thinking the while that the aristocrat had
excellent taste.
“Come, my friend, let us be frank. How much do you want from
me?”
Their eyes met. Croquart laughed.
“Ten thousand crowns.”
“What, sir?”
“For you, sire. Also ten thousand for madame.”
“Twenty thousand crowns!”
The Fleming’s eyes were full of cunning impudence.
“You are the Sieur de Tinteniac,” he said.
“True.”
“And courtesy would not permit you, sire, to value yourself more
highly than madame—your wife.”
Tinteniac looked at his broken sword.
“Well, friend, you will have to wait.”
“Content, sire, content.”
“What road do you take us?”
“The road to Morlaix, sire. I shall join young Bamborough there.”
XXVIII
In the underwood that topped a high bank overhanging the road
where it swept round the beech wood a man in black harness
crouched behind the twisting roots and stems of a clump of hazels.
The black shell of steel was almost indistinguishable in the shadows.
Snakelike it had crawled through a bank of gorse and reached the
hazels overhanging the road.
Bertrand, with his sword naked at his side, had lifted his head
cautiously and looked down into the road through a loop left by the
twisting roots. The first glance had shown him Tiphaïne seated on
her palfrey under the trees, watching Tinteniac weakening before
the Fleming’s sword. Bertrand was not a man easily astonished, but
his heart gave a great leap in him as he saw the Lady of the Aspen
Tower with the sunlight shining through the branches on her face.
Bertrand’s thoughts were in a tangle for the moment. The Sieur de
Tinteniac fighting with Croquart the Fleming, and the Vicomte de
Bellière’s daughter waiting to be claimed as the better man’s prize!
Bertrand felt dazed for the moment by the utter unexpectedness of
the scene before him. The whole tone of the adventure had changed
on the instant. Had a miracle been performed before him the man
amid the grass and hazels, with bluebells nodding about his body,
could not have been more struck than by this strange interweaving
of the threads of fate.
When Tinteniac fell, Bertrand was on his knees, teeth set, sword
ready, on the brink of a battle with the Fleming. The three men-at-
arms watching the fight had not seen the black figure poised amid
the hazel boughs. It hung there a moment as though hesitating, and
then dropped back again into the grass and leaves.
Tiphaïne was facing Croquart, while Tinteniac grovelled on his
elbow, and this new grouping of the characters had sent Bertrand
back to cover. He lay like a fallen bough, almost invisible, his body
sunk in the dead leaves and the grass tussocks, hearing Tiphaïne
speak, yet unable to catch her words. Her face, clear before him in
the sunlight, had that look that was peculiar to her when her
courage was in arms. She was speaking for Tinteniac, and Bertrand
watched her, noting the play of feeling on her face with the
intentness of a man who watches the face of one he loves. It hurt
him to see her speaking for Tinteniac, so sensitive is the strongest
heart when a woman’s eyes have power to wound or heal. The old
blind feeling of bitterness that had been bred in him at Motte Broon
rushed up to tantalize him with the imagined meaning his instinct set
upon the scene.
Croquart gave her the wine-flask and the linen, and she knelt
beside Tinteniac, one arm about his shoulders, her face very close to
his. Bertrand winced, drove one knee into the grass, and yet cursed
himself for a credulous fool. Would any woman stand by and see a
wounded man bleed to death, and would that woman be Tiphaïne of
La Bellière?
Croquart had moved away, and was shouting orders to his men.
Bertrand heard them, though his eyes never left Tinteniac, with his
head upon Tiphaïne’s knee. They seemed to be speaking together in
low tones, and watching the broad back the Fleming had turned to
them for the moment. Bertrand saw their hands touch, and looks
that were alive with a subtle significance pass between them.
Bertrand would have given all he had to have heard the words they
had spoken.
The little picture was broken at last, though it seemed to the
man among the hazels that Tinteniac had had hours at his disposal.
They were binding up the wounded shoulder, and there was blood,
Tinteniac’s blood, on Tiphaïne’s hands. With some trick of the
memory the sight of it brought back to Bertrand the vision of Arletta
dying with red hands in that dark tower amid the beeches of
Broceliande. It was as though God’s voice had called to him—a still,
small voice amid the silence of the mysterious woods. The perfervid
selfishness went out of him like the lust out of the man who
remembers the womanhood of his mother.
Bertrand’s hands gripped the blade of his sword as he lay with it
crosswise under his throat. He saw Tiphaïne rise, draw aside, her
face hidden by her hands. Bertrand felt numb at the sight of it, yet
very humble. If she wept for Tinteniac, then Tinteniac was of all
men the most to be honored. Honored? And Bertrand’s face burned
with the hot memories of many unclean years—years when he had
bartered his manhood for harlots’ kisses.
He drew back slowly from under the hazels, and, crawling
through the gorse and underwood, reached the place where he had
left his horse. A dead tree lay there that had fallen in a winter gale,
and Bertrand sat down on the trunk with his drawn sword across his
knees. He was humbled, but the struggle was not over with him yet.
His heart was still full of the bitterness of the man who covets what
he imagines another man to possess.
Bertrand sat on his tree-trunk with the sword across his knees
and stared at his horse, that was trying to crop the grass, though
the bridle was hitched over the bough of a tree. The oak bough
would not bend, nor would the grass spring up to the hungry beast’s
muzzle. Bertrand, with a wry twist of the mouth, saw that he and his
horse were the victims of a somewhat similar dilemma.
Jealousy is the great distorter of justice, and Bertrand had the
devil at his elbow for fully ten minutes on the trunk of the dead tree.
The imp shouted every imaginable grievance in his ear, exaggerating
possibilities into facts and creating reality from conjecture. Had not
he, Bertrand du Guesclin, sacrificed himself for Robin Raguenel’s
sake, and accepted shame to save a coward? If Tiphaïne was so
tender for Tinteniac’s sake, then, by God, let Tinteniac look to the
guarding of his own petticoats!
But that great advocate whose irony slashes to shreds the special
pleading of the meaner spirit, the sense of chivalry, that great
chastener of manhood, took up the argument in Bertrand’s cause. All
ethical struggles are fierce in powerful natures, fierce in their climax,
but sure in their decision. Bertrand’s honesty was not to be cajoled.
He sat in judgment on himself, the self-asking of a few pitiless
questions baring that sincerity that makes true strength.
When he carried Robin’s arms at Mivoie, had he not hoped that
some day Tiphaïne might know what he had done?
Had Tiphaïne ever given him the promise of any deeper thing
than friendship?
Whose past was the cleaner, the Sieur de Tinteniac’s or his own?
Bertrand knotted his brows over these accusations, and
confessed that the spirit of justice had him at its mercy.
He rose, stood irresolute a moment, and then moved towards his
horse. The imp of jealousy made a last leap for his shoulders.
Bertrand shook them, and was a free man, breathing in new
inspiration for the days to come.
Now Croquart had ordered two men-at-arms to go and cover the
bodies of Tinteniac’s esquires, who lay dead together in the middle
of the forest road. Bertrand was no hot-headed fool. He knew
enough of the Fleming and his men to realize that a mere free lance
such as he seemed would be treated to no such courtesy as had
been given to Tinteniac. He was worth no ransom. If worsted, the
point of a spear or the edge of a sword would give him his quittance
in the Loudeac woods.
Bertrand knew, also, that he would have no chance with Croquart
and his three men, one against four, and that Croquart would not
trouble to engage him singly as he had engaged Tinteniac. For one
moment Bertrand thought of returning towards Josselin, in the hope
of meeting some of Dubois’s men. But the plan did not please him.
He had marked down Croquart as his own stag.
Unhitching his bridle from the bough of the tree, he took his
spear, that rested against the trunk, and, making a détour through
the woods, bore towards the place where the two esquires lay dead.
Croquart, meanwhile, was preparing to resume his march on
Loudeac. He had dressed and bound Tinteniac’s wounds, and lifted
that gentleman back to the saddle.
“I take your word, sire, as a knight—and a Breton.”
“Be easy, friend, I have not enough blood in me to give you
trouble.”
Croquart turned to hold Tiphaïne’s stirrup. She had ceased her
anger of weeping, and her face had the white sternness of one
whose courage has cooled from the heat of passion. Croquart’s smile
was as powerless as a feeble sun upon the winter of her face. She
mounted, took the bridle, and looked into the distance to avoid
meeting the Fleming’s eyes.
Croquart and Tête Bois got to horse. The two men who were
covering the dead bodies with sods and leaves were to follow the
Fleming as soon as their work was done. Croquart placed himself
between Tiphaïne and Tinteniac. He had rearmed himself in all his
heavy harness. No more courtesies were to be expected from him
that day.
They had hardly gone a hundred yards when a cry came stealing
through the silence of the woods. It held a moment, quivered, to
end in a last up-leap like the last flash of a gutted candle. Croquart
reined in and set his hand upon his sword. His face, ugly in repose,
grew doubly sinister as he glanced back under the boughs of the
trees.
A single man-at-arms came cantering over the grass, crouching
in the saddle and looking back nervously over his shoulder. Croquart
swore at him as he pulled up his horse.
“Hallo, cur!—where is Guymon?”
The man straightened in the saddle and pointed towards
Josselin.
“A fellow ran at us out of the woods, struck down Guymon with
his spear—”
“And you used the spurs.”
The man agreed, as though Croquart’s anger was preferable to
the stranger’s spear.
“Well, what next?”
“The man turned back into the woods, captain.”
“What! He did not follow you?”
“No.”
“How was he armed?”
“Rusty harness that had been oiled and looked black.”
“And both of you ran away—he from you, and you from him.”
“Yes, captain.”
Croquart laughed, and turned again towards Loudeac.
“You must have looked fiercer than you are, fool, or else your
brother coward has stopped behind to take the dead men’s rings.”
The free lance accepted the explanation. As a matter of fact, he
had taken the dead men’s rings himself, but he did not trouble to tell
Croquart so.
XXIX
The thrushes were singing on the glimmering spires of the oaks
as the crimson banner of the sunset waved to pale gold. In the
deepening azure of the east the moon had lost the filmy thinness of
a cloud and stood out in splendor over the black hills and the valleys
faint with mist. Night came, and with it the bent figures of Croquart’s
men, gathering sticks and kicking leaves together to make a fire.
The very brilliance of the night made the woods cold, and
Tinteniac, stiff with his wounds, sat propped against a tree, trying to
pretend that he was neither in pain nor cold. Tiphaïne stood near
him, her eyes seeming to catch the melancholy of the dying
afterglow.
Croquart turned his hands everywhere to help his men.
Whistling, as he might have whistled as a boy when splitting
carcasses in Flanders, he looked to the horses, cut down
underwood, the fresh, green foam of the woods in spring, and built
a screen between the trunks of two great oaks. A horse-cloth
stretched across two poles gave some sort of shelter. Business was
brisk and money forthcoming, despite the rout at Josselin and the
loss of all his baggage. A ransom of twenty thousand crowns was
not to be counted on every day of the week, and with the Sieur de
Tinteniac as a hostage he could bargain with Beaumanoir should the
marshal be discourteous enough to continue offering bribes for his
head.
Croquart plunged down the slope of the hill where he had chosen
ground for the night, to reappear with a bundle of freshly cut broom,
which he tossed down under cover of the screen of boughs. His
men’s cloaks were purloined to cover the litter; the fellows could go
damp when a Tinteniac was to be kept dry. Tête Bois had already
persuaded the fire to blaze, and Croquart turned to his prisoners
with a smile that suggested supper.
“A bed, sire, for you and for madame.”
They saw, and avoided each other’s eyes. Croquart, officious in
his courtesies, picked up Tinteniac and laid him on the pile of broom,
with a saddle on which he might rest his shoulders.
“Room for two, sire,” and he looked at Tiphaïne as though it
would have pleased him to lift her as he had lifted Tinteniac. Her
immobility discouraged him, and the dusk covered the color on her
face. She was watching the flames leap up through the crackling
wood, and thinking of poor Gilbert and poor Gilles, left to be spoiled
of their rings in the lonely Loudeac woods. Only that morning she
had seen their two heads, tawny and black, bowed over the chess-
board as they made, little knowing it, the last moves in the game of
life. Croquart had killed them, yet stood there offering her the
impertinences of his butcher’s tongue. The two lads might have
been two sparrows caught in a trap and left with their necks wrung,
for all the reflection the deed caused the Fleming.
She went and sat with Tinteniac on the bed Croquart had made
for them. Her mock husband felt the unwillingness of her nearness
to him, an antagonism, that he would have found in few ladies of
the court.
“I remember we have a part to play,” she said, when the Fleming
had moved away some paces.
“You trust me, child?”
“Yes, at all times. Yet to lie to this fellow makes me despise
myself. I cannot forget the Breton blood he has upon his hands.”
“We shall remember it,” and his eyes grew alive with the firelight.
“Mother of God, does a Tinteniac forget such things!”
Supper came, with Croquart ready to serve as their esquire. The
man Tête Bois had been sent into a hamlet to the north of Loudeac,
with orders to get food, wine, a horse-cloth, flint, steel and tinder,
and an iron pot. A boiled chicken, eggs, brown bread, and a flask of
cider had resulted from Tête Bois’s marketing. Hunger is a great
leveller of prides and prejudices, yet Croquart, ravenous as he was,
set his reputation for gallantry before the cravings of his stomach,
and carved the chicken and broke the bread.
On a square manchet the white slices of the bird’s breast were
proffered to the lady. Tiphaïne saw the two great hands loaded with
rings. She thought of the dead esquires, and the food disgusted her,
given by those butcher’s hands.
“Madame will eat?”
She took the bread and meat as though they smelled of blood.
Tinteniac, less sensitive, and a veteran in the art of concealing his
feelings, drew his knife and betrayed no disgust.
“Keep the fool in a good temper,” ran his counsel to Tiphaïne in a
whisper.
“Must I eat this food?”
“Yes, though it choke you.”
Croquart watched her, as though his cunning had uncovered her
pride. He came to her with the wine-flask, saw her touch it with her
lips and hardly taste the wine. Tinteniac was less scrupulous.
Croquart’s turn came next. He took a long pull, wiped the mouth on
a corner of his surcoat, and smiled a smile that made his small eyes
glitter.
“Madame, more wine?”
“Thanks to you, sir, no.”
He saw the repugnance on her face, as though the slime of some
unclean reptile could not have made the flask more nauseous to her
lips.
“Madame will not drink after me?”
“I am not thirsty.”
“And you do not eat? Well, as you will,” and he treated her as
though she were a sulky child. “Sire, I drink to you, the champion of
Mivoie.”
Tinteniac laughed.
“Women never know what is pleasant,” he said.
Croquart sprawled beside the fire.
“The battle makes men friends,” and he sucked at the flask till
the wine dribbled down his chin.
“I remember, sire, when the Countess de Montfort gave me her
own cup after the first taking of Roche d’Errien.”
“Ah, yes.”
“A great lady, sire, who can set courage before birth. I had this
ring from her,” and he held a hand up in the light of the fire.
Tinteniac humored him.
“Rubies! I have no such stones in my strong-box.”
“Ah, sire, Jeanne de Montfort knows the value of a brave man
when she is served by him. What say you, madame?”
Tiphaïne swept the crumbs from her lap with a quick gesture of
the hand.
“No doubt the Countess had need of you,” she said.
Croquart’s watch-fire was the red eye of the night to Bertrand,
the black shadow on the black horse stealing through the
greenwood on the Fleming’s heels. Bertrand saw the flames waving
through the trees as he sat amid the crooked roots of a great oak,
cutting slices from a loaf of bread he had bought on the road, his
bassinet full of brackish water that he had drawn from a woodland
pool. Bertrand was not a sentimentalist, and he broke his dry bread
in the dusk as though hungry from a sense of duty, knowing that
Croquart was not the man to starve on the march, and that a full
stomach makes a better soldier than a head stuffed full of Southern
songs. Bertrand carried an amusing matter-of-factness into the
current of his adventures. It was not that he did not feel or suffer,
but rather the obstinacy of his strength that insisted on coolness and
lack of flurry. Thoroughness was a passion with him, even to the
masticating of a loaf of bread.
When the dusk had deepened into the white mystery of a
moonlit night, Bertrand braced on his bassinet, saw that his horse
was securely tethered, and began his advance on Croquart’s fire.
Slipping from trunk to trunk and bush to bush, he made a mere
moving shadow amid the trees. Croquart had chosen his ground on
the slope of a low hill, a ridge of forest hiding the fire from the main
track running to Loudeac town. Bertrand, by crawling along the
farther slope of the knoll, got within twenty yards of the fire, and lay
where a tree threw a black patch on the grass like a piece of ebony
set in silver.
The figures were easily distinguishable to Bertrand. Tiphaïne,
head held high, lids drooping, the whiteness of her throat rising out
of the crimson stuffs beneath. Tinteniac, propped against a saddle,
his handsome face looking thin and tired, his eyes restless like the
eyes of a man in pain. Croquart, a burly patch of angry red, bassinet
off, tanned throat showing, a wine-flask in one hand, a charred stake
in the other for stirring the fire. The two men-at-arms stretched half
asleep on the far side of the flames.
The setting of the picture gave Bertrand the chance of testing the
sincerity of his renunciation. He saw the rough bed, the canopy, the
screen of boughs; Tiphaïne close to Tinteniac, a space between
them and the Fleming, as though the two were one by courtesy and
by desire. Bertrand gnawed at his lips, despite the sternness of his
self-repression. The group seemed typical of his own luck in life.
Tiphaïne and the Sieur de Tinteniac shared the fire, while he, as
ever, lurked in the dark, alone.
“I would say, sire, without making a boast of it, that I have found
none of your Breton men a match for me in arms.”
Bertrand heard the words as a man who is half asleep hears a
voice that wakes him in the morning. Croquart had been telling a
few of his adventures, poking the fire with his stick and brandishing
it like the baton of a master musician marshalling the lutanists and
flute-players at a feast. The vanity of the Fleming was so inevitable a
characteristic that one was no more surprised by it than by seeing a
toad spit. Innocent egoism may be a delicate perfume, an essence
that adds to the charm of the individual, admirably so in women
when they are deserving of desire. But with Croquart his
intemperate arrogance was a veritable stench, an effluvium of the
flesh, a carrion conceit that nauseated and repelled.
To Bertrand, Tiphaïne’s face seemed tilted antagonistically
towards the moon. Her throat lengthened, her lids drooped more
over her eyes. She looked impatient over the bellowings of this bull.
Tinteniac leaned on his elbow and watched the fire. His contempt,
deep as it was, found no expression on his face.
“You cut a notch on your spear,” he said, “for every gentleman
you have beaten in arms.”
Croquart prodded the embers with his stick.
“I have cut twenty notches, sire, already.”
“You will have no wood left to your spear soon, eh?”
“Room for more yet,” and he laughed. “I will tell you the names:
Sir John de Montigny, Sir Aymery de la Barre, Geoffroi Dubois, Sir
Gringoir of Angers, Lord Thomas Allison, whom I challenged at Brest
—” And he ran on, mouthing the syllables with the air of a gourmet
recalling the dishes at some great feast.
Tiphaïne drew her cloak about her as though she felt the cold.
“And to-day, sir, you have cut another notch,” she said.
“Ah, madame, it shall be one of the deepest, I assure you.”
Tinteniac was able to laugh.
“You flatter me, Fleming. We shared the fame at Mivoie.”
“Sire, madame your wife would break my spear at this last notch
if she could.”
His eyes challenged Tiphaïne, and she did not deny him.
To the man lying in the shadow of the tree these words came like
the blows of a passing bell. It seemed to him that he had heard all
now that he could ever know, and that the silver swan of Rennes
would be but a memory and a lost desire. He lay very still in the wet
grass, looking at Tiphaïne with a dull aching of the heart, as a man
might look at a lost love who has risen to trouble him beyond the
waters of the river of death.
XXX
Croquart yawned behind his arm. He rose, threw a bundle of
sticks upon the fire, and called Tête Bois aside towards the horses.
The free lance was a little bowlegged, brown-faced Gascon, very
tough and wiry, with eyes like a hawk’s and a sharp nose and beard.
“Hello! can you keep awake to-night?” and Croquart shook him
by the shoulder. “We are in the way of earning a lapful of crowns. I
will give you a thousand crowns if we bring the Sieur de Tinteniac to
Morlaix.”
Tête Bois’s eyes lost their sleepiness and twinkled like the eyes of
a rat.
“A thousand crowns, captain?”
“I say it again. Take this ring as a pledge. No tricks, or I shall pay
you in other coin.”
“Trust me,” and he took the ring; “you can go to sleep in peace.
Madame and her gentleman are safe by the fire. Go to sleep,
captain,” and he assumed the responsibility with an alert swagger.
“No tricks, little one.”
“A thousand crowns, captain!” and his eyes twinkled. “Curse me,
I love you.”
Bertrand saw the Fleming turn back towards the fire, where
Tiphaïne was helping Tinteniac to wrap himself in his cloak for the
night. Bertrand buried his face in the grass, as though unable to
watch them at such an hour as this. Tiphaïne, upon her bed of
golden broom, had a sacredness for him, even though she slept at
another man’s side. She was pure, irreproachable, herself still, and
no carnal thoughts made his happier memories bleed.
When Bertrand lifted his face again from the grass, Tinteniac,
muffled in his cloak, lay full length upon the bed of broom; while
Tiphaïne, leaning against the screen of boughs, had unloosed her
hair and was combing it with a little silver comb. Croquart, a mass of
dusky red, sprawled by the fire, his naked sword under his arm and
his shield propped against the saddle under his head. Tête Bois’s
short and bow-legged figure went to and fro with a shimmer of
steel, his shadowy face and the polished back of his bassinet turned
alternately towards Bertrand as he kept his guard.
Bertrand, forgetting Croquart and the sentinel, watched Tiphaïne
as she combed her hair. Her cloak, turned back a little, drew with its
crimson lining rivers of color from the whiteness of her throat.
Tossed by the comb, her hair glimmered in the firelight, rich whorls
of mystery moving about her face. To Bertrand her eyes seemed to
look far into the night, but what her thoughts were he could not tell.
He saw her put her comb away at last, turn and look at
Tinteniac, who seemed ready to forget his wounds in sleep. She
stretched a hand towards him, slowly, tentatively, but drew back
sharply as Croquart found his bed uncharitable and shifted his body
with much heaving of the shoulders. Tête Bois’s keen profile showed
against the firelight, mustachios upturned, nose beaking out from
under the rim of his open bassinet.
“Madame had better sleep. We travel early.”
The fellow had seen her stretch out her hand towards Tinteniac,
and the words warned her that the Gascon was not to be cajoled.
His strut was independent and alert as he turned his back on her
abruptly and resumed his marching to and fro.
Tiphaïne lay down on the bed, so that, though her face was
hidden from Bertrand, he could see the glitter of her hair. There was
the length of a sword between her and Tinteniac, three feet of
flowering broom between the green cloak and the gray. Bertrand in
his heart thanked God that he could see her so, separate, untouched
under the moon. He could not have looked at Tiphaïne if she had
lain wrapped in Tinteniac’s arms. Twice he saw her lift her head and
look at Croquart and the rest. An hour passed before weariness
seemed to overpower distrust, and her stillness showed him that she
was asleep.
Tête Bois, tired of pacing to and fro, had come to a halt some
ten paces from the fire, and now leaned heavily upon his spear. The
Gascon was amusing himself by calculating how far a thousand
crowns would go to making him the master of a troop of horse. The
pieces kept up a fantastic dance before his eyes. He handled them
lovingly in anticipation, letting them slip through his fingers in
glittering showers, pouring them upon a table and listening to the
joyous clangor of the metal. The moon was but a great crown-piece
so far as Tête Bois was concerned. He took off the ring Croquart had
given him as a pledge, and held it out towards the fire to watch the
flashing of the stones.
Unfortunately for Tête Bois, greed dulled the keenness of his
senses, and he neither saw nor heard the stealthy and sinuous
moving of a black shape across the moonlit grass. The Gascon might
have swallowed his thousand crowns for supper to judge by the
nightmare that leaped on him out of the mists of the silent woods.
Dawn came, and Croquart the Fleming was the first to wake. He
yawned, stretched himself, and sat up sleepily, his red face suffused,
his surcoat wet with the heavy dew. Gray mist hung everywhere
over the forest, though in the east there was a faint flush of rose
and of gold. The birds were piping in the thickets. Tinteniac and the
lady were still asleep.
Croquart smiled at them as a farmer might smile over the fatness
of two prize beasts. He scrambled up and looked round him for Tête
Bois, thinking that the Gascon might have gone to cut fodder for the
horses. The bow-legged paladin was nowhere to be seen. The
watch-fire was out, though the embers still steamed in the cold air
of the morning.
“Hallo, there, Tête Bois!”
The deep voice, resonant from the Fleming’s chest, woke echoes
in the woods and silenced the birds singing in the thickets. Harduin,
the second free lance, sat up and rubbed his eyes like a cat pawing
its face. Tinteniac turned from sleep to find his wounds stiff and
aching under the sodden bandages. Tiphaïne, propped upon one
elbow, her hair falling down to touch the flowering broom, saw
Croquart striding to and fro, flourishing a stick, restless and
impatient.
“Tête Bois, rascal, hallo!”
A few rabbits scurried down the misty glades, and a couple of
partridges went “burring” into cover. The Fleming’s voice brought
back nothing.
Croquart looked grim.
“The little Gascon devil!” he thought. “That ring was worth a
hundred crowns, and a ring on the finger, Messire Tête Bois, is worth
a thousand crowns in my strong-box, eh? If I ever catch you, my
friend, I will break your back. Let us see whether you have taken
your own horse.”
But Tête Bois’s horse was standing quietly with the rest, and the
frown on the Fleming’s face showed that he was puzzled. What had
happened to the fellow? And if he had deserted, why had he left his
horse?
Tête Bois’s disappearance opened the day ill-humoredly for the
Fleming. The natural roughness of his temper broke to the surface,
and he was sullen and abrupt, his affectations of refinement damp
as his own finery with the night’s dew. Tiphaïne and her champion
had never a smile from him as they made their morning meal and
Croquart bustled them to horse, impatient as any merchant afraid of
losing his silks and spices to footpads ambushed in the woods. Such
baggage as they had was tied on the back of Tête Bois’s horse, and
before the sun had been up an hour they were on the road towards
Morlaix.
The mists rolled away, leaving a dappling of clouds over the blue
of the May sky. The grass glittered with dew, and the scent of the
woods was like the scent of some cedar chest filled with the
perfumed robes of a queen. The beech-trees, with their splendor of
misty green, towered up beside the embattled oaks, whose crockets
and finials seemed of bronze and of gold. The grass was thick with
many flowers, the robes of the earth wondrous with color.
Yet beauty cannot save a man from pain, and before they had
gone two leagues that morning Tiphaïne saw that Tinteniac suffered.
From white his face had changed to gray, and his eyes had the
wistful look that one sees in the eyes of a wounded dog. He had lost
much blood and needed rest, for his harness and each jolting of the
saddle gave him pain. Pride kept Tinteniac silent—the pride of the
man unwilling to ask favors in defeat. The cool air of the morning
had its balm, but when the sun rose above the trees the heat of the
day made his forehead burn.
Tiphaïne, looking up at him with pitying eyes, saw how he
suffered, though he told her nothing. Croquart, sullen and out of
temper, had forged on ahead, feeling the smart of the rout at
Josselin. The man Harduin, leading Tête Bois’s horse, followed
leisurely in the rear.
“Your wounds are too much for you.” And she drew her palfrey
close to the great horse.
“No, child, no.”
“Tell the Fleming you must rest.”
Tinteniac straightened in the saddle with a slight shudder of pain.
“I can bear it longer,” he said, quietly.
“Why, sire, why? Croquart must let you rest.”
“Upon my soul, I will ask him no favor.”
“And upon my soul, sire, in ten minutes you will fall from your
horse.”
She pushed past him without further parley and overtook the
Fleming, who was biting his beard and looking as ill-tempered as it is
possible for a man with an ugly jowl to look. Tiphaïne caught a
glimpse of his solid and pugnacious profile before he turned to her
with an impatient glint of the eyes.
“Well, madame, what now?”
“The Sieur de Tinteniac’s wounds are still open; he cannot travel
farther without a rest.”
“Rest—a soldier asks for rest!”
Tiphaïne’s color deepened. The very arrogance of the man’s
impatience fed her hate. She could have laid a whip across
Croquart’s face with immense comfort to her self-respect.
“You answer me—that?”
“I command here, madame.”
“Then call a halt.”
“The Sieur de Tinteniac must hold on to the saddle till we reach
the hills.”
“You have no pity!”
“I have no time to waste.”
“And I—no words.”
She reined in her palfrey, slipped from the saddle, and, leading
the beast aside by the bridle, began to pick the flowers that grew in
the long grass, as though she were at home in the La Bellière
meadows. Croquart pulled up his horse, looking as black and
threatening as a priest out-argued by a heretic. Tinteniac, guessing
what had passed between them, reined up in turn and let his horse
crop the grass.
Croquart’s veneer of chivalry cracked under the heat of the sun.
Tiphaïne’s eyes had flattered him too little to persuade him to be
pleased with a woman’s whims. He heeled his horse across the road,
to see the Vicomte’s daughter retreating from him at her leisure,
singing to herself and stooping to pick flowers.
“Madame!”
Tiphaïne went on with her singing.
“Devil take the woman!” And he pushed on after her, not
knowing for the moment how to meet her tactics.
Tiphaïne stood in a pool of waving grass, where bluebells
touched the hem of her gray gown. Great oaks, with tops of
burnished gold, swept up beyond to touch the clouds. She reached
out a white arm for the flowers, seeing the shadow of Croquart’s
horse loom towards her over the grass. He was quite close before
she turned and faced him, keeping her palfrey between her and the
Fleming.
“Well, Messire Croquart,” and she gave him the title with a curl of
the lip, “am I to believe that you have no manners?”
“A truce to this foolery.”
“I tell you, I am tired, sir, and I am going to rest.”
Croquart bit his beard.
“I shall have to dismount to you, madame.”
Her eyes blazed out at him, their splendor more visible now that
she was angry.
“Dismount to me, you butcher boy from Flanders! No, that would
be too gracious of you. Please continue to forget your manners.”
“Madame, I shall lose my temper with you.”
“It is lost already, Messire Croquart. Try the flat of your sword, or
the edge thereof if it pleases you. I am not afraid.”
“I shall have to put you up into the saddle.”
“You cannot keep me from falling off.”
“Hands and feet can be tied, eh?”
“Yes, and I have a knife.”
“Pah, madame, am I a fool? I tell you I am in no temper to be
bated.”
“Get down, then, sir, and see if you can run in your heavy
harness. Meanwhile the Sire de Tinteniac might have his rest.”
Croquart opened his mouth to swear, but mastered himself with
an effort, as though realizing that the species of dictatorship was not
crowned with too much dignity.
“Come, madame, be reasonable.”
“Is it unreasonable, Messire Croquart, for a wife to fear that her
husband may die of his wounds?”
“Oh—you exaggerate.”
“The weight of your blows? They were not too feeble.”
“Grace de Dieu, madame, have your way, or we shall be
quarrelling here till midnight!”
“Then we rest for an hour?”
“I grant it.”
And he capitulated sulkily, with the air of a man giving way to the
foibles of a woman.
Of all this by-play Bertrand had a distant view as he followed
Tiphaïne through the green mystery of May. What were the golden
meads to him, the winding woodways wonderful with spring, the
dawn song of the birds, the scent of the wild flowers rising like
incense out of the grass? To Bertrand that silent and unseen journey
towards Morlaix seemed like a pilgrimage for the humbling of his
heart. He followed, watched, planned, yet felt himself forgotten,
reading into every incident that passed a woman’s tenderness for a
man whom he himself could easily have loved.
Through the long watches of the night and the shining of the
east at dawn Bertrand had wrestled with his loneliness. It was not
easy for him to renounce so much, to accept forgetfulness, to look
upon the past as a mere memory. And yet the very obstinacy of his
new self-discipline helped him to throw his jealousy aside. What kind
of creature would he find himself if he deserted Tiphaïne at such a
pass, standing upon a mean punctilio, refusing to be generous save
for his own ends? If he was to suffer, then let him serve and suffer
like a man, remembering the old days when Tiphaïne had saved him
from his shame.
XXXI
A desolated homestead in a valley among the northern hills gave
Croquart and his prisoners shelter the same night. The house, built
of unfaced stone and thatched with straw and heather, had been
plundered by some of Bamborough’s English, whose passion for
thoroughness in their thieving moved them to burn what they could
not carry.
Croquart rode into the grass-grown yard, where all the byres and
out-houses had been destroyed by fire, nothing but a few charred
posts rising above the weeds and nettles. The Fleming dismounted,
after sounding his horn to see whether any of the farm folk still
loitered about the place. They found the house itself to be full of
filth, for the birds had roosted on the rafters, and the English used it
as a stable, the droppings from their horses rotting upon the floor. It
held nothing but the hall, a cellar, and the goodman’s parlor under
the western gable—the last room being a little more cleanly than the
hall, its single window, with the shutter broken, looking down upon
the orchard. Pears and apples piled up their bloom above the rank
splendor of the grass—a sea of snow flecked and shaded with rose
and green. To the east of the orchard a great pool shimmered in the
sunlight, its waters dusted with blown petals from the trees.
Tinteniac was so stiff and sore with his wounds after the day’s
ride that Croquart had to help him from his horse. The Fleming, who
had examined the house, took Tinteniac in his arms, and carried him
to the upper room, where there was some mouldy straw piled in a
corner. He laid Tinteniac on the straw, having made a show of his
great strength by carrying a man taller than himself with the ease
that he would have carried a child of five. Croquart had recovered
his self-complacency since his skirmish with Tiphaïne in the morning,
and she had had nothing to charge him with save with his
insufferable boasting.
Tinteniac was so utterly weary that he had not sufficient mind-
force left in him to resent his being treated as a dead weight for the
exhibition of the Fleming’s strength. He drew a deep breath of relief
when he felt his body sink into the straw—too faint to care whether
the bed was one of swan’s-down or of dung. In five minutes he was
fast asleep.
Harduin had watered the horses and stabled them in the hall, lit
a fire, and slung the cooking-pot over a couple of forked sticks. In a
little hovel at the end of the orchard Croquart had found some clean
straw, and carried a truss into the goodman’s parlor to make
Tiphaïne a bed. She met him with a finger on her lip, and pointed to
Tinteniac, whose tired body drank in sleep as a dry soil drinks in
rain. How much alone she was, how wholly at the Fleming’s mercy,
she only realized as she watched him spread the straw in a far
corner of the room.
“You will sleep softly enough,” he said, turning on his knees, and
looking at her with an expression of the eyes she did not trust.
“It is not likely that I shall sleep,” and she moved aside towards
the window.
“No bedfellow, eh?” And he got up with a chuckle, leaving her
alone with the wounded man upon the straw.
Presently he returned with a pitcher full of water, some brown
bread, and a few olives. He set them down on a rough bench by the
window, and loitered foolishly at the door.
“I trust madame has forgotten the quarrel we had this morning?”
“I am ready to forget it, Messire Croquart.”
“Thanks,” and he gave her an impudent bow, “we shall be better
friends before we reach Morlaix.”
When he had gone she closed the door on him, and found to her
delight the wooden bar that was used in lieu of a latch. The staples
were firm in the oak posts, yet not so firm that she could abandon
her distrust. The rough bench at the window, a cup of water, olives,
and bread; with such comforts she was content, so long as the door
parted Croquart and herself. While Tinteniac slept she watched the
sun sink low behind the woods that broke like green waves upon the
bosoms of the hills. Below her lay the orchard trees, smothering the
old house with beauty under the benisons of eve. Swallows were
skimming over the still waters of the pond, and the mist in the
meadows covered the sheeted gold of May.
In the dirty cobwebbed hall Croquart was making his plans for
the coming night. The house door, studded with iron nails, lay
wrenched from its hinges in the yard, and through the open
windows the birds and bats could come and go. Croquart, sitting on
a saddle by the fire, his sword across his thighs, called Harduin to
him, and offered him the same bribe as he had given Tête Bois the
night before.
“Well, my friend, are you in a hurry to desert?”
The fellow fidgeted under the Fleming’s eyes.
“Come, let us understand each other; I have a mind to be
generous. Will you stand by Croquart the Fleming or follow Tête
Bois, who preferred a ring to a thousand crowns?”
Harduin, who had already stolen the rings from Tinteniac’s dead
esquires, appeared even more greedy than the Gascon.
“When shall I finger the money, captain?”
“At Morlaix.”
“Call it a bargain.”
“And easily earned, eh? Keep guard in the orchard near the Sieur
de Tinteniac’s window.”
Harduin nodded.
“The house shall be my affair. Whistle if you see anything
strange.”
“Right, captain.”
And taking his spear and shield with him, he went out into the
orchard to keep watch.
About midnight Tinteniac awoke, and turned on his straw with
the confused thoughts of a man whose surroundings are strange to
him. Tiphaïne, seated by the window, where the moonlight streamed
in upon the floor, went to him quietly, and knelt down by the bed.
“You have slept well,” and she felt his forehead; “there is food
here if you are hungry.”
“Asleep! Selfish devil that I am! You must be tired to death.”
“No, I am not tired.”
He looked at her steadily, propping himself upon one arm. Sleep
had cooled the fever in him, freshened his brain, and strengthened
the beating of his heart. The room lit by the moonlight, the
perfumed coolness of the night, the white face of the woman by the
bed, filled him with a sense of strangeness and of mystery.
“It is my turn to watch.” And he touched her arm, thrilling, man
of forty that he was, at Tiphaïne’s nearness to him in the moonlight.
“There is no need for it; I have barred the door.”
“And Croquart?”
She did not tell him of her great distrust.
“Croquart has left us as man and wife. I have too much to think
about to wish to sleep.”
Tinteniac sank back on his straw, watching her as she brought
him the water-pot, bread, and olives.
“I am afraid I am a broken reed,” he said, with the smile of a
man contented to be ministered to by a woman’s hands.
“You must gain strength, sire, for both our sakes.”
“Yes, true.”
“Therefore, you must sleep again.”
“I would rather talk.”
“We can talk to-morrow.”
“Have we not changed our parts? Well, I will obey your orders.”
And in half an hour his breathing showed that he had forgotten
the world and such subtleties as the glimmer of moonlight on a
woman’s hair.
Tiphaïne had returned to her seat by the window, her sense of
loneliness increased now that Tinteniac was asleep. The night, with
all its infinite uncertainty, its vague sounds and distorted shadows,
filled her with restlessness and with those imaginings that people the
world with half-seen shapes. The bravest of us are but great children
when a wind blows the boughs against the window at midnight, and
the moon, that magician of the skies, brings back the childhood of
the race, when man trembled before Nature, filling the forest, the
desert, and the marsh with goblin creatures born out of his own
vivid brain.
Before Tiphaïne at her window stood the orchard trees, pillars of
ebony spreading into carved canopies of whitest marble, each chisel-
mark perfect as from the touch of a god. The deep grass looked
black as water in a well, the wooded slopes of the silent valley
steepled with a thousand shimmering spires. Under an apple-tree
stood Croquart’s sentinel, leaning lazily against the trunk, the
moonlight sifting through the apple bloom and dappling his harness
with silver burrs. Tiphaïne had discovered Harduin there, and knew
that he had been set there to watch the window. Twice she saw
Croquart enter the orchard to assure himself that Harduin was
awake at his post.
An hour later she heard the Fleming mount the stairs, stealthily
and with the deliberation of a man fearing to wake a household as
he creeps to an intrigue. She could hear his breathing as he stood
and listened, while the rats scuffled and squeaked under the wood-
work of the floor. His hand tried the door, shaking it cautiously with
tentative clickings of the wooden latch. Tiphaïne thanked God for the
good oak-bar that gave Messire Croquart the lie for once. He turned
at last and went back to the hall, where she could hear him
swearing and throwing wood upon the fire. There would be no
thought of sleep for the mock wife that night.
Now whether Tiphaïne was very quick of hearing, or whether the
tension of her distrust had turned up the sensitiveness of her ears,
she heard some sound in the moonlit orchard that seemed lost upon
Harduin as he leaned against his tree. The noise resembled the faint
“tuff—tuff” of a sheep cropping at short grass. Sometimes it ceased,
only to commence again, nearer and more distinct to her than
before. Tiphaïne strained her ears and her conjectures to set a cause
to the approaching sound. She wondered that Harduin had not
heard it, and judged that his bassinet might make him harder of
hearing than herself.
A suggestion of movement, a vague sheen in the grass showed
in the moonlight under the apple-trees, as of something crawling
towards the house. Slowly, noiselessly, a figure rose from the grass
behind the trunk of the tree against which Croquart’s sentinel was
leaning. There was a sudden darting forward of the stooping figure,

You might also like