Basic Hyperspectral Analysis Using ENVI- Tutorial of ENVI Software - Completely GIS, GPS, and Remote Sensing Lecture Material - facegis.com
Basic Hyperspectral Analysis Using ENVI

Overview of This Tutorial

This tutorial is designed to introduce you to the concepts of Spectral Libraries, Region of Interest (ROI) extraction of spectra, Directed Color composites, and to the use of 2-D scatterplots for simple classification. We will use 1995 Airborne Visible/Infrared Imaging Spectrometer (AVIRIS) apparent reflectance data of Cuprite, Nevada, USA, calibrated using the ATREM atmospheric modeling software. The subsetted data cover the 1.99 to 2.48 mm range in 50 spectral bands approximately 10 nm wide. You will extract ROIs for specific minerals, compare them to library spectra, and design R, G, B color composites to best display the spectral information. You will also use 2-D scatterplots to locate unique pixels, interrogate the data distribution, and perform simple classification. This tutorial is designed to be completed in two to four hours.

Files Used in This Tutorial

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 C95AVSUB subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.

The files listed below, along with their associated .hdr files, are required to run this exercise. Selected data files have been converted from floating-point to integer format by multiplying by 1000 to conserve disk space. Data values of 1000 represent apparent reflectances of 1.0.

Required Files

CUP95_AT.INT	Cuprite ATREM calibrated reflectance data. 50 bands (integer).
JPL1.SLI	JPL Spectral Library in ENVI format.
USGS_MIN.SLI	USGS Spectral Library in ENVI format.
CUP95_AV.ROI	Saved ROI locations.

Spectral Libraries, Image Reflectance Spectra, ROIs, and Color Composites

This portion of the tutorial is designed to familiarize you with Spectral Libraries, Browsing and extraction of image reflectance spectra, Region of Interest (ROI) definition in ENVI, and directed design of color composite images for spectral discrimination.

Start ENVI and Load AVIRIS data

Before attempting to start the program, ensure that ENVI is properly installed as described in the installation guide.

  • To open ENVI in Unix, enter " envi " at the UNIX command line.
  • To open ENVI from a Windows or Macintosh system, d ouble-click on the ENVI icon.

The ENVI Main Menu appears when the program has successfully loaded and executed.

  1. On the ENVI Main Menu, select File->Open Image File and navigate to the C95AVSUB subdirectory of the ENVIDATA directory on the ENVI TUTORIALS & DATA CD-ROM.
  2. Choose CUP95_AT.INT as the input file name. The Available Bands List dialog will appear, listing the 50 spectral band names.

Display a Grayscale Image

  1. Use the scroll bar on the right side of the Available Bands List dialog to scroll through the list until Band 193 (2.20 mm ) is displayed.
  2. Click on Band 193 and click "Load" at the bottom of the dialog.

An ENVI image display containing the selected band will appear.

  1. Click the right mouse button in the Main Image window and select Functions->Profiles->Z Profile to extract an apparent reflectance spectrum.

Browse Image Spectra and Compare to Spectral Library

  1. Move the Zoom Window indicator box around the image to browse through image apparent reflectance spectra.
  2. Drag the box by grabbing and dragging with the left mouse button or click the middle mouse button in the Main Image display to center the Zoom Indicator box on the selected pixel.
  3. Position the Zoom Indicator box at various locations in the image and examine the spectra.
  4. Compare apparent reflectance spectra from the image to selected library reflectance spectra.

ENVI includes several spectral libraries. For the purposes of this exercise, you will use the JPL Spectral Library (Groves et al., 1992) and the USGS Spectral Library (Clarke et al., 1993).

  1. Select Spectral Tools->Spectral Libraries->Spectral Library Viewer.
  2. When the Spectral Library Input File dialog appears, click "Open New File", select JPL1.SLI from the list, and click "OK".

JPL1.SLI now appears in the "Select Input File" field of the dialog.

  1. Click on the file name and click "OK" to open the Spectral Library Viewer dialog.
  2. Select Options->Edit (x, y) Scale Factors and enter a value of 1000 into Y Data Multiplier to match the image apparent reflectance range (0 - 1000).
  3. Plot the following spectra in the Spectral Library Viewer window (Figure 1) by clicking on the appropriate mineral name in the list of spectra:
  4. ALUNITE SO-4A
  5. BUDDINGTONITE FELDS TS-11A
  6. CALCITE C-3D
  7. KAOLINITE WELL ORDERED PS-1A

Basic Hyperspectral Analysis Using ENVI - facegis.com

  1. Move the Zoom Indicator Box (which is centered on the "current pixel") to several different areas in the image and visually compare the image and laboratory spectra.
  2. Select Functions->Interactive Analysis->Pixel Locator in the Main Image display and use it to center the Zoom Indicator on pixel 590, 570 (Stonewall Playa).
  3. Enter the desired pixel location in the Pixel Locator dialog and click "Apply" to move to that location, which can be used as a starting point for analysis.
  4. Now start a new plot window by selecting File->New Window->Inherit in the #1 Spectral Profile window.
  5. Drag and drop the spectrum for each site for the exact pixels listed below from the Spectral Profile window into the new plot window for comparison (Figure 2).

  1. Location Name Sample

    (with offset)

    Line

    (with offset)

    Stonewall Playa 590 570
    Varnished Tuff 435 555
    Silica Cap 494 514
    Opalite Zone with Alunite 531 541
    Strongly Argillized Zone with Kaolinite 502 589
    Buddingtonite Zone 448 505
    Calcite 260 613
  2. Click the right mouse button to the right of the vertical plot axis labeled "2.40" to display the spectra names, then click and hold the left mouse button on the first letter of the name and drag the name into the plot window before releasing the mouse button.
  3. Select Options->Stack Data to offset spectra vertically.
  4. Visually compare these spectra to the library spectra extracted previously.

Note the similarity of shape and absorption features between the laboratory spectra and the individual image apparent reflectance spectra.

Based on these similarities, we conclude that the image spectra similar to the alunite, buddingtonite, calcite, and kaolinite laboratory spectra represent pixels predominantly of the above minerals.

Basic Hyperspectral Analysis Using ENVI - facegis.com

  1. Drag and drop spectra from the Spectral Library Viewer into the Z-Profile window for direct comparison using the method described above.
  2. When you have identified several minerals, continue with the next section.
  3. Optionally, compare spectra from the USGS Spectral Library USGS_MIN.SLI with image spectra and the JPL Spectral library.

Close Windows and Plots

  • To close all of the previous plot windows, select Basic Tools->Display Controls->Close All Plot Windows.
  • To close these dialogs, select File->Cancel in the Spectral Library Viewer dialog and the Pixel Locator.


Define Regions of Interest

Regions of Interest (ROIs) are used to extract statistics and average spectra from groups of pixels. You can define as many ROIs as you wish in any displayed image.

  1. Select Basic Tools->Region of Interest->Define Region of Interest.
  2. When the Region of Interest Controls dialog appears (Figure 3). click in the "Display #" text box at the top of the dialog, and enter "1" for the display number.

Basic Hyperspectral Analysis Using ENVI - facegis.com

Create New Region of Interest

To begin drawing an ROI:

  1. Click the left mouse button in the image.
  2. Draw the ROI by clicking the left mouse button at the axes of a polygon, or draw continuously by clicking and dragging the left mouse button.
  3. Complete the ROI by clicking the right mouse button to close the polygon.
  4. Click on the Stats button to calculate the statistics and plot a mean spectrum (white), the first standard deviation above and below the mean spectrum (green), and the Min/Max envelope containing all of the spectra in the ROI (red).
  5. Click "Cancel" in the File Statistics Report and select File->Cancel in the Avg Spectrum plot to close the dialog and plot respectively.
  6. Click "Delete" in the Region of Interest Controls dialog to delete the selected ROI.

Load Previously Saved Regions of Interest

  1. Click "Restore ROIs" and select the file CUP95_AV.ROI from the files list on the input file dialog and click "OK".

Regions previously defined for known areas of specific minerals will be loaded into the ROI Controls dialog and listed in an ENVI message dialog.

  1. Click "OK" at the bottom of this dialog and the ROIs will be loaded and displayed on the #1 Display.
  2. Click the "Off" toggle button at the top of the Region of Interest Controls Dialog to enable pixel positioning within the Main Image display.
  3. Start a Z-Profile window by selecting Functions->Profiles->Z-Profile in the Main Display window.
  4. Move the current pixel position/cursor location into each ROI by clicking the middle mouse button on a pixel in the ROI.
  5. Click on different pixels in the ROI to move the cursor position and display a new spectral profile in the Spectral Profile window.

Note that the y-axis plot range is automatically rescaled to match the spectral profile for each new ROI. Examine the spectral variability within each ROI.

Extract Mean Spectra from ROIs

  1. Select a ROI name in the Region of Interest Controls dialog by clicking on the name, then click "Stats" to extract statistics and a spectral plot of the selected ROI.
  2. Examine the spectral variability of each ROI by comparing the mean spectrum (white) with the 1st standard deviation spectra (green above and below the mean) and the envelope spectra (red above and below the mean).
  3. Repeat for each ROI.
  4. If you wish, load the corresponding library signatures from the JPL1.SLI library into the plot window for direct comparison/identification.

Don't forget to use a "Y-Scaling Factor" of 1000 when loading the library spectra.

  1. When you have finished, click "Cancel" in each of the File Statistics Report dialogs.
  2. Select File->Cancel in each plot window to remove these plots from the screen.
  3. Click "Mean All" in the Region of Interest Controls dialog to plot the average spectrum for each ROI in a single plot window (Figure 4).

Basic Hyperspectral Analysis Using ENVI - facegis.com

  1. Compare the spectral features of each spectrum and note unique characteristics that might allow identification.
  2. Select Options->Stack Data to offset spectra for comparison.
  3. If desired, load the corresponding spectral library signatures from the JPL1.SLI library for direct comparison of image apparent reflectance spectra with laboratory spectra.

Don't forget to use a Y Factor of 1000 when loading the library spectra.

  • Optionally, compare spectra from the USGS Spectral Library USGS_MIN.SLI with image spectra and the JPL Spectral library.

Optional: Define New ROIs

To define a new ROI:

  1. Click on the "Image" toggle button in the Region of Interest Controls dialog and click "New Region".
  2. Enter a name in the "Name:" text box and change the ROI color by choosing a color from the pulldown list of colors to the right of the "Name" field.
  3. Click the left mouse button in the Main window to establish the first point of the ROI polygon.
  4. Select additional points defining the polygon border by clicking the left mouse button sequentially to outline the desired region.
  5. Click the right mouse button to complete the polygon.

The ROI will be added to the dialog's list of Available Regions with the name, region color, and number of pixels enclosed.

  1. Extract the statistics and average spectrum for each new region as described above.
  2. Extract the mean for all of the new ROIs using the "Mean All" button.

Design Color Images to Discriminate Mineralogy

  1. Load a color composite image by clicking on the "RGB Color" toggle button in the Available Bands List and clicking sequentially on Band 183, Band 193, and Band 207.
  2. Click "Load RGB" to load the color image into the current image display.

Note that the positions of the bands used to make the RGB color composite image are marked in the Z-Profile with vertical red, green, and blue lines.

  1. Click on the "Off" toggle button in the Region of Interest Controls dialog and use the Z profiler to browse spectra at or near your ROI locations from above.

Note where the selected RGB bands fall with respect to spectral features in the previously displayed mean spectra and how the spectral features affect the color observed in the image. After inspecting a few sites, you should begin to understand how the color composite colors correspond with the spectral signature. For instance, the alunitic regions appear magenta in the RGB composite because the green band is within the alunite absorption feature, giving a low green value, while the red and blue bands are of almost equal reflectance. The combination of red and blue results in a magenta color for pixels containing alunite.

  • Based on the above results, try these exercises:
  • Predict how certain spectra will look, given a particular pixel's color in the RGB image.
  • Explain the colors of the training sites, in terms of their spectral features.
  • Design and test specific RGB band selections that maximize your ability to map certain minerals, like kaolinite and calcite.

Close Plot Windows and ROI Controls

  • To close all open plot windows, select Basic Tools->Display Controls->Close All Plot Windows.
  • To close the Region of Interest Control dialog, click "Cancel".

2-D Scatterplots

Examine 2-D Scatterplots

  1. Start a 2-d scatterplot for the apparent reflectance image by selecting Functions->Interactive Analysis->2-D Scatter Plots in the Main window.
  2. Choose band 193 by clicking on the band number in the "Choose Band X:" list and choose band 207 in the "Choose Band Y:" list.
  3. Click "OK".

After a brief wait, the scatterplot will appear with a plot of the X vs. Y apparent reflectance values (Figure 5).

Basic Hyperspectral Analysis Using ENVI - facegis.com

Density Slice the Scatterplot

  • Click the right mouse button in the scatterplot to automatically density slice the scatterplot.

The colors show the frequency of occurrence of specific apparent reflectance combinations for the two bands being scatterplotted. White is the lowest frequency, progressing through the colors of the rainbow to red as the highest frequency of occurrence.

Scatterplot Dancing Pixels

  1. Click and drag the left mouse button in the Main Image window to toggle "Dancing Pixels" in the scatterplot.

The red pixels in the scatterplot correspond to those pixels within a 10 x 10 box around the cursor in the Main Image window.

  • You can change the box-cursor size by selecting Options->Set Patch Size in the scatter plot window.
  • Move the cursor in the Main window with the left mouse button depressed to cause the red-highlighted pixels to change in the scatterplot display.
  • Try to predict the locations of certain image colors in the scatterplot, then check them.

Notice the shape of the red sub-scatterplot of dancing pixels.

  1. Try changing the patch size and observe the difference.

Image Dancing Pixels

  1. Click and drag the center mouse button in the scatterplot window over any portion of the white scatterplot to toggle "Dancing Pixels" in the Main Image window.

The red pixels in the image correspond to those pixels within a 10 x 10 box around the cursor in the scatterplot window.

  • You can change the box-cursor size by selecting Options->Set Patch Size in the scatter plot window.
  • Move the cursor around the scatterplot with the middle mouse button depressed to cause the red-highlighted pixels to change in the Main Image display.

Note the spatial distribution and coherency of the selected pixels.

  1. Try changing the patch size and observe the difference.

Scatterplot ROIs

The scatterplot tool can also be used as a quick classifier.

  1. Click the left mouse button in the scatterplot to select the first point of a Region of Interest (ROI).
  2. Draw a ROI polygon in the scatter plot by selecting the desired line segments using the left mouse button.
  3. Click the right mouse button to close the polygon.

Image pixels with the two-band characteristics outlined by the polygon will be color-coded red in the Main Image window.

  1. Choose another color from the Class pulldown menu in the scatterplot window.
  2. Draw another polygon and the corresponding pixels will be highlighted in the selected color on the image.
  3. If you want to remove a class, select Options->Clear Class.
  4. You can also clear the current class by clicking using the middle mouse button outside (below) the plot axes.
  5. Use the 2-D scatterplot tool to work backwards from the scatterplot to see where certain pixels occur in the image.
  6. Classes can be converted to ROIs to act as training sets for classification using all of the bands by selecting Options->Export Class or Export All from the scatterplot menu bar.

ROIs exported in this fashion will appear in the Region of Interest Controls dialog and be available for subsequent supervised classification.

  1. Select Options->Clear All in the scatterplot to clear both scatterplot and image.

Image ROIs

The scatter plot tool also functions as a simple classifier from the image.

  1. Choose Options->Image ROI in the scatterplot.
  2. Draw polygons in the Main Image window (as before, click the left mouse button to draw lines and the right button to close the polygon).

They will be mapped to the scatterplot and highlighted in the currently selected color. After the pixels are highlighted on the scatterplot, all of the matching pixels in the image will be inverse mapped to the Main Image window and highlighted in the same color, as though you had drawn the scatterplot region yourself. This is the simplest form of 2-band classification, but it is still a powerful tool.

  1. Draw a few image regions and note the correspondence between image color and scatterplot characteristics.

Scatterplots and Spectral Mixing

  • Can you explain the overall diagonal shape of the scatterplot in terms of spectral mixing? Where do the purest pixels in the image fall on the scatterplot? Are there any secondary "projections" or "points" on the scatterplot?
  • Choose some other band combinations for scatterplotting by selecting Options->Change Bands in the scatterplot.

Try at least one pair of adjacent bands and other pairs that are far apart spectrally.

  • How do the scatterplots change shape with different band combinations? Can you describe the n -Dimensional "shape" of the data cloud?
  • Close the scatterplot window when finished by selecting File->Cancel in the scatterplot.

Close the Scatterplot

  • To close the scatterplot window, select File->Cancel in the scatterplot menu bar.

Close Files and Exit ENVI.

  • When you have finished your ENVI session, click "Quit" or "Exit" on the ENVI Main Menu, then type exit at the IDL command prompt.

If you are using ENVI RT, quitting ENVI will take you back to your operating system.


References

Clark, R. N., Swayze, G. A., Gallagher, A., King, T. V. V., and Calvin, W. M., 1993, The U. S. Geological Survey Digital Spectral Library: Version 1: 0.2 to 3.0 mm: U. S. Geological Survey, Open File Report 93-592, 1340 p.

Grove, C. I., Hook, S. J., and Paylor, E. D., 1992, Laboratory reflectance spectra of 160 minerals, 0.4 to 2.5 Micrometers: JPL Publication 92-2.

Source: http://www.ltid.inpe.br