ENVI Classic Tutorial: Classification Methods
ENVI Classic Tutorial: Classification Methods
Classification Methods
Classification Methods
Files Used in this Tutorial
Examining a Landsat TM Color Image
Reviewing Image Colors
Using the Cursor Location/Value
Examining Spectral Plots
Exploring Unsupervised Classification Methods
Applying K-Means Classification
Applying ISODATA Classification
Exploring Supervised Classification Methods
Selecting Training Sets Using Regions of Interest (ROI)
Applying Parallelepiped Classification
Applying Maximum Likelihood Classification
Applying Minimum Distance Classification
Applying Mahalanobis Distance Classification
Exploring Spectral Classification Methods
Collecting Endmember Spectra
Applying Binary Encoding Classification
Exploring Rule Images
Post Classification Processing
Extracting Class Statistics
Generating a Confusion Matrix
Clumping and Sieving
Combining Classes
Overlaying Classes
Editing Class Colors
Working with Interactive Classification Overlays
Overlaying Vector Layers
Converting a Classification to a Vector
Adding Classification Keys Using Annotation
2
2
3
3
4
4
6
6
7
9
9
9
10
10
11
12
12
13
15
17
17
18
19
20
20
22
23
24
24
25
Page 1 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Classification Methods
This tutorial provides an introduction to classification procedures using Landsat TM data from Caon
City, Colorado. Results of both unsupervised and supervised classifications are examined and post
classification processing including clump, sieve, combine classes, and accuracy assessment are
discussed.
Description
Caon City, Colorado TM reflectance image
ENVI header for above
K-means classification
ENVI header for above
ISODATA classification
ENVI header for above
Regions of interest (ROI) for supervised classification
Parallelepiped classification
ENVI header for above
Binary encoding result
ENVI header for above
SAM classification result
ENVI header for above
Rule image for SAM classification
ENVI header for above
Sieved image
ENVI header for above
Clump of sieved image
ENVI header for above
Combined classes image
ENVI header for above
Classes overlain on gray scale image
ENVI header for above
Vector layer generated from class #1
Vector layer generated from class #2
Page 2 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 3 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
2. Move the cursor around the image and examine the data values in the dialog for specific
locations. Also note the relation between image color and data value.
3. From the Cursor Location/Value dialog, select Files > Cancel.
Page 4 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
1. From the Display group menu bar, select Tools > Profiles > Z Profile (Spectrum) to begin
extracting spectral profiles.
2. Examine the spectra for areas that you previewed above using color images and the
Cursor/Location Value dialog by clicking the left mouse button in any of the display group
windows. Note the relations between image color and spectral shape. Pay attention to the location
of the image bands in the spectral profile, marked by the red, green, and blue bars in the plot.
3. From the Spectral Profile dialog menu bar, select File > Cancel.
Page 5 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
3. Accept the default values, select the Memory radio button, and click OK. The new band is
loaded into the Available Bands List.
4. From the Available Bands List, click the Display #1 button and select New Display.
5. From the Available Bands List, select the K-Means band and click Load Band.
Page 6 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
6. From the Display group menu bar, select Tools > Link > Link Displays then click OK to link the
images.
7. Compare the K-Means classification result to the color-composite image using the dynamic
overlay feature in ENVI Classic (click using the left mouse button in the Image window).
8. From the Display group menu bar, select Tools > Link > Unlink Display to remove the link and
turn off the dynamic overlay feature.
9. If desired, experiment with different numbers of classes, change thresholds, standard deviations,
and maximum distance error values to determine their effect on the classification.
Page 7 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
4. From the Available Bands List, click the Display #2 button and select New Display.
5. Select the ISODATA band and click Load Band.
6. From the Display group menu bar, select Tools > Link > Link Displays. The Link Displays
dialog appears.
7. Click the Display #2 toggle button to select No, and click the Display #3 toggle button to select
Yes. Click OK to link the images.
8. Compare the ISODATA classification result to the color-composite image using the dynamic
overlay feature in ENVI Classic (click using the left mouse button in the Image window).
9. From the Display group menu bar, select Tools > Unlink Displays.
10. From the Display group menu bar, select Tools > Link > Link Displays. The Link Displays
dialog appears.
11. Click the Display #1 toggle button to select No, and ensure that the Display #2 and Display #3
toggle buttons say Yes. Click OK to link and compare the K-means and ISODATA images.
12. If desired, experiment with different numbers of classes, change thresholds, standard deviations,
maximum distance error, and class pixel characteristic values to determine their effect on the
classification.
13. From the Display group menu bar on the K-Means Image window, select File > Cancel to close
the display group. Close the ISODATA display group using the same technique.
Page 8 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 9 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
6. From the Available Bands List, click the Display #1 button and select New Display.
7. Select the Parallel band and click Load Band.
8. From the Display group menu bar, select Tools > Link > Link Displays and click OK in the
dialog to link the images.
9. Use image linking and dynamic overlay to compare this classification to the color composite
image.
Page 10 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 11 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 12 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 13 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
5. In the Endmember Collections dialog, click Apply. The Binary Encoding Parameters dialog
appears.
6. In the Binary Encoding Parameters dialog, select to output the result to Memory using the radio
button provided.
7. Toggle the Output Rule Images to No, then click OK to start the classification. The new band is
loaded into the Available Bands List.
8. From the Available Bands List, select the Bin Encode band, and click Load Band.
9. Use image linking and dynamic overlay to compare this classification to the color composite
image and previous unsupervised and supervised classifications.
Page 14 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
1. From the ENVI Classic main menu bar, select File > Open Image File.
2. Select can_rul.img, and click Open. The Available Bands List appears on your screen.
3. Click on the Gray Scale radio button in the Available Bands List and open each Rule band into its
own image window (use the Display > New Display button).
4. Use image linking and dynamic overlay to compare the color composite image to the rule images.
5. From the Display group menu bar, select Tools > Color Mapping > ENVI Classic Color Tables
and drag the Stretch Bottom and Stretch Top sliders to opposite ends of the dialog. Areas with low
Page 15 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 16 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 17 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
7. Click OK to compute the statistics. The Class Statistics Results dialog appears.
Page 18 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
5. Select can_sam.img in the Ground Truth Input File dialog and click OK. The Match Classes
Parameters dialog appears.
6. Select Region #1 from both fields and click Add Combination. Continue to pair corresponding
classes from the two images in this way, then click OK. The Confusion Matrix Parameters dialog
appears.
7. Click the Output Result to Memory radio button then click OK.
8. Examine the confusion matrix and confusion images (in the Available Bands List). Determine
sources of error by comparing the classified image to the original reflectance image using
dynamic overlays, spectral profiles, and Cursor Location/Value.
Page 19 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
3. Click the Output Result to Memory radio button, then click OK. The image is loaded into the
Available Bands List.
4. You will now use the output of the sieve operation as the input for clumping. From the ENVI
Classic main menu bar, select Classification > Post Classification > Clump Classes. The
Classification Input File dialog appears.
5. Select the previously created image file from memory, and click OK. The Sieve Parameters
dialog appears.
6. Click the Output Result to Memory radio button, then click OK. The image is loaded into the
Available Bands List.
7. Compare the three images (can_sam.img, Clump, and Sieve) and reiterate if necessary to
produce a generalized classification image.
8. Optional: compare the pre-calculated results in the files can_tm\can_sv.img (sieve) and
can_clmp.img (clump of the sieve result) to the classified image can_pcls.img
(parallelepiped classification) or calculate your own images and compare to one of the
classifications.
Combining Classes
The Combine Classes function provides an alternative method for classification generalization. Similar
classes can be combined to form one or more generalized classes.
1. From the ENVI Classic main menu bar, select Classification > Post Classification > Combine
Classes or review the pre-calculated results of classifying the image by opening the can_
comb.img file in the can_tm directory. The Classification Input File dialog appears.
2. Select the can_sam.img file and click OK. The Combine Classes Parameters dialog appears.
3. Select Region #3 from the Select Input Class field, click Unclassified from the Select Output
Class field, click Add Combination, then click OK. The Combine Classes Output dialog
appears.
4. Click the Output Result to Memory radio button then click OK. The image is loaded into the
Available Bands List.
5. Using image linking and dynamic overlays, compare the combined class image to the classified
images and the generalized classification image.
Overlaying Classes
Overlay classes allow you to place the key elements of a classified image as a color overlay on a gray
scale or RGB image.
You can examine the pre-calculated image can_tm\can_ovr.img or create your own overlay(s)
from the can_tmr.img reflectance image and one of the classified images.
Page 20 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
1. From the ENVI Classic main menu bar, select Classification > Post Classification > Overlay
Classes or review the pre-calculated results of classifying the image by opening the can_
comb.img file in the can_tm directory. The Input Overlay RGB Image Input Bands dialog
appears.
2. Under can_tmr.img in the Available Bands List, select Band 3 for each RGB band (Band 3
for the R band, Band 3 for the G band, and Band 3 for the B band) and click OK. The
Classification Input File dialog appears.
3. Click Open, and select New File. A file selection dialog appears.
4. Open can_tm\can_comb.img, and click Open.
5. Click OK in the Classification Input File dialog.
6. Using the Shift key on your keyboard, select Region #1 and Region #2 in the Class Overlay to
RGB Parameters dialog.
7. Click the Output Result to Memory radio button, then click OK. The image is loaded into the
Available Bands List.
8. Load the overlay image to a new display group.
9. Using image linking and dynamic overlays, compare this image to the classified image and the
reflectance image.
Page 21 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 22 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 23 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Page 24 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
Copyright Notice:
ENVI Classic is a registered trademark of Exelis Inc.
QUAC and FLAASH are registered trademarks of Spectral Sciences, Inc.
Page 25 of 26
2014 Exelis Visual Information Solutions, Inc. All Rights Reserved. This information is not subject to the controls
of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However,
this information may be restricted from transfer to various embargoed countries under U.S. laws and regulations.