Image Analysis Classification and Change Detection in Remote Sensing With Algorithms For ENVI IDL and Python 3rd Edition Morton John Canty
Image Analysis Classification and Change Detection in Remote Sensing With Algorithms For ENVI IDL and Python 3rd Edition Morton John Canty
com
https://ebookgate.com/product/image-analysis-classification-
and-change-detection-in-remote-sensing-with-algorithms-for-
envi-idl-and-python-3rd-edition-morton-john-canty/
OR CLICK BUTTON
DOWLOAD EBOOK
https://ebookgate.com/product/image-registration-for-remote-
sensing-1st-edition-jacqueline-le-moigne/
ebookgate.com
https://ebookgate.com/product/spectral-spatial-classification-of-
hyperspectral-remote-sensing-images-1st-edition-jon-atli-benediktsson/
ebookgate.com
https://ebookgate.com/product/kernel-methods-for-remote-sensing-data-
analysis-1st-edition-gustavo-camps-valls/
ebookgate.com
https://ebookgate.com/product/datums-and-map-projections-for-remote-
sensing-gis-and-surveying-2rev-ed-edition-iliffe/
ebookgate.com
https://ebookgate.com/product/scale-issues-in-remote-sensing-1st-
edition-qihao-weng/
ebookgate.com
https://ebookgate.com/product/remote-sensing-imagery-1st-edition-
florence-tupin/
ebookgate.com
https://ebookgate.com/product/regression-analysis-with-python-luca-
massaron/
ebookgate.com
IMAGE ANALYSIS,
CLASSIFICATION AND
CHANGE DETECTION
IN REMOTE SENSING
With Algorithms for ENVI/IDL and Python
THIRD EDITION
This page intentionally left blank
IMAGE ANALYSIS,
CLASSIFICATION AND
CHANGE DETECTION
IN REMOTE SENSING
With Algorithms for ENVI/IDL and Python
THIRD EDITION
Morton J. Canty
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
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, transmit-
ted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented,
including photocopying, microfilming, and recording, or in any information storage or retrieval system,
without written permission from the publishers.
For permission to photocopy or use material electronically from this work, 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 identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
2 Image Statistics 35
2.1 Random variables . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.1.1 Discrete random variables . . . . . . . . . . . . . . . . 36
2.1.2 Continuous random variables . . . . . . . . . . . . . . 37
2.1.3 Random vectors . . . . . . . . . . . . . . . . . . . . . 40
2.1.4 The normal distribution . . . . . . . . . . . . . . . . . 42
2.1.5 The gamma distribution and its derivatives . . . . . . 45
2.2 Parameter estimation . . . . . . . . . . . . . . . . . . . . . . . 47
2.2.1 Random samples . . . . . . . . . . . . . . . . . . . . . 47
2.2.2 Sample distributions and interval estimators . . . . . . 50
2.3 Multivariate distributions . . . . . . . . . . . . . . . . . . . . 53
2.3.1 Vector sample functions and the data matrix . . . . . 54
2.3.2 Provisional means . . . . . . . . . . . . . . . . . . . . 55
v
vi Image Analysis, Classification, and Change Detection in Remote Sensing
3 Transformations 85
3.1 The discrete Fourier transform . . . . . . . . . . . . . . . . . 85
3.2 The discrete wavelet transform . . . . . . . . . . . . . . . . . 91
3.2.1 Haar wavelets . . . . . . . . . . . . . . . . . . . . . . . 91
3.2.2 Image compression . . . . . . . . . . . . . . . . . . . . 95
3.2.3 Multiresolution analysis . . . . . . . . . . . . . . . . . 98
3.3 Principal components . . . . . . . . . . . . . . . . . . . . . . 105
3.3.1 Image compression and reconstruction . . . . . . . . . 107
3.3.2 Primal solution . . . . . . . . . . . . . . . . . . . . . . 108
3.3.3 Dual solution . . . . . . . . . . . . . . . . . . . . . . . 110
3.4 Minimum noise fraction . . . . . . . . . . . . . . . . . . . . . 111
3.4.1 Additive noise . . . . . . . . . . . . . . . . . . . . . . . 112
3.4.2 Minimum noise fraction in ENVI . . . . . . . . . . . . 115
3.5 Spatial correlation . . . . . . . . . . . . . . . . . . . . . . . . 117
3.5.1 Maximum autocorrelation factor . . . . . . . . . . . . 117
3.5.2 Noise estimation . . . . . . . . . . . . . . . . . . . . . 119
3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
References 483
Index 495
Preface to the First Edition
This textbook had its beginnings as a set of notes to accompany seminars and
lectures conducted at the Geographical Institute of Bonn University and at its
associated Center for Remote Sensing of Land Cover. Lecture notes typically
continue to be refined and polished over the years until the question inevitably
poses itself: “Why not have them published?” The answer of course is “By
all means, if they contribute something new and useful.”
So what is “new and useful” here? This is a book about remote sensing
image analysis with a distinctly mathematical-algorithmic-computer-oriented
flavor, intended for graduate-level teaching and with, to borrow from the
remote sensing jargon, a rather restricted FOV. It does not attempt to match
the wider fields of view of existing texts on the subject, such as Schowengerdt
(1997), Richards and Jia (2006), Jensen (2005) and others. However, the
topics that are covered are dealt with in considerable depth, and I believe that
this coverage fills an important gap. Many aspects of the analysis of remote
sensing data are quite technical and tend to be intimidating to students with
moderate mathematical backgrounds. At the same time, one often witnesses
a desire on the part of students to apply advanced methods and to modify
them to fit their particular research problems. Fulfilling the latter wish, in
particular, requires more than superficial understanding of the material.
The focus of the book is on pixel-oriented analysis of visual/infrared Earth
observation satellite imagery. Among the topics that get the most attention
are the discrete wavelet transform, image fusion, supervised classification with
neural networks, clustering algorithms and statistical change detection meth-
ods. The first two chapters introduce the mathematical and statistical tools
necessary in order to follow later developments. Chapters 3 and 4 deal with
spatial/spectral transformations, convolutions and filtering of multispectral
image arrays. Chapter 5 treats image enhancement and some of the pre-
processing steps that precede classification and change detection. Chapters
6 and 7 are concerned, respectively, with supervised and unsupervised land
cover classification. The last chapter is about change detection with heavy
emphasis on the use of canonical correlation analysis. Each of the 8 chap-
ters concludes with exercises, some of which are small programming projects,
intended to illustrate or justify the foregoing development. Solutions to the
exercises are included in a separate booklet. Appendix A provides some ad-
ditional mathematical/statistical background and Appendix B develops two
efficient training algorithms for neural networks. Finally, Appendix C de-
scribes the installation and use of the many computer programs introduced
xi
xii Image Analysis, Classification and Change Detection in Remote Sensing
Morton Canty
Preface to the Second Edition
Shortly after the manuscript for the first edition of this book went to the pub-
lisher, ENVI 4.3 appeared along with, among other new features, a support
vector machine classifier. Although my decision not to include the SVM in
the original text was a conscious one (I balked at the thought of writing my
own IDL implementation), this event did point to a rather glaring omission
in a book purporting to be partly about land use/land cover classification.
So, almost immediately, I began to dream of a Revised Second Edition and
to pester CRC Press for a contract. This was happily forthcoming and the
present edition now has a fairly long section on supervised classification with
support vector machines.
The SVM is just one example of so-called kernel methods for nonlinear
data analysis, and I decided to make kernelization one of the themes of the
revised text. The treatment begins with a dual formulation for ridge regres-
sion in Chapter 2 and continues through kernel principal components analysis
in Chapters 3 and 4, support vector machines in Chapter 6, kernel K-means
clustering in Chapter 8 and nonlinear change detection in Chapter 9. Other
new topics include entropy and mutual information (Chapter 1), adaptive
boosting (Chapter 7) and image segmentation (Chapter 8). In order to ac-
commodate the extended material on supervised classification, discussion is
now spread over the two Chapters 6 and 7. The exercises at the end of each
chapter have been extended and re-worked and, as for the first edition, a
solutions manual is provided.
I have written several additional IDL extensions to ENVI to accompany the
new themes, which are available, together with updated versions of previous
programs, for download on the Internet. In order to accelerate some of the
more computationally intensive routines for users with access to CUDA (par-
allel processing on NVIDIA graphics processors), code is included which can
make use of the IDL bindings to CUDA provided by Tech-X Corporation in
their GPULib product:
http://gpulib.txcorp.com
Notwithstanding the revisions, the present edition remains a monograph
on pixel-oriented analysis of intermediate-resolution remote sensing imagery
with emphasis on the development and programming of statistically moti-
vated, data-driven algorithms. Important topics such as object-based feature
analysis (for high-resolution imagery), or the physics of the radiation/surface
interaction (for example, in connection with hyperspectral sensing) are only
xiii
xiv Image Analysis, Classification and Change Detection in Remote Sensing
touched upon briefly, and the huge field of radar remote sensing is left out
completely. Nevertheless, I hope that the in-depth focus on the topics covered
will continue to be of use both to practitioners as well as to teachers.
I would like to express my appreciation to Peter Reinartz and the German
Aerospace Center for permission to use the traffic scene images in Chapter 9
and to NASA’s Land Processes Distributed Active Archive Center for free and
uncomplicated access to archived ASTER imagery. Thanks also go to Peter
Messmer and Michael Galloy, Tech-X Corp., for their prompt responses to my
many cries for help with GPULib. I am especially grateful to my colleagues
Harry Vereecken and Allan Nielsen, the former for generously providing me
with the environment and resources needed to complete this book, the latter
for the continuing inspiration of our friendship and long-time collaboration.
Morton Canty
Preface to the Third Edition
A main incentive for me to write a third edition of this book stemmed from my
increasing enthusiasm for the Python programming language. I began to see
the advantage of illustrating the many image processing algorithms covered
in earlier editions of the text not only in the powerful and convenient, but
not inexpensive, ENVI/IDL world, but also on a widely available open source
platform. Python, together with the Numpy and Scipy packages, can hold its
own with any commercial array processing software system. Furthermore, the
Geospatial Data Abstraction Library (GDAL) and its Python wrappers allow
for great versatility and convenience in reading, writing and manipulating dif-
ferent image formats. This was enough to get me going on a revised textbook,
one which I hope will have appeal beyond the ENVI/IDL community.
Another incentive for a new edition was hinted at in the preface to the
previous edition, namely the lack of any discussion of the vast and increas-
ingly important field of radar remote sensing. Obviously this would be a topic
for (at least) a whole new book, so I have included material only on a very
special aspect of particular interest to me, namely multivariate statistical clas-
sification and change detection algorithms applied to polarimetric synthetic
aperture radar (polSAR) data. Up until recently, not many researchers or
practitioners have had access to this kind of data. However with the advent
of several spaceborne polarimetric SAR instruments such as the Japanese
ALOS, the Canadian Radarsat-2, the German TerraSAR-X and the Italian
COSMO-SkyMed missions, the situation has greatly improved. Chapters 5, 7
and 9 now include treatments of speckle filtering, image co-registration, super-
vised classification and multivariate change detection with multi-look polSAR
data.
The software associated with the present edition includes, along with the
ENVI/IDL extensions, Python scripts for all of the main processing, classifica-
tion and change detection algorithms. In addition, many examples discussed
in the text are illustrated with Python scripts as well as in IDL. The Appen-
dices C and D separately document the installation and use of the ENVI/IDL
and Python code. For readers who wish to use the Eclipse/Pydev develop-
ment environment (something which I highly recommend), the Python scripts
are provided in the form of a Pydev project.
What is missing in the Python world, of course, is the slick GUI provided
by ENVI. I have made no attempt to mimic an ENVI graphical environment
in Python, and the scripts provided content themselves with reading imagery
from, and writing results to, the file system. A rudimentary command line
xv
xvi Image Analysis, Classification and Change Detection in Remote Sensing
Morton Canty
List of Figures
3.1 Logarithm of the power spectrum for the 3N band of the Jülich
ASTER image. . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.2 The Haar scaling function. . . . . . . . . . . . . . . . . . . . . . 91
3.3 A row of c pixel intensities represented as a piecewise constant
function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.4 Basis functions Cn for function space Vn . . . . . . . . . . . . . 92
3.5 The Haar mother wavelet. . . . . . . . . . . . . . . . . . . . . . 93
3.6 Spatial subset of the Jülich ASTER image before and after
wavelet compression. . . . . . . . . . . . . . . . . . . . . . . . . 97
3.7 Haar wavelet coefficients for the image of Figure 3.6. . . . . . . 98
3.8 Approximation to the Haar scaling function. . . . . . . . . . . . 100
3.9 Approximation to the Daubechies D4 scaling function. . . . . . 104
3.10 RGB color composites of principal components of a LANDSAT
7 ETM+ image over Jülich. . . . . . . . . . . . . . . . . . . . . 107
3.11 Eigenvalues of the minimum noise fraction (MNF) transforma-
tion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.12 Two classes of observations in a two-dimensional feature space. 125
xvii
xviii Image Analysis, Classification, and Change Detection in Remote Sensing
9.4 The change probability for the bitemporal image in Figure 9.1
after five iterations of principal components analysis. . . . . . . 375
9.5 Two traffic scenes taken 0.7 seconds apart. . . . . . . . . . . . . 376
9.6 Change detection with linear and nonlinear PCA. . . . . . . . . 377
9.7 The fifth kernel principal component for the nonlinear bitem-
poral traffic scene. . . . . . . . . . . . . . . . . . . . . . . . . . 378
9.8 Multivariate alteration detection (MAD) using the six nonther-
mal bands of the bitemporal image of Figure 9.1. . . . . . . . . 382
9.9 Scatterplots of V6 vs. U6 and of V1 vs. U1 from Figure 9.8. . . . 382
9.10 The sixth MAD variate for the bitemporal image in Figure 9.1. 385
9.11 The canonical correlations ρi , i = 1 . . . 6, under 20 iterations of
the MAD transformation of the image in Figure 9.1. . . . . . . 386
9.12 Correlation of the fourth iteratively reweighted MAD (IR-MAD)
component with the seven spectral bands for the scene in Fig-
ure 9.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
9.13 The fourth IR-MAD component. . . . . . . . . . . . . . . . . . 388
9.14 Gaussian mixture fit to a MAD/MNF component. . . . . . . . 393
9.15 Color composite of MAD/MNF components 1, 2, and 3. . . . . 394
9.16 RGB composite of an IR-MAD image. . . . . . . . . . . . . . . 395
9.17 Four clusters in MAD feature space projected onto the 5,6
plane. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
9.18 Overlay of the harvested grain cluster onto spectral band 4 of
the August 2001 LANDSAT ETM+ image. . . . . . . . . . . . 397
9.19 Wishart change detection with TerraSAR-X data. . . . . . . . . 402
9.20 Radiometric normalization of bands 2 and 3 for two ASTER
images using scatterplot matching. . . . . . . . . . . . . . . . . 405
9.21 Principle of scatterplot matching. . . . . . . . . . . . . . . . . . 406
9.22 Mosaic of two LANDSAT 7 ETM+ images over Morocco. . . . 408
9.23 Regressions of the December 1999 reference scene on the Octo-
ber 2000 target scene. . . . . . . . . . . . . . . . . . . . . . . . 409
9.24 As Figure 9.22 after automatic radiometric normalization. . . . 410
xxiii
xxiv Image Analysis, Classification, and Change Detection in Remote Sensing
4.6 The filter method for the Python object DWTArray (excerpt
from auxil.py). . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4.7 Calculating a kernel matrix. . . . . . . . . . . . . . . . . . . . . 148
5.1 Histogram equalization in Python (excerpt from auxil.py) . . . 160
5.2 Calculating the power spectrum of the filter h1 in Equation
(5.5). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
5.3 LoG filtering with sign change detection in IDL. . . . . . . . . 165
5.4 Corner detection with OpenCV. . . . . . . . . . . . . . . . . . . 168
5.5 Illustrating the Hu invariant moments. . . . . . . . . . . . . . . 171
5.6 Hu invariant moments of image contours. . . . . . . . . . . . . 174
5.7 HSV panchromatic sharpening with ENVI batch procedures
and ENVI Classic. . . . . . . . . . . . . . . . . . . . . . . . . . 177
5.8 HSV panchromatic sharpening with ENVI batch procedures
and the new ENVI GUI. . . . . . . . . . . . . . . . . . . . . . . 178
5.9 An IDL routine for the Wang-Bovik quality index. . . . . . . . 184
5.10 Estimation of the equivalent number of looks. . . . . . . . . . . 190
5.11 Calculation of a DEM with cross-correlation. . . . . . . . . . . 206
5.12 Image matching by phase correlation. . . . . . . . . . . . . . . 214
5.13 Polarimetric SAR image registration. . . . . . . . . . . . . . . . 216
5.14 Polarimetric SAR image registration (continued). . . . . . . . . 217
5.15 Image–image registration with the similarity transform. . . . . 224
5.16 Image–image registration with the similarity transform (con-
tinued). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
6.1 Calculating class membership probabilities from rule images. . 240
6.2 Excerpt from the program module MAXLIKE_RUN.PRO. . . . . . . 241
6.3 Excerpt from the Python module supervisedclass.py. . . . . . 242
6.4 Excerpt from the program module KERNEL_RUN.PRO. . . . . . . . 246
6.5 Excerpt from the program module KERNEL_RUN.PRO. . . . . . . . 247
6.6 Excerpt from the object class FFN. . . . . . . . . . . . . . . . . 255
6.7 Excerpt from the Python module supervisedclass.py. . . . . . 256
6.8 Excerpt from the object class FFNBP. . . . . . . . . . . . . . . . 263
6.9 Excerpt from the Python module supervisedclass.py. . . . . . 264
6.10 Excerpt from the Python module supervisedclass.py. . . . . . 279
7.1 Cross-validation on the cloud. . . . . . . . . . . . . . . . . . . . 295
7.2 Excerpt from the script rx.py . . . . . . . . . . . . . . . . . . . 314
7.3 Excerpt from the ENVI/IDL extension KRX_RUN.PRO. . . . . . . 318
7.4 Excerpt from the ENVI/IDL extension KRX_RUN.PRO. . . . . . . 318
8.1 K-means clustering of a multispectral image with Python. . . . 328
8.2 Excerpt from the program KKMEANS_RUN.PRO. . . . . . . . . . . . 330
8.3 Extended K-means clustering. . . . . . . . . . . . . . . . . . . . 334
8.4 Extended K-means clustering (continued). . . . . . . . . . . . . 335
8.5 Excerpt from the IDL program module EM.PRO. . . . . . . . . . 344
8.6 Excerpt from the Python script em.py. . . . . . . . . . . . . . . 345
8.7 Excerpt from the program module EM_RUN.PRO. . . . . . . . . . 347
8.8 Excerpt from the program module EM.PRO. . . . . . . . . . . . . 349
Program Listings xxv
There are many Earth observation satellite-based sensors, both active and
passive, currently in orbit or planned for the near future. Representative of
these, we describe briefly the multispectral ASTER system (Abrams et al.,
1999) and the TerraSAR-X synthetic aperture radar satellite (Pitz and Miller,
2010). See Jensen (2005), Richards and Jia (2006) and Mather and Koch
(2010) for overviews of remote sensing satellite platforms.
The Advanced Spaceborne Thermal Emission and Reflectance Radiometer
(ASTER) instrument was launched in December 1999 on the Terra space-
craft. It is being used to obtain detailed maps of land surface temperature,
reflectance and elevation and consists of sensors to measure reflected solar
radiance and thermal emission in three spectral intervals:
• VNIR: Visible and near-infrared bands 1, 2, 3N, and 3B, in the spectral
region between 0.52 and 0.86 µm (four arrays of charge-coupled detectors
(CCDs) in pushbroom scanning mode).
The altitude of the spacecraft is 705 km. The across- and in-track ground
sample distances (GSDs), i.e., the detector widths projected through the sys-
tem optics onto the Earth’s surface, are 15 m (VNIR), 30 m (SWIR) and
90 m (TIR).∗ The telescope associated with the 3B sensors is back-looking at
an angle of 27.6o to provide, together with the 3N sensors, along-track stereo
image pairs. In addition, the VNIR camera can be rotated from straight down
(nadir) to ± 24o across-track. The SWIR and TIR instrument mirrors can be
pointed to ± 8.5o across-track. Like most platforms in this ground resolution
category, the orbit is near polar, sun-synchronous. Quantization levels are 8
bits for VNIR and SWIR and 12 bits for TIR. The sensor systems have an
average duty cycle of 8% per orbit (about 650 scenes per day, each 60×60
∗ At the time of writing, the SWIR sensor is no longer functioning although both the
1
2 Images, Arrays, and Matrices
FIGURE 1.1
ASTER color composite image (1000 × 1000 pixels) of VNIR bands 1 (blue),
2 (green), and 3N (red) over the town of Jülich in Germany, acquired on May
1, 2007. The bright areas are open cast coal mines. (See color insert.)
km2 in area) with revisit times between 4 and 16 days. Figure 1.1 shows a
spatial/spectral subset of an ASTER scene. The image is a UTM (Universal
Transverse Mercator) projection oriented along the satellite path (rotated ap-
proximately 16.4o from north) and orthorectified using a digital terrain model
generated from the stereo bands.
Unlike passive multi- and hyperspectral imaging sensors, which measure
reflected solar energy or the Earth’s thermal radiation, synthetic aperture
radar (SAR) airborne and satellite platforms supply their own microwave
radiation source, allowing observations which are independent of time of day
or cloud cover. The radar antenna on the TerraSAR-X satellite, launched in
3
FIGURE 1.2
A 5000×5000-pixel spatial subset of the HH polarimetric band of a TerraSAR-
X quad polarimetric image acquired over the Rhine River, Germany, in so-
called Stripmap mode. The data are slant-range, single-look, complex. The
gray-scale values correspond to the magnitudes of the complex pixel values.
June, 2007, emits and receives X-band radar (9.65 GHz) in both horizontal and
vertical polarizations to provide surface imaging with a geometric resolution
from about 18 m (scanSAR mode, 10 km×150 km swath) down to 1 m (high-
resolution Spotlight mode, 10 km×5 km swath). It flies in a sun-synchronous,
near-polar orbit at an altitude of 514 km with a revisit time for points on
the equator of 11 days. Figure 1.2 shows a TerraSAR-X HH polarimetric
band (horizontally polarized radiation emitted and detected) acquired over
the Rhine River, Germany, in April, 2010. The data are at the “single-look,
slant-range complex” processing level, and are not map-projected.
4 Images, Arrays, and Matrices
gk (i, j), 1 ≤ i ≤ c, 1 ≤ j ≤ r, 1 ≤ k ≤ N,
where c is the number of pixel columns (also called samples) and r is the
number of pixel rows (or lines). The index k denotes the spectral band, of
which there are N in all. For data at an early processing stage a pixel may be
stored as a digital number (DN), often in a single byte, so that 0 ≤ gk ≤ 255.
This is the case for the ASTER VNIR and SWIR bands at processing level L1A
(unprocessed reconstructed instrument data), whereas the L1A TIR data are
quantized to 12 bits (as unsigned integers) and thus stored as digital numbers
from 0 to 212 − 1 = 4095. Processed image data may of course be stored in
byte, integer or floating point format and can have negative or even complex
values.
The gray-scale values in the various bands encode measurements of the
radiance L∆λ (x, y) in wavelength interval ∆λ due to sunlight reflected from
some point (x, y) on the Earth’s surface, or due to thermal emission from
that surface, and focused by the instrument’s optical system along the array
of sensors. Ignoring all absorption and scattering effects of the intervening
atmosphere, the at-sensor radiance available for measurement from reflected
sunlight from a horizontal, Lambertian surface, i.e., a surface which scatters
reflected radiation uniformly in all directions, is given by
The units are [W/(m2 · sr · µm)], E∆λ is the average spectral solar irradiance
in the spectral band ∆λ, θz is the solar zenith angle, R∆λ (x, y) is the surface
reflectance at coordinates (x, y), a number between 0 and 1, and π accounts
for the upper hemisphere of solid angle. The conversion between DN and
at-sensor radiance is determined by the sensor calibration as measured (and
maintained) by the satellite image provider. For example, for ASTER VNIR
and SWIR L1A data,
In the computer language IDL, so-called column major indexing is used for
arrays (Gumley, 2002) and the elements in an array are numbered from zero.
This means that, if a gray-scale image g is assigned to an IDL array variable
G, then the intensity value g(i, j) is addressed as G[i-1,j-1]. An N -band
multispectral image is stored in BIP format as an N × c × r array in IDL, in
BIL format as a c × N × r and in BSQ format as a c × r × N array. So, for
example, in BIP format the value gk (i, j) is stored at G[k-1,i-1,j-1].
In numerical Python (Python with the Numpy package) arrays are also
numbered from zero, but the indexing is row major. The array shapes are
thus reversed relative to IDL. For example, a BSQ image has shape N × r × c.
Auxiliary information, such as image acquisition parameters and georef-
erencing, is sometimes included with the image data on the same file, and
the format may or may not make use of compression algorithms. Examples
are the GeoTIFF∗ file format used, for instance, by Space Imaging Inc. for
distributing Carterra(c) imagery and which includes lossless compression, the
HDF-EOS (Hierarchical Data Format-Earth Observing System) files in which
ASTER images are distributed, and the PCIDSK format employed by PCI
∗ GeoTIFF is an open source specification and refers to TIFF files which have geographic
(or cartographic) data embedded as tags within the file. The geographic data can be used
to position the image in the correct location and geometry on the screen of a geographic
information display.
6 Images, Arrays, and Matrices
PT GT GR λ2 σ o ∆a ∆r
PR = [W ], (1.2)
(4π)3 D4
where ω = 2πf and φ are the angular frequency and phase of the radiation
and Re denotes “real part.”∗ It is usually convenient to work exclusively
with complex amplitudes |E|ei(ωt+φ) , bearing in mind that only the real part
is physically significant. When the oscillating electric fields are described by
complex numbers in this way, the scattering matrix elements are also complex.
A full polarimetric, or quad polarimetric SAR image then consists of four
complex bands shh , shv , svh and svv , one for each pixel-wise determination of
an element of the scattering matrix. So-called reciprocity (Richards, 2009),
which normally applies to natural targets, implies that shv = svh . The squared
amplitudes of the scattering coefficients, i.e., |shh |2 , |shv |2 , etc., constitute the
radar cross sections for each polarization combination. These in turn replace
σ o in Equation (1.2) and determine the received power in each polarization
channel.
Listing 1.3 gives a basic IDL script for reading polarimetric TerraSAR-X
imagery in COSAR format, an annotated binary matrix format with each
sample (pixel) held in 32 bytes (16 bytes real, 16 bytes imaginary) stored
with the most significant byte first (big endian format). The script makes use
of the freely available TerraSAR-X/TanDEM-X SSC/CoSSC reader for IDL
and ENVI (Exelis/DLR, 2012). After opening the data file, a 500 × 500 pixel
subset of the first (HH) band is read into the IDL variable data. Then the
magnitudes of the complex pixel values are displayed in an IDL window as in
Figure 1.2.
Listing 1.4 shows a similar script in Python which makes use of GDAL and
the matplotlib library as well as the auxil package to access and plot the
data.
x1 1 0
x= = x1 + x2 = x1 i + x2 j , (1.11)
x2 0 1
where the symbols i and j denote vectors of unit length along the x and y
directions, respectively.
A 2 × 2 matrix is written in the form
a11 a12
A= . (1.12)
a21 a22
The first index of a matrix element indicates its row, the second its column.
While numerical Python indexes two-dimensional array and matrix objects
in this way, the indices of the elements in Equation (1.12) do not correspond
to the IDL convention. The first index of a 2-dimensional IDL array denotes
the column, the second the row. Thus, IDL may be said to be array-oriented
but not matrix-oriented. This can cause confusion and must be kept in mind
when writing programs in IDL. Depending on the context, we will refer to an
n × m IDL array and an m × n matrix as one and the same object.
When a matrix is multiplied with a vector, the result is another vector, e.g.,
a11 a12 x1 a11 x1 + a12 x2 a11 a11
Ax = = = x1 + x2 .
a21 a22 x2 a21 x1 + a22 x2 a21 a22
Algebra of vectors and matrices 13
(A + B)⊤ = A⊤ + B ⊤
(1.19)
(AB)⊤ = B ⊤ A⊤ .
The sum is taken over all permutations (j1 . . . jp ) of the integers (1 . . . p) and
f (j1 . . . jp ) is the number of transpositions (interchanges of two integers) re-
quired to change (1 . . . p) into (j1 . . . jp ). The determinant of a 2 × 2 matrix,
for example, is given by
|AB| = |A||B|
(1.21)
|A⊤ | = |A|.
The identity matrix is a square matrix with ones along its diagonal and
zeroes everywhere else. For example
1 0
I= ,
0 1
Ax = 0 (1.31)
only has the so-called trivial solution x = 0. To see this, multiply from the
left with A−1 . Then A−1 Ax = Ix = x = 0.
If A is singular, Equation (1.31) has at least one nontrivial solution x 6= 0.
This, again, is easy to see for a 2 × 2 matrix. Suppose |A| = 0. Writing
Equation (1.31) out fully:
a11 x1 + a12 x2 = 0
a21 x1 + a22 x2 = 0.
x⊤ Ax > 0 (1.32)
We will see how to show that this matrix is positive definite in Section 1.4.
(Page 128)
Sydney and Miss Osric looked at one another. “The belfry ropes
are gone!”
Before they had finished speaking, Mr. Seaton was tearing in a
neck-or-nothing fashion down the ladders. It was well for him that
he was forced to act, and not wait to think. Ropes must be got, and
immediately, for what ladder would be long enough? He did not even
cast one glance back at the tower as he rushed through the
churchyard in search of a rope.
There was nothing that Miss Osric and Sydney had the power to
do but wait and pray. They clung to one another silently, with set,
white faces, as Hugh commenced his difficult and dangerous
descent, with one eye on the little figure, which might move and be
dashed from its precarious resting-place at any moment. Was the
child stunned? Hugh almost hoped he might be. Any movement
must almost certainly be fatal to his balance.
But as the young man felt carefully his third step in that perilous
climb, there was a quiver in the dark blue bundle on the gargoyle,
and a scared little face was uplifted to his. The hearts of the girls
above stood still.
Hugh was struggling desperately for a foothold which it seemed
impossible to find. Would the child move, or look down? Should he
do so, nothing could save him.
“It’s all right, old chap!” Hugh called in his cheeriest tone. “You
just keep still where you are. Yes, that’s right; now look at me. I’m
coming down to take you up again. No, don’t try and sit up—you can
see me splendidly from where you are.”
His voice broke off, as he all but lost both hold and footing. He
regained it with a frantic struggle and descended another step.
“Look at me, Pauly!”
Pauly’s round eyes gazed up wonderingly. Hugh neared the
gargoyle, and set his teeth for a mighty effort.
Pauly was a particularly large and strong boy for not quite five
years old, and, even on firm ground, would be no joke to lift in one
hand. But the thing must be done. Hugh strengthened his hold with
his right hand, and took an anxious downward glance. Some of the
village men were trying to join ladders, but they were far too short.
Mr. Seaton was running frantically up the road beyond the
churchyard, with a coil of rope on his arm. In the clear air Hugh
could see his upturned face, dead white, with eyes staring wildly.
He could not possibly get through the churchyard and up the
tower in less than ten minutes—Hugh thought he would probably
take longer. It was not therefore possible to risk leaving Pauly on the
gargoyle till he himself should have the help of a rope.
He took the firmest grip he could of the roughened stonework of
the tower with feet and right hand, and loosed cautiously the other,
reaching with it towards the blue bundle on the gargoyle. “Steady,
Pauly, keep quite still, old chap!”
With a struggle that brought beads of perspiration out upon his
forehead and nearly sent him flying into space, he grasped the child,
and raised him slowly from his resting-place; then stepped down on
to the gargoyle, and stood there, clasping Pauly closely, and leaning
back against the wall with closed eyes.
He was too physically exhausted with the terrible anxiety and
effort of the last few minutes to make any further movement then.
Besides, it was now a necessity to wait for the rope. The upward
climb would be impossible when burdened by the well-grown boy.
He had to concentrate all his powers on keeping steady on the
slender foothold, which was all the gargoyle afforded, and waiting
for the help which Mr. Seaton would bring.
It seemed hours before a shout from above came down cheerily to
him, and a rope end struck him on the shoulder. “Now, Pauly,” he
said, “hold on round my neck for all you’re worth, there’s a good
little chap!”
He took a firm grip of the child’s blouse in his teeth, and,
steadying himself with infinite difficulty, fastened the rope beneath
his own arms, in the strongest knots that he could make. Then,
using his hands as a trumpet, he called “Ready!”
His left arm was round Pauly, his right grasped the rope above his
head. “Now hold tight, little chap, and don’t be frightened!”
Pauly carried out this order by taking as good a grip as the hair-
cutter allowed of Hugh’s head, and it was in this position that the
two were at length hauled over the parapet by the united strength of
the Vicar, Hiram, and the Vicarage gardener, whom Mr. Seaton had
met while searching for a rope.
Mr. Seaton wrung Hugh’s hand in silence, and held his son to him,
in silence also. No one seemed to have much voice for speech just
then; even Pauly was subdued and shaken by his fall, though he had
escaped with nothing worse than grazed knees.
The descent from the tower was very quiet and sober. A strong
shudder went through the party as they passed the belfry chamber
and thought about the awful moment when they had realised that
the ropes were gone.
His father carried Pauly, and Hugh went in front of Sydney and
Miss Osric, and gave them his hand where the ladders turned. He
and Sydney never spoke the whole way down.
They were in the churchyard at last, and Pauly was demanding to
be shown “the funny little step where me and him was standing.”
The Vicar, shivering, hushed him, and turned to Hugh. “You’ll come
in and lunch with me?” he said, a little huskily, his hand upon the
young man’s shoulder.
“Thank you, I will,” Hugh answered gravely.
“And, Sydney, we must hurry back,” Miss Osric suggested. “I am
sure it is getting late.”
Sydney moved a step away; then took a sudden resolution.
She went to Hugh and held out her hand. “Good-bye, Hugh.
Please understand,” she said very low.
Hugh took the little gloved hand in his, and read rightly the
trouble in her eyes.
“It’s all right—don’t you bother, Syd,” he said. “I understand.”
CHAPTER XII
MERRY CHRISTMAS
ebookgate.com