100% found this document useful (7 votes)
25 views

(Ebook) Image Operators: Image Processing in Python by Jason M. Kinser ISBN 9781498796187, 1498796184 2024 scribd download

The document provides information about various ebooks related to image processing in Python, including titles by authors such as Jason M. Kinser and Philip A. Laplante. It includes details on how to download these ebooks, their ISBNs, and links to their respective product pages. Additionally, it features a comprehensive table of contents for the book 'Image Operators: Image Processing in Python' by Jason M. Kinser, covering topics from scripting in Python to frequency space manipulations.

Uploaded by

lharchislum
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 (7 votes)
25 views

(Ebook) Image Operators: Image Processing in Python by Jason M. Kinser ISBN 9781498796187, 1498796184 2024 scribd download

The document provides information about various ebooks related to image processing in Python, including titles by authors such as Jason M. Kinser and Philip A. Laplante. It includes details on how to download these ebooks, their ISBNs, and links to their respective product pages. Additionally, it features a comprehensive table of contents for the book 'Image Operators: Image Processing in Python' by Jason M. Kinser, covering topics from scripting in Python to frequency space manipulations.

Uploaded by

lharchislum
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/ 57

Download Full Version ebook - Visit ebooknice.

com

(Ebook) Image Operators: Image Processing in


Python by Jason M. Kinser ISBN 9781498796187,
1498796184

https://ebooknice.com/product/image-operators-image-
processing-in-python-7384456

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Image operators image processing in Python by


Kinser, Jason M ISBN 9780429451188, 9780429835926,
9780429835933, 9780429835940, 9781138197053,
9781498796187, 0429451180, 0429835922, 0429835930
https://ebooknice.com/product/image-operators-image-processing-in-
python-9953358

ebooknice.com

(Ebook) Morphological Image Operators: Morphological Image


Operators by Heijmans H.J.A.M. ISBN 9780128210031,
0128210036
https://ebooknice.com/product/morphological-image-operators-
morphological-image-operators-51606390

ebooknice.com

(Ebook) Modeling and Simulation in Python by Jason M.


Kinser ISBN 9781032116488, 9781032128702, 103211648X,
1032128704, 2021059491
https://ebooknice.com/product/modeling-and-simulation-in-
python-42372604

ebooknice.com

(Ebook) Information Fusion in Signal and Image Processing


(Digital Signal and Image Processing) by Isabelle Bloch
ISBN 9781848210196, 1848210191
https://ebooknice.com/product/information-fusion-in-signal-and-image-
processing-digital-signal-and-image-processing-1406464

ebooknice.com
(Ebook) Deep Learning for Computer Vision - Image
Classification, Object Detection and Face Recognition in
Python by Jason Brownlee
https://ebooknice.com/product/deep-learning-for-computer-vision-image-
classification-object-detection-and-face-recognition-in-
python-33715580
ebooknice.com

(Ebook) Software Engineering for Image Processing Systems


(Image Processing Series) by Philip A. Laplante ISBN
0849313767
https://ebooknice.com/product/software-engineering-for-image-
processing-systems-image-processing-series-2135544

ebooknice.com

(Ebook) Image Processing Masterclass with Python : 50+


Solutions and Techniques by Dey, Sandipan ISBN
9789389898644, 9389898641
https://ebooknice.com/product/image-processing-masterclass-with-
python-50-solutions-and-techniques-36367776

ebooknice.com

(Ebook) Image Processing and Acquisition using Python


(Chapman & Hall/CRC The Python Series) by Ravishankar
Chityala, Sridevi Pudipeddi ISBN 9780367198084, 0367198088
https://ebooknice.com/product/image-processing-and-acquisition-using-
python-chapman-hall-crc-the-python-series-11146968

ebooknice.com

(Ebook) Image Processing and Acquisition using Python


(Chapman & Hall/CRC The Python Series) by Chityala,
Ravishankar, Pudipeddi, Sridevi ISBN 9780367531577,
0367531577
https://ebooknice.com/product/image-processing-and-acquisition-using-
python-chapman-hall-crc-the-python-series-55196430

ebooknice.com
Image Operators
Image Operators
Image Processing in Python

Jason M. Kinser
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2019 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business
No claim to original U.S. Government works

Printed on acid-free paper


International Standard Book Number-13: 978-1-4987-9618-7 (Hardback)
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made
to publish reliable data and information, but the author and publisher 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, micro-
filming, 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, please access www.copyright.com (http://www.
copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-
750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations
that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identifi-
cation and explanation without intent to infringe.

Library of Congress Cataloging-in-Publication Data

Names: Kinser, Jason M., 1962- author.


Title: Image operators: image processing in Python/Jason M. Kinser.
Description: First edition. | Boca Raton, FL: CRC Press/Taylor & Francis Group, [2019] |
“A CRC title, part of the Taylor & Francis imprint, a member of the Taylor & Francis Group,
the academic division of T&F Informa plc.” | Includes bibliographical references and index.
Identifiers: LCCN 2018017140 (print) | LCCN 2018017764 (ebook) | ISBN 9780429451188 (eBook) |
ISBN 9780429835940 (Adobe PDF) | ISBN 9780429835933 (ePUB) |
ISBN 9780429835926 (Mobipocket) | ISBN 9781498796187 (hardback: acid-free paper)
Subjects: LCSH: Image processing—Digital techniques. | Python (Computer program language)
Classification: LCC TA1637 (ebook) | LCC TA1637 .K48 2019 (print) | DDC 006.6—dc23
LC record available at https://lccn.loc.gov/2018017140

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com

and the CRC Press Web site at


http://www.crcpress.com
This book is dedicated to my beautiful wife – Sue Ellen.
Contents

Python Codes ................................................................................................................................... xv


Preface.............................................................................................................................................xxi
Software and Data.........................................................................................................................xxiii
Author ............................................................................................................................................ xxv

PART I Image Operators

Chapter 1 Introduction ............................................................................................................. 3


1.1 Scripting in Python ......................................................................................... 3
1.2 Installation ...................................................................................................... 4
1.2.1 Example Codes .................................................................................. 4
1.2.2 Establishing a Work Space................................................................. 4
1.2.3 The Spyder Interface.......................................................................... 5
1.2.4 Intent of the Text ................................................................................ 5

Chapter 2 Operator Nomenclature ........................................................................................... 7


2.1 Image Notation ............................................................................................... 7
2.2 Operators......................................................................................................... 8
2.2.1 Creation Operators ............................................................................. 8
2.2.2 Channel Operators ............................................................................. 9
2.2.3 Informational Operators................................................................... 12
2.2.4 Intensity Operators........................................................................... 14
2.2.5 Geometric Operators........................................................................ 16
2.2.6 Transformation Operators ................................................................ 16
2.2.7 Expansion Operators........................................................................ 17
2.3 Combinations and Reduced Notation ........................................................... 18
2.4 Summary....................................................................................................... 19

Chapter 3 Scripting in Python ................................................................................................ 21


3.1 Basic Python Skills ....................................................................................... 21
3.1.1 Variables........................................................................................... 21
3.1.2 Strings .............................................................................................. 22
3.1.3 Type Conversions with Strings ........................................................ 23
3.2 Tuples, List, Dictionaries, and Sets .............................................................. 23
3.2.1 Tuple ................................................................................................ 23
3.2.2 Slicing .............................................................................................. 23
3.2.3 Lists.................................................................................................. 25
3.2.4 Dictionaries ...................................................................................... 25
3.2.5 Sets................................................................................................... 26
3.3 Flow Control ................................................................................................. 26
3.3.1 The if Command .............................................................................. 27
3.3.2 The while Command........................................................................ 28

vii
viii Contents

3.3.3 Break and Continue.......................................................................... 29


3.3.4 The For Loop ................................................................................... 29
3.3.5 The map and lambda Functions ....................................................... 31
3.3.6 Image Operators and Control........................................................... 31
3.4 Input and Output ........................................................................................... 32
3.4.1 Reading and Writing Text Files ....................................................... 32
3.4.2 Pickling Files ................................................................................... 32
3.5 Defining Functions........................................................................................ 33
3.5.1 Function Components ...................................................................... 33
3.5.2 Returns ............................................................................................. 34
3.5.3 Default Arguments........................................................................... 35
3.5.4 Function Help................................................................................... 35
3.6 Modules ........................................................................................................ 36
3.7 Errors ............................................................................................................ 38
3.8 NumPy .......................................................................................................... 39
3.8.1 Creating Arrays................................................................................ 39
3.8.1.1 Zeros and Ones ................................................................ 39
3.8.1.2 Random............................................................................ 40
3.8.1.3 Geometric Shapes............................................................ 41
3.8.1.4 Conversion of Numerical Data ........................................ 41
3.8.2 Manipulating Arrays ........................................................................ 42
3.8.2.1 Display Option................................................................. 42
3.8.2.2 Converting Arrays ........................................................... 42
3.8.2.3 Simple Math .................................................................... 42
3.8.2.4 Multiplying Vectors ......................................................... 43
3.8.2.5 Multiplying Matrices ....................................................... 44
3.8.2.6 Array Functions ............................................................... 44
3.8.2.7 Decisions ......................................................................... 47
3.8.2.8 Advanced Slicing............................................................. 48
3.8.2.9 Universal Functions ......................................................... 48
3.8.2.10 Sorting ............................................................................. 49
3.8.3 Indices .............................................................................................. 51
3.9 SciPy ............................................................................................................. 52
3.9.1 Loading and Saving Images............................................................. 53
3.9.2 Examples from ndimage .................................................................. 54
3.9.2.1 Rotation and Shift............................................................ 54
3.9.2.2 Center of Mass................................................................. 55
3.10 Summary....................................................................................................... 56

Chapter 4 Digital Images ....................................................................................................... 59


4.1 Images in Python .......................................................................................... 59
4.2 Resolution ..................................................................................................... 59
4.2.1 Intensity Resolution ......................................................................... 59
4.2.2 Spatial Resolution ............................................................................ 61
4.3 Digital Formats ............................................................................................. 63
4.3.1 Bitmaps ............................................................................................ 63
4.3.2 JPEG ................................................................................................ 63
4.3.3 GIF ................................................................................................... 63
4.3.4 TIFF ................................................................................................. 64
Contents ix

4.3.5 PNG.................................................................................................. 65
4.3.6 Other Compressions......................................................................... 65
4.4 Summary....................................................................................................... 65

Chapter 5 Color ...................................................................................................................... 67


5.1 The RGB Color Model ................................................................................. 67
5.2 The HSV Color Model.................................................................................. 69
5.3 The YUV Family .......................................................................................... 72
5.4 CIE L*a*b*................................................................................................... 73
5.5 Improvements in Recognition....................................................................... 74
5.6 Summary....................................................................................................... 77

PART II Image Space Manipulations


Chapter 6 Geometric Transformations ................................................................................... 81
6.1 Selections...................................................................................................... 81
6.2 Linear Translation......................................................................................... 83
6.2.1 Simple Shifting ................................................................................ 83
6.2.2 NonInteger Shifts ............................................................................. 84
6.3 Scaling .......................................................................................................... 85
6.4 Rotation......................................................................................................... 87
6.5 Dilation and Erosion ..................................................................................... 88
6.6 Coordinate Mapping ..................................................................................... 90
6.7 Polar Transformations................................................................................... 90
6.7.1 Theory .............................................................................................. 91
6.7.2 Python Implementation.................................................................... 92
6.7.3 Example ........................................................................................... 94
6.8 Pincushion and Barrel Transformations ...................................................... 95
6.9 Other Transformations.................................................................................. 96
6.9.1 Generic Transformations.................................................................. 97
6.9.2 Affine Transformation...................................................................... 98
6.10 Summary....................................................................................................... 99

Chapter 7 Image Morphing .................................................................................................. 101


7.1 Warp............................................................................................................ 101
7.1.1 Marking Fiducial Points................................................................. 101
7.1.2 Image Dancer ................................................................................. 101
7.1.3 Delaunay Tessellation .................................................................... 103
7.1.4 Applying the Warp ......................................................................... 104
7.2 Average Face............................................................................................... 106
7.3 Image Morphing ......................................................................................... 107

Chapter 8 Principle Component Analysis ............................................................................ 111


8.1 The Purpose of PCA ................................................................................... 111
8.2 Covariance Matrix ...................................................................................... 111
8.3 Eigenvectors................................................................................................ 112
8.4 PCA............................................................................................................. 113
Visit https://ebooknice.com to
discover a wide range of
eBooks across various genres.
Enjoy exclusive deals and
discounts to enhance your
reading experience. Start your
digital reading journey today!
x Contents

8.4.1 Distance Tests ................................................................................ 116


8.4.2 Organization Example ................................................................... 116
8.4.3 RGB Example ................................................................................ 121
8.5 First Order Nature of PCA.......................................................................... 124
8.6 Summary..................................................................................................... 124

Chapter 9 Eigenimages ........................................................................................................ 127


9.1 Eigenimages................................................................................................ 127
9.1.1 Large Covariance Matrix ............................................................... 128
9.1.2 Python Implementation.................................................................. 128
9.1.3 Face Recognition Example ............................................................ 130
9.1.4 Natural Eigenimages...................................................................... 131

PART III Frequency Space Manipulations

Chapter 10 Image Frequencies............................................................................................... 137


10.1 Complex Numbers ...................................................................................... 137
10.2 Theory......................................................................................................... 138
10.3 Digital Fourier Transform........................................................................... 138
10.3.1 FFT in Python ................................................................................ 139
10.3.2 Signal Reconstruction .................................................................... 139
10.4 Properties of a Fourier Transform............................................................... 140
10.4.1 DC Term......................................................................................... 140
10.4.2 Conservation of Energy ................................................................. 141
10.4.3 Replication ..................................................................................... 142
10.4.4 Addition ......................................................................................... 142
10.4.5 Shift................................................................................................ 143
10.4.6 Scale............................................................................................... 143
10.4.7 Power Spectrum ............................................................................. 144
10.5 Displaying the Transform ........................................................................... 144
10.6 Simple Shapes............................................................................................. 145
10.6.1 Rectangle........................................................................................ 145
10.6.2 Circle.............................................................................................. 146
10.7 Frequency Bands ........................................................................................ 147
10.8 Windowing.................................................................................................. 149
10.9 Summary..................................................................................................... 152

Chapter 11 Filtering in Frequency Space............................................................................... 153


11.1 Frequency Filtering..................................................................................... 153
11.1.1 Low-pass Filter .............................................................................. 153
11.1.2 High-pass Filter.............................................................................. 154
11.1.3 Band-pass Filter ............................................................................. 155
11.2 Directional Filtering.................................................................................... 156
11.3 Fingerprint Example ................................................................................... 158
11.4 Artifact Removal......................................................................................... 160
11.5 Summary..................................................................................................... 163
11.6 Problems ..................................................................................................... 163
Contents xi

Chapter 12 Correlations ......................................................................................................... 165


12.1 Justification and Theory.............................................................................. 165
12.2 Theory......................................................................................................... 165
12.2.1 Computations in Fourier Space...................................................... 166
12.3 Implementation in Python........................................................................... 167
12.3.1 Brute Force..................................................................................... 167
12.3.2 Method Based on Fourier Transforms ........................................... 168
12.3.3 Example – Geometric Shapes ........................................................ 169
12.3.4 Example – Boat Isolation............................................................... 170
12.4 Composite Filtering .................................................................................... 174
12.5 SDF and MACE.......................................................................................... 175
12.5.1 Fractional Power Filter (FPF) ........................................................ 176
12.5.1.1 Theory............................................................................ 176
12.5.1.2 Manipulating α .............................................................. 177
12.5.1.3 Example......................................................................... 178
12.5.1.4 The Constraints.............................................................. 180
12.5.1.5 Dual FPFs ...................................................................... 182
12.6 Restrictions of Correlations ........................................................................ 184
12.7 Summary..................................................................................................... 184

PART IV Texture and Shape

Chapter 13 Edge Detection .................................................................................................... 189


13.1 Edges........................................................................................................... 189
13.2 The Sobel Filters......................................................................................... 190
13.3 Difference of Gaussians.............................................................................. 191
13.4 Corners........................................................................................................ 193

Chapter 14 Hough Transforms ............................................................................................... 199


14.1 Detection of a Line ..................................................................................... 199
14.2 Detection of a Circle................................................................................... 202
14.3 Application ................................................................................................. 204
14.4 Summary..................................................................................................... 205

Chapter 15 Noise.................................................................................................................... 209


15.1 Random Noise ............................................................................................ 209
15.2 Salt and Pepper Noise................................................................................. 209
15.3 Camera Noise.............................................................................................. 212
15.4 Colored Noise ............................................................................................. 212
15.5 Comparison of Noise Removal Systems .................................................... 212
15.5.1 Smoothing ...................................................................................... 213
15.5.2 Low-Pass Filtering ......................................................................... 214
15.5.3 Erosion and Dilation ...................................................................... 214
15.5.4 Median Filter.................................................................................. 215
15.5.5 Wiener Filter .................................................................................. 216
15.6 Other Types of Noise .................................................................................. 217
15.7 Summary..................................................................................................... 217
xii Contents

Chapter 16 Texture Recognition ............................................................................................ 221


16.1 Data............................................................................................................. 221
16.2 Edge Density............................................................................................... 221
16.2.1 Statistical Method .......................................................................... 221
16.2.2 The Method of Rosenfeld and Thurston ........................................ 223
16.2.3 Wavelet Decomposition and Texture ............................................. 227
16.2.4 Gray-Level Co-Occurrence Matrix ................................................ 230
16.2.4.1 Angular Second Moment............................................... 232
16.2.4.2 Contrast.......................................................................... 232
16.2.4.3 Correlation..................................................................... 233
16.2.4.4 Variance ......................................................................... 234
16.2.4.5 Entropy .......................................................................... 234
16.2.4.6 The Remaining Haralick Metrics .................................. 235
16.3 Filter-Based Methods.................................................................................. 238
16.3.1 Law’s Filters................................................................................... 238
16.4 Summary..................................................................................................... 240

Chapter 17 Gabor Filtering .................................................................................................... 243


17.1 Gabor Filtering............................................................................................ 243
17.2 Edge Response............................................................................................ 245
17.3 Texture Extraction with Gabor Filters ........................................................ 246
17.4 Gabor Filters in Fourier Space.................................................................... 249
17.5 Summary..................................................................................................... 249

Chapter 18 Describing Shape................................................................................................. 251


18.1 Contour Methods ........................................................................................ 251
18.1.1 Chain Code..................................................................................... 251
18.1.2 The Polygon Method...................................................................... 252
18.1.3 Metrics Used to Describe Shape .................................................... 252
18.1.4 Fourier Descriptors ........................................................................ 255
18.1.5 Wavelets ......................................................................................... 258
18.1.6 Elastic Matching ............................................................................ 258
18.2 Region Methods.......................................................................................... 262
18.2.1 Eigenvectors and Eigenvalues........................................................ 262
18.2.2 Shape Metrics................................................................................. 265
18.3 Describing Structure ................................................................................... 267
18.3.1 Curvature Flow .............................................................................. 267
18.3.2 Medial Axis.................................................................................... 269
18.4 Problems ..................................................................................................... 271

PART V Basis

Chapter 19 Basis Sets............................................................................................................. 275


19.1 Discrete Cosine Transform ......................................................................... 276
19.2 Zernike Polynomials................................................................................... 279
19.3 Empirical Mode Decomposition................................................................. 282
19.4 Image Analysis with Basis Sets.................................................................. 285
Contents xiii

Chapter 20 Pulse Images and Autowaves .............................................................................. 293


20.1 Pulse-Coupled Neural Network .................................................................. 293
20.1.1 Mammalian Visual Cortex ............................................................. 293
20.1.2 PCNN............................................................................................. 293
20.1.2.1 Theory............................................................................ 294
20.1.2.2 Pulse Streams................................................................. 294
20.1.2.3 Applications................................................................... 295
20.1.2.4 Operator Notation.......................................................... 296
20.2 Intersecting Cortical Model ........................................................................ 296
20.2.1 Centripetal Autowaves ................................................................... 297
20.2.2 ICM ................................................................................................ 297
20.3 Texture Classification with the ICM........................................................... 298
20.4 Summary..................................................................................................... 300

Appendix A Operators ............................................................................................................. 303


Appendix B Operators in Symbolic Order............................................................................... 325
Appendix C Lengthy Codes..................................................................................................... 327
Bibliography ................................................................................................................................. 333
Index.............................................................................................................................................. 335
Python Codes
1.1 Positioning Python to the user’s directory ............................................................................. 4
1.2 Positioning Python to the user’s directory ............................................................................. 5
2.1 Corresponding Python outline ............................................................................................... 7
2.2 Swapping the color channels ............................................................................................... 11
2.3 Converting an RGB image to a grayscale image ................................................................. 12
2.4 A few informational operations ........................................................................................... 13
2.5 Computing the average of selected pixels............................................................................ 13
2.6 Determining which channel has the most energy ................................................................ 14
2.7 Isolating the man’s cane....................................................................................................... 16
3.1 Creating an integer............................................................................................................... 21
3.2 Simple math functions ......................................................................................................... 22
3.3 Type casting ......................................................................................................................... 22
3.4 Creating strings .................................................................................................................... 22
3.5 Type conversions.................................................................................................................. 23
3.6 Building a name ................................................................................................................... 23
3.7 Tuple .................................................................................................................................... 24
3.8 Extraction............................................................................................................................. 24
3.9 Slicing selected elements ..................................................................................................... 24
3.10 Using a list ........................................................................................................................... 25
3.11 Using a dictionary ................................................................................................................ 26
3.12 Some dictionary functions ................................................................................................... 26
3.13 Some set functions ............................................................................................................... 27
3.14 A simple if statement ......................................................................................................... 27
3.15 A multiple line if statement................................................................................................ 27
3.16 The if-else statement ....................................................................................................... 28
3.17 The elif statement.............................................................................................................. 28
3.18 A compound if statement ................................................................................................... 28
3.19 A while statement............................................................................................................... 29
3.20 Usgin break command........................................................................................................ 29
3.21 Using the continue command ........................................................................................... 30
3.22 The for loop........................................................................................................................ 30
3.23 Using the range command.................................................................................................. 30
3.24 Using the range command in a for loop ........................................................................... 31
3.25 Using the map and lambda functions ................................................................................. 31
3.26 Choosing parameters in a function ...................................................................................... 31
3.27 Choosing parameters in a function ...................................................................................... 32
3.28 Writing to a file .................................................................................................................... 32
3.29 Reading to a file ................................................................................................................... 32
3.30 Pickling a file ....................................................................................................................... 33
3.31 Reading a pickle file............................................................................................................. 33
3.32 Reading a pickle file............................................................................................................. 33
3.33 Defining a function .............................................................................................................. 34
3.34 Return a value from a function ............................................................................................ 34
3.35 Return a tuple from a function ............................................................................................. 34
3.36 Default arguments ................................................................................................................ 35

xv
xvi Python Codes

3.37 Function help ....................................................................................................................... 35


3.38 Showing help ....................................................................................................................... 36
3.39 Initial commands.................................................................................................................. 36
3.40 Reading a module ................................................................................................................ 37
3.41 Shortcut name ...................................................................................................................... 37
3.42 From import ......................................................................................................................... 37
3.43 Executing commands in either version of Python ............................................................... 38
3.44 Divide by 0 error .................................................................................................................. 38
3.45 Traceback through a module................................................................................................ 38
3.46 Try-except ............................................................................................................................ 39
3.47 Creation of vectors............................................................................................................... 40
3.48 Creating tensors ................................................................................................................... 40
3.49 Accessing data in a matrix ................................................................................................... 40
3.50 Creating random arrays........................................................................................................ 41
3.51 Using a random seed............................................................................................................ 41
3.52 Creating a solid rectangle..................................................................................................... 41
3.53 Creating arrays from data..................................................................................................... 42
3.54 Setting the number of decimal places that are printed to the console.................................. 42
3.55 Converting between vectors and matrices............................................................................ 43
3.56 Math operations for vectors ................................................................................................. 43
3.57 Multiplication with vectors .................................................................................................. 44
3.58 The inner product of two matrices ....................................................................................... 44
3.59 Maximum values in an image .............................................................................................. 45
3.60 Application of several functions .......................................................................................... 46
3.61 Locating the maximum ........................................................................................................ 46
3.62 Using the nonzero function ................................................................................................ 47
3.63 Advanced slicing for arrays ................................................................................................. 48
3.64 Advanced slicing for arrays with multiple dimensions........................................................ 49
3.65 Mathematical functions for an array .................................................................................... 49
3.66 Sorting data in an array ........................................................................................................ 50
3.67 Sorting images according to a user-defined criteria............................................................. 50
3.68 Example of the indices function .......................................................................................... 51
3.69 Creating a solid circle .......................................................................................................... 52
3.70 The Circle function.............................................................................................................. 52
3.71 Loading an image................................................................................................................. 53
3.72 Rearranging the color channels............................................................................................ 53
3.73 Saving an image ................................................................................................................... 54
3.74 An example of melding the operators and functions from ndimage.................................... 54
3.75 Finding the center of mass ................................................................................................... 55
4.1 Loading the image using Python Image Library.................................................................. 59
4.2 Loading the image using commands from imageio ............................................................. 59
4.3 Reducing the intensity resolution......................................................................................... 61
5.1 Creating an image that suppresses the background ............................................................. 69
5.2 Converting between HSV and RGB values ......................................................................... 70
5.3 The vectorize function applies the operation to all pixels................................................... 70
5.4 Modifying the hue channel .................................................................................................. 71
5.5 The RGB to YIQ conversion................................................................................................ 72
5.6 Getting the Cb and Cr channels from the rocket image....................................................... 73
6.1 Using the Window and Plop operators................................................................................. 82
6.2 Demonstrating the Downsample and Concatenate operators .............................................. 83
Python Codes xvii

6.3 Shifting an image ................................................................................................................. 84


6.4 Noninteger shifts.................................................................................................................. 86
6.5 Scaling the image................................................................................................................. 86
6.6 Rotation using scipy.ndimage .............................................................................................. 87
6.7 Multiple rotations................................................................................................................. 88
6.8 Dilation operations............................................................................................................... 89
6.9 The perimeters are created by computing the difference between two dilations................. 90
6.10 Creation of the image in Figure 6.10 ................................................................................... 91
6.11 The RPolar function............................................................................................................. 93
6.12 The IRPolar function............................................................................................................ 93
6.13 The LogPolar function ......................................................................................................... 93
6.14 Finding the perimeter of the cell.......................................................................................... 96
6.15 The Barrel function ............................................................................................................. 97
6.16 An example using scipy.ndimage.geometric–transform .................................................. 98
6.17 An example using scipy.ndimage.affine_transform ................................................ 98
7.1 Starting Dancer .................................................................................................................. 102
7.2 The DelaunayWarp function ............................................................................................ 103
7.3 Reading a CSV file............................................................................................................. 103
7.4 Extracting information from the tessellation ..................................................................... 104
7.5 Finding a simplex............................................................................................................... 104
7.6 Commands to warp an image............................................................................................. 106
7.7 Morphing two images ........................................................................................................ 108
8.1 Testing the eigenvector engine in NumPy ......................................................................... 113
8.2 Proving that the eigenvectors are orthonormal .................................................................. 113
8.3 Projection of data into a new space.................................................................................... 115
8.4 Projection of data into a new space.................................................................................... 116
8.5 The first two dimensions in PCA space ............................................................................. 117
8.6 The ScrambleImage function ........................................................................................... 118
8.7 The Unscramble function ................................................................................................. 119
8.8 Various calls to the Unscramble function ......................................................................... 120
8.9 The LoadImage and IsoBlue functions ............................................................................ 122
9.1 The EigenImages function ................................................................................................ 129
9.2 The ProjectEigen function................................................................................................ 129
10.1 The Rect2Polar and Polar2Rect functions....................................................................... 137
10.2 Forward and inverse FFT ................................................................................................... 139
10.3 The DC term ...................................................................................................................... 142
10.4 Conservation of energy ...................................................................................................... 142
10.5 Computing the original image ........................................................................................... 142
10.6 The shifting property.......................................................................................................... 143
10.7 The script for Equation (10.28).......................................................................................... 148
10.8 Creating the mask .............................................................................................................. 151
10.9 Using the KaiserMask function........................................................................................ 152
11.1 An example of a low-pass filter ......................................................................................... 154
11.2 An example of a high-pass filter ........................................................................................ 155
11.3 An example of a band-pass filter ....................................................................................... 155
11.4 An example of a band-pass filter with soft edges .............................................................. 156
11.5 The Wedge function .......................................................................................................... 157
11.6 An example of line filtering ............................................................................................... 158
11.7 The MaskinF function....................................................................................................... 159
11.8 The MultiWedges function ............................................................................................... 160
xviii Python Codes

11.9 The ColorCode1 function ................................................................................................. 160


11.10 Removal of the screen from the baseball image ................................................................ 162
12.1 Smoothing through a correlation with a small solid block ................................................ 167
12.2 The Correlate1D function................................................................................................. 169
12.3 The Correlate2DF function .............................................................................................. 169
12.4 Correlating shapes.............................................................................................................. 169
12.5 Loading and creating the necessary images....................................................................... 171
12.6 The LocateDock function.................................................................................................. 172
12.7 The Overlay function ........................................................................................................ 173
12.8 The SubtractDock function .............................................................................................. 174
12.9 The IDboats function ........................................................................................................ 174
12.10 The FPF function............................................................................................................... 176
12.11 Testing the FPF function ................................................................................................... 177
12.12 Computing an FPF ............................................................................................................. 178
12.13 The LoadTach function..................................................................................................... 179
12.14 The MakeTachFPF function............................................................................................. 180
12.15 Running the functions in the tachometer problem............................................................. 180
13.1 Shifting a simple array ....................................................................................................... 189
13.2 Extracting the vertical edges .............................................................................................. 190
13.3 Using the Sobel function to create an edge enhancement ................................................. 191
13.4 Application of the DoG filter ............................................................................................. 193
13.5 The Harris function........................................................................................................... 194
13.6 Applying the Harris detector to simple geometric shapes ................................................. 195
14.1 The LineHough function................................................................................................... 200
14.2 Creating Figure 14.1 .......................................................................................................... 201
14.3 Creating Figure 14.2 .......................................................................................................... 201
14.4 Running the Hough transform on an image with a line ..................................................... 201
14.5 The Hough transform applied to a different image............................................................ 202
14.6 Creating a line that is at a different orientation.................................................................. 202
14.7 Circle Hough transform applied to multiple rings ............................................................. 204
14.8 The detection of the cane ................................................................................................... 206
15.1 Adding random noise......................................................................................................... 210
15.2 Smoothing in Python ......................................................................................................... 210
15.3 Salt noise............................................................................................................................ 211
15.4 Applying colored noise ...................................................................................................... 212
15.5 The AddNoise function ..................................................................................................... 213
15.6 The Lopass function .......................................................................................................... 214
15.7 The ErosionDilation function ........................................................................................... 215
15.8 Applying a median filter .................................................................................................... 216
15.9 Applying a Wiener filter .................................................................................................... 217
16.1 Simple texture measure through the ratio of the mean and standard deviation ................. 223
16.2 Compute the edge density.................................................................................................. 223
16.3 Measuring the four moments ............................................................................................. 225
16.4 The FourMoments function.............................................................................................. 225
16.5 Beginning the comparison of textures ............................................................................... 226
16.6 The WvlIteration function................................................................................................ 228
16.7 Creating an output after a single iteration in wavelet decompostion ................................. 228
16.8 The WaveletDecomp function .......................................................................................... 229
16.9 The GetParts function....................................................................................................... 230
16.10 The WaveletEnergies function.......................................................................................... 230
Python Codes xix

16.11 The Cooccurrence function .............................................................................................. 231


16.12 The HHomogeneity function ............................................................................................ 232
16.13 The HContrast function.................................................................................................... 233
16.14 The HCorrelation function ............................................................................................... 234
16.15 The HVariance function.................................................................................................... 234
16.16 The HEntropy function..................................................................................................... 235
16.17 The Haralick function....................................................................................................... 236
16.18 Using the Haralick function.............................................................................................. 237
16.19 The five Law’s vectors ....................................................................................................... 239
16.20 The BuildLawsFilters function ........................................................................................ 239
16.21 The LawsJets function ...................................................................................................... 240
17.1 The GaborCos function .................................................................................................... 244
17.2 The Filts function .............................................................................................................. 244
17.3 The ManyCorrelations function ...................................................................................... 245
17.4 Complete steps to create an image, Gabor filters, and the correlations ............................. 246
17.5 The RandomJets function................................................................................................. 247
17.6 The entire process of gathering correlations, extracting jets, and mapping in
PCA space ......................................................................................................................... 248
18.1 The PerimeterPoints function .......................................................................................... 254
18.2 The ShowPerimPoints function........................................................................................ 254
18.3 The ChainLength function ............................................................................................... 255
18.4 The Curvature function .................................................................................................... 255
18.5 The FourierDescriptors function ..................................................................................... 257
18.6 The ReadFiducial function ............................................................................................... 259
18.7 The RemoveCenterBias function ..................................................................................... 260
18.8 The RemoveRotateBias function...................................................................................... 261
18.9 The RemoveScaleBias function ........................................................................................ 261
18.10 The GridDifference function ............................................................................................ 262
18.11 The Shape1 function.......................................................................................................... 263
18.12 The ExtractStats function................................................................................................. 263
18.13 Computing four geometric values...................................................................................... 266
18.14 The metrics for the six shapes............................................................................................ 267
18.15 The CurveFlow function ................................................................................................... 268
18.16 Running iterations of curvature flow ................................................................................. 269
18.17 Computing the medial axis ................................................................................................ 270
19.1 Using the 1D discrete cosine transform ............................................................................. 276
19.2 An example of a 1D DCT .................................................................................................. 277
19.3 The dct2d function ............................................................................................................ 278
19.4 The idct2d function ........................................................................................................... 278
19.5 Modified 2D EMD ............................................................................................................. 284
19.6 Reconstruction ................................................................................................................... 285
20.1 The original PCNN Python class ....................................................................................... 295
20.2 Typical execution of the PCNN ......................................................................................... 295
C.1 Programs to convert RGB to XYZ and then to CIE L*a*b* ............................................. 327
C.2 The Zernike function ........................................................................................................ 328
C.3 The Plop function .............................................................................................................. 329
C.4 The Warp function ............................................................................................................ 330
C.5 The KaiserMask function ................................................................................................. 331
Visit https://ebooknice.com to
discover a wide range of
eBooks across various genres.
Enjoy exclusive deals and
discounts to enhance your
reading experience. Start your
digital reading journey today!
Preface
Image processing and analysis is a burgeoning field that is gaining renewed interest in recent years.
The need for image analysis tools is ever increasing. Along with this is also the need to be able to
efficiently and explicitly describe processes used in analyzing images. Unfortunately, the current
state of publications is that each author has their own way of describing processes. Two different
authors describing the same process will often provide vastly different ways of communicating their
proposed process.
The recent development of high-powered scripting languages such as Python compounds the
issue. Publications can consume more real estate in explaining the process than it takes to write
the Python script to execute the process. Furthermore, the descriptions can be imprecise, because
some authors prefer to describe their processes through textual descriptions. Readers attempting to
replicate their results may find it a difficult process as not all of the steps are clearly explained.
The purpose of this text is to provide a unified mathematical language that coincides with Python
scripting. Image operators represent processes in a image analysis sequence, and these are associated
with Python scripts. Thus, a concise mathematical description of a process is easily translated into
Python scripts through this correlation. The conversion of Python scripts to image operators is nearly
as easy. Thus, this text introduces the initial set of image operators, complete with associated Python
scripts and examples.

Jason Kinser, D.Sc.


George Mason University
Fairfax, VA, USA
jkinser@gmu.edu

xxi
Software and Data
Software and data used in this text are available at:
https://jmkinser49.wixsite.com/imageoperators
Software and images copyright (c) Jason M. Kinser 2018. Software and images provided on this
site may be used for educational purposes. All other rights are reserved by the author.

xxiii
Author
Jason M Kinser, DSc, has been an associate professor at George Mason University for more than
18 years teaching courses in physics, computational science, bioinformatics and forensic science.
Recently, he converted the traditional university physics course into an active learning technology
environment at GMU. His research interests include modern teaching techniques, more effective
methods in text-based education, image operators and analysis, pulse image processing and multi-
domain data analysis. This book was born from a desire to engage students in physics education
and to find ways of reducing the external costs that both students and institutions incur within the
traditional education framework.

xxv
Part I

Image Operators
Exploring the Variety of Random
Documents with Different Content
"Well, he's a crack-brained young Señor, to begin with," was the
reply, with a shrug of the shoulders. "His name is Bartholomew Las
Casas, and he's only been out here a few weeks. He came out with
Ovando. His father came out here before, with the Admiral himself."
Montoro grew still more interested.
"But why do you call him crack-brained?"
"Because he is crack-brained. Crazy as he can be about what he
calls the wrongs of the black rascals out here. His father took one
over for him to have as his own in Spain, five or six years ago, and
comfortable enough the fellow was with such a soft-hearted master.
Then comes the royal order that there are to be no more of these
Indian slaves in Spain; that they are not cruelly to be kept from their
own country, and they are forthwith all packed back again, to be
grabbed at as fast as they arrive, and worked to quick deaths in the
mines. Meantime, our young Señor Las Casas has been taught to
think a whole host of nonsense about their miseries, and his duties
of relieving them. If he uses his arms as their covers in his fashion
just now he'll pretty soon need some one to relieve him.”
"Ay, verily," murmured Montoro musingly as he turned away from his
informant and rejoined his companions. The history of his own
family's wrongs had made him more keenly alive to the wrongs of
others. He had a generous feeling of envy that it had been the arm of
the young Las Casas, and not his own, that had taken the blow for
the Indian. But, as the great American poet says,
"A boy's will is the wind's will."
Before half-an-hour had passed Montoro's will had veered round
once more—from a desire to relieve injuries to a desire to inflict
them. For humanity's sake Columbus had sent urgent warnings and
entreaties that the departure of the fleet might be delayed a few
days, to avoid the coming storm. And for his charity he received
contempt. The Governor and his counsellors looked at the quiet sky,
the calm sea, they felt the soft breeze on their cheeks, and the
contemptuous answer was sent back:
"In this year of grace dreamers of dreams are out of fashion."
"When I see the Admiral's letters patent as the authorized reader of
the heavens, and the interpreter of its signs," said the Governor
haughtily, "doubtless he will find me an obedient pupil. Meantime I
prefer instruction when I ask for it."
"He and all the rest of them deserve to be drowned if they are not,"
said Diego Mendez indignantly, as he returned with his party to the
boat, and put back to the ship.
Montoro's thoughts flew back to the cannon on board. He felt just
then as if nothing on earth would so well satisfy him as to see them
pointed at the Governor's house, to see their flash, to hear their roar,
and to witness the wholesale destruction they could cause.
"Why was there no young Las Casas to avenge this insult to the
Admiral?"
But there was One mightier than Las Casas to do that, One whose
artillery was mightier than the cannon in which Montoro put such
confidence. Two days passed, and then the tropical storm burst in all
its fury. To such poor, unforbidden shelter as he could find the
Admiral had guided his battered little squadron, and there he and his
followers waited, and watched the gathering gloom of earth and sea
and air and sky; and well it might seem to some of those watchers
that a spirit of retributive wrath was brooding over the scene of
cruelty, treachery, and insolence.
"It will require all their seamanship to ride out the coming hurricane,"
said the pilot, Antonio de Alaminos, on the second day, as he
regarded somewhat dubiously their own quarters.
And Diego Mendez answered moodily:
"I should heave no sigh if they and their ill-gotten wealth went to the
bottom of the deep before mine eyes; but I do grieve to have heard
that on the craziest of their barques they are carrying home the
Admiral's gold, the poor remnant of his rents they have permitted
him."
"Never have care for that, Señor," said the young Fernando
earnestly. "It is my father's, and it will be kept safe for him."
"It is as well that thou canst console thyself with that belief, any way,"
muttered the man, as the boy went off to where Columbus was
already issuing orders, needed by the sudden wild gusts of wind that
came as forerunners of the tempest.
Then came the wild roar and whirl, and darkness made more awful
by the fiery flashes that momentarily illumined the terrors of the
scene. On land trees uprooted, houses flung into ruins as though
made by children's hands of cards, the fields of maize changed as in
an instant from fields of gold to grey, scorched deserts. Living beings
struck at a breath into corpses; others crushed in the downfall of
their homes. And at sea those four poor cranky vessels, which were
all a great country could afford its great benefactor, tossing and
toiling in the boiling sea.
Now the waters would seethe as though some hideous cauldron,
prepared by evil spirits for some demon feast, and the doomed
vessels shook through every plank and spar as though with living
horror. And then, with a sudden shock the waters would rush
together, and mount wildly into mountain waves crowned with crests
of foam.
The ships lost sight of each other. Sailors and adventurers all gave
themselves up for death. In a delirium of fear they confessed their
sins to whoever would heed the dismal catalogue. Ave Marias,
invocations of the saints, and such fragments of Scripture as they
knew, were groaned forth on all sides, rather as invocations than
prayers, as the days went by, and still the furious battle of nature
raged.
The fellow to that storm not even the veteran navigator of all seas
had experienced before. At times during the blackness of the night it
would seem to the affrighted mariners as though hell itself had
opened its jaws to swallow them. Making a pathway for themselves
through the darkness, the raging billows would suddenly rush
onwards brilliant with light, and surround the ship and its awe-struck
occupants with a sea of flame. For a day and night the heavens
glowed as a furnace; and the reverberating peals of thunder
sounded to the distracted sailors as the last despairing cries from the
other ships of their sinking comrades. What was becoming of the
wretched, foolhardy creatures on board Ovando's proud fleet they
had no longer care to think. Drenched with the ceaseless sheet of
rain, which poured down day and night throughout that long week of
storm continually, exhausted with toil, worn with fears, Columbus and
his company were to be still further tried by the majestic terrors of
those southern seas.
Wildly tossed as was the whole ocean, it suddenly became
observed, with deepening dread, that in one spot the agitation was
still redoubled. Even as they looked the waters reared themselves
higher and yet higher, grim and terrible as a giant pillar of molten
lead; while a livid cloud bent down from the heavens to meet it. Thus
joining, and ever gathering fresh size and force as it sucked up the
waves in its headlong course, the dreadful column rushed on
towards the ships.
The Admiral came forth from his cabin with the iron-clasped Bible
open in his hands, to exorcise the evil spirit abroad for their
destruction. Men hardened in callousness fell on their knees in silent
prayer. Antonio de Alaminos stood gazing with fixed eyes at the
invincible enemy. His skill and knowledge were powerless in the
presence of that foe. As he stood there waiting for the end he was
startled by a voice beside him so clear, so calm, that it was distinct
even in the midst of that wild tumult.
"Alaminos, thinkest thou that we shall live through the storm?"
Starting, the pilot turned his gaze for a moment from the advancing
column, and exclaimed:
"Montoro! boy, hast thou no fears?"
"None," was the low, soft answer of his lips. "None," was the answer
of his rapt, earnest eyes, full of a beautiful awe and reverence. "He
holds the storm in His hand, and us."
Even as the boy spoke the vessel swerved, the waterspout passed
on beside it, and they were safe.
"The Admiral's Bible has saved us," exclaimed the mariners, as wild
with joy as they had been with fear.
Alaminos, the pilot, looked at Montoro de Diego, and said nothing.
For the first time in his life the thought had stolen into his mind
whether the faith to be learnt from the teaching of the Bible might not
be a more precious thing than even its print and paper.
The force of the long-protracted tempest was at length spent; the
sea subsided, and Columbus's scattered caravals, none of them lost,
gathered together again to offer thanks to God for their preservation,
and to seek the shelter and refreshment no longer denied them, in
the ports of Hispaniola.
The storm had passed, but it had left behind it sorrow and shame
and gloom on the countenances of Ovando the Governor, and those
about him. The gay, grand fleet, despatched against the Admiral's
advice, was lost, with all those many hundreds of souls on board,
and all that wealth. The Admiral's enemies had perished; Bobadilla,
the mutinous Roldan, and many another. Those gallant ships were
gone. Only that poor, mean, weak little barque, inferior to all its
consorts, that had been thought good enough to carry the Admiral's
grudged revenue, that lived through the storm, and took its little
treasure safe into the Spanish port.
"It is my father's; I told you that God would guard it," said Fernando
Colon, some months later, when the strange, good news of that
survivor reached his ears.
CHAPTER XI.
THE FIRST FIND.
Great storms are very terrible, and weeks of drenching rains,
Montoro de Diego, and his friend Ferdinand Columbus, had time to
discover, were most disagreeable accompaniments to travels
whether by water or land. As for poor Don Aguilar, the hardships of
the way killed him, as Fernando Colon had foreseen, before he had
a chance to purchase a draught from that dreamt-of fountain of
youth. And long-continued dismal weather very nearly also killed the
courage at least of most of the old hidalgo's companions.
After that first great storm, a few days were passed at Port Hermosa,
to refresh the crews, and repair the caravels, and then Columbus
started forth again to find the wished-for, but non-existent, strait
through the Isthmus of Darien. Having spent about five months in
this fruitless search he gave it up, greatly to the delight of the whole
of his companions. They were much more anxious after what they
considered the infinitely superior quest for the gold mines of
Veragua, distant about thirty leagues from Porto Bello.
What with cross currents, however, contrary winds, and bad weather,
those thirty leagues took nearly a month in the traversing, and it was
not until the day of the Epiphany, 1503, that the Admiral reached the
mouth of a river, to which he gave the name of Belen, or Bethlehem.
In the immediate neighbourhood of this river was the country said to
be so rich in the precious mineral that Columbus felt convinced that,
as further discoveries would find the Garden of Paradise in the new-
found world, so also he was on the borders of that land of Ophir
whence king Solomon had drawn his stores of the valued treasure.
Meanwhile, every one but himself, and his son Ferdinand, was very
eager to get similar treasure for his own purse, and so soundings
somewhat less cautious than usual were taken, the four caravels
crossed the bar at the mouth of the river Belen, now swollen by past
months of rain, sailed some little distance up it, and there cast
anchor for a season of exploration.
Montoro was as wild with eager excitement and delight as any one,
when he obtained leave to go with the first boats sent on shore.
"Do you then, too, care so much for gold?" asked his friend
Fernando, in a disappointed tone, as he saw his companion's
glowing face. "I had not thought it of thee."
"Nor need now," was the quick answer. "I go not to hunt for gold, but
glory. My father's wealth they robbed him of. The glory he won on the
walls of Alhama will cling as long as time shall last to the name of
Don Montoro de Diego. Such glory, and not gold, would I win also."
"Nobly spoken, my lad of the quick temper," said Señor Diego
Mendez, in smiling allusion to the time when he had hindered hasty
words by putting his hand over the boy's mouth. Since that day
Diego Mendez had many times taken note of his young companion.
Neither Montoro's ability, courage, wit, nor readiness were lost upon
him, and the occasion was soon to come now when he was to show
his appreciation of them.
As the boats' crews stepped on shore, one or two of the eager
seekers after fortune gathered up handfuls of the glistening sand,
eyeing it sharply, as they did so, in such a way that Diego Mendez
exclaimed with a laugh:
"Why now, comrades, would it not be well, think you, just to set to
work, and shovel the shore pell-mell into the boats, and carry it off at
once to Spain? Of course you'd be rich then, no doubt, without
further trouble."
"Well, we've had enough of that, at any rate, already, to deserve
some pay," grumbled one, while a couple of others sulkily enough
dropped their glittering burden to avoid further ridicule.
"How pretty it is though," exclaimed Montoro, who stood watching
the wet grains as they fell shining in the sunlight. "And here is some
more up here!" he cried in astonishment half-an-hour later, suddenly
stopping short from his companions, in their progress through the
forest, and dropping on his knees beneath a tree.
"Some more what?" asked half-a-dozen voices at once, as their
owners crowded round in amazed watching of their young comrade,
who was most busily grubbing away at the tree's roots.
"Ay, indeed, some more what?" repeated the Adelantado, in equal
surprise. "What is it that you have found?"
"Why some more of that shining sand," was the ready reply. "And of
course it is nothing worth really, only that it is somewhat strange,
methinks, to find it up here so far from the sea wet and shining."
"Strange! ay, strange indeed," echoed Diego Mendez, now quickly
pressing through to his namesake's side. "Passing strange, my lad, if
it be indeed, as you say, shining because, this dry, hot day, it lies
there wet. But—is it so?"
Just as that question was put Montoro raised his stooping face with
almost a startled glance at the questioner. He had told Fernando,
and told him truly, that it was glory, not gold, that he desired. Still
treasure meant power to return to his mother, power to give her
comfort, power perhaps to win back his ancestral home. And he
knew now that his hand was full, not of grains of sand, shining
because they were wet; but of grains of gold, shining with their own
lustre.
"No," he breathed, for a moment awed by his discovery. "No, my
Señor, this is no sand heavy with the spray of sea waves. This is the
treasure you are seeking."
Montoro's find put a stop to all further explorations for that day,
excepting explorations about those roots. The entire party fell into a
state that might, far more literally than usual, be termed one of
'money-grubbing' excitement. More diligently than the greediest pigs
ever grubbed for a feast round about oak trees or beeches, or
Spanish pigs grub for truffles, did those Spanish gentlemen grub with
fingers and nails round about the trees of that wild American forest.
Montoro put a crown to the triumphs of his keen-sighted eyes by
finding quite a fair-sized little lump of gold at the edge of a streamlet,
which he put by carefully for Fernando; and then he employed
himself in gathering a supply of the abundant fruits to carry back to
the ship for the general benefit.
"Nay then," said Antonio de Alaminos, gratefully accepting a bunch
of bananas, "but these are worth all the gold that was ever found or
fought over, my lad. Our God gives us these as loving gifts. I
sometimes think that He has given us gold as He gave the forbidden
fruit—to try us."
Montoro raised his eyes for an instant and then lowered them again,
as he murmured:
"Often hath my mother said that there are many things more worth."
"Truly are there," was the assent. "But hark!" he added in a louder
tone and more quickly, "here is the Admiral. He is calling for us."
The summons was an important one. So satisfactory were the
accounts brought back of the country, not only as regarded the
promise of gold, but as to its general appearance of fertility and
beauty, that the Admiral forthwith resolved upon the establishment of
a colony.
"You think not," he demanded as Montoro and the pilot drew near;
"you think not, Mendez, that it is the finding of this glittering dust only,
that hath dazzled your eyes with respect to the virtues of the land?"
Mendez was about to reply with due gravity when his friend, Rodrigo
de Escobar, broke in boldly, exclaiming:
"Nay then, as the Jewish spies said of old so can we say now, that it
is a goodly land and a pleasant; and if it overfloweth not with milk
and honey, neither is it inhabited with a people akin to the Anakim;
and it has at least the grapes of Eshcol, and many a pleasant thing
besides."
The Admiral smiled gravely.
"All which meaneth, I take it, Señor Rodrigo, that whosoever else
believeth thy report, thou believest it thyself."
De Escobar bowed, while one beside Montoro muttered with a low
laugh:
"Most assuredly friend Rodrigo would believe everything favourable
of a land that flowed with that best of all sweet golden honey, the real
gold itself, even though all else were desert."
"And small blame to him," retorted Tristan, captain of one of the
other caravels, who had just come on board to hear the news.
"Señor de Escobar is much of my own way of thinking—that life
united with poverty is but a poor sort of an affair, not worth the
trouble of the guardianship."
This being the general opinion, and a very slight amount of
questioning eliciting the universal adhesion to Rodrigo's proposition,
that a land where gold was to be gathered, even about the roots of
the trees, was a good land to stay in, it was not difficult to obtain
volunteers for the new colony.
Besides, even for those who were not so madly eager for gold
Veragua had many attractions, seeing that the land abounded in rich
fruits, the water in fish, the soil was fertile, and the Cacique and his
people friendly.
"And what more can you want?" said Amerigo Vespucci decisively.
"What more can any men want?" said another, with a shrug of the
shoulders. "Especially men like us, who have had for these weeks
past to munch our biscuit in the dark, lest our stomachs should turn
at seeing how many and how fat were the other eaters we were
obliged also to devour."
"Bah!" ejaculated De Escobar, as he flung over a morsel of the said
biscuit at the same time into the water. "It is too abominable of thee,
Tristan, thus to remind a hungry wretch of the foul nature of his food.
For thy barbarity thou shalt owe me thy first—"
"Nay, Señor," interposed Montoro Diego out of the dusk; "here is
somewhat to make amends for thy lost supper. These great nuts
have hard outsides; but within they are better than our little ones of
Spain."
CHAPTER XII.
SURGEON TO THE REDSKINS.
Colonists for the proposed new settlement having proved so easily
forthcoming, the next step in the business was to provide them
habitations, and shelter of some sort for the needful stores.
Accordingly the next morning, almost as soon as it was light, a
number of men were sent on shore, as builders of the first European
town to be founded on the mainland of America. Bartholomew
Columbus went with them to choose a site for the place of which he
was to be the Governor; and amongst the number of his companions
were Diego Mendez, Diego's special comrade Rodrigo de Escobar,
and of course Montoro.
"I cannot get on at all without my sharp-eyed namesake," said the
notary good-naturedly, when he pleaded with the Admiral for
Montoro's company. And thus, some little it must be confessed to
Ferdinand's vexation, Montoro was once more of the land-going
party, proving of as much service on this occasion as on the last,
although the results were not so immediately apparent.
Cutting timber, clearing ground of a troublesomely-luxuriant
vegetation, and driving stakes, had progressed for some time merrily
enough, to the evident wonder and interest of an ever-increasing
crowd of natives, men, women, and children, when Diego Mendez,
looking about him for a help in a hard piece of work, discovered
Montoro some couple of hundred yards or so distant from the
building-ground, and apparently engaged in a very private and
earnest conversation with a couple of native women, and three or
four children.
"What, in the name of St. Jago, is the lad after now?" he exclaimed
rather irritably, for he had got his fingers pinched in a split bamboo
he had wanted his protégé to help him in sundering, and small
annoyances were more trying to these brave Spaniards than great
disasters. "Montoro," he shouted, "Montoro, you come here, can't
you!"
Montoro was back like an arrow.
"Ay, Señor Mendez; what would you with me?"
"What would I?" was the hasty answer. "Why everything; all manner
of things. But thou'rt such a fellow! Thou'rt never at hand when
needed. At least,"—still growling, but with a grim dawning accent of
compunction for injustice,—"at least not always. Here thou'st left me
to well-nigh lose the half of my hand, while thou'st been trying to
wheedle gold mine secrets out of those poor fools yonder, with that
soft tongue of thine."
"No such thing," exclaimed Rodrigo de Escobar with his usual
volubility, before Montoro could answer for himself. "You are
mistaken, Mendez. Had the lad been using a soft tongue so usefully
his absence might be the more readily forgiven him. But it is a stupid
soft heart that deserves the blame this time. Because gold-seeker,
discoverer, navigator, builder, and half-a-dozen other things are not
trades enough for the young jackanapes to take to at once, he must
needs be taking a turn now at surgery."
"Nay then, Rodrigo," said his friend incredulously, and looking
alternately from the laughing accuser to the half-troubled accused.
The face of neither tended in any way to relieve the notary's
curiosity. "Speak out, man," he said at last. "With what is it that you
charge the lad?"
"With what I say," replied de Escobar with another laugh. "With
playing the surgeon unauthorized, Children and monkeys are all
alike—they must needs imitate what they see others doing; and
consequently, one of those monkey-children yonder got hold of my
hammer awhile since, and of course contrived to hammer its own
fingers pretty sharply."
"Terribly!" broke in Montoro impulsively, forgetting his temporary
shyness in the recollection of his pity. "The poor little creature, my
señor, has hammered his fingers perfectly black, and the poor
ignorant mother could only cry over it, and do nothing; and so—and
so—"
And so, and so Montoro Diego once more grew shy as his own part
in the business drew to the fore, and came to a stammering
conclusion, and Diego Mendez with a smile took up the tale.
"And so, and so then, my friend, I suppose you do really confess that
Don Rodrigo de Escobar has laid only true things to your charge,
and that you have thought, by adding your ignorance to the woman's
ignorance, to make one wisdom. Hey, my modest young friend, then
is it so?"
Montoro looked up now, with flushed cheeks it is true, but with some
returning boldness also, as he replied sturdily—
"My ignorance, at any rate, my señor, has had this good result—that
the child no longer cries. But if you would spare me yet another five
minutes, I would fain return to him, just to make my bandages more
secure than I left them in my haste upon your call."
"Come then, have your way," said his new patron good-humouredly.
"I confess I am not a little curious to see what sort of surgery you
have evolved from that daring head of yours, and whether it be not a
gag in the squaller's mouth that has produced this peacefulness."
But there was no gag in the small redskin's smiling mouth, neither,
assuredly, was there one in the mouth of the small redskin's mother,
who poured forth a perfect torrent of incomprehensible words as she
alternately kissed Montoro's feet and her child's injured hand, or
rather the great bundle of wet leaf-poultice in which it was most
scientifically enveloped.
"Umph!" muttered Diego Mendez, as he looked at the bound-up limb
and the grateful mother. "And pray how hast thou come by thy skill,
my friend? Is St. Luke thy patron saint, and has he instructed thee?"
"My mother has been my teacher," was the quiet answer. "And she
had much learning of many various uses to mankind, from her
father."
The notary cast a keen glance of sudden intelligence at his
companion, and then said slowly—
"Ah, now thou hast let me into a secret as to thy birth that I had
partly guessed at before. Now I know from what race thou hast
drawn much of thine intelligence, and the bookishness that hath
ofttimes surprised me. But hark ye, lad, for I have a kindness for
thee. Tell to none others of our companions what thou hast thus told
to me; for remember, Spain has decreed just now that she will have
no dealings, save those of the fire and the rack, with the great race
that is too wise for bigotry to let it live. And the favour thou art sure to
win, and the good fortune, will make men but too ready to use ill
tales against thee. But now—leave thy patient, and let us back to our
building again, for the day wears fast."
So saying, he turned his steps back towards the rising settlement;
and when Montoro had managed with some difficulty to disengage
himself from the thankful woman, he followed his patron, the native
child clinging to him with his sound hand, and contriving to make his
short legs keep up with his companion's long ones.
A general laugh greeted the truant when he returned thus
accompanied; but Montoro tossed up his handsome young head
very independently as he shouted—
"Laugh as you may please, my señors; but when you desire a guide
and an interpreter, do not then think to borrow mine."
"Ah! ha!" exclaimed Diego Mendez, not at all displeased at his
protégé's readiness. "My friends, methinks the lad hath had the best
of it; and we were wise not to provoke him to register a vow to keep
his useful new acquaintances to himself."
"If he did," muttered Rodrigo, "there would but need to draw a long
and doleful face to make him break it. For no oath's sake would he
ever be got to cut off a John Baptist's head."
"I'll cut off thine, though," grumbled Juan de Alba, "if thou keepest
not those bamboo points to thyself, instead of using them to pierce
mine eyes. Thou art a clumsy carpenter, in very deed, as ever I
saw."
"And I rejoice that thou shouldst have to say so," retorted the other.
"The fingers of Rodrigo de Escobar scorn this servile work."
"Do they also scorn to peel bananas?" asked the Adelantado,
coming up with a great ripe bunch at an opportune moment to stop a
squabble from growing into a quarrel. He had enough to do to keep
the peace among his gang of noble workmen.
CHAPTER XIII.
FOR LIFE OR DEATH.
For some few days the work of building progressed merrily enough.
The seemingly ubiquitous Montoro Diego, with his beautiful voice,
his bright eyes, and his untiring activity, inspired the whole party with
a portion of his own spirit; and his grateful native friend, the mother
of his small patient, proved of the greatest comfort to the new
colonists by keeping them plentifully supplied with fruit, fish, birds,
and food cooked after the native fashion, but very acceptable to men
who had lived hardly too long to be fastidious. Besides, they were
very desirous of sparing as much as possible their own small
remaining stores of biscuit, cheese, wine, oil, and vinegar, of which
the Admiral could only leave so small a quantity for the civilized
provision of the colony.
At the outset of the new undertaking, others besides the mother of
the child had shown most hospitable alacrity in bringing gifts for the
white strangers' larder; but by degrees these gifts ceased, and at
last, whilst all the others of the Spaniards still looked gay enough,
Montoro's face began to grow very grave. He still had many good
things brought to him, but he noticed that they began to be brought
with an air of secresy, and at last the poor creature proved her
gratitude by giving him signs as plainly as she dared, that Quibian,
the Cacique of Veragua, was not altogether so friendly as he
seemed.
"It was not his own gold mines, but those of a dreaded neighbour
chief, that he had pointed out to the Spaniards on their first arrival,"
she declared; "and now he was noting with jealous eyes, and an
angry heart, the preparations of the white strangers for taking up
their abode on his territories."
Poor Cacique! Had he known the dismal fate that was so speedily to
overwhelm him and all he cherished, his jealousy and wrath must
have burnt with a fierceness to consume his heart. But for the
moment the Spaniards were but a handful of men in an unknown
and populous country; moreover, the water in the river had fallen, dry
weather had set in, and threatened to continue, the bar at the river's
mouth was visible at low tide, and the ships were shut in beyond the
possibility of present escape. It behoved the Admiral and his band of
followers to be careful, and each individual felt it incumbent on him
personally to watch for the safety of all; even to sleep, as the saying
is, like a dog with one eye open.
Under these circumstances it is little wonder that Mendez noticed
with some uneasiness the unusual gravity of Montoro's face one
morning, after a short interview with his Indian patient, and the
child's mother.
"Hey, then, master Long-face" he exclaimed, with half-affected
gaiety, "say, what treason is it thou hast been concocting with thy
dark friend yonder? Hath she been offering thee the kingdom of the
Cacique Quibian, if thou wilt engage to share the throne with her?"
Montoro threw back his head for an instant haughtily. Boy as he was,
he did not like such jests. But he too much admired Diego Mendez
for his anger against him to be long-lived. Besides, he had a weight
upon his mind of which he desired to unburden himself. After the
momentary pause, he said hastily—
"The woman's communication, Señor Mendez, had no reference to
me further than as I am one of us. But if I at all rightly comprehend
her signs, this Quibian, the Cacique of Veragua, under his
smoothness to us has designs of the deepest treachery. Even now I
believe that we are being surrounded on all sides by his warriors."
Señor Mendez stroked his chin thoughtfully. To say truth, he was
deeply startled by the suspicion thus presented to him; but he was a
Spaniard, and therefore chary of displays of any other emotion than
that of pride. Moreover, he was a notary by profession, and had thus
learnt caution: to hear all he could, to see all he could, to think much,
and to say little.
His meditations were undisturbed by Montoro. At last he took the boy
by the arm, leading him farther away from their companions before
he said quietly—
"You have done well, my namesake, in bringing your tale to me. Let
it rest there for the present, and see that you show the woman no
great belief of her news, and no shadow even of a fear."
"But—" began Montoro eagerly, and then he stopped as suddenly as
he had begun.
His companion looked at him doubtfully.
"Well, Diego, 'but' what? Wouldst say thy fears are too strong to be
dissembled?"
"Even so," was the startling answer, with flushed cheeks, but with
such a bold, brave look in the uplifted eyes that the unexpected reply
was still more bewildering.
"Nay, then; thou art audacious enough in confessing cowardice,"
ejaculated the notary, with eyes so widening with wonder that they
seemed to monopolize his face.
Just a flash of a smile shot across Montoro's face at having for once
thus overbalanced the self-possession of the shrewd man of
business. But he replied almost in the same moment—
"In truth, Señor, I can afford to be bold in confessing to these fears,
seeing that they are not for myself, but for others, and for the honour
of our expedition. Verily I think that it would break our great Admiral's
heart, should terrible mischance happen to us who are with him now
in his neglected, sorely-tried old age. And that must not be."
"And how then do you purpose to prevent it?" asked Mendez, once
more the cool, self-contained notary. "Do you propose to call out the
Cacique to prove his honourable intentions by single combat, after
our own Spain's knightly fashion?"
"Would that it were possible!" was the reply with kindling eyes. "But
no, Señor, my meaning is more simple. I have told you my fears. But
if you mean to treat them as idle fancies, or to stand by to see what
comes of them, I shall forthwith carry them to the Admiral himself."
"Umph!" said Diego Mendez deliberately, "you would so, would you?
And you would do well. But hark ye, youngster—I neither intend to
treat you nor your tale as nought, so with that assurance rest thee
satisfied a while. I too have noted somewhat of late, upon which your
news throws fresh light. But be wary. Tell no one what you have told
to me, and show no sign of trouble."
Convinced at last that his warning was received as seriously as he
desired, Montoro returned to his task amongst the amateur house-
builders, and displayed considerable ingenuity as a constructor of
neat roofs out of palm leaves. His alacrity at his work was the more
cheerful when, from his position on the hill above the mouth of the
river, he saw the accountant for the new settlement put off in one of
the boats to return to the Admiral's ship. This happened within half-
an-hour of their conversation on the native woman's intelligence, and
increased Montoro's good opinion of his own wisdom in choosing
Señor Mendez as the recipient of his confidence. Cautious as he
was, he could evidently act quickly enough in an emergency. In a
short time he was rowing rapidly back to the building-ground,
bringing half-a-dozen fully-armed men with him, and making signs to
Montoro to meet him on the shore.
Down went tools and palm leaves, down from the roof with a bound
sprang the tiler, and a minute later a second flying leap had carried
him into the boat beside Diego Mendez. A few rapid words were
exchanged between the two, and then the notary said gravely—
"Well, I have made you the offer of coming with me by the Admiral's
consent; but remember, our undertaking is one of life and death."
"I understand," was the quiet answer. "But if we die, our deaths will
be a sign to all these others to prepare for defence; if we live we
shall at any rate have discovered the nature of our danger. I go with
you gladly."
And of that latter fact his earnest, animated countenance gave
abundant evidence as they proceeded on their perilous enterprise.
Passing from the river Belen, they rowed along the sea-coast until
they reached the Veragua, at which point the real peril of their
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like