Upload
ernesto-sanchez-castro
View
68
Download
5
Tags:
Embed Size (px)
DESCRIPTION
Breve documento de envi 5
Citation preview
Spectral Analysis with
ENVI
Contents
2 Spectral Analysis With ENVI
Copyright 2011
All rights reserved.
E3De, ENVI and IDL are trademarks of Exelis, Inc. All other marks are the property of their
respective owners. ©2011, Exelis Visual Information Solutions, Inc.
Produced by Outreach Services
Exelis Visual Information Solutions
4990 Pearl East Circle
Boulder, CO 80301
303-786-9900
Spectral Analysis With ENVI 3
Contents
4 Spectral Analysis With ENVI
Contents
INTRODUCTION ........................................................................................................................................................... 6
WHAT IS ENVI? ........................................................................................................................................................ 7 ENVI + IDL, ENVI, and IDL .................................................................................................................................... 7 ENVI RESOURCES ..................................................................................................................................................... 7
DATA PREPROCESSING ...........................................................................................................................................10
WHAT YOU WILL LEARN IN THIS CHAPTER ............................................................................................................ 11 CALIBRATION .......................................................................................................................................................... 11 ATMOSPHERIC AND SOLAR IRRADIANCE CURVE CORRECTION ............................................................................... 11 MODEL-BASED REFLECTANCE CONVERSION .......................................................................................................... 14 ARTIFACTS OF MODEL-BASED CONVERSIONS ......................................................................................................... 17 CHAPTER REVIEW ................................................................................................................................................... 20
PRINCIPAL COMPONENTS ANALYSIS .................................................................................................................21
WHAT YOU WILL LEARN IN THIS CHAPTER ............................................................................................................ 22 INTRODUCTION ........................................................................................................................................................ 22 CHAPTER REVIEW ................................................................................................................................................... 26
EXAMINING SPECTRA AND USING SPECTRAL LIBRARIES ..........................................................................27
WHAT YOU WILL LEARN IN THIS CHAPTER ............................................................................................................ 28 DATA EXPLORATION ............................................................................................................................................... 28 Visually Comparing Spectra ...................................................................................................................................30 WORKING WITH SPECTRAL LIBRARIES .................................................................................................................... 31 Creating Your Own Spectral Libraries ...................................................................................................................36 CHAPTER REVIEW ................................................................................................................................................... 36
WHOLE PIXEL ANALYSIS TECHNIQUES ............................................................................................................37
WHAT YOU WILL LEARN IN THIS CHAPTER ............................................................................................................ 38
INTRODUCTION ........................................................................................................................................................ 38
SPECTRAL ANGLE MAPPER (SAM) CLASSIFICATION .............................................................................................. 38
MATCHING IMAGE SPECTRA TO REFERENCE SPECTRA ............................................................................................ 44
Continuum Removal ................................................................................................................................................45 Spectral Feature Fitting (SFF) ................................................................................................................................48 CHAPTER REVIEW ................................................................................................................................................... 57
IDENTIFYING DATA ENDMEMBERS ....................................................................................................................58
WHAT YOU WILL LEARN IN THIS CHAPTER ............................................................................................................ 59
INTRODUCTION ........................................................................................................................................................ 59
Endmembers, Mixed Pixels, and Sub-Pixel Analysis ...............................................................................................59 Finding Endmembers ..............................................................................................................................................59 Review of the Linear Unmixing Model ....................................................................................................................60 MINIMUM NOISE FRACTION (MNF) ........................................................................................................................ 60
PIXEL PURITY INDEX (PPI) ...................................................................................................................................... 65
For Future Reference ..............................................................................................................................................65 N-D VISUALIZER ..................................................................................................................................................... 68
SPECTRAL ANALYST ............................................................................................................................................... 74
CHAPTER REVIEW ................................................................................................................................................... 76
SUB-PIXEL ANALYSIS TECHNIQUES ....................................................................................................................77
WHAT YOU WILL LEARN IN THIS CHAPTER ............................................................................................................ 78
INTRODUCTION ........................................................................................................................................................ 78
LINEAR SPECTRAL UNMIXING ................................................................................................................................. 78
Spectral Analysis With ENVI 5
PARTIAL UNMIXING USING MATCHED FILTERING ................................................................................................... 80
Matched Filtering ................................................................................................................................................... 81 Mixture Tuned Matched Filtering ........................................................................................................................... 81 SPECTRAL HOURGLASS WIZARD ............................................................................................................................. 84
Wizard Processing Flow ......................................................................................................................................... 85 Wizard Basics .......................................................................................................................................................... 86 CHAPTER REVIEW ................................................................................................................................................... 92
GEOREFERENCING AND MOSAICKING .............................................................................................................. 95
WHAT YOU WILL LEARN IN THIS CHAPTER ........................................................................................................... 95
INTRODUCTION........................................................................................................................................................ 96
Introduction
What is ENVI? ................................................................................................................... ENVI Resources ................................................................................................................
ENVI Resourse
Introduction
Spectral Analysis With ENVI 7
What is ENVI?
ENVI®
(the Environment for Visualizing Images) is the ideal software for the visualization,
analysis, and presentation of all types of digital imagery. ENVI’s complete image-processing
package includes advanced, yet easy-to-use, spectral tools, geometric correction, terrain analysis,
radar analysis, raster and vector GIS capabilities, extensive support for images from a wide variety
of sources, and much more.
ENVI can be used to perform numerous image analysis techniques, including multispectral
classification, various types of spatial filtering, image registration, principal components
transformations, band ratios, and image statistics. ENVI also has a unique suite of advanced
spectral analysis tools designed specifically for working with hyperspectral data (although many
are also appropriate for multispectral analysis) and a complete set of tools for working with radar
data (both single band and fully polarimetric SAR). Furthermore, ENVI provides full access to the
programming language in which it was written: the Interactive Data Language (IDL) a powerful,
yet easy to use, fourth-generation language whose programs can easily be incorporated into ENVI.
ENVI’s interactive analysis capabilities include:
Multiple dynamic overlay that allows you to easily compare images in multiple displays.
Real-time extraction and linked spatial/spectral profiling from multi-band and
hyperspectral data that provide you with new ways of looking at high-dimensional data.
Interactive tools to view and analyze vectors and GIS attributes.
Standard capabilities, such as contrast stretching and 2D scatter plots.
ENVI + IDL, ENVI, and IDL
ENVI is written in Interactive Data Language (IDL®
), a powerful structured programming
language that offers integrated image processing. The flexibility of ENVI is due largely to IDL’s
capabilities.
There are two types of ENVI licenses:
ENVI + IDL — ENVI plus a full version of IDL
ENVI — ENVI plus a runtime version of IDL
ENVI + IDL users can use IDL to customize their own command-line functions. Advanced ENVI
+ IDL users should find the flexibility offered by IDL’s interactive features helpful for their
dynamic image analyses.
ENVI Resources Exelis Visual Information Solutions has a team of Global Services Group (GSG) consultants who
provide custom software development; consulting services; and training to commercial, research,
and government markets. The GSG team can either help you define requirements and lead your
development cycle from prototyping to final installation, or they can join your project mid-stream
and provide expert assistance.
8 Spectral Analysis With ENVI
Each GSG team member offers expertise in areas such as image processing; data
analysis; visualization; software development; a broad range of scientific application
areas; and government civilian, defense, and intelligence community requirements. If
needed, some staff have the necessary security clearances to support classified projects.
The GSG team is experienced in extending ENVI’s robust suite of user functions and
batch programming capabilities, and it has up-to-date knowledge on recent product
enhancements and future product direction. You can e-mail the Global Services Group
This is a training manual used to teach customers ENVI. It is designed to be a classroom
training aid. However, if you cannot attend a training course, this manual is the next best
tool for quickly learning and understanding ENVI.
We want you to learn ENVI and apply it successfully to your work. If you have any
suggestions for improvements or additions to this manual, please let us know.
Most chapters in this manual are self-contained. In most cases you can pick up the manual
in any particular functional area and start working with the exercise immediately.
Bold All ENVI menu options, dialog buttons, dialog fields, other dialog
options, and values that you need to enter are bold.
Courier File names, directory paths, and IDL/ENVI programming variables are
in a Courier font.
Numbered Steps Paragraphs beginning with a bold number designate commands that
need to be performed for a particular exercise
Chapter 1:
Data Preprocessing
What You Will Learn In This Chapter .................................................................................... Calibration ............................................................................................................................. Atmospheric and Solar Irradiance Curve Correction ............................................................. Model-Based Reflectance Conversion .................................................................................. Artifacts of Model-Based Conversions .................................................................................. Chapter Review ....................................................................................................................
ENVI Resourse
Chapter 1: Data Preprocessing
Spectral Analysis With ENVI 11
What You Will Learn In This Chapter In this chapter you will:
Use different ENVI tools to convert radiance data to reflectance by removing atmospheric and
solar effects
Remove artifacts introduced by model-based programs when converting to reflectance
Exercise Data
You will use hyperspectral data sets from the Probe 1 sensor, collected over Santa Barbara, CA. Probe 1
is a “full range” sensor with 128 channels ranging from 0.4 μm to 2.5 μm. SBcoast_rad is a radiance
data set.
Calibration Hyperspectral sensors should be spectrally and radiometrically calibrated before you analyze their data.
During laboratory experiments, researchers determine the center wavelengths for sensor channels, and
they measure the radiometric response. Based on these experiments, they derive the calibration factors
used to convert raw digital numbers (DNs) to radiance. Conversion to radiance or reflectance is
particularly important when comparing data sets. Some researchers analyze radiance data. However, many
applications require the use of reflectance data.
Atmospheric and Solar Irradiance Curve Correction Conversion to reflectance involves removing atmospheric absorption and scattering, as well as removing
the shape of the solar irradiance spectrum. You can compare reflectance spectra to spectral libraries to
facilitate material identification. ENVI provides several utilities for converting radiance data to
reflectance. It is also possible to write your own calibration functions for ENVI.
ENVI provides several simple atmospheric correction methods. You can access the Flat Field, Empirical
Line, and Internal Average Reflectance methods under the Basic Tools Preprocessing Calibration
Utilities menu. These routines are typically used only on hyperspectral data sets. A method called Dark
Subtraction (primarily used with multispectral data) is located under the Basic Tools Preprocessing
General Purpose Utilities menu. The best results are usually obtained using an atmospheric correction
based on laboratory or field reflectance spectra.
The Flat Field technique normalizes the spectrum of each pixel in the image using the average spectrum
from a region of flat reflectance within the scene. Some knowledge of the area is useful, although you can
search through the data set for flat field prospects. This technique assumes that all of the spectral features
in the flat field region are due to the atmosphere and the solar spectrum. You can use an ROI to outline the
area known to have flat reflectance and calculate its average spectrum. Then, divide the data set by this
flat field average spectrum, effectively removing the shape of the solar spectrum and atmospheric
scattering and absorptions.
Chapter 1:
12 Spectral Analysis With ENVI
The Empirical Line technique also requires some detailed knowledge of the scene. In this instance, you
collect field or laboratory reflectance spectra for two or more known target areas in the image (usually
including a dark and a bright area). Select the targeted regions using ROIs. Calculate a linear regression
between the field or lab reflectance spectra and the data radiance spectra for the target areas. This
regression line, based upon the bright and dark targets, is used to predict the surface reflectance spectrum
for each pixel.
The Internal Average Reflectance (IAR) technique can be used when working in an area for which no
ground truth data exists. Calculate the average spectrum of the entire image, then divide this spectrum into
each pixel in the image to calculate a relative reflectance.
Atmospheric modeling is another common approach for applying atmospheric and solar corrections to
data sets, particularly for hyperspectral sensors. Exelis Visual Information Solutions sells a separate
atmospheric correction module called FLAASH (Fast Line-of-sight Atmospheric Analysis of Spectral
Hypercubes). Other vendors also offer atmospheric correction software, some of which can interface
directly with ENVI.
Exercise #1: Flat Field Correction 1. From the ENVI main menu bar, ENVI Classic select File Open Image File. The Enter Data
Filenames dialog appears.
2. Navigate to envihyper\Probe, and select SBcoast_rad.
3. Click Open. The Available Bands List appears.
4. Right-click on Sbcoast_rad, and display Load True Color. ENVI automatically determines the
proper band combination for a true-color image, and it loads the image into a new display group.
5. Center the Zoom box over a wide beach area near the bottom of the image. This is a good candidate
for a flat field calibration target, since it is bright and spectrally homogenous.
Figure 1: Zoom window centered over wide beach area
ENVI Resourse
Chapter 1: Data Preprocessing
Spectral Analysis With ENVI 13
6. From the Display group menu bar, select Overlay Region of Interest. The ROI Tool dialog
appears.
7. In the ROI Tool dialog, click the Zoom radio button.
8. Draw a polygon ROI inside of the sandy beach.
9. From the ENVI main menu bar, select Basic Tools Preprocessing Calibration Utilities
Flat Field. The Calibration Input File dialog appears.
10. Select SBcoast_rad, and click OK. The Flat Field Calibration Parameters dialog appears.
11. Select the ROI you created, and enter an output filename of SBcoast_FF.
12. Click OK. After processing is complete, the resulting calibration image is added to the Available
Bands List.
13. Right-click on Sbcoast_FF and select Load True Color to <new>.
14. From a Display group menu bar, select Tools Link Link Displays. The Link Displays dialog
appears.
15. In the Link Displays dialog, click the Dynamic Overlay toggle button to select Off.
16. Click OK.
17. From both Display group menu bars, select Tools Profiles Z Profile (Spectrum). A Spectral
Profile window appears for each display group.
18. Roam through an image and compare the spectra from the original radiance image and corrected
image. Compare spectra from several different types of land cover.
Did the flat field correction remove most of the obvious features of radiance spectra? Do the flat
field corrected spectra look like reflectance spectra?
Exercise #2: IAR Correction 1. From the ENVI main menu bar, select Basic Tools Preprocessing Calibration Utilities
IAR Reflectance. The Calibration Input File dialog appears.
2. Select SBcoast_rad, and click OK. The IARR Calibration Parameters dialog appears.
3. Enter SBcoast_IAR as the output filename, and click OK. After processing is complete, the
resulting image appears in the Available Bands List.
4. Right-click on Sbcoast_IAR, and select Load True Color to <new>.
Chapter 1:
14 Spectral Analysis With ENVI
5. To link the IAR image with the radiance and flat field images, select Tools Link Link Displays
from a Display group menu bar. The Link Displays dialog appears. Click the Display #3 toggle button
to select Yes.
6. In the Link Displays dialog, click the Dynamic Overlay toggle button to select Off.
7. From the Display #3 menu bar, select Tools Profiles Z Profile (Spectrum). A Spectral Profile
window appears.
8. Compare spectral profiles from all three images and from several different land cover types.
Do the Flat Field and IAR corrections remove atmospheric effects and the shape of the solar
irradiance curve? What differences do you see between these two methods?
9. When you are finished, close all display groups and dialogs.
Model-Based Reflectance Conversion Because of difficulties in collecting ground spectra for calibration, or the absence of good calibration
targets within a scene, most researchers use a model-based radiative transfer program to convert radiance
data to reflectance. Many of these programs use some form of the MODTRAN4 radiation transfer code or
lookup tables derived from MODTRAN4 to estimate atmospheric parameters.
ENVI provides an atmospheric correction module called FLAASH that you must purchase as an add-on
module from Exelis Visual Information Solutions. Developed by Spectral Sciences, Inc., FLAASH uses
MODTRAN4 radiation transfer code to correct images for atmospheric water vapor, oxygen, carbon
dioxide, methane, and ozone absorptions and molecular and aerosol scattering.
Exercise #3: Using FLAASH 1. From the ENVI main menu bar, select Spectral FLAASH. The FLAASH Atmospheric Correction
Model Input Parameters dialog appears.
2. Click Input Radiance Image. The FLAASH Input File dialog appears.
3. Select SBcoast_rad and click OK. The Radiance Scale Factors dialog appears.
4. Select Use single scale factor for all bands, and enter 1000 in the Single scale factor field. Click
OK.
5. Click Output Reflectance File. The Select Output File dialog appears.
6. Navigate to envihyper\hyperout, and enter an output filename of SBcoast_ref. Click
Open.
ENVI Resourse
Chapter 1: Data Preprocessing
Spectral Analysis With ENVI 15
7. Make sure the Output Directory for FLAASH Files is also envihyper\hyperout.
8. In the Rootname for FLAASH Files field, enter SBcoast_ref. ENVI automatically appends an
underscore to the root name. The FLAASH output files will include a water vapor image, a cloud
classification image, a journal file, and an optional template file.
9. In the Lat fields, enter 34 24 36.0.
10. In the Lon fields, enter -119 48 0.0.
11. Click the Sensor Type button, and select Hyperspectral HYMAP. The file SBcoast_rad was
derived from the Probe sensor, but since Probe is not an option with FLAASH, you can use HyMap
instead. The HyMap and Probe sensors were built by the same company, and their characteristics are
essentially the same except for the number of channels.
12. In the Sensor Altitude (km) field, enter 2.7.
13. In the Ground Elevation (km) field, enter 0.005.
14. In the Pixel Size (m) field, enter 5.7.
15. Set the Flight Date to Jul 17 1998.
16. Set the Flight Time GMT (HH:MM:SS) to 17 39 15.
17. From the Atmospheric Model drop-down list, select Mid-Latitude Summer.
18. Click the Water Retrieval toggle button to select Yes.
19. Keep the default value of 1135 nm for Water Absorption Feature.
20. From the Aerosol Model drop-down list, select Maritime.
21. Make sure the Spectral Polishing toggle button is set to Yes.
22. Leave the default values for all other fields.
23. Click Advanced Settings. The FLAASH Advanced Settings dialog appears with many more
parameters. Use the default values for all of these parameters.
Aerosol Scale Height, CO2 Mixing Ratio, Use Adjacency Correction, and Use Square Slit
Function are used to calculate adjacency effects). Modtran Resolution allows you to select
between accuracy or processing speed. For the Modtran Multiscatter Model, Scaled DISORT
falls in between ISAACS and DISORT with regard to accuracy and processing speed. The
DISORT model is preferred for very hazy conditions. For Tiled Processing, computer processing
speed and memory limits are considered when determining processing tile size. If this is toggled
Chapter 1:
16 Spectral Analysis With ENVI
off, FLAASH requires large amounts of available disk space to create intermediate files. The
Output Scale Factor of 10,000 is typically used to scale the data to integer format. This maintains
accuracy and keeps file size down. You can toggle on Output Diagnostic Files to help if
problems occur.
24. Click Cancel to return to the main FLAASH dialog.
25. Click Apply in the FLAASH Atmospheric Correction Model Input Parameters dialog. The FLAASH
processing may take several minutes. When processing is complete, the FLAASH Atmospheric
Correction Results dialog appears with a summary of processing results. Also, three new images are
loaded into the Available Bands List:
Sbcoast_ref_water.dat Sbcoast_ref_cloudmask.dat
Sbcoast_ref
26. In the Available Bands List, select Water column vapor and click Load Band. The water vapor
image is loaded to a new display group. High values for this image are typically found near water.
Ideally, you should not see much of the ground in this image. When you are finished, close this
display group.
27. In the Available Bands List, right-click Band 1 (under Sbcoast_ref_cloudmask.dat), and
select Load Band to New Display. The cloud mask image appears in a new display group.
28. Right click in the Image window displaying the cloud mask image, and select Cursor
Location/Value. Examine the various data values and their meanings. When you are finished, close
this display group.
29. In the Available Bands List, right-click on SBcoast_ref, and select Load True Color. A
FLAASH-corrected reflectance image appears in a new display group.
30. From the Display group menu bar, select Tools Profiles Z Profile (Spectrum). A Spectral
Profile window appears. Move the cursor over various land cover types and man-made structures, and
view their reflectance spectra.
Did FLAASH do a good job in converting the data to reflectance? Did it remove the solar curve
and atmospheric effects from the spectral curve?
31. Keep the display group and Spectral Profile window open for the next exercise.
32. Close the FLAASH Atmospheric Correction Model Input Parameters and FLAASH Atmospheric
Correction Results dialogs.
ENVI Resourse
Chapter 1: Data Preprocessing
Spectral Analysis With ENVI 17
Artifacts of Model-Based Conversions Conversion of radiance data to reflectance using a model-based program (such as FLAASH) typically
introduces artifacts into the spectra. These artifacts can result from mismatches in the spectral calibration
of the hyperspectral data set and the spectral radiative transfer calculations, as well as errors in the
absolute radiometric calibration or in the radiative transfer calculations. In addition, the 1.4 μm and 1.9
μm water vapor bands typically give very noisy reflectance results. These noisy values result from the low
radiance values in these portions of the spectrum and could lead to undesirable spikes. ENVI provides a
tool called EFFORT that removes all of these artifacts.
Optional - Exercise #4: Removing artifacts 1. Run FLAASH as before but this time make sure the Spectral Polishing toggle button is set to No.
You will do the spectral polishing using EFFORT.
2. From the ENVI main menu bar, select Spectral EFFORT Polishing. The Select EFFORT Input
File dialog appears.
3. Select SBcoast_ref (FLAASH-corrected reflectance data), and click OK. The EFFORT Input
Parameters dialog appears.
4. Click Enter New Segment three times. Three items appear under the Segment Information title at the
top of the dialog.
5. Click the first Edit button. A Segment Spectral Subset dialog appears. Click Clear.
6. In the two text fields, enter 1 and 64. Click Add Range, then OK.
7. In the EFFORT Input Parameters dialog, click the second Edit button. A Segment Spectral Subset
dialog appears. Click Clear.
8. In the two text fields, enter 65 and 96. Click Add Range, then OK.
9. In the EFFORT Input Parameters dialog, click the third Edit button. A Segment Spectral Subset
dialog appears. Click Clear.
10. In the two text fields, enter 97 and 124. Click Add Range. Hold the Ctrl button and deselect band 99.
Channels 125 to 128 tend to be noisy due to low solar energy at these wavelengths, so you will not
include these bands. Additionally, band 99 contains an atmospheric CO2 absorption feature that is best
to exclude. Click OK.
11. In the EFFORT Input Parameters dialog, accept the default values for the remaining fields. Click the
Apply Results ? toggle button to select Yes.
12. Enter an output filename of SBcoast_effref.
Chapter 1:
18 Spectral Analysis With ENVI
13. Click OK. When processing is complete, an EFFORT Gain / Offset Results plot window appears, and
the resulting image is added to the Available Bands List.
Figure 2: EFFORT Gain / Offset Results
14. In the Available Bands List, right-click on SBcoast_effref and select Load True Color to
<new>.
15. From the Display #2 menu bar (EFFORT-corrected image), select Tools Link Link Displays.
The Link Displays dialog appears.
16. In the Link Displays dialog, click the Dynamic Overlay toggle button to select Off. Click OK.
17. From the Display #1 menu bar (FLAASH-corrected image), select Tools Profiles Z Profile
(Spectrum). A Spectral Profile window appears.
18. Compare this spectral profile with the EFFORT Gain / Offset Results profile. Did the EFFORT
correction adequately remove artifacts and produce smoother spectra? Are there wavelengths that look
worse? Look especially at the longer wavelengths. Can you think of a way to improve the appearance
of the reflectance spectra at longer wavelengths?
19. Close the EFFORT Gain / Offset Results plot window.
This Santa Barbara scene includes a lot of water, which has very little reflectance at longer wavelengths.
When EFFORT calculates gains and offsets, the low signal there causes spurious features and the
reflectance spectra are not as smooth as they should be. You can improve the results by calculating
EFFORT gains and offsets just over land and applying them to the spatial and spectral data.
ENVI Resourse
Chapter 1: Data Preprocessing
Spectral Analysis With ENVI 19
20. Start EFFORT again by selecting Spectral EFFORT Polishing from the ENVI main menu bar.
The Select EFFORT Input File dialog appears.
21. Select SBcoast_ref, then click Spatial Subset. The Select Spatial Subset dialog appears.
22. Click Image. The Subset by Image dialog appears.
23. Change the Samples and Lines values to resize the box so it covers as much land and as little water as
possible. The following figure shows an example:
Figure 3: Subsetting the image to include land only
24. Click OK three times.
25. The EFFORT Input Parameters dialog should retain the parameters you entered earlier. However, this
time, be sure to set the Apply Results ? toggle button to No.
26. Click OK. When processing is complete, an EFFORT Gain / Offset Results plot window appears.
Next, you will use Spectral Math to apply the EFFORT results to the FLAASH-corrected data.
Chapter 1:
20 Spectral Analysis With ENVI
27. From the ENVI main menu bar, select Basic Tools Spectral Math. The Spectral Math dialog
appears.
28. In the Enter an expression field, type the following: fix((s1*s2)+s3)
If you press Enter on your keyboard, you will not see an error message if you correctly typed the
expression.
29. Click OK. The Variables to Spectra Pairings dialog appears. The Available Spectra list shows the
names of spectral profile windows that are currently open.
30. First, associate the S1 variable to the input data. Highlight S1, then click Map Variable to Input File.
The Spectra Math Input File dialog appears. Select SBcoast_ref and click OK.
31. Highlight S2, then highlight Gain in the Available Spectra list.
32. Highlight S3, then highlight Offset in the Available Spectra list.
33. Enter an output filename of SBcoast_effref. (You will overwrite the file you created in Step 11.)
34. Click OK. The resulting image is added to the Available Bands List.
35. Load SBcoast_effref to a new display group, and evaluate the results by looking at spectra of
various ground cover materials. Did the results improve?
36. Close all display groups and plot windows.
Chapter Review ENVI has several algorithms for atmospheric correction, including Empirical Line, Flat Field,
Internal Average Reflectance, and Dark Subtraction.
ENVI provides a model-based, atmospheric correction module called FLAASH.
ENVI provides an EFFORT Polishing tool that removes artifacts of the radiance-to-reflectance
conversion.
Chapter 2:
Principal Components Analysis
What You Will Learn In This Chapter ................................................................................. Introduction ........................................................................................................................ Chapter Review .................................................................................................................
Chapter 2:
22 Spectral Analysis With ENVI
What You Will Learn In This Chapter In this chapter, you will learn the following:
The concept of principal components analysis (PCA)
Why PC transforms are used in remote sensing
How to perform a PC transform on Landsat TM data and evaluate the results
Introduction
Principal components analysis (PCA) is used in many branches of science, particularly for
analyzing data with many dimensions. This analysis is useful for enhancing information content,
segregating signal from noise, and reducing the dimensionality of data sets.
PCA is a mathematical technique that transforms a multivariate data set into a new coordinate
system. The axes, or principal components (PCs), of the new coordinate system are specific linear
combinations of the original variables. More importantly, the axes are uncorrelated. The first PC is
in the direction of the greatest variance in the dataset, the second PC is in the direction of the
second greatest variance in the data set, and so forth.
PCs of a multivariate data set are computed from the eigenvectors and eigenvalues of the
covariance matrix. An image is calculated for each PC. Because the PC rotation maximizes the
variance in the first few PC bands, these bands usually contain most of the coherent image
information and can be used to isolate features in the data. Often, higher-order PC images contain
only noise, and therefore, can be ignored.
Exercise #1: Principal Components Rotation This exercise uses Landsat-7 Enhanced Thematic Mapper (ETM) data from the Salton Sea area of
California.
1. From the ENVI main menu bar, select File Open Image File. The Enter Data Filenames
dialog appears.
2. Navigate to envihyper\Landsat and select Salton_TM.dat. Click Open.
3. In the Available Bands List, select one band and click Load Band.
4. From the ENVI Toolbox menu bar, write Forward PC Rotation and selec
Compute New Statistics and Rotate. A Principal Components Input File dialog appears.
5. Select Salton_TM.dat and click OK. The Forward PC Rotation Parameters dialog appears
(Figure 4).
6. You will generate statistics from the data and save them to a file. In the Output Stats
Filename field, enter salton.sta.
Note: Using existing statistics saves a lot of time when running the PCA. To calculate
statistics on an image before running the PCA, select Statistics Compute Statistics
from the ENVI main menu bar.
7. In the Enter Output Filename field, enter salton_pca.dat.
ENVI Resourse
Chapter 2: Principal Components Analysis
Spectral Analysis With ENVI 23
8. Leave the default values for all other fields. Click OK. When processing is complete, a PC
Eigenvalues plot appears (Figure 5).
Figure 4: Forward PC Rotation Parameters
Chapter 2:
24 Spectral Analysis With ENVI
Figure 5: Plot of Eigenvalues vs. PC Band
9. In the PC Eigenvalues plot, you can see that the first two to three components of the PCA
contain nearly all of the variance in the scene. In fact, the first PC alone accounts for nearly
90% of the variance. From this eigenvalue plot, you would expect that the last PC band does
not contain much signal.
10. In the Available Bands List, load an RGB composite of the first three PC bands in
salton_pca.dat into Display #1.
11. Images of the first three PC bands are sharp and spatially coherent, while the last three PC
bands primarily contain noise, making features difficult to find. The signal from the original
six-band TM data set could be compressed into just three PC bands that account for 98.8% of
the variance in the original data.
12. Load an RGB composite of the first three bands of Salton_TM.dat (the original image) into
Display #2.
Do you see some features more clearly in one image versus the other? What might account
for this difference?
Exercise #2: Viewing Statistics Used in a PCA
1. From the ENVI toolbox main menu bar, writes Statistics and selec View Statistics File.
An Enter Statistics Filename dialog appears.
2. Navigate to your output directory and select salton.sta. Click Open. A statistics report
dialog appears (Figure 6), showing plot and text information from the statistics file.
3. The plot displays the minimum, maximum, mean, and standard deviation for the original image
bands. Click Select Plot to view the standard deviation or eigenvalue plot.
ENVI Resourse
Chapter 2: Principal Components Analysis
Spectral Analysis With ENVI 25
4. The lower half of the dialog contains text statistics: mean, maximum, minimum, standard
deviation, correlation and covariance matrices, and the eigenvalues and eigenvectors for the
covariance matrix. Note that you can generate images of the covariance, correlation and
eigenvector matrices by selecting File Save Current Covariance to Image from the
statistics report dialog menu bar.
5. Examine the statistics report and plots, and the image of the covariance matrix. Of particular
interest after a PC transformation are the eigenvalues and eigenvectors of the covariance
matrix. The eigenvectors correspond to the PC axes and show the relative contributions of the
different original image bands to the final PC bands. The eigenvalues indicate the amount of
variance described by each PC band.
6. When you are finished examining the PC images and statistics, close all displays and plot
windows.
Figure 6: The Statistics Report Dialog
Chapter 2:
26 Spectral Analysis With ENVI
Chapter Review PCA helps segregate image information from noise.
The higher-numbered PC bands contain mostly noise. So, the dimensionality of the PC-
transformed data is reduced as you consider only the lower-numbered PC bands.
Because the PC axes are orthogonal, the PC bands do not contain redundant information
(they vary independently). Thus, the information content increases in an RGB composite of
the PC bands.
Chapter 3:
Examining Spectra and Using Spectral Libraries
What You Will Learn In This Chapter ................................................................................. Data Exploration ................................................................................................................ Working with Spectral Libraries in ENVI ............................................................................ Chapter Review .................................................................................................................
Chapter 3:
28 Spectral Analysis With ENVI
What You Will Learn In This Chapter
In this chapter you will:
Extract and examine spectral profiles from hyperspectral data
Collect unique spectra in the same plot window for comparison
Learn how and why to use spectral libraries
Compare data-derived spectra to known library spectra
Data Exploration
This section of the course introduces you to ENVI’s spectral analysis tools. While many of these
tools were originally designed for use with hyperspectral data, they often work quite well for
multispectral data. See ENVI Help for full documentation on spectral analysis tools.
Manual data exploration techniques such as extracting and collecting image spectra, or comparing
image spectra to known references, are important steps in image interpretation and information
extraction. ENVI provides a suite of tools specially designed to help work with image and library
spectra.
While learning about spectral analysis tools in the following exercises, you will often see the term
endmembers. These are spectrally unique materials that make up a scene. With each similarity
classifier, you can use endmembers identified from the spectra of pure pixels or from field or
laboratory spectra. ENVI provides several unique tools designed to help define accurate
endmember spectra from images. The following exercises use pure-pixel and field/laboratory
spectra as endmember spectra.
Exercise Data
Two separate data sets are provided in the following exercises. You can use one or the other,
depending on your intended application.
If you are primarily interested in geologic/mineral applictions, use the file cup95_at.int
(located in envihyper\cup95av). This file contains Airborne Visible/Infrared Imaging
Spectrometer (AVIRIS) data from Cuprite, Nevada, USA, collected in 1995 and spectrally
subsetted to 50 channels from 2.0-2.4 μm. Also use the JPL Mineral Spectral Library, which has
approximately 300 mineral spectra measured over a wavelength range from 0.4 μm to 2.5 μm in
826 bands.
If you are primarily interested in vegetation studies, use the file dupont_rad.env (located in
envihyper\aisa\dupont). This file contains data collected by 3Di Technologies, Inc. for the
area of Dupont Experimental Farms agricultural research center near Chestertown, Maryland.
These data were acquired in August 1998 using the Airborne Imaging Spectrometer (AISA)
ENVI Resourse
Chapter 3: Examining Spectra and Using Spectral Libraries
Spectral Analysis With ENVI 29
instrument, which is a commercial hyperspectral pushbroom sensor that collected data from 0.43
μm to 0.90 μm in 34 spectral bands. Pixel size is 2.0 m.
In each exercise, options for Cuprite data are provided first, followed by the Dupont data options.
For simplicity, the figures refer to Cuprite data.
Exercise #1: Spectral and Spatial Profile Extraction
Open and Display Image Data
1. From the ENVI Classic main menu bar, select File Open Image File. Navigate to the
following directory, and select a file:
Cuprite data (geology): envihyper\cup95av\cup95_at.int
Or,
Dupont data (vegetation): envihyper\aisa\dupont\dupont_rad.env
Click Open.
2. From the Available Bands List, click RGB Color and display the following bands as R, G,
B, respectively, to display a false-color composite:
Cuprite data: 183, 193, and 207
Or,
Dupont data: 34, 21, and 9
Click Load RGB.
ENVI can extract horizontal, vertical, arbitrary, and spectral profiles from any multispectral
image display. With spectral profile extraction, the information is extracted from the whole file,
not just the bands displayed on the screen. In other words, if a file has all 224 bands of AVIRIS
data and you extract a spectral profile from a gray scale image of this file, the spectral plot
shows the values for that pixel in all 224 channels.
3. From the Display group menu bar, select Tools Profiles Z Profile (Spectrum). A
Spectral Profile window appears.
4. Move the Zoom box around the Image window. Notice how the Spectral Profile window
automatically updates to show the spectra of the pixel highlighted by the crosshairs in the
Zoom window. The Spectral Profile window shows the selected pixel’s value for every
channel of data in this file. If you click outside of the Zoom box and drag it around the
Image window, the Zoom box follows the cursor, and the Spectral Profile plot window
updates continuously as the cursor moves.
5. Examine the Spectral Profile window. The red, green, and blue lines indicate the positions
of the currently displayed bands in the Image window (see Figure 7).
6. Right-click in the Spectral Profile plot window, and select Plot Key. This displays a key on
the right side of the plot window (see Figure 7).
Chapter 3:
30 Spectral Analysis With ENVI
7. To zoom to a specific wavelength range, drag the middle mouse button to create a box that
encloses the zoom area. To reset the original zoom range, click the middle mouse button
inside the plot window.
8. Click the left mouse button inside the plot window to display the y data value at a particular
x position.
Visually Comparing Spectra
In ENVI, you can visually compare spectra derived from image data to those collected in the field
or laboratory. This allows you to quickly compare image spectra to that of known materials.
Absorption and reflectance features are easy to compare when the spectra are plotted in the same
window.
1. From the Display group menu bar, select Tools Pixel Locator. In the Pixel Locator dialog,
enter the following pixel coordinates:
Cuprite data: (304, 602). This is an area of purple pixels in the Cuprite scene.
Dupont data: (526, 577). This is an area of green pixels in the Dupont scene.
Click Apply. The Spectral Profile plot window updates to the new location.
2. From the Spectral Profile menu bar, select Edit Data Parameters. The Data Parameters
dialog appears.
3. Enter the following in the Name field:
Cuprite data: Image-Purple
Dupont data: Image-Green
4. Right-click the Color box, select Items 1:20, and select one of the following:
Cuprite data: Orchid
Dupont data: Green
5. Click Apply, then Cancel in the Data Parameters dialog. You can resize the plot window any
time by dragging one of its corners to a new size.
Figure 7: Spectral profile of purple area in Cuprite scene
ENVI Resourse
Chapter 3: Examining Spectra and Using Spectral Libraries
Spectral Analysis With ENVI 31
6. Copy the spectral profile to a new plot window by selecting Options New Window: with
Plots from the Spectral Profile menu bar. An ENVI Plot Window appears.
7. In the Pixel Locator dialog, enter the following pixel coordinates and click Apply:
Cuprite data: (502, 586). This is an area of red pixels in the Cuprite scene.
Dupont data: (276, 2114). This is an area of red pixels in the Dupont scene.
8. From the Spectral Profile menu bar, select Edit Data Parameters.
9. In the Data Parameters dialog, enter Image-Red in the Name field (for both Cuprite and
Dupont data).
10. Right-click the Color box, select Items 1:20, and select Red (for both Cuprite and Dupont
data).
11. Click Apply, then Cancel in the Data Parameters dialog.
Figure 8: Spectral profile of red area in Cuprite scene
12. You can move spectral signatures between plot windows using drag-drop functionality with
plot legend names. In the #1 Spectral Profile dialog, use your left mouse button to click on the
plot key name, and then drag it to the Spectral Profile dialog and drop it. You should now see
two signatures in the Spectral Profile dialog.
13. Keep the Spectral Profile dialog open. You will compare these unknown spectra to those of
known materials in the next section. Close the Pixel Locator dialog.
Working with Spectral Libraries
You can use libraries of field or laboratory spectral signatures to visually and analytically identify
characteristics in an image. ENVI includes several public-domain spectral libraries and tools to
work with them. ENVI provides spectral libraries developed at the Jet Propulsion Laboratory (JPL)
for three different grain sizes of approximately 160 “pure” minerals from 0.4 μm to 2.5 μm. ENVI
also provides public-domain U.S. Geological Survey (USGS) spectral libraries with nearly 500
Chapter 3:
32 Spectral Analysis With ENVI
spectra of well-characterized minerals and a few vegetation spectra, from a range of 0.4 μm to 2.5
μm. ENVI spectral libraries are stored in ENVI’s image format, with each line of the image
corresponding to an individual spectrum and each sample of the image corresponding to an
individual spectral measurement at a specific wavelength (see “ENVI Spectral Library Files” in
ENVI Help for more information).
Exercise #2: Open and Display a Spectral Library
1. From the ENVI main menu bar, select Spectral Spectral Libraries Spectral Library
Viewer. The Spectral Library Input File dialog appears.
2. Click Open Spectral Library.
3. Navigate to the following directory, and select a file:
Cuprite data (JPL spectra): envihyper\speclib\jpl1sli.dat
Or,
Dupont data (AISA spectra): envihyper\speclib\dupont.sli
Click Open.
4. In the Spectral Library Input File dialog, select jpl1sli.dat (or dupont.sli), and click
OK. The Spectral Library Viewer dialog appears with a list of spectra.
Figure 9: JPL Spectral Library
ENVI Resourse
Chapter 3: Examining Spectra and Using Spectral Libraries
Spectral Analysis With ENVI 33
5. To visually compare these laboratory spectra with the unknown spectra from the image data,
you need to scale the laboratory spectra. From the Spectral Library Viewer dialog menu bar,
select Options Edit (x, y) Scale Factors. An Edit Display Scales dialog appears.
If you are using the Cuprite data, enter 400 in the Y Data Multiplier field. Leave the X
Multiplier field as 1.00000. Click OK. You can now view reflectance and absorption
features of the library spectra in the same y range as the spectral plots of the image data.
If you are using the Dupont data, you must specify both X and Y multipliers with the
AISA spectra. Enter 1000 in the X Data Multiplier field, and enter 6580 in the Y Data
Multiplier field. Click OK.
6. In the Spectral Library Viewer dialog, click any spectrum name. A new Spectral Library Plots
window appears.
7. Click the right mouse button in the Spectral Library Plots window and select Plot Key. This
displays a key on the right side of the plot window.
8. To zoom to a specific wavelength range, drag the middle mouse button to create a box that
encloses the zoom area. To reset the original zoom range, click the middle mouse button inside
the plot window. Note the differences in absorption and reflectance features of different
spectra. This particular spectral library spans 0.4 μm to 2.5 μm.
9. From the Spectral Library Plots menu bar, select Options Clear Plot.
If you are using Cuprite data, plot the JPL library spectra for the minerals Alunite SO-
4A, Calcite C-3D, Chabazite TS-15A, Illite PS-11A, and Kaolinite Well Ordered
PS-1A.
If you are using Dupont data, scroll to the end of the AISA library spectra and plot
grass.spc, drygrass.spc, maplelea.spc, and cheatgra.spc. Scroll to the middle of the
spectra list, and plot Ferruginous Sandstone.
You will use some of these spectra in an upcoming SAM classification exercise.
Figure 10: JPL library spectra for five minerals
Chapter 3:
34 Spectral Analysis With ENVI
10. At this point, you may have a cluttered desktop with many different ENVI windows open.
Minimize the display group windows, the Spectral Library Viewer dialog, and the Available
Bands List. Then, arrange the three plot windows so they are all visible.
11. From the Spectral Library Plots window:
Cuprite data: drag and drop the Alunite SO-4A label to the ENVI Plot Window
containing the Image-Purple unknown spectrum that was extracted from the AVIRIS
image. If you successfully drag and drop the spectrum, the cursor will look like the plot
in Figure 11.
Dupont data: drag the Ferruginous Sandstone label to the ENVI Plot Window
containing the Image-Green unknown spectrum.
Figure 11: Comparing image spectra to library spectra (alunite)
Does the library spectrum look much like the unknown spectrum?
If you are dragging and dropping a spectrum into a plot window and the cursor label
disappears when the cursor is inside this plot window, there may be multiple plot windows
stacked on top of each other. ENVI automatically copies the spectrum into the top plot
window if that one was opened last; otherwise, it drops it into the bottom-most plot
window. As a workaround, either move the plot window that is receiving the spectrum so
that there are no plot windows beneath it, or find an area in the receiving plot window
where the cursor label returns before dropping it.
12. Repeat the previous step as follows:
Cuprite data: drag and drop the Kaolinite label to the Spectral Profile window
containing the Image-Red unknown spectrum.
Dupont data: drag and drop the grass.spc label to the Spectral Profile window
containing the Image-Red unknown spectrum.
ENVI Resourse
Chapter 3: Examining Spectra and Using Spectral Libraries
Spectral Analysis With ENVI 35
The color of the image pixels in the RGB composite corresponds to the relative magnitude
of the reflectance of the three bands chosen for display. Thus, the other brown pixels in the
Cuprite scene may also have kaolinite features, and the other red pixels in the Dupont scene
may also have vegetation features.
Figure 12: Comparing image spectra to library spectra (kaolinite)
In the next chapter, you will use the unknown reference spectra again. In the following steps,
you will include the two spectra in the same Spectral Profile window and rename them based
on their similarity to the library spectra.
13. In the Spectral Profile window:
Cuprite data: right-click the Kaolinite label, and select Remove "Kaolinite…"
Dupont data: right-click the grass.spc label, and select Remove "grass.spc…"
14. Perform the following step:
Cuprite data: drag the Image-Purple label from the ENVI Plot Window to the Spectral
Profile window. From the Spectral Profile menu bar, select Edit Data Parameters.
In the Data Parameters dialog, select Image-Purple and change its Name to alunite.
Select Image-Red and change its Name to kaolinite. Your plot should look like Figure
13.
Dupont data: drag the Image-Green label from the ENVI Plot Window to the Spectral
Profile window. From the Spectral Profile menu bar, select Edit Data Parameters.
In the Data Parameters dialog, select Image-Green and change its Name to Fe ss.
Select Image-Red and change its Name to grass.
Click Apply, then Cancel in the Data Parameters dialog.
Chapter 3:
36 Spectral Analysis With ENVI
Figure 13: Image spectra
15. From the Spectral Profile menu bar, select File Save Plot As ASCII. The Output Plots to
ASCII File dialog appears.
16. Select both spectra, and enter an output filename of Cuprite_spectra.txt (or
Dupont_spectra.txt). Click OK.
17. Keep the Spectral Profile window and Spectral Library Viewer dialog open for the next
chapter. Close the ENVI Plot Window and Spectral Library Plots window.
Creating Your Own Spectral Libraries
Although ENVI includes several laboratory spectral libraries, you may want to create your own
library of field or laboratory spectra. These behave just like the spectral libraries included in
ENVI; once you build a spectral library, you can use the Spectral Library Viewer and plot windows
with the new library.
From the ENVI main menu bar, select Spectral Spectral Libraries Spectral Library
Builder. You can import libraries from ASCII files, other spectral libraries, ROI means, spectral
profiles, and plots. You can also create spectral library files outside of ENVI as long as the binary
file has the correct format.
Chapter Review Z Profiles are used to show the spectrum of an individual pixel.
Spectral libraries are an efficient way to catalog image, field, or laboratory spectra for
comparison with spectra from various sources.
Individual spectra can be plotted, saved, color-coded, and stacked for easy identification
and comparison.
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 37
Chapter 4:
Whole Pixel Analysis Techniques
What You Will Learn In This Chapter ................................................................................. Introduction ........................................................................................................................ Spectral Angle Mapper (SAM) Classification ..................................................................... Matching Image Spectra to Reference Spectra ................................................................. Chapter Review .................................................................................................................
Chapter 4:
38 Spectral Analysis With ENVI
What You Will Learn In This Chapter In this chapter you will:
Use the Spectral Angle Mapper (SAM) classifier
Evaluate classification results using Rule images
Examine continuum-removed spectra
Map the presence of specific minerals with Spectral Feature Fitting (SFF)
Introduction A wide variety of methods have been developed to help identify ground cover types in remote
sensing imagery. Multispectral techniques such as supervised classification produce a thematic
map of the input image by measuring the similarity of image spectra to known references. Results
from methods such as this are typically interpreted as whole pixel identification techniques because
they attempt to answer the question, “Is a given material present in this image pixel?” In addition to
the common classification algorithms, ENVI provides two additional whole pixel identification
techniques that are specially suited to hyperspectral imagery. These two techniques -- Spectral
Angle Mapper and Spectral Feature Fitting -- are based on entirely different principles and can
provide independent analyses of the same scene. Each is explored in detail in this chapter.
Exercise Data
You will use the same data sets as the previous chapter. In each exercise, options for Cuprite data
are provided first, followed by the Dupont data options. For simplicity, the figures refer to the
Cuprite data.
Spectral Angle Mapper (SAM) Classification
Spectral Angle Mapper (SAM) is an automated method for comparing image spectra to library
spectra. For the SAM classification to be effective, you need to convert the image data to apparent
reflectance, so that the data units are the same as the library units. The SAM algorithm determines
the similarity between two spectra by calculating the spectral angle between them, treating them as
unit vectors in spectral space with dimensionality equal to the number of bands.
The simplest way to understand this classifier is to consider a hypothetical image pixel spectrum
from a two-band image and a library spectrum. The two spectra can be represented in a 2D scatter
plot as two points (Figure 14). A vector from the origin through each point describes the position of
each respective spectrum under all possible illumination conditions.
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 39
Figure 14: Spectral Angle Mapper classifier
The “color” of the material is defined by the direction of the unit vectors. SAM uses only the
direction of the vectors and not the vector lengths. For this reason, SAM is insensitive to differing
amounts of illumination.
The SAM classifier generalizes this geometric interpretation in n-D space, where n is the number
of bands in the image. For each library spectrum selected during the analysis, the n-D spectral
angle (in radians) is determined for every pixel in the input image. A spectral angle image is output
for every library spectrum you select. These spectral angle images are referred to as “rule” images.
The smaller the angle, the more similar the data spectrum is to the library spectrum. When viewing
the resulting SAM rule images, darker pixels indicate that the pixel is spectrally similar to the
corresponding library spectrum.
If you are accustomed to viewing brighter pixels as the closer match, you can inverse the rule
images by selecting Tools Color Mapping Control RGB Image Planes from the Display
group menu bar. The RGB Channels dialog appears. Use the toggle buttons to switch to Inverse.
From the RGB Channels dialog menu bar, select Options Apply to refresh the screen.
SAM also outputs a classified image that assigns each pixel to a class (i.e., to one of the materials
represented by the selected library spectra). The classification chooses the library spectrum that
makes the smallest spectral angle with each pixel in the input image.
Exercise #1: SAM Classification
1. From the ENVI Classic main menu bar, select Spectral Mapping Methods Spectral
Angle Mapper. The Classification Input File dialog appears.
2. Navigate to one of the following directories and select a file:
Cuprite data: envihyper\cup95av\cup95_at.int
Do not click OK yet! Spectrally subset the data by following Steps 3-6.
Chapter 4:
40 Spectral Analysis With ENVI
Dupont data: envihyper\aisa\dupont\dupont_sm_rad.env
No spectral subsetting is necessary. Click OK in the Classification Input File dialog and
proceed to Step 7.
3. (Cuprite data only): In the Classification Input File dialog, click Spectral Subset. A File
Spectral Subset dialog appears.
4. (Cuprite data only): All bands are selected by default. Click Clear.
5. (Cuprite data only): In this step, you will select bands that encompass characteristic absorption
features. Click Band 177 (2.0409 μm), hold down the Shift key on your keyboard, and select
Band 217 (2.4394 μm). Click Add Range, then OK.
6. (Cuprite data only): Click OK in the Classification Input File dialog. The Endmember
Collection:SAM dialog appears.
This dialog is a generic ENVI dialog that is used for all of the classification and mapping
routines that require endmember spectra to be specified. Using the Algorithm menu, you
can apply any classification technique supported by ENVI to the selected image with these
reference spectra, which saves a lot of time when comparing multiple classification
techniques. You can also start the Endmember Collection dialog from the Classification
menu of the ENVI main menu bar.
7. Drag the two spectra labels from the Spectral Profile window into the Endmember
Collection:SAM dialog.
Cuprite data: alunite and kaolinite
Dupont data: Fe ss and grass
Figure 15: Endmember Collection:SAM dialog
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 41
8. Select and plot the following from the Spectral Library Viewer:
Cuprite data: Calcite C-3D, Chabazite TS-15A, and Illite PS-11A
Dupont data: drygrass.spc, maplelea.spc, and cheatgra.spc
(You will be comparing AISA radiance data to reflectance spectra from the spectral
library, which is typically not recommended. However, since you are using a limited
spectral range in this exercise, solar and atmospheric effects should be minimal.)
A Spectral Library Plots window appears with three spectra.
9. Right-click inside the Spectral Library Plots window, and select Plot Key.
Figure 16: JPL library spectra for three minerals
10. (Dupont data only): You need to change the color of the library spectra to ensure that they are
different from the reference/image spectra (which are red and green); otherwise, some SAM
output classes will have the same color. From the Spectral Library Plots menu bar, select Edit
Data Parameters. The Data Parameters dialog appears. Change the colors of the library
spectra so they are different from the reference spectra in the Spectral Profile window. Click
Apply, then Cancel.
11. Drag the library spectra labels into the Endmember Collection:SAM dialog. You should see the
names of all five spectra (see Figure 17). ENVI automatically resamples the library spectra to
the wavelengths of the input data.
12. Confirm the correct spectral range and different class colors by clicking Plot in the Endmember
Collection:SAM dialog.
Chapter 4:
42 Spectral Analysis With ENVI
13. When you are finished examining spectra plots, close all plot windows.
Figure 17: Importing spectra into the Endmember Collection dialog
Dragging spectra to the Endmember Collection dialog is not the only way to gather reference
spectra. From the Import menu, you can gather spectra all at once from a spectral library, an
ASCII file, statistics file, or ROI.
14. Click Apply in the Endmember Collection:SAM dialog. The Spectral Angle Mapper
Parameters dialog appears.
15. Type the following in the Enter Output Filename field:
Cuprite data: cupSAM
Dupont data: dupSAM
16. Type the following in the Enter Output Rule Filename field:
Cuprite data: cupSAMrule
Dupont data: dupSAMrule
17. Keep the default value of 0.10 for Maximum Angle (radians). This angle defines the threshold
used by the SAM classifier. Any image pixel whose SAM angle is larger than the threshold for
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 43
any of the selected library spectra will remain unclassified. Thus, the smaller the maximum
angle, the more stringent the classification becomes.
Note: You can click Preview to assess the classification. After assessing, you can change
the spectral angle to adjust the matching threshold.
18. Keep the default values for the remaining fields. Click OK to start the classification. When
processing is finished, leave the Endmember Collection dialog open. The SAM classification
image and rule images appear in the Available Bands List.
19. In the Available Bands List, right-click on Sam (cup95_at.int) or Sam (dupont_sm_rad.env),
and select Load Band to New Display.
20. From any Display group menu bar, select Tools Link Link Displays. The Link Displays
dialog appears.
21. In this step, you will link the RGB image (which should be already displayed from an earlier
exercise) with the SAM classification image. Click OK in the Link Displays dialog.
22. Click inside either Image window to toggle between the RGB image and SAM classification
image.
The colors of the classification image correspond to the colors of the library spectra shown
in the Endmember Spectra plot you created in Step 12. This plot can be used as a key to the
classification image.
23. From the Display #2 (SAM classification results) menu bar, select Tools Color Mapping
Class Color Mapping. The Class Color Mapping dialog appears, which helps you identify
classification endmembers and their colors in the class image.
Optional: If some classes appear to cover too much area, you can run the SAM classifier
again using different spectral angles for different materials. Click Apply in the Endmember
Collection dialog. When the Spectral Angle Mapper Parameters dialog appears, select
Multiple Values. The Assign Maximum Angle (radians) dialog appears. Change the
spectral angle of various classes. You can quickly judge the new angles by clicking
Preview.
Rule images are extremely important in any interpretation of classified data. For the SAM
classifier, the rule images answer the question, “What is the similarity between the image pixel’s
spectrum and the reference spectra?”
24. In the Available Bands List, right-click the name of the alunite (Cuprite) or Fe ss (Dupont)
Rule image, and select Load Band to Current Display. This should replace the classification
result.
Chapter 4:
44 Spectral Analysis With ENVI
Dark pixels represent smaller spectral angles—spectra that are more similar to the reference
spectra.
25. The two displays should still be linked together. Click in one to see the other. To see Z Profiles
of dark pixels in the rule image, right click in Display #1 and select Z Profile (Spectrum).
Then move the zoom window for the Rule image display to dark areas and check the spectra in
the Spectral Profile plot. The spectra in the darker areas should have absorption features that
match alunite (Cuprite) or Fe ss (Dupont).
26. If you prefer to view the rule image with the brightest pixels representing the most similar
pixels, select Tools Color Mapping ENVI Color Tables from the Display #3 menu bar.
The ENVI Color Tables dialog appears. Reverse the two sliders so that the Stretch Bottom
slider is all the way to the right and the Stretch Top slider is all the way to the left. This is a
good tool to help you define a threshold value for good matches.
27. Leaving the Stretch Top slider all the way to the left, move the Stretch Bottom slider
increasingly to the left. Fewer and fewer pixels are highlighted until only the best matches are
bright.
28. From the Display #3 menu bar, select Tools Cursor Location/Value. Examine the data
values in the Rule image, and determine a threshold below which you think are pixels that
effectively match the reference spectrum. You can optionally select Tools Region of
Interest Band Threshold to ROI to specify this maximum value for an ROI based on this
class.
Are the image-derived spectra Rule images less noisy than the library spectra Rule images?
If so, why? Which of the two types of spectra (image or library) yield the best results?
29. Close all display groups, but leave the Endmember Collection dialog open for Exercise #3.
Matching Image Spectra to Reference Spectra Most methods for hyperspectral analysis measure the similarity between an unknown material and
a reference material, rather than directly identifying a specific material. Nevertheless, techniques
for direct identification of field or laboratory materials by comparison to spectra of known
materials have been available for years. Recently these techniques have been updated so that they
can be used on imaging spectrometer data and field/laboratory spectra. This approach has proven
quite successful for geologic applications in particular.
SFF may be considered the first step towards a knowledge-based system for expert identification of
spectra throughout a data set. SFF is an absorption feature-based method for matching image
spectra to reference spectra. This method requires you to convert the data to reflectance and to
remove the continuum from both the image and reference spectra prior to analysis.
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 45
Continuum Removal
To define a common baseline from which to measure absorption feature depth and position, you
can normalize each spectrum in the input reflectance image by comparing it to a continuum curve.
A continuum curve is a mathematical function formed by fitting a convex hull to the spectrum
(draw a curve that connects the peaks in the spectrum, as in Figure 18). Remove the continuum by
dividing it into the original spectrum. The general shape of the spectrum is removed, leaving the
absorption features.
The continuum-removed image spectra are equal to 1.0, where the continuum and the spectra
match and less than 1.0 where absorption features occur. The continuum-removed data are scaled
so that pixel values are between 0.0 to 1.0. Darker areas have larger absorption features than lighter
areas.
You can use Continuum Removal (to isolate absorption features) with other classifiers that do not
look at the overall shape of the spectrum, such as Spectral Angle Mapper. Linear Spectral
Unmixing and Matched Filtering use the overall shape of the spectrum, and hence, would not be
suitable for a continuum-removed image. If the continuum has been removed from reference
spectra, then the continuum must also be removed from the image-derived spectra. ENVI’s
Spectral Feature Fitting (SFF) routine automatically looks for a continuum-removed library. If
none exists, ENVI will remove the continuum on the fly. For the other classifiers, you must
manually remove the continuum.
Figure 18: Reflectance spectrum (solid line) and its continuum curve (dotted line)
Exercise #2: Comparing Image Spectra to Continuum Removed Spectra Because Continuum Removal is a computationally intensive process, continuum-removed data are
provided here to allow for more time for the exercises. If you wish to run Continuum Removal in
the future, you can access it by selecting Spectral Mapping Methods Continuum Removal
from the ENVI main menu bar.
Chapter 4:
46 Spectral Analysis With ENVI
1. In the Available Bands List, select one of the following and click Load Band:
Cuprite data: Band 193 under cup95_at.int
Dupont data: Band 22 under dupont_sm_rad.env
2. From the ENVI main menu bar, select File Open Image File. The Enter Data Filenames
dialog appears.
3. Navigate to one of the following directories, and select a file:
Cuprite data: envihyper\cup95av\cup95_cr.dat.
Dupont data: envihyper\aisa\dupont\dupont_sm_cr.dat
Click Open. This file contains the continuum-removed version of the data.
4. In the Available Bands List, right-click on one of the following, and select Load Band to New
Display to view the continuum-removed data:
Cuprite data: Band 193 under cup95_cr.dat
Dupont data: Band 22 under dupont_sm_cr.env
5. From a Display group menu bar, select Tools Link Link Displays. The Link Displays
dialog appears.
6. Click the Dynamic Overlay toggle button to select Off. Click OK.
7. From both Display group menu bars, select Tools Profiles Z Profile (Spectrum).
Spectral Profile windows appear for each image.
8. From both Spectral Profile menu bars, select Options and de-select Auto-Scale Y-Axis to turn
it off.
9. From the #1 Spectral Profile menu bar, select Edit Plot Parameters.The Plot Parameters
dialog appears.
10. Click the Y-Axis radio button, and enter Range values of 0 to 500.
11. Click Apply, then Cancel.
12. From the #2 Spectral Profile menu bar, select Edit Plot Parameters. The Plot Parameters
dialog appears.
13. Click the Y-Axis radio button, and enter Range values of 0 to 1.
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 47
14. Click Apply, then Cancel.
15. From any Display group menu bar, select Tools Pixel Locator. The Pixel Locator dialog
appears.
16. Enter one of the following pixel coordinates:
Cuprite data: (500, 580)
Dupont data: (479, 1361)
Click Apply. Notice how continuum removal affects the spectrum. What improvements
would help identify spectral absorption features when the continuum is removed from the
spectra?
Figure 19: Spectrum of pixel (500, 580) in the original reflectance image (top) and continuum-removed
spectrum (bottom)
Chapter 4:
48 Spectral Analysis With ENVI
17. Close all dialogs, Spectral Profile windows, and the display group containing the RGB Image.
Keep open the display group containing the continuum-removed data for the next exercise.
Spectral Feature Fitting (SFF)
SFF is an absorption feature-based method for matching image spectra to reference spectra. To
obtain the best results from the SFF classification, you need to pick the narrowest spectral range
that contains the entire absorption feature. By isolating an absorption feature, you achieve the best
fit with the least error.
SFF requires the following:
The reference spectra must be selected from the image or a spectral library
The continuum must be removed from the image spectra and reference spectra
The reference spectrum must be scaled to match the pixel spectrum.
SFF produces a “scaled” image for each endmember you select, by first subtracting the continuum-
removal spectra from 1.0, thus inverting it and making the continuum zero. SFF then determines a
single multiplicative scale factor that matches the reference spectrum to the pixel spectrum.
Assuming that you selected a reasonable spectral range, a large scale factor indicates a deep
spectral feature, and a small scale factor indicates a weak spectral feature.
The SFF routine then performs a band-by-band, least-squares fit between each reference spectrum
and the pixel spectra, producing a root mean squared (RMS) image for each reference spectrum (or
endmember). The routine then produces a fit image by computing a ratio of the Scale Image to the
RMS Image (Scale/RMS) to show how well each pixel spectrum matches the reference spectrum.
Exercise #3:Spectral Feature Fitting In this exercise, you will produce individual scale and RMS images from the continuum-removed
image used in the previous exercise. Then you will compare Scale and RMS images for different
reference spectra, and you will create fit images using ENVI's Band Ratio tool.
1. From the Display #2 menu bar (containing the continuum-removed data), select Tools
Profiles Z Profile (Spectrum). A Spectral Profile window appears.
You will obtain best results if you narrow the spectral range to include only one important
absorption feature. If the spectral characteristics of the material are unknown, use a Z
Profile to determine the narrowest range. In the following steps, you will narrow the
spectral range to discriminate between alunite and kaolinite (Cuprite scene) or to
discriminate between bare soil and vegetation (Dupont scene) in the continuum-removed
data.
2. From the Display #2 menu bar, select Tools Pixel Locator. The Pixel Locator dialog
appears.
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 49
3. Enter the following pixel coordinates, and click Apply:
Cuprite data: (300, 427). From field studies, alunite is known to occur in this area.
Notice that the main absorption feature from the continuum removed data is between
2.08 μm and 2.25 μm.
Dupont data: (594, 696). This is an area of iron-rich, red-colored soils. The soil
spectrum is relatively flat here.
4. Now enter the following pixel coordinates, and click Apply:
Cuprite data: (502, 586). From field studies, kaolinite is known to occur in this area,
which has a prominent absorption feature around 2.2 μm. The major absorption feature
from the continuum-removed data is also between 2.08 μm and 2.25 μm. This spectral
range is good to use in SFF for discriminating between alunite and kaolinite.
Dupont data: (544, 715). This area contains a lot of vegetation, which has a prominent
absorption feature around 680 nm. The major absorption feature from the continuum-
removed data is also between 540 nm and 750 nm. This spectral range is good to use in
SFF for discriminating between vegetation and soil.
5. Close the display group containing the continuum-removed data.
6. The Endmember Collection:SAM dialog should still be open from Exercise #1. Select the three
library spectra, one at a time, by clicking their number so the entire row is highlighted. Then,
click Delete. You won’t use these in the SFF classification.
Cuprite data: Calcite C-3D, Chabazite TS-15A, Illite PS-11A, and Kaolinite Well
Ordered PS-1A
Dupont data: drygrass.spc, maplelea.spc, and cheatgra.spc
The Endmember Collection:SAM dialog should now just display the image spectra from
Exercise #1:
Chapter 4:
50 Spectral Analysis With ENVI
Figure 20: Endmember Collection dialog showing two image spectra
7. From the Endmember Collection dialog menu bar, select Algorithm Spectral Feature
Fitting.
8. From the Endmember Collection menu bar, select File Change Input File. The Select Input
File dialog appears.
9. Navigate to one of the following directories and select a file, but do not click OK yet!
Cuprite data: envihyper\cup95av\cup95_cr.dat
Dupont data: envihyper\aisa\dupont\dupont_sm_cr.dat
10. In the Select Input File dialog, click Spectral Subset. A File Spectral Subset dialog appears.
11. All bands are selected by default. Click Clear.
12. In this step, you will select bands that encompass characteristic absorption features.
Cuprite data: click Band 181 (2.0810 μm), hold down the Shift key on your keyboard,
and select Band 198 (2.2506 μm). Click Add Range, then OK.
Dupont data: click the band name corresponding to 542.0200 nm, hold down the Shift
key on your keyboard, and select the band name corresponding to 747.1700 nm. Click
Add Range, then OK.
13. Click OK in the Select Input File dialog.
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 51
14. In the Endmember Collection dialog, click Plot. The Endmember Collection Spectra plot
window appears, which provides a check of the spectral range that will be used.
Figure 21: Plot of image spectra
15. In the Endmember Collection dialog, click Apply to begin the SFF classification. The Spectral
Feature Fitting Parameters dialog appears.
16. The toggle button is set by default to Output separate Scale and RMS Images, which is the
option you want for this exercise. With this option, ENVI creates a Scale and RMS image for
each endmember.
If you clicked the toggle button to select Output combined (Scale / RMS) Images, ENVI
would create a Fit image for each endmember. In most cases, a Fit image is very useful.
However, to understand how the SFF classifier works, you will examine Scale and RMS
images separately in this exercise, then calculate a Fit image from them.
17. Enter the following output filename:
Cuprite data: cupsff.dat
Dupont data: dupontsff.dat
18. Click OK. When processing is complete, the Scale and RMS images for each endmember
appear in the Available Bands List.
19. In the Available Bands List, select the following image and click Load Band:
Chapter 4:
52 Spectral Analysis With ENVI
Cuprite data: Scale (kaolinite)
Dupont data: Scale (grass)
20. In the Available Bands List, right-click on the following image and select Load Band to New
Display:
Cuprite data: Scale (alunite)
Dupont data: Scale (Fe ss)
21. Examine the data values in both Scale images, using the Cursor Location/Value tool. High
pixel values in the Scale images indicate absorption features with depths that are similar to the
features in the library spectra.
22. Close both display groups.
23. In the Available Bands List, select the following image and click Load Band:
Cuprite data: RMS (kaolinite)
Dupont data: RMS (grass)
24. In the Available Bands List, right-click on the following image and select Load Band to New
Display:
Cuprite data: RMS (alunite)
Dupont data: RMS (Fe ss)
25. Examine the RMS images for each endmember. These images should show some real
differences. Low RMS error values correspond to areas where the pixel spectra have shapes
similar to that of the endmember spectra.
Areas with low RMS error and high Scale values have good spectral fits. Because the fit is
a function of two different images, the 2D Scatter Plot tool will be useful for finding
regions where the spectral fit is good.
26. From the display group menu bar containing the RMS image for kaolinite (Cuprite) or grass
(Dupont), select Tools 2D Scatter Plots. The Scatter Plot Band Choice dialog appears.
27. Under the Choose Band X column, select the RMS image for kaolinite (Cuprite) or grass
(Dupont).
28. Under the Choose Band Y column, select the Scale image for kaolinite (Cuprite) or grass
(Dupont).
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 53
Figure 22: Scatter Plot Band Choice dialog
29. Click OK. The 2D Scatter Plot window appears.
30. In the 2D Scatter Plot window, draw a polygon around an area where the RMS error is small
and the scale factor is high. Right-click to close the polygon:
Chapter 4:
54 Spectral Analysis With ENVI
Figure 23: Area with a small RMS value and high Scale value
The areas in the image corresponding to the pixels circled in the scatter plot are now
highlighted. These are the areas with good spectral fit to the chosen absorption feature in the
endmember spectrum.
31. Repeat this technique with the alunite (Cuprite) or Fe ss (Dupont) Scale and RMS images. Do
these results compare favorably with the SAM results?
32. Close both display groups.
Exercise #4: Creating Fit Images There are several ways to create SFF Fit images. In this exercise, you will use the Band Ratio tool.
1. From the ENVI main menu bar, select Transform Band Ratios. The Band Ratio Input
Bands dialog appears.
2. Select the following:
Cuprite data: Scale (alunite)
Dupont data: Scale (Fe ss)
This band name appears in the Numerator field.
3. Select the following:
Cuprite data: RMS (alunite)
ENVI Resourse
Chapter 4: Whole Pixel Analysis Techniques
Spectral Analysis With ENVI 55
Dupont data: RMS (Fe ss)
This band name appears in the Denominator field.
4. Click Enter Pair to set this ratio.
5. Repeat Steps 2-4 for kaolinite (Cuprite data) or grass (Dupont data). The Band Ratio Input
Bands dialog should appear as follows:
Figure 24: Band Ratio Input Bands dialog
6. Click OK. The Band Ratios Parameters dialog appears.
7. Enter an output filename:
Cuprite data: cup_ak.fit
Dupont data: dup_ak.fit
Chapter 4:
56 Spectral Analysis With ENVI
8. Click OK. When processing is complete, the Fit images appear in the Available Bands List
with band names that begin with "Ratio."
9. Display the kaolinite (Cuprite) or grass (Dupont) Fit image as a gray scale image, and examine
its data values. In a Fit image, bright pixels represent the best fit to the reference endmember
spectrum of kaolinite (or grass).
10. Display the SAM classification image (cupSAM or dupSAM) from Exercise #1 in a new
display group.
11. Link the two display groups, and find areas that the SAM classifier identified as kaolinite (or
grass). Does the corresponding Fit image show good correlation to those areas?
12. Use the Cursor/Location Value tool to explore the data values of the Fit image. You should see
that bright pixels in the Fit image have data values of 30 and higher for kaolinite in the Cuprite
scene (or 10 and higher for grass in the Dupont scene). Therefore, a fit value above 30 (or 10)
indicates that a pixel spectrum matches the kaolinite (or chlorophyll) feature well.
To isolate possible kaolinite (or healthy, green vegetation in the Dupont scene) from this Fit
image, you can generate a classification image that identifies pixels either as kaolinite (or
vegetation) or unclassified. Make your own rule that classifies any pixel with a Fit value
above 30 (or 10) as kaolinite (or healthy, green vegetation). Then, apply this rule to the Fit
image.
13. From the ENVI main menu bar, select Classification Post Classification Rule
Classifier. The Rule Image Classifier dialog appears.
14. Navigate to your output directory, and select cup_ak.fit (Cuprite) or dup_ak.fit
(Dupont). Click OK. The Rule Image Classifier Tool dialog appears.
15. Uncheck the box next to alunite (or Fe ss), keeping only the kaolinite (or grass) band On.
16. Enter a Thresh value of 30 (or 10 for the Dupont scene) next to kaolinite (or grass).
17. Click Quick Apply.
ENVI Resourse
Spectral Analysis With ENVI 57
Figure 25: Rule Image Classifier Tool dialog
A new display group appears with the thresholded Fit image. Compare this image to the
SAM classification image. What is the difference between the two classifiers, as far as
kaolinite (or grass) is concerned?
18. Now experiment with the Rule Classifier for alunite (Cuprite) or Fe ss (Dupont).
19. When you are finished, close all files.
Chapter Review At this point, you should feel comfortable:
Extracting a Z Profile from an image.
Creating new plot windows (blank and with plot data)
Copying spectra between plot windows using a drag-and-drop technique
Modifying plots to change colors, data ranges, etc.
Using SAM and SFF classifiers to help identify materials in an image based on
knowledge about absorption features.
Chapter 5:
Identifying Data Endmembers
What You Will Learn In This Chapter ................................................................................. Introduction ........................................................................................................................ Minimum Noise Fraction (MNF) ......................................................................................... Pixel Purity Index (PPI) ...................................................................................................... n-D Visualizer .................................................................................................................... Spectral Analyst ................................................................................................................. Chapter Review .................................................................................................................
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 59
What You Will Learn In This Chapter In this chapter you will:
Examine the linear unmixing model for subpixel analysis
Follow a standard processing path to identify endmembers in a hyperspectral image
Determine the dimensionality of a hyperspectral data set using an MNF transform
Identify the purest pixels in an image using the PPI tool
Select image endmembers using the n-D Visualizer
Use the Spectral Analyst tool to help identify unknown endmember materials
Introduction
Endmembers, Mixed Pixels, and Sub-Pixel Analysis
Spectral mixing occurs when materials with different spectral properties exist within a single image
pixel. Because surfaces rarely contain large areas composed of a single material, spectral mixing
(or mixed pixels) is a common occurrence. In many cases, you can use a Linear Spectral Unmixing
model to calculate the abundance of individual materials within the mixed pixels, a method known
as sub-pixel analysis. ENVI’s Linear Spectral Unmixing technique models the observed
(measured) image spectra as linear combinations of a set of endmember spectra, weighted by their
fractional abundances.
Endmembers are defined as materials that are spectrally unique in the wavelength bands used to
measure the image that is, endmember spectra cannot be reconstructed as a linear combination of
other image spectra. This type of sub-pixel analysis is extremely useful for many applications.
Finding Endmembers
Linear Spectral Unmixing is only valid when all endmembers are identified and used in the model.
Unfortunately, correctly identifying all of the endmembers in a hyperspectral image can be a
difficult task, particularly as the quality of hyperspectral sensors continues to improve and signal-
to-noise ratios increase. To aid in the identification process, ENVI provides a special suite of tools
which, together comprise a recommended processing path for hyperspectral data analysis. The
tools included in this processing path are the Minimum Noise Fraction (MNF), Pixel Purity Index
(PPI), and n-D Visualizer, each of which are explored in detail in this chapter.
MNF helps to determine the true or inherent dimensionality of the data (reducing the number of
bands) by separating information from noise. PPI identifies pixels that are spectrally the most pure
in the scene (meaning that they are mostly composed of one material). The n-D Visualizer is used
to separate the purest pixels into a set of endmembers.
Chapter 5:
60 Spectral Analysis With ENVI
Review of the Linear Unmixing Model
This is a single pixel with three materials: A, B and C.
Material A covers 25% of the pixel.
Material B covers 25% of the pixel.
Material C covers 50% of the pixel.
Each endmember has a unique spectrum. In a linear mixing model, the mixed pixel spectrum is a
weighted average: Mixture = 0.25 * A + 0.25 * B + 0.5 * C.
Linear Spectral Unmixing returns a separate image for each defined endmember. The resulting
images report the percentage of different endmembers in each pixel.
In the following exercises, you will identify endmembers from pure pixels in the image, and use
them in the unmixing or other routines.
The process to identify endmembers from imagery is:
Separate noise from information and reduce the data set to its true dimensionality by
applying an MNF transform
Determine spectrally pure (extreme) pixels using the PPI routine on the MNF results
Create an ROI from the purest pixels
Use the n-D Visualizer to separate the purest pixels into different endmembers.
Minimum Noise Fraction (MNF) MNF is used to:
Decorrelate the data
Separate noise from information (signal)
Determine the inherent dimensionality of image data.
The MNF transform implemented in ENVI is a linear transformation that consists of the following
separate PC rotations:
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 61
The first rotation uses the principal components of the noise covariance matrix to
decorrelate and rescale the noise in the data (a process known as noise whitening), resulting
in transformed data where the noise has unit variance and no band-to-band correlations.
The second rotation uses the principal components derived from the original image data
after they have been noise-whitened by the first rotation and rescaled by the noise standard
deviation. Since further spectral processing will occur, the inherent dimensionality of the
data is determined by examining the final eigenvalues and the associated images. You can
divide the data space into two parts: one part associated with large eigenvalues and coherent
eigenimages, and a complementary part with near-unity eigenvalues and noise-dominated
images. Using only the coherent portions separates the noise from the data, thus improving
spectral processing results.
You can also use the MNF transform to remove noise from data by performing a forward
transform, determining which bands contain the coherent images (by examining the images and
eigenvalues), and running an inverse MNF transform using a spectral subset to include only the
good bands, or smoothing the noisy bands before the inverse.
MNF bands with high variance have high eigenvalues and contain unique, spatially coherent
information. Conversely, MNF bands with low eigenvalues (especially those near unity) may be
discarded because they will not contain significant amounts of information that can be
distinguished from noise. However, rare materials that may be of inerest could be found in MNF
bands with low eigenvalues. Therefore the goal of the data analysis should be considered before
MNF bands are discarded. The inherent dimensionality of the data is determined by examination of
the eigenvalues as will be shown in the upcoming exercise. In subsequent processing only the MNF
bands with eigenvalues greater than one will be used.
Exercise #1: Minimum Noise Fraction (MNF)
Opening and Displaying Image Data
1. From the ENVI Classic main menu bar, select File Open Image File. The Enter Data
Filenames dialog appears.
2. Navigate to the following directory, and select a file:
Cuprite data (geology): envihyper\cup95av\cup95_at.int
Dupont data (vegetation): envihyper\aisa\dupont\dupont_sm_rad.env
Click Open.
3. In the Available Bands List, select Band 193 (or Band 22 for Dupont data), and click Load
Band.
Estimating Noise Statistics
In this step, you will calculate a forward MNF transform to estimate the noise statistics used in the
first PC rotation. Noise information can be acquired from several sources: dark statistics from the
Chapter 5:
62 Spectral Analysis With ENVI
instrument, statistics from an ROI or other user-defined statistics, or statistics calculated from the
entire data set.
4. From the ENVI main menu bar, select Transform MNF Rotation Forward MNF
Estimate Noise Statistics from Data. The MNF Transform Input File dialog appears.
5. Select a file:
Cuprite data: cup95_at.int
Spectrally subset the data by performing Steps 6-9. A spectral subset speeds up the
processing; however, you normally should use all available image bands for endmember
identification and subpixel analysis, with the exception of bad instrument bands.
Dupont data: dupont_sm_rad.env.
No spectral subsetting is necessary. Proceed to Step 10.
6. (Cuprite data only): Click Spectral Subset. The File Spectral Subset dialog appears.
7. (Cuprite data only): Click Clear.
8. (Cuprite data only): Select Band 177 (2.0409 μm), hold down the Shift key, and select Band
217 (2.4394 μm).
9. (Cuprite data only): Click Add Range.
10. Click OK. The Forward MNF Transform Parameters dialog appears.
11. Enter noise.sta for Output Noise Stats Filename.
12. Click Shift Diff Subset. The Select Spatial Subset dialog appears.
To estimate the noise statistics from the data, ENVI uses a shift difference technique. This
technique assumes that each pixel contains both signal and noise, but that adjacent pixels
within a homogeneous (or spectrally uniform) area contain the same signal. Thus, any
difference in pixel values between adjacent pixels in such an area are assumed to be due to
noise. The algorithm calculates the difference between a given pixel and the pixels adjacent
to it, to obtain noise values. Whenever possible, you should strongly consider choosing a
spatial subset that is spectrally uniform.
13. In the Select Spatial Subset dialog, click Image. The Subset by Image dialog appears.
14. Enter 20 in the Samples and Lines fields to make a 20 x 20 pixel box.
15. Hold down your middle mouse button, and move the red box to the following location:
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 63
Cuprite data: inside the uniformly white, oval-shaped feature in the lower-right edge of
the image. This is Stonewall Playa, a dry lake bed.
Dupont data: inside the uniformly white field near the bottom of the image.
Figure 26: Selecting a spectrally uniform area
16. Click OK in the Select Spatial Subset dialog.
17. In the Forward MNF Transform Parameters dialog, enter cupmnf.sta (or dupmnf.sta) in
the Output MNF Stats Filename field.
18. Enter cupmnf.dat (or dupmnf.dat) in the Enter Output Filename field.
19. Click OK. When ENVI finishes processing, it adds the MNF bands to the Available Bands List
and displays the MNF Eigenvalues plot window. The output only contains the number of bands
you selected for output. For example, if your input data contains 224 bands, but you selected 50
bands for output, your output only contains the first 50 calculated MNF bands from your input
file.
Chapter 5:
64 Spectral Analysis With ENVI
Figure 27: MNF Eigenvalues plot
Interpreting the MNF Eigenvalues Plot
Bands with large eigenvalues (greater than 1) contain data, and bands with eigenvalues near 1
contain noise. You should display the MNF bands and compare them with the MNF Eigenvalues
plot to determine which bands contain data and which bands contain predominantly noise. In
subsequent processing of these data, spectrally subset the MNF bands to only include those bands
where the images appear spatially coherent and the eigenvalues are greater than one in the MNF
Eigenvalues plot.
20. In the Available Bands List, select MNF Band 1, and click Load Band.
21. In the Available Bands List, right-click on Band 25 and select Load Band to New Display.
Notice how sharply defined the landscape is in MNF band 1 and how noisy it is in larger-
numbered MNF bands.
22. From the Display #1 menu bar, select Tools Animation. The Animation Input Parameters
dialog appears.
23. Accept the default selection (MNF Bands 1 through 41), and click OK to run the animation.
24. Change the Speed value to 3, to more effectively view the animation.
From the animation and from interpreting the MNF Eigenvalues plot, you should determine
that the first 25 MNF bands (in the Cuprite data) should be used to identify endmembers in
subsequent processing. For Dupont data, the first 28 MNF bands should be used.
25. Close the animation, the MNF Eigenvalues plot, and the display groups.
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 65
Pixel Purity Index (PPI) ENVI's PPI function finds the most spectrally pure (extreme) pixels in multispectral and
hyperspectral images. These typically correspond to mixing endmembers. The PPI is computed by
repeatedly projecting n-dimensional (n-D) scatter plots on a random unit vector. ENVI records the
extreme pixels in each projection those pixels that fall onto the ends of the unit vector and it
notes the total number of times each pixel is marked as extreme.
ENVI creates a Pixel Purity Image where each pixel value corresponds to the number of times that
pixel was recorded as extreme. The purpose of the image is to associate spatial information (i.e.,
pixel locations) with the probability that each pixel represents a pure image endmember. More
specifically, the pixel values indicate the degree of convexity of the data cloud near each pixel.
Higher values indicate pixels that are nearer to the corners of the n-D data cloud and are thus more
pure relative to pixels with lower values.
A Pixel Purity Index plot shows the total number of pixels satisfying the threshold criterion as a
function of the number of iterations. It should asymptotically approach a flat line as all of the
extreme pixels are found. If the plot has positive slope, new pixels are being added with each
iteration. If the slope is near-flat, no new pixels are being added.
The PPI function can create a new output band or continue its iterations and add the results to an
existing output band. The PPI is typically run on an MNF transform result, excluding the noise
bands. The results of the PPI are typically used as input into ENVI's n-D Visualizer.
Because the processing time to run a complete PPI is quite long, we provide you with a pre-
processed PPI image to use with the exercises in this section.
For Future Reference
To run a PPI analysis on your own data, select Spectral Pixel Purity Index [FAST] New
Output Band from the ENVI main menu bar. Be sure to spectrally subset the input image to select
only the low-numbered MNF bands to speed up the PPI analysis. In the Pixel Purity Index
Parameters dialog, enter a large number of iterations (for example, a typical AVIRIS scene may
require at least 20,000 iterations, even after you spectrally subset the scene based on MNF results).
Next, enter a threshold in standard deviation units. Think of this threshold as a tolerance facor,
which you typically set to approximately 2-3 times the noise level in the data. If you are working
with MNF-transformed data, the units of the data are already in noise standard deviation, so 2-3
times the noise level corresponds to 2-3 times the pixel values.
When the PPI process begins, the PPI plot displays and automatically updates with the completion
of each iteration. You can stop the PPI any time by clicking the Cancel button in the Fast Pixel
Purity Index Calculation dialog. ENVI then outputs the PPI image to the Available Bands List.
Chapter 5:
66 Spectral Analysis With ENVI
You can resume the PPI later by selecting Spectral Pixel Purity Index [FAST] Existing
Output Band from the ENVI main menu bar.
Exercise #2: Pixel Purity Index (PPI) 1. From the ENVI main menu bar, select File Open Image File. The Enter Data Filenames
dialog appears.
2. Open a pre-calculated PPI image:
Cuprite (geology) data: envihyper\cup95av\cupppi.dat
Dupont (vegetation) data: envihyper\aisa\dupont\duppi.dat
Click Open.
3. In the Available Bands List, select the PPI band and click Load Band.
4. From the Display group menu bar, select Tools Cursor Location/Value. Explore the data
values in the PPI image, which represent the number of times each pixel was identified as pure
in the PPI process. Close the Cursor Location/Value tool when you are finished.
5. From the Display group menu bar, select Enhance Interactive Stretching. A histogram
window appears.
6. Click the middle mouse button several times in the Input Histogram window to slowly zoom in
on the input histogram.
Figure 28: Histogram of PPI values
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 67
7. Click the left mouse button in the left histogram to view the distribution of PPI values. You can
see that most of the pixels in the image were never identified as pure (they have PPI values of
0). As the PPI value increases, the number of pixels decreases. This indicates that most pixels
are probably not pure but contain more than one spectrally unique material.
Exercise #3: Threshold PPI to Region of Interest To visualize pixels in the n-D scatter plot later in this chapter, you must first define an ROI from
the PPI image. The most appropriate ROI includes all pixels with high PPI values. Use the Image
Threshold to ROI tool to create such an ROI.
An appropriate image threshold must be determined empirically. This requires some trial and error.
From the histogram above, you can see that the PPI image has a minimum value of 0 (pixels that
were never identified as pure) and a maximum value of 493 (pixels that were identified 493 times
during the PPI iterations). You can select a starting point for the threshold value by selecting a
value near the break in slope (maximum curvature) of the input histogram.
1. From the Display group menu bar, select Overlay Region of Interest. The ROI Tool dialog
appears.
2. From the ROI Tool dialog menu bar, select Options Band Threshold to ROI. The Band
Threshold to ROI Input Band dialog appears.
3. Select the PPI image, and click OK. The Band Threshold to ROI Parameters dialog appears.
4. In the Min Thresh Value field, enter 15 (Cuprite data) or 100 (Dupont data).
Figure 29: Band Threshold to ROI Input Band dialog
5. Leave the default values for other fields, and click OK. An ENVI Question dialog appears,
showing you the number of pixels that fit the criterion you selected. The dialog asks if you
would like to make an ROI from the pixels found. Click Yes.
Chapter 5:
68 Spectral Analysis With ENVI
All pixels that were flagged 15 times (100 times for Dupont data) or more will be selected,
and an ENVI ROI will be created from them and added to the ROI Tool dialog. These are
the spectrally purest pixels in the image. The spectra that correspond to these ROI pixels
will be used as input into the n-D Visualizer where they will be separated into classes
corresponding to the spectral endmembers of the image. You can then use these
endmembers in image classification and mapping.
6. Keep the display group open for the next exercise.
n-D Visualizer
Exercise #4: n-D Visualizer The n-D Visualizer is an interactive tool for selecting endmembers in n-D space where n is the
number of bands of interest. Like the 2D scatter plot, it can help identify pure pixels that
correspond to different image endmembers. Unlike the 2D scatter plot, however, the n-D Visualizer
can plot the image data in all available dimensions.
Comparing the n-D Data Visualizer with a 2D Scatter Plot
1. From the ENVI main menu bar, select Spectral n-Dimensional Visualizer Visualize
with New Data. The n-D Visualizer Input File dialog appears.
(You can perform the following steps automatically by selecting Spectral
n-Dimensional Visualizer Auto Cluster from the ENVI main menu bar. However, for
this exercise, you will perform the steps manually so that you can learn how the process
works.)
2. Navigate to your output directory and select cupmnf.dat (or dupmnf.dat). Do not click
OK yet!
3. Click Spectral Subset. The File Spectral Subset dialog appears.
4. Select the first 25 bands of the MNF image (if you are using the Dupont data, select the first 28
bands). These encompass most of the variance in the original data set. Limiting the number of
bands improves the performance of the n-D Visualizer. Click OK.
5. Click OK in the n-D Visualizer Input File dialog. The n-D Visualizer and n-D Controls dialogs
appear.
6. In the n-D Controls dialog, select MNF bands 1 and 2 by clicking in the black boxes marked 1
and 2.
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 69
Figure 30: n-D Controls and n-D Visualizer dialogs
The resulting scatter plot shows pixels plotted against MNF bands 1 and 2. The “center
cloud” of pixels that you typically see (if a scatter plot were displayed directly from the
MNF data) are eliminated because you are using only those pixels in the ROI that were
given high PPI values (the pixels that corresponded to the outer-most portions of the data
cloud).
7. From the Display group menu bar, select Tools 2D Scatter Plot. The Scatter Plot Band
Choice dialog appears.
8. Plot MNF Bands 1 and 2, then click OK. A Scatter Plot window appears:
Figure 31: Scatter plot of MNF Bands 1 and 2
Chapter 5:
70 Spectral Analysis With ENVI
The shape of the data clouds for both scatter plots is the same; however, the n-D Visualizer
plot window shows only the extreme pixels, or the corners. Can you see why pixels were
excluded from the n-D Visualizer, based on pixel purity? Why is this important?
9. Close the Scatter Plot window and the display group.
Using the n-D Visualizer
10. In the n-D Controls dialog, select four or five more MNF bands by clicking their numbers. Note
the shape of the data clouds in the n-D Visualizer. Examine some of the higher-order MNF
bands.
11. To rotate the pure pixels about these axes, click Start in the n-D Controls dialog. The n-D
Visualizer rotates the pixels through different projections in MNF space. You can continue to
select any number of bands.
12. Once you click Stop, you can rotate backward or forward one step at a time by clicking the
arrow buttons labeled Step.
13. If you only selected three bands, you can manually rotate the plot in three dimensions by
selecting Options 3-D: Drive Axes from the n-D Controls dialog menu bar. Then, manually
rotate the cloud using the left mouse button in the n-D Visualizer window.
The rotations seem different when you include more than three bands. With more than three
dimensions, the data points “fold” in upon themselves in the projection. This should
convince you that the data are truly high-dimensional and why 2D scatter plots are
inadequate for analyzing hyperspectral data.
Selecting Endmembers
14. Watch the n-D Visualizer for pixels that form a corner in the data cloud and remain together in
all projections. When you find such a corner, stop the animation by clicking Stop in the n-D
Control dialog.
If you selected only three bands, select Options from the n-D Controls dialog menu bar,
and make sure that 3-D: Drive Axes is deselected.
15. Click and drag your cursor inside the n-D Visualizer window to draw a red ROI polygon
around pixels and to create a new class. Right-click to close the polygon. This is how you
select, or paint, endmembers.
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 71
Figure 32: Drawing a polygon around a corner of pixels in the data cloud
16. Click Start again, and watch the same corner where you defined your ROI. You may see new
endmembers in this region as the data cloud rotates in different projections. Draw more
polygon ROIs around the corner as necessary to include more endmembers. You are currently
only defining one class.
17. If you no longer want to include certain endmembers that you previously identified, you can
erase them by selecting Class Items 1:20 White from the n-D Controls dialog menu bar.
Then, draw a polygon around those endmembers.
18. From the n-D Controls dialog menu bar, select Class New. Repeat the last three steps to
define polygon ROIs around another data corner. Create a few more classes based on this
process.
Linking the n-D Visualizer to Spectral Profiles
19. To help assess whether some pixels belong to the same class, view their reflectance spectra.
From the n-D Controls dialog menu bar, select Options Z Profile. The Input File
Associated with n-D Data dialog appears.
20. Select the reflectance file: cup95_at.int (or dupont_sm_rad.env). Click OK. A blank
n-D Profile plot window appears.
21. Click the middle mouse button inside the n-D Visualizer to interactively view the
corresponding spectrum in the n-D Profile. When you middle-click inside a group of
endmembers belonging to a certain class, the spectral profile shows the corresponding class
color.
22. Right-click once inside the n-D Profile. Then, right-click in the n-D Visualizer to collect
spectra in the n-D Profile. Each subsequent spectrum is retained in the n-D Profile without
Chapter 5:
72 Spectral Analysis With ENVI
erasing the previous spectrum. Click the middle mouse button in the n-D Visualizer to clear the
plot and to return to single-spectrum mode.
Collapsing Classes
Once you have identified a few endmembers, you may find it difficult to locate additional
endmembers, even after rotating the data clouds and viewing different 2D projections of the n-D
data.
To help solve this problem, you can collapse classes in ENVI by grouping the endmembers you
have already found into one group representing the background. Mixed features that were
previously hidden become visible, and you can select them by drawing ROIs in the n-D Visualizer.
23. After you have chosen a few obvious corners in the data cloud and verified that the pixels in the
classes remain together as the data cloud continues to rotate, select Options Collapse
Classes by Means from the n-D Controls dialog menu bar to hide the span of these classes.
The dimensionality of the data cloud defined by those classes is collapsed so that the means of
the selected classes occur at the same point in the data cloud.
A Collapse Class EigenValues plot also appears, indicating the remaining dimensionality
(which is one less than the number of remaining endmembers) of the transformed data, so
that you can see how many more classes may be defined.
You can uncollapse classes by selecting Options Uncollapse from the n-D Controls
dialog menu bar.
24. Define as many unique classes as you can, finding corners of the data cloud and recollapsing.
Some classes may contain only a few pixels. See Step 17 for instructions on removing a class.
25. You can view the mean spectrum in the original image of a class by selecting Options
Mean Class from the n-D Controls dialog menu bar. Select Mean All to view mean spectra of
all of the classes. Close the plot when you are finished looking at the class spectra.
Using the n-D Class Controls
26. Select Options Class Controls from the n-D Controls dialog menu bar. The n-D Class
Controls dialog appears.
This dialog lists the number of points in each defined class and the class color. You can
change the symbol, turn individual classes on and off, and select classes to collapse. You
can also plot the minimum, maximum, mean, and standard deviation spectra for a class, plot
the mean for a single class, and plot all the spectra within a class. Also, you can clear a
class and export a class to an ROI.
27. Experiment with the different functions available in the n-D Class Controls dialog, and close
the dialog when you are finished.
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 73
Exporting Classes to ROIs
28. Once you select appropriate classes, you can convert them to ROIs by selecting Options
Export All from the n-D Controls dialog menu bar. The ROIs are loaded into the ROI Tool
dialog.
29. In the ROI Tool dialog, delete the threshold region defined from the PPI by selecting Thresh
(cuppi.dat) (or Thres (duppi.dat)), then clicking Delete. This region was defined from the PPI
image to load to the n-D Visualizer. It is no longer needed because it has been divided into
smaller, unique endmember regions.
30. From the ENVI main menu bar, select File Open Image File. The Enter Data Filenames
dialog appears.
31. Select the original reflectance image, and click Open:
Cuprite data: envihyper\cup95av\cup95_at.int
Dupont data: envihyper\aisa\dupont\dupont_sm_rad.env
32. In the Available Bands List, click Band 193 (or Band 22 for Dupont data), and click Load
Band.
33. From the Display group menu bar, select Overlay Region of Interest. The ROI Tool dialog
appears, and the ROIs you defined in the n-D Visualizer overlay on the reflectance image.
34. Save these ROIs for future work by selecting File Save ROIs from the ROI Tool dialog
menu bar. The Save ROIs to File dialog appears.
35. Highlight the desired ROIs listed, then enter an output filename of cup_em.roi (or
dupont_em.roi). Click OK.
36. In the display group, zoom in to see the various ROIs. Be sure to select the Off radio button in
the ROI Tool dialog.
37. View the mean spectrum from each ROI by clicking Select All in the ROI Tool dialog, then
clicking Stats. The ROI Statistics Results dialog appears with information about the
endmember regions in plot and text format. Can you tell from the shape of the endmember
spectra which materials they correspond to?
38. Move the endmember spectra to their own plot window by right-clicking in the ROI Statistics
Results plot window and selecting Options New Window: with Plots.
39. Leave open the display group, its associated ROI Tool dialog, and the ENVI Plot Window
containing the ROI means. Close all other display groups and plot windows.
Chapter 5:
74 Spectral Analysis With ENVI
Spectral Analyst Although you have identified endmembers, you have not yet identified the materials that comprise
the endmembers. Identifying materials can often be a very difficult process, complicated by the fact
that an image-derived endmember may be a mixture of more than one material. ENVI provides a
tool called the Spectral Analyst to aid in the identification process.
The Spectral Analyst compares input spectra (such as the endmember spectra you identified in the
last exercise) to a spectral library of known materials. Several different comparison methods are
available for use in the Spectral Analyst, including Spectral Feature Fitting, Spectral Angle
Mapper, and Binary Encoding. You can also write your own algorithm or use a weighted
combination of the multiple algorithms.
The Spectral Analyst returns a score for each spectrum in the library. The highest scores are
returned for the library spectra that best match the input spectrum. If the Spectral Library does not
contain a spectrum for the material corresponding to the input spectrum, then the Spectral Analyst
returns low scores for every spectrum in the library.
The Spectral Analyst does not compare input spectra to combinations of spectra in the chosen
library. It only uses the individual library entries. Spectral libraries are not all-encompassing, and
many materials do not have distinctive absorption features in this particular part of the
electromagnetic spectrum. So, it is important to use common sense with your results and compare
the output of the Spectral Analyst to your knowledge of the image, the study area, and the contents
of the Spectral Library.
Exercise #5: Identifying Endmembers Using the Spectral Analyst 1. From the ENVI main menu bar, select Spectral Spectral Analyst. The Spectral Analyst
Input Spectral Library dialog appears.
2. Click Open, and select Spectral Library. A file selection dialog appears.
3. Select a spectral library file, and click Open:
Cuprite data: use the USGS library spectra in envihyper\speclib\usgs_sli.dat
Dupont data: use the AISA library spectra in envihyper\aisa\dupont\dupont.sli
4. Click OK in the Spectral Analyst Input Spectral Library dialog. The Edit Identify Methods
Weighting dialog appears, along with a blank Spectral Analyst dialog.
5. The default uses only Spectral Feature Fitting to determine the validity of the spectral matches.
Click OK.
6. (Dupont data only): From the Spectral Analyst dialog menu bar, select Options Edit (x,y)
Scale Factors. In the X Data Multiplier field, enter 0.001. Click OK.
ENVI Resourse
Chapter 5: Identifying Data Endmembers
Spectral Analysis With ENVI 75
7. Click Apply in the Spectral Analyst dialog. You must have the ENVI Plot Window containing
the ROI means (from the last exercise) open. The Spectral Analyst Input Spectrum dialog
appears.
8. Select the mean spectrum from your first ROI identified in the last exercise, and click OK. The
results are returned to the Spectral Analyst dialog.
The library spectrum with the best match to your chosen endmember spectrum is listed at
the top, with other library spectra listed in order of decreasing score. Does the material
listed at the top seem like a likely endmember for this image? Remember that the results
must make sense in the context of the region in which they are identified. To confidently
predict that the material picked by the Spectral Analyst is the material corresponding to the
chosen endmember, the score should be relatively high for the SFF routine. It is also a good
sign if several similar spectra appear at the top of the Spectral Analyst dialog, indicating
that all of these similar materials match the endmember spectrum reasonably well.
However, the best way to assess the accuracy of the identification is to compare the spectra.
9. In the Spectral Analyst dialog, double-click on the library spectrum of choice. The Identify:
Known vs. Unkown plot appears with the library and unknown spectra plotted with the
continuum removed. The absorption features of interest should match fairly well.
Do the Spectral Analyst results provide enough information about the material this
endmember spectrum represents? If so, write down the material corresponding to this
endmember.
10. Click Apply again in the Spectral Analyst dialog, and repeat the last two steps with different
ROIs. If appropriate, write down the material corresponding to this endmember spectrum.
Can you think of reasons that the Spectral Analyst would give high scores for materials that
are not true matches to the endmember spectra? (Hint: Remember that we are working with
a spectral subset of a full scene.)
11. In the ROI Tool dialog, select an ROI for which the Spectral Analyst seemed to give a good
result. Click Edit, and change the name of that ROI to reflect the material that it probably
represents. Repeat for any ROIs for which the Spectral Analyst seemed to give good results.
12. When you are finished, save the endmember spectra by selecting File Save Plot As
ASCII from the ROI Means plot window menu bar. The Output Plots to ASCII File dialog
appears.
13. Select the desired spectra, and enter an output filename of cup_em.txt (or dup_em.txt).
Close the Spectral Analyst dialog window.
Potential Endmembers
76 Spectral Analysis With ENVI
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
ROI Name _____________________ Endmember Material ___________________
Chapter Review At this point, you should feel confident about interpreting:
Scatter plots in the context of a linear unmixing model
MNF-Space versus Reflectance-Space
The PPI histogram
The selection of potential endmembers using the n-D Visualizer
Chapter 6:
Sub-Pixel Analysis Techniques
What You Will Learn In This Chapter ................................................................................. Introduction ........................................................................................................................ Linear Spectral Unmixing ................................................................................................... Partial Unmixing using Matched Filtering ........................................................................... Spectral Hourglass Wizard ................................................................................................ Chapter Review .................................................................................................................
Chapter 6:
78 Spectral Analysis With ENVI
What You Will Learn In This Chapter In this chapter, you will learn how to:
Apply the Linear Unmixing model and evaluate its results
Learn about partial solutions of the unmixing model that provide more robust results
Run Matched Filtering and Mixture Tuned Matched Filtering analyses
Introduction Once all of the image endmembers have been identified, you are ready to apply the unmixing
model to estimate sub-pixel abundances of each endmember in the scene. ENVI provides several
different ways to use the unmixing model. You can perform a complete linear unmixing with or
without a unit sum constraint, or you can compute a partial unmixing solution (known as Matched
Filtering), which results in abundance estimates for only selected endmembers without the need for
identifying all endmembers. This chapter provides an opportunity to explore both applications of
the unmixing model.
Linear Spectral Unmixing Linear Spectral Unmixing is a method of determining the relative abundance of materials depicted
in multispectral or hyperspectral imagery based on the materials' spectral characteristics. The
apparent reflectance of each pixel in the image is assumed to be a linear combination of the
apparent reflectance of each material present within the pixel. In theory, the number of
endmembers that can be determined in any scene is equal to the number of spectral bands plus one.
However, in practice, the number of endmembers must be less than the number of spectral bands
for the unmixing algorithm to be valid. ENVI’s Linear Spectral Unmixing defaults to
unconstrained unmixing, where abundances may assume negative values and are not constrained to
sum to unity.
The ENVI developers feel that this is a wiser use of the linear unmixing model because the results
will make it clear when endmembers are missing or poorly chosen. However, there is an option that
allows a variable amount of constraint to be added to the system of simultaneous equations in the
unmixing inversion process. Larger weights cause the unmixing to honor the unit sum constraint
more closely.
Linear Spectral Unmixing only produces valid results if you have correctly defined all
endmembers. This is the motivation behind the development of the MNF, PPI, and n-D Visualizer
techniques. If the resulting Linear Spectral Unmixing images have negative values or values
greater than one, then either incorrect or incomplete endmembers were identified. If all of the
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 79
image endmembers are unknown (or you wish to map only selected endmembers) you should use
other mapping methods such as Spectral Feature Fitting or Matched Filtering.
The result of the Linear Spectral Unmixing routine is a series of abundance images (one for each
endmember) and a RMS error image. Higher abundance (and higher errors) are represented by
brighter pixels.
Exercise #6: Linear Spectral Unmixing For this exercise, use the derived endmembers defined from the previous n-D Visualizer exercise.
1. From the ENVI Classic main menu bar, select Spectral Mapping Methods Linear
Spectral Unmixing. The Unmixing Input File dialog appears.
2. Select cup95_at.int (or dupont_sm_rad.env), and click OK. The Endmember
Collection:Unmixing dialog appears.
3. From the Endmember Collection dialog menu bar, select Import from ROI/EVF from
input file. A Select Regions for Stats Calculation dialog appears.
4. Select all of the endmembers derived from the image (from the previous exercise), and click
OK.
5. Once the endmembers are loaded into the Endmember Collection dialog, click Plot to double-
check what endmember spectra will be used. Then click Apply. The Unmixing Parameters
dialog appears.
6. Enter an output filename of cupunm.dat (or dupunm.dat), and click OK. The resulting
rule images appear in the Available Bands List.
7. Display one of the Rule images in a new display group. Brighter pixels correspond to a
relatively high abundance of this material in that area.
8. Display another Rule image in a separate display group.
9. Use the Cursor Location/Value dialog to view abundances of endmembers in each image.
10. Display different combinations of Rule images as RGB images.
Use spatial and spectral clues to evaluate the results of the unmixing. Explain the colors of
fractional endmembers in terms of mixing. Notice the occurrence of non-primary colors
(not RGB). Are all of the fractions feasible? Note areas where unreasonable results were
obtained (fractions greater than one or less than zero).
11. Display the RMS Error image. If you did a good job picking endmembers for the image, the
RMS Error image will not show distinct spatial patterns corresponding to real features that exist
on the ground.
Chapter 6:
80 Spectral Analysis With ENVI
12. When you are finished examining the unmixing results, close the Endmember Collection
dialog.
13. Using the information you wrote down during the Spectral Analyst exercise, determine which
of your endmember spectra you think corresponds to alunite (Cuprite data). Or, if you are using
Dupont data, determine which of your endmember spectra you think corresponds to healthy
vegetation, which the spectral library classified as maple leaves.
Then display the Rule image corresponding to your alunite (or maple leaves) ROI as a gray
scale image. You will compare this result with later analyses.
14. When you are finished, close all display groups and the Endmember Collection Spectra dialog.
Keep the Endmember Collection dialog open for the next exercise.
Partial Unmixing using Matched Filtering
Matched Filtering
The results in the previous exercise show how much work it takes to define all endmembers
present in an image. Matched Filtering allows a similar analysis when not all endmember materials
are of interest. This algorithm is like Linear Spectral Unmixing because it uses a linear model for
subpixel analysis.
Matched Filtering removes the requirement of knowing all of the endmembers by maximizing the
response of a known endmember and suppressing the response of the composite unknown
background. It provides a rapid means of detecting specific minerals based on matches to specific
library or image endmember spectra. This technique produces images similar to the unmixing, but
with significantly less computation and without the requirement to know all the endmembers. It
does, however, suffer from high false-positive rates, where materials may be randomly matched if
they are rare in a pixel (thus not contributing to the background covariance).
Exercise #7: Matched Filtering In this exercise, you will apply several endmembers to the Matched Filtering routine and compare
the results to the rule images created in the Linear Spectral Unmixing exercise above.
1. From the ENVI main menu bar, select Window Start New Plot Window. An ENVI Plot
window appears.
2. Load the endmember spectra you saved in the previous chapter by selecting File Input Data
ASCII from the ENVI Plot window menu bar. The Enter ASCII Plot Filename dialog
appears.
3. Navigate to your output directory and select cup_em.txt (or dup_em.txt). Click Open.
The endmember spectra are loaded into the ENVI Plot window.
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 81
4. From the Endmember Collection dialog menu bar, select Algorithm Matched Filtering.
5. Right-click in the ENVI Plot window, and select Plot Key to show the names of the
endmember spectra. Select several endmember spectra that you think were correctly identified,
and drag their labels into the white area of the Endmember Collection dialog.
6. Once the desired spectra appear in the Endmember Collection dialog, click Apply. The
Matched Filter Parameters dialog appears.
7. Enter an output stats filename of cupmf.sta (or dupmf.sta), and an output image
filename of cupmf.dat (or dupmf.dat) and click OK. Leave the Endmember Collection dialog
open.
The Matched Filtering classifier produces an abundance image called MF Score, for each
selected endmember. The results appear in the Available Bands List.
8. Display an MF Score image in a new display group.
9. Using dynamic linking, compare the MF Score images to the Rule images from the previous
Linear Spectral Unmixing exercise. Which routine seems to show the best results? Are there
problems with false positives in the MF score images?
10. When you are finished, close all display groups.
Mixture Tuned Matched Filtering
In Matched Filtering (MF), any rare spectra (or any spectrum that differs markedly from the
background) can produce a high MF Score, even if these spectra are not very similar to the target
spectrum. This false positive problem is perhaps the leading drawback to Matched Filtering and
can sometimes make interpretation difficult.
Mixture Tuned Match Filtering (MTMF) improves upon MF by also computing a feasibility
measure that you can use to more accurately interpret MF Score images. MTMF calculates the
same Matched Filter image (the MF Score) but also outputs a corresponding Infeasibility image
whose data values are in noise sigma units that vary with the MF score. As an example, pixels with
a lot of alunite should have both a high MF score and a low infeasibility value.
Exercise #8: Mixture Tuned Matched Filtering The MTMF routine is nearly identical to MF, except that the endmember spectra imported into the
Endmember Collection dialog must be in MNF space instead of reflectance.
1. From the ENVI main menu bar, select File Open Image File. The Enter Data Filenames
dialog appears.
Chapter 6:
82 Spectral Analysis With ENVI
2. Navigate to your output directory, and select cupmnf.dat (or dupmnf.dat), and click
Open.
3. In the Available Bands List, select any MNF band, and click Load Band.
4. From the Endmember Collection dialog menu bar, select Algorithm Mixture Tuned
MF.
5. The MTMF routine requires MNF-transformed data. From the Endmember Collection
dialog menu bar, select File Change input file. The Select Input File dialog appears.
6. Navigate to your output directory and select cupmnf.dat (or dupmnf.dat). Click OK.
The endmembers must be in the same MNF space as the input data set. Because the
endmembers are derived from image ROIs, the spectra can be brought into MNF space by
opening the ROI Tool dialog from an MNF image instead of the original data image, then
plotting the mean spectra for the ROIs.
ENVI also provides an alternative routine to convert the spectra into MNF Space, which
you can run by selecting Transforms MNF Rotation Apply Forward MNF to
Spectra. The statistics file output from the MNF routine should be used to transform the
spectra.
7. First, delete the reflectance spectral signatures in the Endmember Collection dialog by
clicking Select All and then Delete.
8. From the Display group menu bar, select Overlay Region of Interest. The ROI Tool
dialog appears.
9. In the ROI Tool dialog, click Select All, then click Stats. An ROI Statistics Results dialog
appears with a plot of mean MNF spectra. Right-click in the plot window, and select Plot
Key to view their labels.
10. Drag selected MNF spectra into the Endmember Collection window. Select several
endmember spectra that you think were correctly identified using the Spectral Analyst.
Click Apply in the Endmember Collection dialog. The Mixture Tuned Matched Filter
Parameters dialog appears.
11. In the Output Stats Filename field, enter cupmtmf.sta (or dupmtmf.sta).
12. In the Output Filename field, enter cup_mtmf.dat (or dup_mtmf.dat). Click OK.
When processing is complete, MF Score and Infeasibility images for each endmember
appear in the Available Bands List.
13. Inspect several MF Score images. They should appear the same as those obtained from the
Matched Filter routine.
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 83
Scatter plots of MF Score versus Infeasibility are used to determine pixels that contain large
amounts of the endmember of interest, those that contain little amounts, and those that give
false “high-match” scores.
14. From the Display group menu bar of an MF Score image, select Tools 2D Scatter Plots.
The Scatter Plot Band Choice dialog appears.
15. Under Choose Band X, select an MF Score image. Under Choose Band Y, select the
corresponding Infeasibility image for that same endmember. Click OK. A Scatter Plot
window appears.
Which area of the scatter plot shows pixels with a high abundance of a given endmember?
Notice the highly selective nature and few false positives resulting from MTMF.
There are several ways to present results. You can color pixels in the MF Score versus
Infeasibility plot, and export them to an ROI. You can do this for all endmembers of
interest, with each endmember having a different color or class. Alternatively, if levels of
relative abundance are important, you can color pixels with a high score red, then color
pixels with a moderate score a “less hot” color, then color pixels with a lower score a
relatively cool color. Then, export the various levels of abundance to ROIs by right-clicking
in the plot window and selecting Export All.
16. In the scatter plot, draw an ROI that encompasses good matches for the endmember. These
correspond to pixels with a high MF score and low infeasibility.
Figure 33: MF Score vs. Infeasibility plot
Chapter 6:
84 Spectral Analysis With ENVI
17. To help delineate areas of good matches, select Options Density Slice from the Scatter
Plot menu bar.
18. You can also check spectra of the pixels to evaluate whether they indeed belong to the class
by selecting Options Z Profile. Input File Associated with 2-D Scatter Plot dialog
appears.
19. Select cup95_at.int (or dupont_sm_rad.env), and click OK. The Scatter Plot
Profile window appears.
20. Right-click on a pixel to view its spectrum.
21. Select Options Export Class from the Scatter Plot Profile menu bar to create an ROI of
the endmember.
22. From the Scatter Plot menu bar, select File New Scatter Plot. Plot the MF Score and
Infeasibility for other endmembers.
23. Select a new class color and draw a polygon around good matches for this endmember.
Export the class to a new ROI. Repeat the process for several endmembers.
24. Overlay the ROIs on a single-band image of cup95_at.int (or
dupont_sm_rad.env). This is an effective way to display your endmember mapping
results. You could then save the image with the ROIs overlain to a TIFF image, for
example, and georeference the image to make an image map.
25. When you are finished, close all display groups, plots, and dialogs.
Spectral Hourglass Wizard Use the Spectral Hourglass Wizard to guide you step-by-step through the ENVI hourglass
processing flowFigure 34 to find and map image spectral endmembers from hyperspectral or
multispectral data. The wizard displays detailed instructions and useful information for each
function.
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 85
Apparent Reflectance
MNF
PPI
N-D Visualizer
Spectral
Analyst
SAM, Unmixing, MF, MTMF, SFF
Spatial/Spectral
Browsing
Spectral Data
Reduction
Spatial Data
Reduction
Endmember
Extraction
Endmember
Identification
Map Distribution
+/- Abundance
The Spectral Hourglass Processing Workflow
Apparent Reflectance
MNF
PPI
N-D Visualizer
Spectral
Analyst
SAM, Unmixing, MF, MTMF, SFF
Spatial/Spectral
Browsing
Spectral Data
Reduction
Spatial Data
Reduction
Endmember
Extraction
Endmember
Identification
Map Distribution
+/- Abundance
The Spectral Hourglass Processing Workflow
Apparent Reflectance
MNF
PPI
N-D Visualizer
Spectral
Analyst
SAM, Unmixing, MF, MTMF, SFF
Spatial/Spectral
Browsing
Spectral Data
Reduction
Spatial Data
Reduction
Endmember
Extraction
Endmember
Identification
Map Distribution
+/- Abundance
The Spectral Hourglass Processing Workflow
Figure 34: Spectral Hourglass Processing Flow
The hourglass processing flow uses the spectrally over-determined nature of hyperspectral data to
find the most spectrally pure, or spectrally unique, pixels (endmembers) within the data set and to
map their locations and sub-pixel abundances. This processing flow begins with reflectance or
radiance input data. You can spectrally and spatially subset the data, visualize the data in n-D space
and cluster the purest pixels into endmembers, and optionally supply your own endmembers. You
can map the distribution and abundance of the endmembers, use ENVI’s Spectral Analyst to
identify the endmembers, and review the mapping results.
Each step in the Spectral Hourglass Wizard executes a standalone ENVI function such as MNF,
PPI, and SAM classifiction. You have already performed each step in detail throughout the course,
but the Spectral Hourglass Wizard combines them all into a single process to help streamline the
process of selecting endmembers. The name of the corresponding ENVI function appears at the top
of the panel during each step. Results from specific steps are output to the Available Bands List.
Various plots appear throughout the processing flow to help assess results as you proceed.
Wizard Processing Flow
The Spectral Hourglass Wizard has individual panels that take you through the following steps.
Chapter 6:
86 Spectral Analysis With ENVI
Introduction
Input/OutputFile Selection
Minimum NoiseTransform (MNF)
Determination
Pixel Purity Index (PPI)
Derive Endmembers
from Data?
Examine PPI Results
n-Dimensional Visualizationand Endmember Selection
Input User-SuppliedEndmembers?
Mapping with SAM
Investigate Mapping Results
Summary Report
Input User-SuppliedEndmembers?
Endmember Collection
Data Dimensionality
Review of MNF Results
YES
YES
NO
NO
YES
Figure 35: Each step within the Spectral Mapping Wizard flow chart represents a panel in the Wizard
Wizard Basics
To successfully use the Spectral Mapping Wizard, you should become familiar with the basic
functions and concepts shown in Figure 36:
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 87
Figure 36: The Spectral Mapping Wizard screen with the select input/output files panels displayed
Text in the top panel of the wizard provides background information and guidance for each
step. It is very important that you read this information before proceeding. Use the vertical
and horizontal scroll bars to view all of the text.
Enter and select the parameters for that step using the buttons and fields near the bottom of
the panel.
Function
Title
Important
information and
instructions
Use scrollbar to see all
the text and
parameters
Enter and select
parameters
Click these buttons to move
backward and forward through the
steps
Chapter 6:
88 Spectral Analysis With ENVI
Use the Prev and Next buttons to step through the wizard.
Each processing step will execute when you click Next.
If the Next button is not available for selection, be sure that you set all of the necessary
parameters.
Click Prev to go back to a previous step to modify parameters and to run that step again.
The results of the processing steps appear in the Available Bands List.
You can examine the results of a function at any time.
Various plots display during processing, and you can save them by selecting File Save
Plot As in the plot window.
To display only the title of each panel and not the text, right-click on the text and select
Display Title Only. To redisplay the text, right-click and select Display Full Text.
Exercise #9: Using the Spectral Hourglass Wizard
Selecting Input/Output Files
1. From the ENVI main menu bar, select Spectral Spectral Hourglass Wizard. The ENVI
Spectral Hourglass Wizard displays the Introduction panel.
Typically, data that have been converted to reflectance via atmospheric correction are used
as input, particularly if library spectra or other external spectra are used as endmembers in
the mapping process. You must assign wavelength values in the ENVI header of the input
file. If you are not using any external spectra in the processing, then you can use radiance or
even uncalibrated data as input. However, unless you use reflectance data, you cannot use
the Spectral Analyst (later in the wizard) to identify the image-derived endmembers by
reference to a spectral library.
2. Click Next. The Select Input/Output Files panel appears.
3. Click Select Input File. Select cup95_at.int (or dupont_sm_rad.env), and click
OK.
4. In the Select Input/Output Files panel, the Output Root Name defaults to the root name of
the selected input file. For example, if the input file is cup95_at.int, then the output
file for each process is cup95_at appended with a function-dependent suffix (for
example, cup95_at.mnf). Click Select Output Root Name and enter or choose a
different root name if desired.
5. Click Next. The Forward MNF Transform panel appears.
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 89
Minimum Noise Transform
6. You can optionally enter a Number of output MNF bands value. However, in most cases,
you should use the default (based on the number of input bands) to preserve the full data
dimensionality. The Spectral Hourglass Wizard helps determine if all of the MNF bands are
required later, depending on the inherent data dimensionality revealed in the MNF process.
You can calculate noise statistics from the data based on a shift difference method that uses
local pixel variance to estimate noise. A virtual noise image is created by subtracting line-
shifted and sample-shifted images from the original data and averaging and scaling these
two results. In Steps 7-11, you will select a small spatial subset of the data over a uniform
area to improve noise estimates in the noise statistics calculation.
7. Click Shift Difference Spatial Subset. A Select Spatial Subset dialog appears.
8. Click Image. A Subset by Image dialog appears.
9. Change the Samples and Lines values to 20.
10. Put your cusor inside the red zoom box and drag it to the solid white area in the bottom-
right of the image, so that the zoom box fully contains the uniform, white pixels. Click OK.
11. Click OK in the Select Spatial Subset dialog.
12. Click Next in the Forward MNF Transform panel of the wizard. The View MNF Results
panel appears, and progress windows display the processing status. After the processing is
complete, the View MNF Results panel and an MNF Eigenvalues plot window appear.
The MNF Eigenvalues plot shows the eigenvalue (y-axis) for each MNF-transformed band
(an eigenvalue number, shown in the x-axis). Larger eigenvalues indicate higher data
variance in the transformed band and may help indicate data dimensionality. When the
eigenvalues approach 1, only noise is left in the transformed band, as the noise floor has
been scaled to unity in each output MNF band.
13. Click Load MNF Result to ENVI Display to display an RGB image of the first three MNF
bands. Use this image to quickly locate dominant spectral materials, which are displayed in
bright, pure colors. Or, select Load Animation of MNF Bands to load the MNF result as a
gray scale animation.
14. After displaying and analyzing the MNF result, click Next in the wizard. The Determine
Data Dimensionality panel appears.
Data Dimensionality
Data dimensionality indicates the number of intrinsic endmembers that the data set contains, since
each linearly independent component adds another dimension to a spectral dataset through mixing.
You can determine the data dimensionality in the MNF Eigenvalues plot by finding where the
slope of the eigenvalue curve breaks and the values fall to 1.
Or, you can let the wizard estimate data dimensionality using a spatial coherence measure:
15. Click Calculate Dimensionality. A processing status dialog appears, followed by a Spatial
Coherence Threshold plot, which shows the wizard's best guess for the number of non-noise
MNF bands.
Chapter 6:
90 Spectral Analysis With ENVI
16. Evaluate the Spatial Coherence Threshold plot.
17. If you are satisfied with the dimensionality calculation, click OK in the Spatial Coherence
Threshold plot, then click Next in the wizard. The Derive or Select Endmembers panel
appears.
18. Otherwise, manually change the threshold level by clicking and dragging the horizontal red
threshold line on the Spatial Coherence Threshold plot to a new level. Click OK. You can
also click Cancel in the Spatial Coherence Threshold plot and enter a new Data
Dimensionality value in the Determine Data Dimensionality panel. Click Calculate
Dimensionality and repeat the steps above.
Deriving Endmembers from the Input Image
19. In the Derive or Select Endmember panel, set the Derive Endmembers from Image?
toggle button to Yes and click Next. The Pixel Purity Index panel appears.
The PPI is computed by repeatedly projecting n-D scatter plots on a random unit vector.
The wizard records the extreme pixels in each projection and notes the total number of
times each pixel is marked as extreme. The PPI Threshold Value is used to define how
many pixels are marked as extreme at the ends of the projected vector. The threshold value
should be approximately 2-3 times the noise level in the data (which is 1 when using MNF-
transformed data). Larger thresholds cause the PPI to find more extreme pixels, but they are
less likely to be “pure” endmembers.
The PPI is highly CPU-intensive and can take a long time to run, with the size of the data
cube and the number of iterations being the main controlling factors. Reducing the Number
of PPI Iterations can also save time; however, a minimum of 5,000 iterations is usually
required to produce useful results. The PPI Maximum Memory use value must
correspond to a value smaller than your available system memory (RAM).
20. Click Next. The Calculating Pixel Purity Index panel appears, and progress windows
display the processing status.
The PPI is calculated for the number of iterations you specified in the previous panel. A
Pixel Purity Index Plot appears, showing which iteration you are on and the cumulative
number of pixels that were flagged as extreme. The curve in this plot usually starts steeply,
as new pixels are found in each iteration, and it should flatten out as all the extreme pixels
are found.
21. When the iterations are complete, you can return to the Pixel Purity Index panel and
increase the Number of PPI Iterations if the plot has not flattened. While it is difficult or
impossible to precisely say how many iterations are enough, you can never run too many
iterations. Having many iterations (20,000 for example) gives a PPI result with an increased
dynamic range and thus the ability to find subtle, poorly expressed endmembers that might
be undetected if fewer iterations were completed.
22. When the iterations are complete, a PPI image is created in which the value of each pixel
corresponds to the number of times that pixel was recorded as extreme. Bright pixels in the
PPI image generally are image endmembers. This image is listed in the Available Bands
ENVI Resourse
Chapter 6: Sub-Pixel Analysis Techniques
Spectral Analysis With ENVI 91
List. The pixels with the highest values are input into the n-D Visualizer for the clustering
process that develops individual endmember spectra.
The PPI image is an important intermediate product in the spectral hourglass process. It
identifies and locates the purest pixels in the scene (often less than 1% of the total number
of pixels). By understanding this small collection of the purest pixels, you can have a full
understanding of all the pixels in the image via spectral mixture models. Furthermore, the
PPI image maps type localities and sites that should be visited for ground truth collection
and spectral measurements in the field.
23. In the Examine PPI Results panel, you can leave the default value of 10,000 for Maximum
PPI Pixels to use in the n-D Visualizer, or you can experiment with modifying the value.
Smaller numbers animate faster and show only the purest pixels; larger numbers give a
better overall picture of the scatter plot, but they animate more slowly and may hinder the
selection of vertices. The wizard automatically applies a threshold to the PPI image to
obtain the best PPI pixels without exceeding the selected maximum. You can return to this
page and change the PPI maximum threshold so you can view both the overall scatter plot
and only the purest pixels.
24. Click Next in the Examine PPI Results panel to proceed to the n-Dimensional Visualizer
panel of the wizard. The n-D Visualizer and n-D Controls dialogs appear.
26. Refer to the wizard text for information and instructions for retrieving endmembers from
the n-D Visualizer.
27. Click Retrieve Endmembers in the n-Dimensional Visualizer panel of the wizard.
28. To plot endmembers once they are loaded into the wizard, click Plot Endmembers in the
n-Dimensional Visualizer panel of the wizard.
29. To use ENVI’s Spectral Analyst to help you identify the endmembers, click Start Spectral
Analyst in the n-Dimensional Visualizer panel of the wizard. See the "Spectral Analyst"
section of this training guide for details on using the Spectral Analyst.
30. Click Next. The User Supplied Endmembers panels appear.
31. To use endmembers from the image, click the User supplied Endmembers toggle button
to select No, and click Next. The Mapping Methods panel appears.
Performing Classification
32. In the Mapping Methods panel, choose SAM.
The SAM method produces a classified image based on the value you specify for SAM
Maximum Angle. Decreasing this threshold usually results in fewer matching pixels (better
matches to the reference spectrum). Increasing this threshold may result in a more spatially
coherent image; however, the overall pixel matches will not be as good as for the lower
threshold.
33. Click Next. Progress windows display the processing status. The Calculate Mapping
Methods panel briefly appears. Then, the Investigate SAM Results panel appears.
The output from SAM is a classified image and a set of rule images (one per endmember).
The pixel values of the rule images represent the spectral angle in radians from the
Chapter 6:
92 Spectral Analysis With ENVI
reference spectrum for each class. Lower spectral angles represent better matches to the
endmember spectra. Areas that satisfied the selected radian threshold criteria are carried
over as classified areas into the classified image.
34. Click Load SAM Class Result to examine the SAM classification image. If the image does
not show spatially coherent classes, then the classification does not match the target spectra
or what you know about the target. In this case, you should review the SAM rule images.
35. Highlight the name of an image in the SAM Rule Images list and click Load SAM Rule
Image, or double-click the image name in the SAM Rule Images list. Follow the wizard
instructions for examining SAM rule image results.
36. In the Investigate SAM Results panel, click Next. A Spectral Hourglass Wizard Summary
Report appears.
37. This is the final panel of the Spectral Hourglass Wizard. The summary lists the processing
steps you performed and a list of the output files created. Save the summary by selecting
File Save Text to ASCII from the Spectral Hourglass Wizard Summary Report menu
bar.
38. Compare the results with those obtained from the first SAM exercise. Then close all open
display groups in ENVI.
Chapter Review A recommended processing path for sub-pixel analysis of hyperspectral data is:
MNF Transform to decorrelate and determine the dimensionality of the data
PPI to identify the purest pixels
n-D Visualizer to segregate spectral endmembers
Spectral Analyst to help identify and name unknown spectra
Full or partial unmixing algorithms to map endmember abundances.
You should understand the following concepts:
Linear Spectral Unmixing requires all endmembers to be identified correctly
Unrealistic abundances or pixel sums that are much greater than unity are indications that
the chosen endmembers are not completely correct
Matched Filtering is a partial linear unmixing algorithm that does not require knowledge
about all endmembers
If MNF-transformed data are available, then you should use the MTMF classifier because
its infeasibility measure helps to more accurately interpret the MF Score
Chapter 6:
Georeferencing and Mosaicking
OPTIONAL
What You Will Learn In This Chapter ................................................................................. Introduction ........................................................................................................................
ENVI Resourse
Chapter 6: Georeferencing and Mosaicking
Spectral Analysis With ENVI 95
What You Will Learn In This Chapter In this chapter you will:
Work with IGM files to georeference imagery
Mosaic the resulting georeferenced images
Introduction Some satellite and airborne data sets come with associated Input Geometry (IGM) files that contain
map locations for every pixel. Using IGM files to georeference imagery is a very accurate method
of georeferencing data because it places every pixel at its exact map location, while avoiding the
use of ground control points (GCPs) to warp imagery. The map information is stored in two bands:
one for x coordinates (longitude or northing) and one for y coordinates (latitude or easting).
The IGM file is used to create a geographic lookup table (GLT) file that contains information about
which original pixel occupies which output pixel in the final product. The GLT file can be used to
georectify any band or derived product through a lookup table. The GLT file contains integer pixel
locations, which are sign-coded to indicate if a certain output pixel is “real” or a nearest-neighbor
infill pixel. The GLT file is a georeferenced product with a fixed pixel size projected into a rotated
UTM system. It uses one-based coordinates, where the upper-left pixel is located at (1,1).
You can georeference your data directly from an IGM file or from a GLT file. When you
georeference from an IGM file, the GLT file is built on the fly.
Because the sizes of georeferenced images are often inflated by adding pixels around the images
(and these pixels must be masked in processing), a recommended method is to perform data
processing first, then georeference the derived products.
Exercise Data
You will open two 3-band Probe-1 images from Wyoming and use their associated IGM files to
georeference the images.
Exercise 1: Georeferencing from an IGM file 1. From the ENVI 5 main menu bar, Open Image File. The Enter Data Filenames dialog
appears.
2. Navigate to envihyper\Probe, and use the Ctrl key to select Line3.img and Line
5.img, and their associated IGM files, Line3igm.bil and Line5igm.bil. Click Open.
3. In the Available Bands List, right-click Line3.img and select Load True Color.
4. Right-click on IGM input X map under Line3igm.bil, and select Load Band to New
Display.
96 Spectral Analysis With ENVI
5. Right-click on IGM input Y map under Line3igm.bil, and select Load Band to New
Display.
6. Use the Cursor Location/Value tool to explore the data values in the IGM images. The data
values in the X Map image are UTM meters Easting, and the data values for the Y Map image
are UTM meters Northing.
7. Close the two IGM display groups when you are finished.
8. From the ENVI main menu bar, toolbox write Georeference from Input Geometry selec
Georeference from IGM. The Input Data File dialog appears.
9. Select Line3.img, and click OK. The Input X Geometry Band dialog appears.
10. Select IGM input X map under Line3igm.bil, and click OK. The Input Y Geometry
Band dialog appears.
11. Select IGM input Y map under Line3igm.bil, and click OK. The Geometry Projection
Information dialog appears.
12. Keep the default selection of UTM for the input and output projections.
13. Click the Datum button for both the input and output projections, and select North America
1983.
14. In both Zone fields, enter 13. Click OK. The Build Geometry Lookup File Parameters dialog
appears.
15. Keep the default value for Output Pixel Size.
16. You will be creating a mosaic later, so change the Output Rotation angle to 0. The default
output rotation angle is used to minimize the output file size. If you set the rotation angle to 0,
then north will be up in the output image. If you set it to another angle, then north will be at an
angle instead of up. The rotation angle is stored in the ENVI header and is used when
overlaying grids, so they will appear at an angle.
17. In the Enter Output GLT Filename field, enter Line3glt.
18. In the Output Georef Filename field, enter Line3geo.
19. Let the Georeference Background Value default to 0.
20. Click OK. ENVI builds the GLT file and georeferences the input data file. Both results appear
in the Available Bands List.
ENVI Resourse
Chapter 6: Georeferencing and Mosaicking
Spectral Analysis With ENVI 97
21. Display GLT Sample Lookup and display Line3glt, and select Load Band to New
Display.
22. Use the Cursor /Value tool to explore this image. Data values in this band refer to the original
sample number. A positive data value indicates that the pixel is an actual image pixel, located
in its proper position. A negative data value indicates that the pixel is a nearest-neighbor infill
pixel, placed to fill an undersampled image gap. A value of 0 indicates that no input pixel
corresponds to the output pixel. Similarly, data values in the GLT Line Lookup band refer to
the original line number.
23. In the Available Bands List, right-click Line3geo and select Load True Color to
<current>.
24. Use the Cursor Location/Value tool to confirm that the georeferenced image contains
geographic coordinates.
25. Repeat Steps 8-24 using the other flight line, Line5.img. Be sure to use different names for
the output. In the Enter Output GLT Filename field, enter Line5glt. In the Output
Georef Filename field, enter Line5geo.
Or, you can select Georeference from Input Geometry Build Super GLT. Then, use
Georeference from Super GLT.
Using a Super GLT file for georeferencing provides a more robust resampling method. A
radial resampling method is used to derive the output image using a specified kernel size.
Each output pixel is calculated by weighting all the pixels in the kernel by the inverse of
their radial distance to the center of the output pixel. You specify the kernel size and
minimum number of pixels used in the resampling. This is a much slower process than
regular GLT functions.
26. Close all display groups when finished.
Exercise 2: Mosaicking georeferenced images 1. From the ENVI main menu bar, toolbox select Georeferenced Mosaicking The Map Based
Mosaic dialog appears.
2. From the Map Based Mosaic dialog menu bar, select Import Import Files and Edit
Properties. The Mosaic Input Files dialog appears.
3. Use the Ctrl key to select Line3geo and Line5geo, and click OK. The Entry: Line3geo
dialog appears.
4. Enter 0 for Data Value to Ignore.
5. Keep the Feathering Distance value of 0.
98 Spectral Analysis With ENVI
6. Click the Mosaic Display toggle button to select RGB.
7. Ensure the No radio button is selected for Color Balancing. Click OK. The Entry: Line3glt
dialog appears.
8. Repeat Steps 4-7, and click OK. The two color images should appear in the Mosaic dialog
(Figure 37).
9. From the Mosaic dialog menu bar, select File Apply. The Mosaic Parameters dialog
appears.
10. Enter an output filename of WY_mosaic.
11. Accept the default values for all other fields, and click OK.
12. In the Available Bands List, right-click WY_mosaic, and select Load True Color. Inspect the
mosaicked image.
If the two images don’t properly align, two methods to improve accuracy may be necessary.
The provider of the IGM files may need to adjust the bore sight angles. These are pitch,
roll, and heading offsets for the Inertial Measurement Unit data used to make IGM files. Or,
if topographic relief variations are a factor, a digital elevation model (DEM) may have to be
incorporated into the process.
ENVI Resourse
Chapter 6: Georeferencing and Mosaicking
Spectral Analysis With ENVI 99
Figure 37: Two georeferenced images in the Mosaic dialog