This tutorial leads you through a typical multispectral classification procedure using Landsat TM data from Canon 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. It is assumed that you are already generally familiar with multispectral classification techniques.
You must have the ENVI TUTORIALS & DATA CD-ROM mounted on your system to access the files used by this tutorial, or copy the files to your disk.
The files used in this tutorial are contained in the CAN_TM subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.
The files listed below are required to run this exercise.
CAN_TMR.IMG Boulder Colorado TM Reflectance
CAN_TMR.HDR ENVI Header for Above
CAN_KM.IMG KMEANS Classification
CAN_KM.HDR ENVI Header for Above
CAN_ISO.IMG ISODATA Classification
CAN_ISO.HDR ENVI Header for Above
CLASSES.ROI Regions of Interest (ROI) for Supervised Classification
CAN_PCLS.IMG Paralleleliped Classification
CAN_PCLS.HDR ENVI Header for Above
CAN_BIN.IMG Binary Encoding Result
CAN_BIN.HDR ENVI Header for Above
CAN_SAM.IMG SAM Classification Result
CAN_SAM.HDR ENVI Header for Above
CAN_RUL.IMG Rule image for SAM classification
CAN_RUL.HDR ENVI Header for Above
CAN_SV.IMG Sieved Image
CAN_SV.HDR ENVI Header for Above
CAN_CLMP.IMG Clump of sieved image
CAN_CLMP.HDR ENVI Header for Above
CAN_COMB.IMG Combined Classes image
CAN_COMB.HDR ENVI Header for Above
CAN_OVR.IMG Classes overlain on Grayscale image
CAN_OVR.HDR ENVI Header for Above
CAN_V1.EVF Vector layer generated from class #1
CAN_V2.EVF Vector layer generated from class #2
This portion of the exercise will familiarize you with the spectral characteristics of Landsat TM data of Canon City, Colorado, USA. Color composite images will be used as the first step in locating and identifying unique areas for use as training sets in classification.
Before attempting to start the program, ensure that ENVI is properly installed as described in the installation guide.
The ENVI Main Menu appears when the program has successfully loaded and executed.
To open an image file:
Note that on some platforms you must hold the left mouse button down to display the submenus from the Main Menu.
An Enter Input Data File file selection dialog appears.
The Available Bands List dialog will appear on your screen. This list allows you to select spectral bands for display and processing.
Note that you have the choice of loading either a grayscale or an RGB color image.
The bands you have chosen are displayed in the appropriate fields in the center of the dialog.
Use the displayed color image as a guide to classification. This image is the equivalent of a false color infrared photograph. Even in a simple three-band image, it's easy to see that there are areas that have similar spectral characteristics. Bright red areas on the image represent high infrared reflectance, usually corresponding to healthy vegetation, either under cultivation, or along rivers. Slightly darker red areas typically represent native vegetation, in this case in slightly more rugged terrain, primarily corresponding to coniferous trees. Several distinct geologic classes are also readily apparent as is urbanization.
Figure 1: Landsat TM Color Infrared Composite, Bands 4, 2, 1 (RGB).
Use ENVI's cursor location/value function to preview image values in all 6 spectral bands. To bring up a dialog box that displays the location of the cursor in the Main, Scroll, or Zoom windows.
Alternatively, click the right mouse button in the image display to toggle the Functions menu and choose Functions->Interactive Analysis->Cursor Location/Value.
Use ENVI's integrated spectral profiling capabilities to examine the spectral characteristics of the data.
Figure 2: Spectral Plots
Start ENVI's unsupervised classification routines by choosing Classification->Unsupervised->Method, where Method is either K-Means or Isodata, or review the precalculated results of classifying the image in the CAN_TM directory.
Unsupervised classification uses statistical techniques to group n-dimensional data into their natural spectral classes. The K-Means unsupervised classifier uses a cluster analysis approach which requires the analyst to select the number of clusters to be located in the data, arbitrarily locates this number of cluster centers, then iteratively repositions them until optimal spectral separability is achieved.
Choose K-Means as the method, use all of the default values and click on OK, or review the results contained in CAN_KM.IMG.
If desired, experiment with different numbers of classes, Change Thresholds, Standard Deviations, and Maximum Distance Error values to determine their effect on the classification.
IsoData unsupervised classification calculates class means evenly distributed in the data space and then iteratively clusters the remaining pixels using minimum distance techniques. Each iteration recalculates means and reclassifies pixels with respect to the new means. This process continues until the number of pixels in each class changes by less than the selected pixel change threshold or the maximum number of iterations is reached.
Choose ISODATA as the method, use all of the default values and click on OK, or review the results contained in CAN_ISO.IMG.
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.
Supervised classification requires that the user select training areas for use as the basis for classification. Various comparison methods are then used to determine if a specific pixel qualifies as a class member. ENVI provides a broad range of different classification methods, including Parallelepiped, Maximum Likelihood, Minimum Distance, Mahalanobis Distance, Binary Encoding, and Spectral Angle Mapper. Examine the processing results below, or use the default classification parameters for each of these classification methods to generate your own classes and compare results.
To perform your own classifications use Classification->Supervised->Method, where Method is one of ENVI's supervised classification methods. Use one of the two methods below for selecting training areas (Regions of Interest).
As described in ENVI Tutorial #1 and summarized here, ENVI lets you easily define "Regions of Interest" (ROIs) typically used to extract statistics for classification, masking, and other operations. For the purposes of this exercise, you can either use predefined ROIs, or create your own.
When you have finished defining an ROI, it is shown in the dialog's list of Available Regions, with the name, region color, and number of pixels enclosed, and is available to all of ENVI's classification procedures.
The following methods are described in most remote sensing textbooks and are commonly available in today's image processing software systems.
Parallelepiped classification uses a simple decision rule to classify multispectral data. The decision boundaries form an n-dimensional parallelepiped in the image data space. The dimensions of the parallelepiped are defined based upon a standard deviation threshold from the mean of each selected class.
Maximum likelihood classification assumes that the statistics for each class in each band are normally distributed and calculates the probability that a given pixel belongs to a specific class. Unless a probability threshold is selected, all pixels are classified. Each pixel is assigned to the class that has the highest probability (i.e., the "maximum likelihood").
The minimum distance classification uses the mean vectors of each ROI and calculates the Euclidean distance from each unknown pixel to the mean vector for each class. All pixels are classified to the closest ROI class unless the user specifies standard deviation or distance thresholds, in which case some pixels may be unclassified if they do not meet the selected criteria.
The Mahalanobis Distance classification is a direction sensitive distance classifier that uses statistics for each class. It is similar to the Maximum Likelihood classification but assumes all class covariances are equal and therefore is a faster method. All pixels are classified to the closest ROI class unless the user specifies a distance threshold, in which case some pixels may be unclassified if they do not meet the threshold.
The following methods are described in the ENVI Users's guide. These were developed specifically for use on Hyperspectral data, but provide an alternative method for classifying multispectral data, often with improved results that can easily be compared to spectral properties of materials. They typically are used from the Endmember Collection dialog using image or library spectra, however, they can also be started from the classification menu, Classification->Supervised->Method.
The endmember collection dialog is a standardized means of collecting spectra for supervised classification from ASCII Files, Regions of Interest, Spectral Libraries, and Statistics Files. Start the dialog by selecting, Spectral Tools->Endmember Collection (this can also be started by choosing Classification->Endmember Collection. Click on the Open Image File button at the bottom of the Classification Input File dialog and choose the input file CAN_TMR.IMG and click OK.
The Endmember Collection dialog appears with the Parallelepiped classification method selected by default. The available classification and mapping methods are listed by choosing Algorithm->Method from the dialog menu bar. Available supervised classification methods currently include Parallelepiped, Minimum Distance, Manlanahobis Distance, Maximum Likelihood, Binary Encoding, and the Spectral Angle Mapper (SAM).
The binary encoding classification technique encodes the data and endmember spectra into 0s and 1s based on whether a band falls below or above the spectrum mean. An exclusive OR function is used to compare each encoded reference spectrum with the encoded data spectra and a classification image produced. All pixels are classified to the endmember with the greatest number of bands that match unless the user specifies a minimum match threshold, in which case some pixels may be unclassified if they do not meet the criteria.
The Spectral Angle Mapper (SAM) is a physically-based spectral classification that uses the n-dimensional angle to match pixels to reference spectra. The algorithm determines the spectral similarity between two spectra by calculating the angle between the spectra, treating them as vectors in a space with dimensionality equal to the number of bands.
Use image linking and dynamic overlays to compare this classification to the color composite image and previous unsupervised and supervised classifications.
ENVI creates images that show the pixel values used to create the classified image. These optional images allow users to evaluate classification results and to reclassify if desired based on thresholds. These are grayscale images; one for each ROI or endmember spectrum used in the classification.
The rule images represent different things for different types of classifications, for example:
Classification Method Rule Image Values
Parallelepiped Number of bands that satisfied the parallelepiped criteria.
Minimum Distance Sum of the distances from the class means
Maximum Likelihood Probability of pixel belonging to class
Manalanobis Distance Distances from the class means
Binary Encoding Binary Match in Percent
Spectral Angle Mapper Spectral Angle in Radians (smaller angles indicate closer match to the reference spectrum)
Figure 5: Rule Image for Canon City Landsat TM, Spectral Angle Mapper Classification. Stretched to show best matches (low spectral angles) as bright pixels.
Classified images require post-processing to evaluate classification accuracy and to generalize classes for export to image-maps and vector GIS. ENVI provides a series of tools to satisfy these requirements
This function allows you to extract statistics from the image used to produce the classification. Separate statistics consisting of basic statistics (minimum value, maximum value, mean, std deviation, and eigenvalue), histograms, and average spectra are calculated for each class selected.
Figure 6: Classification Statistics Report for Region 3 of the Canon City Landsat TM data.
ENVI's confusion matrix function allows comparison of two classified images (the classification and the "truth" image), or a classified image and ROIs. The truth image can be another classified image, or an image created from actual ground truth measurements.
Figure 7: Confusion Matrix (percent) using ROIs as Ground Truth.
Figure 8: Confusion Matrix (pixel count) using ROIs as Ground Truth.
Clump and Sieve provide means for generalizing classification images. Sieve is usually run first to remove the isolated pixels based on a size (number of pixels) threshold, and then clump is run to add spatial coherency to existing classes by combining adjacent similar classified areas. Compare the precalculated results in the files 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.
The Combine Classes function provides an alternative method for classification generalization. Similar classes can be combined to form one or more generalized classes.
When a classification image is displayed, you can change the color associated with a specific class by editing the class colors.
Overlay classes allows the user to place the key elements of a classified image as a color overlay on a grayscale or RGB image.
Load the precalculated vector layers onto the grayscale reflectance image for comparison to raster classified images, or execute the function and convert one of the classification images to vector layers.
ENVI provides annotation tools to put classification keys on images and in map layouts. The classification keys are automatically generated.
Figure 9: Classification image with classification key.