Está en la página 1de 149

Curso: Introduccin a la Teledeteccin y

Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 1

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Introduction to ENVI
Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................1
GETTING STARTED WITH ENVI....................................................................................................................................1

Starting ENVI....................................................................................................................................................1

Starting ENVI on Windows Machines.....................................................................................................................................1


Starting ENVI in UNIX ..........................................................................................................................................................1
Starting ENVI on Macintosh Machines ...................................................................................................................................1

Loading a Grayscale Image ................................................................................................................................1

Opening an Image File.........................................................................................................................................................1


The Available Bands List ......................................................................................................................................................1

ENVI FILE FORMATS ................................................................................................................................................2

Exploring the ENVI Header File...........................................................................................................................2

ENVI WINDOWS AND DISPLAYS ...................................................................................................................................3

The ENVI Main Menu Bar ...................................................................................................................................3


The Display Group.............................................................................................................................................3

The Image Window .............................................................................................................................................................4


The Scroll Window...............................................................................................................................................................5
The Zoom Window ..............................................................................................................................................................5

The Mouse Button Descriptions Dialog ................................................................................................................6

BASIC ENVI FUNCTIONS ............................................................................................................................................6

Displaying the Cursor Location and Value ............................................................................................................6


Displaying Image Profiles...................................................................................................................................7
Performing Quick Contrast Stretching..................................................................................................................7
Displaying Interactive Scatter Plots .....................................................................................................................7
Loading a Color Image.......................................................................................................................................8
Linking Two Displays .........................................................................................................................................8

Dynamic Overlays................................................................................................................................................................8

Selecting Regions of Interest..............................................................................................................................9


Annotating the Image...................................................................................................................................... 10
Adding Grid Lines ............................................................................................................................................ 11
Saving and Outputting an Image ...................................................................................................................... 11
Exiting ENVI ................................................................................................................................................... 12

Tutorial: Introduction to ENVI


Overview of This Tutorial
This tutorial is designed to introduce you to the basic concepts of the ENVI software and some of its key features. It
assumes that you are already familiar with general image-processing concepts.
In order to run this tutorial, you must have ENVI installed on your computer.

Files Used in This Tutorial


ENVI Resource DVD: envidata\can_tm
File
can_tmr.img
can_tmr.hdr

Description
Caon City, CO, TM Data
ENVI Header for Above

Getting Started with ENVI


Starting ENVI
Before attempting to start the program, ensure that ENVI is properly installed as described in the Installation Guide that
shipped with your software.

Starting ENVI on Windows Machines

Select Start Programs ENVI x.x ENVI.


(where x.x is the version number)

Starting ENVI in UNIX

For ENVI, enter envi_rt at the UNIX command line.


For ENVI+IDL, enter envi at the UNIX command line.

Starting ENVI on Macintosh Machines


1. Display an OSX, UNIX X-window.
2. Do either of the following:
For ENVI, type envi_rt at the UNIX command prompt.
For ENVI +IDL, type envi at the UNIX command prompt.

Loading a Gray Scale Image


Open a multispectral Landsat Thematic Mapper (TM) data file representing Caon City,
Colorado, USA.

Opening an Image File


1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\can_tm directory, select the file can_tmr.img
from the list, and click Open.

The Available Bands List


ENVI provides access to both image files and to the individual spectral bands in these
files. The Available Bands List is a special ENVI dialog containing a list of all the available
image bands in all open files, as well as any associated map information. You can use
the Available Bands List to load both color and gray scale images into a display.
The File menu at the top of the Available Bands List dialog provides access to file
opening and closing, file information, and canceling the Available Bands List. The Options menu provides a way to find
the band closest to a specific wavelength, shows the currently displayed bands, allows toggling between full and
shortened band names in the list, and provides the capability to fold all of the bands in a single open image into just the
1
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


image name. Folding and unfolding the bands into single image names or lists of bands can also be accomplished by
clicking on the + (plus) or (minus) symbols to the left of the filename in the Available Bands List.
Right-clicking in the Available Bands List displays a menu with access to different functions. The right-click menu
selections will differ depending on what item is currently selected in the Available Bands List.
1. Select TM Band 4. The band you have chosen is displayed in the field marked Selected Band.
2. Click the Gray Scale radio button then click Load Band to load the image into a new display. Band 4 will be
loaded as a gray scale image.

ENVI File Formats


ENVI uses a generalized raster data format consisting of a simple flat-binary file and a small associated ASCII (text)
header file. This file format permits ENVI to use nearly any image file, including those that contain their own embedded
header information. ENVI also supports a variety of data types: byte, integer, unsigned integer, long integer, unsigned
long integer, floating-point, double-precision floating-point, complex, double-precision complex, 64-bit integer, and
unsigned 64-bit integer.
Generalized raster data are stored as a binary stream of bytes in either Band Sequential (BSQ), Band Interleaved by
Pixel (BIP), or Band Interleaved by Line (BIL) format.

BSQ is the simplest format, with each line of data followed immediately by the next line of the same spectral
band. BSQ format is optimal for spatial (x,y) access to any part of a single spectral band.

BIP format provides optimal spectral processing performance. Images stored in BIP format have the first pixel
for all bands in sequential order, followed by the second pixel for all bands, followed by the third pixel for all
bands, etc., interleaved up to the number of pixels. This format provides optimum performance for spectral (z)
access of the image data.

BIL format provides a compromise in performance between spatial and spectral processing and is the
recommended file format for most ENVI processing tasks. Images stored in BIL format have the first line of the
first band followed by the first line of the second band, followed by the first line of the third band, interleaved up
to the number of bands. Subsequent lines for each band are interleaved in similar fashion.

Exploring the ENVI Header File


The separate text header file provides information to ENVI about the dimensions of the image, any embedded header
that may be present, the data format, and other pertinent information. The header file is normally created (sometimes
with your input) the first time a particular data file is read by ENVI. It can also be created outside of ENVI using a text
editor.
1. From the ENVI main menu bar, select File Edit ENVI Header.
2. Click once on can_tmr.img to view the ENVI header file for this image.
3. Click the Cancel button to close the header file.
4. Right-click on an image name in the Available Bands List and select Edit Header as an alternate way to view the
ENVI header file. Close the header file.

2
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


ENVI Windows and Displays
The ENVI Main Menu Bar
In ENVI, activities are initiated by using the menus in the ENVI main menu bar, which may be oriented horizontally as
shown below, or vertically (as set via the option on the File Preferences Miscellaneous tab).

The Display Group


As you work with ENVI, a group of windows will appear on your screen allowing you to manipulate and analyze your
image. This group of windows is collectively referred to as the display group and the default setup consists of an Image
window, a Scroll window, and a Zoom window.

Image window

Zoom Window

Scroll Window

You can choose which combinations of windows appear on the screen by right-clicking on any image window to display
the right-click menu and selecting a style from the Display Window Style submenu. Use the ENVI main menu bar
File Preferences Display Defaults tab to change the default settings for which windows you wish to display and
where you wish to position them.
You may have many display groups open on the screen at any time. A wide variety of other types of ENVI windows may
also be displayed, such as scatter plots, spectral profiles, spectral plots, and vector windows.
All windows can be resized by grabbing and dragging a window corner with the left mouse button.
1. Resize the Image window to be as large as possible (until the Scroll window disappears).
2. Now, make the Image window smaller than the full extent of the image data (the Scroll window will reappear).
3. Resize the Zoom window and notice how the outlining box changes in the Image window.

3
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


The Image Window
The Image window shows a portion of the image at full resolution.

Display Group Menu Bar

Zoom Box

The Display group menu bar provides access to many ENVI features related to the images in the display group. By
default, it appears at the top of the Image window. If you have chosen to display only the Scroll and Zoom windows or
just the Zoom window, the menu bar will appear at the top of the Zoom window.
The Zoom box (the colored box in the Image window) indicates the region that is displayed in the Zoom window.
1. Place the mouse cursor in the Zoom box in the Image window, hold down the left mouse button, and move the
mouse. The Zoom window is updated automatically when the mouse button is released.
2. Place the cursor anywhere in the Image window (outside of the Zoom box) and click the left mouse button to
move the magnified area instantly. If you click, hold, and drag the left mouse button in this fashion, the Zoom
window is updated as you drag.
3. Click once in the Zoom box in the Image window and use the arrow keys on your keyboard to move the box. To
move several pixels at a time, hold down the Shift key while using the arrow keys.
You can choose to have scroll bars displayed in the Image window. These scroll bars provide a way to move through the
Scroll window, allowing you to select which portion of the image appears in the Image window.
1. Right-click in the Image window and select Toggle Display Scroll Bars.
2. To have scroll bars appear in the Image window by default, use the ENVI main menu bar to select the File
Preferences Display Defaults tab. Set the Image Window Scroll Bars toggle to Yes.

4
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


The Scroll Window
The Scroll window displays the entire image at reduced resolution (subsampled). The subsampling factor is listed in
parentheses in the window Title Bar at the top of the image. The highlighted Image box (red by default) indicates the
area shown at full resolution in the Image window.
Subsampling Factor

Image Box

1. Place the mouse cursor inside the Image box, hold down the left mouse button, drag to the desired location, and
release to reposition the portion of the image shown in the Image window. The Image window is updated
automatically when the mouse button is released.
2. Click anywhere within the Scroll window using the left mouse button to instantly move the selected Image
window area. If you click, hold, and drag the left mouse button in this fashion, the Image window will be updated
as you drag (the speed depends on your computer resources).
3. Click in the Image box and press the arrow keys on your keyboard. To move the image in larger increments, hold
down the Shift key while using the arrow keys.

The Zoom Window


The Zoom window shows a portion of the image magnified the number of times indicated by the number shown in
parentheses in the Title Bar of the window. The zoom area is indicated by a highlighted box (the Zoom box) in the Image
window.
Zoom Level

Zoom controls

There are three Zoom controls (red by default) in the lower left corner of the Zoom window. These control the zoom
factor and the crosshair cursor in both the Zoom and Image windows.
1. Place the mouse cursor in the Zoom window and click the left mouse button to reposition the magnified area
(displayed in the Zoom box in the Image window) by centering the zoomed area on the selected pixel.
2. Click and hold the left mouse button in the Zoom window while dragging. This causes the Zoom window to pan
within the Image window.

5
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


3. Click the left mouse button on the
of 1.

graphic in the lower left corner of the Zoom window to zoom out by a factor

4. Using a three button mouse, click the middle mouse button on the
5. Click the right mouse button on the
6. Click the left mouse button on the
7. Click the middle mouse button on the
8. Click the right mouse button on the
9. Click the left mouse button on the
10. Click the middle mouse button on the
11. Click the right mouse button on the

graphic to zoom out by a factor of 2.

graphic to return the Zoom window to the default zoom factor.


graphic to zoom in by a factor of 1.
graphic to zoom in by a factor of 2.
graphic to return the Zoom window to the default zoom factor.
graphic to toggle the crosshair cursor in the Zoom window on or off.
graphic to toggle the crosshair cursor in the Image window on or off.
graphic to toggle the Zoom box in the Image window on or off.

12. The Zoom window can also have optional scroll bars, which provide an alternate method for moving through the
Zoom window. Right-click in the Zoom window and select Toggle Zoom Scroll Bars. To have scroll bars
appear on the Zoom window by default, use the ENVI main menu bar to select the File Preferences
Display Defaults tab. Set the Zoom window Scroll Bars toggle to Yes.

The Mouse Button Descriptions Dialog


ENVI has many interactive functions, and the mouse button combinations and actions are different for each one. The
Mouse Button Descriptions dialog is available to assist you in understanding what the mouse buttons do in each graphics
window. Start the Mouse Button Descriptions dialog by performing either of these methods:

From the Display group menu bar, select Window Mouse Button Descriptions.

From the ENVI main menu bar, select Window Mouse Button Descriptions and place your cursor over the
Image window.

When the Mouse Button Descriptions dialog is open, the mouse button assignments for each ENVI display or graphics
window are shown in the dialog when the cursor is poised over a display group window. In the dialog, MB1 is the left
mouse button, MB2 is the middle mouse button, and MB3 is the right mouse button.

Basic ENVI Functions


This section of the tutorial takes you on a step-by-step tour of ENVIs basic functions.

Displaying the Cursor Location and Value


You can choose to display the location of your mouse cursor, screen value (RGB color), and the actual data value of the
pixel underneath the crosshair cursor using the Cursor Location/Value dialog. When several display groups are open, this
dialog specifies which display groups location and value are being reported.
1. To display the cursor location and value, select Window Cursor Location/Value from either the ENVI main
menu bar or the Display group menu bar. You can also right-click in the Image window and select Cursor
Location/Value.
2. Move the mouse cursor over the Image, Scroll, or Zoom windows to display location and value information in the
Cursor Location/Value dialog.
3. Double-click in the Image window to hide the Cursor Location/Value dialog. Double-click again to show the
Cursor Location/Value dialog.
4. From the Cursor Location/Value menu bar, select File Cancel to close the dialog.

6
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


Displaying Image Profiles
X (horizontal), Y (vertical), and Z (spectral) profile plots can be selected and displayed interactively. These profiles show
the data values across an image line (X), column (Y), or spectral bands (Z). To display these profiles, perform the
following steps.
1. From the Display group menu bar, select Tools Profiles X Profile to display a window plotting data values
versus sample number for a selected line in the image.
2. From the Display group menu bar, select Tools Profiles Y Profile to display a plot of data value versus
line number.
3. From the Display group menu bar, select Tools Profiles Z Profile to display a spectral plot. You can also
open a Z profile from the right-click menu in any Image window.
4. From the Display group menu bar, select Window Mouse Button Descriptions to view the descriptions of
the mouse button actions in the Profile displays.
5. A red crosshair extends to the top and bottom and to the sides of the Image window. The red lines indicate the
line or sample locations for the vertical or horizontal profiles. Move the crosshair around the image (just as you
move the Zoom box) to see the three image profile plots update to display data on the new location.
6. Close the profile plots by selecting File Cancel from the menu bar within each window.

Performing Quick Contrast Stretching


You can perform quick contrast stretches using default parameters and data from either the Image window, the Zoom
window, or the Scroll window.
1. From the Display group menu bar, select Enhance and apply various contrast stretches (Linear, Linear 0-255,
Linear 2%, Gaussian, Equalization, and Square Root).
2. Compare the effects of the various stretches on the display group.

Displaying Interactive Scatter Plots


You can plot the data values of two selected image bands versus
each other in a scatter plot to graphically display the overlapping
values.
1. From the Display group menu bar, select Tools 2D
Scatter Plots. The Scatter Plot Band Choice dialog
appears, allowing you to choose the two image bands to
compare.
2. Select one band for the x axis and another band for the y
axis and click OK. It may take a few seconds for ENVI to
extract and tabulate the data values.
3. Once the scatter plot has appeared (see image right),
position the mouse cursor anywhere in the Image window
and drag with the left mouse button pressed. Pixel values
contained in a ten-pixel by ten-pixel box surrounding the
crosshair will be highlighted in red on the scatter plot.
4. From the Display group menu bar, select Window
Mouse Button Descriptions to display the functions of
the different mouse button actions when applied in the
Scatter Plot display.
5. Click and drag the cursor around in the Image window to observe the dancing pixels effect.

7
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


You can also use the scatter plot to highlight specific data values in the Image window.
1. Place the mouse cursor in the Scatter Plot window and click and drag with the middle mouse button. Pixel values
contained in a ten-pixel by ten-pixel box surrounding the crosshair will be highlighted in red on the scatter plot
Pixels with the values contained in the box are highlighted in the Image window and appear to dance.
2. From the Scatter Plot menu bar, select File Cancel to close the Scatter Plot window.

Loading a Color Image


Previously, you opened and were working with Band 4 of can_tmr.img.
You opened that image using the Gray Scale option. Now you will open
three bands of the image using the RGB Color option.
1. If the Available Bands List dialog is not displayed, select Window
Available Bands List from the ENVI main menu bar.
2. Click the RGB Color radio button, then select TM Band 1 under
can_tmr.img. The band you have chosen is displayed in the field
marked R.
3. Select TM Band 2. The band you have chosen is displayed in the
field marked G.
4. Select TM Band 5. The band you have chosen is displayed in the
field marked B.
5. Click Display #1 and select New Display.
6. Click Load RGB to load the image into a new display.

Linking Two Displays


Link the two displays together for comparison. When you link two displays,
any action you perform on one display (scrolling, zooming, etc.) is echoed in
the linked display. To link the two displays on your screen, do the following.
1. From the Display group menu bar, select Tools Link Link
Displays. You can also right-click in the Image window and select
Link Displays.
2. Click OK in the Link Displays dialog to establish the link.
3. Scroll and zoom in one display group and observe as your changes are mirrored in the second display.

Dynamic Overlays
ENVIs multiple dynamic overlay feature allows you to dynamically superimpose parts of one or more linked images onto
another image. Dynamic overlays are turned on automatically when you link two displays, and may appear in either the
Image window or the Zoom window.
1. Click the left mouse button in one of the Image windows to see the image displays overlaid on one another.
2. To create a smaller overlay area, position the mouse cursor anywhere in either Image window (or Zoom window)
and hold down and drag with the middle mouse button. Upon button release, the smaller overlay area is set
and a small portion of the linked image will be superimposed on the current Image window.
3. Click the left mouse button in the Image window and drag the small overlay window around the image to see the
overlay effects.
4. Resize the overlay area at by clicking and dragging the middle mouse button until the overlay area is the desired
size.

8
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


Selecting Regions of Interest
ENVI lets you define regions of interest (ROIs) in your images. ROIs are typically used to extract statistics for
classification, masking, and other operations.
1. From the Display group menu bar, select Overlay Region of Interest, or right-click in the Image window
and select ROI Tool.
2. Draw a polygon that represents the region of interest by clicking the left mouse button in the Image window to
establish the first point of the ROI polygon, then selecting further border points in sequence by clicking the left
button again. Close the polygon by clicking the right mouse button, then accept the polygon by clicking the right
mouse button again. The middle mouse button deletes the most recent point, or (if you have closed the polygon)
the entire polygon.
ROIs can also be defined in the Zoom and Scroll windows by selecting the appropriate window radio button in the
ROI Tool dialog.
When you have finished defining an ROI, it is shown
in the dialog table, with the name, region color,
number of pixels enclosed, and other ROI properties.
ROIs can also be defined as polylines or as a
collection of individual pixels by selecting the desired
ROI type from the ROI_Type pull-down menu in the
ROI Tool.
3. Click the New Region button.
4. Select an ROI by clicking in a cell of the far left
column of the ROI Tool table. An ROI is selected
when its entire row is highlighted. An asterisk next to
the row also signifies the currently active ROI.
Multiple ROIs can be selected by using Shift-click or
Ctrl-click. All the ROIs can be selected by clicking the
Select All button. Click and type to edit the values
in the cells of the ROI Tool table. Change the name
for the region and select a new color.
5. Hide ROIs by selecting them in the table and clicking
the Hide ROIs button. Use the Show ROIs button
to re-display these hidden ROIs.
6. Go to an ROI in the ENVI display by selecting it and clicking the Goto button.
7. View the statistics for one or more ROIs by selecting them in the table and clicking the Stats button.
8. Grow an ROI to its neighboring pixels within a specified threshold by selecting it and clicking the Grow button.
9. Pixelate polygon and polyline ROIs by selecting them in the table and clicking the Pixel button. Pixelated objects
become a collection of editable points.
10. Delete ROIs by selecting them in the table and clicking the Delete button.
The ROI Tool table also allows you to view and edit various ROI properties, such as name, color, and fill pattern.
Menu options available at the top of the ROI Tool dialog let you perform other various tasks, such as calculate
ROI means, save your ROI definitions, and load saved definitions. ROI definitions are retained in memory after
the ROI Tool dialog is closed, unless you explicitly delete them. ROIs are available to other ENVI functions even
if they are not displayed.
11. Close the ROI Tool using the menu at the top of the table, select File Cancel.

9
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


Annotating the Image
ENVIs flexible annotation features allow you to add text, polygons, color bars, and other symbols to your plots and
images.
The Annotation Text dialog allows you to choose from a variety
of annotation types. Different types are selected from the
Object menu and include Text, Symbols, Rectangles, Ellipses,
Polygons, Polylines, Arrows, Map Scale Bars and Declination
Diagrams, Map Keys, Color Table Ramps, and Images. By
default, the Annotation dialog starts up with Text selected. Other
fields in the dialog let you control the size, color, placement, and
angle of the annotation text. When you select different
annotation types from the Object menu, the fields in the dialog
change to display options appropriate to the new type.
1. From the Display group menu bar, select Overlay
Annotation.
2. Type some text in the text field of the Annotation Text
dialog.
3. Select a font, font size, and color using the fields
provided in the dialog, then position the mouse pointer
in the Image window and click the left mouse button.
Your text is displayed in the window at the point you
clicked.
Remember, you can view the mouse button descriptions
using the Display group menu bar Window Mouse Button Descriptions option.
4. Using the left mouse button, drag the handle (displayed in the image below as a diamond shape to the left,
bottom of the text) to position the text in the window.

5. You can continue to change the annotations properties and position by changing the fields in the dialog box or
dragging the text or symbol while holding down the left mouse button. When you are satisfied with the
annotation, click the right mouse button to fix the annotation in position.
6. You can save your image annotation by selecting File Save Annotation from the Annotation Text dialog
menu bar. If you do not save your annotation in a file, it will be lost when you close the Annotation Text dialog
(you will be prompted to save the annotation if you close without first saving). You can also restore saved
annotation files by selecting File Restore Annotation from the Annotation Text dialog menu bar.

10
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


7. To edit an annotation element that has already been set in the image, select Object Selection/Edit from the
Annotation Text dialog menu bar.
8. Draw a box around the annotation you wish to edit by clicking and dragging with the left mouse button. When
the handle reappears, click and drag the handle and annotation to move and configure the item just as you would
a new annotation.
9. To suspend annotation operations and return to normal ENVI functionality temporarily, select the Off radio
button at the top of the Annotation Text dialog. This allows you to use the scroll and zoom features in your
display without losing your annotations. To return to the annotation function, select the radio button in the
Annotation Text dialog for the window you are annotating.
10. Leave your annotation on the Image window as you complete this tutorial.

Adding Grid Lines


You can use grid lines to overlay one or more grids on an image. Grids can be pixel-based or map-coordinate and/or
latitude/longitude based (for georeferenced images). Each image display can have its own set of grids, which are
displayed in the Image, Scroll, and Zoom windows.
1. From the Display group menu bar, select Overlay Grid Lines to open the Grid Line Parameters dialog box.
As soon as you choose this option, an image border is automatically added.
2. You can adjust the grid line attributes by setting the line thickness and color and the grid spacing by selecting
Options Edit Pixel Grid Attributes from the Grid Lines Parameters dialog menu bar. This selection brings
up the Edit Pixel Attributes dialog box.
3. In the Edit Pixel Attributes dialog, you can change the color, thickness and grid spacing for the labels, lines, box
and corners of the grid. When the attributes are set up to your satisfaction, click OK in the Edit Pixel Attributes
dialog to apply the changes to the grid on the images.
4. When you have added a satisfactory grid, click Apply in the Grid Line Parameters dialog.

Saving and Outputting an Image


ENVI gives you several options for saving and outputting your filtered, annotated, gridded images. You can save your
work in ENVIs image file format, or in several popular graphics formats (including Postscript) for printing or importing
into other software packages. You can also output directly to a printer.
1. From the Display group menu bar, select File Save Image As Image File to save your work in ENVIs
native format (as an RGB file). The Output Display to Image File dialog appears.
11
ENVI Tutorial: Introduction to ENVI

Tutorial: Introduction to ENVI


2. Select 24-Bit Color or 8-bit (gray scale) output.
3. Click the Change Graphic Overlay Selections button to select graphics options (including annotation and
gridlines)
4. Set border options.
5. Select output to Memory or File using the desired radio button. If output to File is selected, enter an output
filename.
6. If you select other graphics file formats from the Output File Type drop-down which, by default is set to ENVI,
your choices will be slightly different.
7. Click OK to save the image. This process saves the current display values for the image, not the actual data
values.

Exiting ENVI
End the ENVI session by selecting File Exit from the ENVI main menu, then click OK to terminate ENVI when
prompted.

12
ENVI Tutorial: Introduction to ENVI

ENVI Tutorial:
Working with ENVI Zoom

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2

Files Used in This Tutorial ..................................................................................................................................2

STARTING ENVI ZOOM..............................................................................................................................................2


SETTING PREFERENCES ..............................................................................................................................................2
OPENING AND DISPLAYING AN IMAGE ............................................................................................................................2
WORKING WITH THE DATA MANAGER ............................................................................................................................3
WORKING WITH LAYERS.............................................................................................................................................3

Reordering Layers .............................................................................................................................................3


Hiding Layers....................................................................................................................................................4

EXPLORING THE ENVI ZOOM INTERFACE ........................................................................................................................4


USING DISPLAY TOOLS ..............................................................................................................................................5
WORKING WITH THE OVERVIEW WINDOW ......................................................................................................................5
PERFORMING RX ANOMALY DETECTION..........................................................................................................................6
WORKING WITH A PORTAL ..........................................................................................................................................7

Pinning the Portal to the Image ..........................................................................................................................7


Working with Blend, Flicker, and Swipe ...............................................................................................................8

Blending .............................................................................................................................................................................8
Flickering ............................................................................................................................................................................8
Swiping...............................................................................................................................................................................8

CHIPPING AND SAVING ..............................................................................................................................................9


RESETTING PREFERENCES AND CLOSING ENVI ZOOM.........................................................................................................9

Tutorial: Working with ENVI Zoom


Overview of This Tutorial
In this tutorial, you will use ENVI Zoom to display a hyperspectral image of Jasper Ridge, California, and enhance, zoom,
pan, and rotate the image. You will perform RX anomaly detection on the scene to identify anomalous spectral targets.
You will create a Portal over a target of interest and compare it to the original scene using blend, flicker, and swipe tools.
Finally, you will use Chip from Display to take a screen capture of the image and save it to JPEG format.

Files Used in This Tutorial


ENVI Tutorial Data DVD: envidata\jsp99hym
File
jsp99hym.eff

Description
HyMap apparent reflectance data, Jasper Ridge, California, USA

1999 HyMap data of Jasper Ridge, California, used for the tutorial are copyright 1999 Analytical Imaging and Geophysics
(AIG) and HyVista Corporation (All Rights Reserved), and may not be redistributed without explicit permission from AIG
(info@aigllc.com).

Starting ENVI Zoom

Windows: Select Start Programs ENVI x.x ENVI Zoom.

UNIX: Type envizoom at the UNIX command line.

Setting Preferences
By default when you open a file, ENVI Zoom attempts to automatically display a true color or gray scale image based on
your file type. For this tutorial, you will change this preference and display the Data Manager.
1. From the menu bar, select File Preferences. The ENVI Zoom Preferences dialog appears.
2. On the left side of the dialog, select Data Manager.
3. On the right side of the dialog, double click the Auto Display Method for Multispectral Files field and select
CIR (color infrared). This will cause image files to be displayed as color infrared by default.
4. Double-click the Launch Data Manager After File/Open field, and select Always. This will change the
preference and allow the Data Manager to be viewed every time a file is opened.
5. Ensure the following settings are selected:
Auto Display Files On Open = True
Clear Display When Loading New Data = False
Close Data Manager After Loading New Data = False.
6. Click OK in the ENVI Zoom Preferences dialog to save these preferences.

Opening and Displaying an Image


1. Click the Open button

on the toolbar. The Open dialog appears.

2. Navigate to envidata\jsp99hym and open jsp99hym.eff. Because of the preferences you set in the
previous step, the image is automatically displayed as color-infrared (CIR) and the Data Manager is displayed.

2
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom


Working with the Data Manager
The Data Manager lists the files that you have opened and makes them accessible to load into your display. When you
open a file in ENVI Zoom, a new item is added to the top of the Data Manager tree. You can open multiple files in one
ENVI Zoom session, and you can choose which of those files to display and how to display them using the Data Manager.
1. When you click on band names in the Data Manager,
color gun assignments automatically cycle through red,
green, then blue (in that order). Experiment with
selecting different band combinations. Click the band
name you want to assign to red. A red box appears
next to the band name.
2. Repeat for the green and blue bands.
If one band is assigned multiple colors, a split box
appears next to the band name, showing the colors.
You must click Load Data each time to see the new
band combination.
3. You originally had a CIR image loaded into the Image
window. In the Data Manager, right-click on the
filename (jsp99hym.eff) and select Load True
Color. ENVI Zoom determines the proper bands to load
a true-color image into the Image window.
4. Click the Tip: Working with the Data Manager link
at the bottom of the Data Manager. You will find quick
access to helpful tips throughout ENVI Zoom. These
tips provide links to the ENVI Zoom Help, which is also
accessible via the Help toolbar button or Help menu.
5. Close the ENVI Zoom Help (use the X at the top right of
the dialog window).
6. Explore the toolbar buttons on the Data Manager. From the Data Manager toolbar, you can open new files,
expand and collapse files, close files, and pin the Data Manager to keep it on the screen or unpin it to have it
automatically close when you load a file into the display.
7. Close the Data Manager (use the X on the top right of the dialog window).

Working with Layers


You can load multiple layers into ENVI Zoom at one time and manage those layers using the Layer Manager. In the last
exercise, you created separate true color and color infrared layers for the same file. Both are displayed in the Layer
Manager.

Reordering Layers
You can control the order of layers in the Image and Overview windows by
dragging and dropping layers in the Layer Manager tree or by using menu
options (which you will use in a later exercise).
1. Click and drag Raster1: jsp99hym.eff in the Layer Manager above
Raster 2: jsp99hym.eff.

3
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom


Hiding Layers
By default, all layers in the Layer Manager are displayed in the Image window. You can temporarily hide the display of a
layer so that you can work with other layers in the Image window.
1. Right-click on Raster1: jsp99hym.eff in the Layer Manager, and disable the Show option to turn the display of
that layer off in the Image window.
2. Right-click on a Raster1: jsp99hym.eff again and enable the Show option to turn the display of that layer
back on.

Exploring the ENVI Zoom Interface


The ENVI Zoom interface includes a menu bar, toolbars, category bars, and a Status bar. Much of the ENVI Zoom
interface is customizable and provides options to make use of multiple monitors.
Menu bar
Toolbars
Category bars

STEP 1

STEP 3

STEP 4

Status bar
Process Manager

1. Detach the Layer Manager category by clicking the Detach button to the right of the Layer Manager category bar
(see image above).
2. Reattach the Layer Manager category by clicking the X on the top right of the Layer Manager dialog window.
3. Collapse the entire category panel by clicking on the collapse bar to the right of the categories (see image
above). This allows you to view a larger Image window. Now, expand the categories by clicking again on the
same bar (to the left of the Image window).
4. Collapse the Cursor Value category by clicking the arrow to the left of the Cursor Value category bar (see image
above). Now, expand the Cursor Value category by clicking again on the same arrow.

4
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom


Using Display Tools
1. Click the Zoom button
then click and drag your cursor to draw a rubber-band box around a vegetated area
near the center of the image. This will zoom to that area in the Image window.
then click and drag your cursor in the Image window to pan in the direction of the
2. Click the Pan button
mouse. You can also use the middle mouse button to perform a pan.
then click and hold to continuously drift in the direction of the cursor. Moving further
3. Click the Fly button
from the center (closer to any side) causes the drift to increase in speed.
. A set of red crosshairs appears in the Image window. You can click-and-drag
4. Click the Crosshairs button
the crosshairs to move them anywhere in the image. The Cursor Value category lists the pixel coordinates of the
pixel directly underneath the center of the crosshairs. (You may want to use the Zoom tools to zoom in to
individual pixels.)
5. In the field labeled Go To, type the pixel coordinates 240,500 and press the Enter key. The crosshairs jump to
that location in the image, and the Image window centers over that location. If you were working with a
georeferenced file, you could enter map coordinates or latitude/longitude coordinates in the Go To field.
then click and drag the cursor in a clockwise or counter-clockwise direction to rotate
6. Click the Rotate button
the image. The Rotate To drop-down list on the toolbar interactively reports the current degree of rotation.
7. Click the Select button

to exit the Rotate tool.

8. Click the Rotate To drop-down list on the toolbar and select 0.


9. Experiment with the Brightness, Contrast, Sharpen, and Transparency
sliders.
Click on the slider bar to the right or left of the indicator or click the slider
then use the Page Up or Page Down keys to move the slider up or down incrementally by ten percent.
Click on the icons to the right or left of the slider bar or click the slider then use the arrow keys on the
keyboard to move the slider up or down incrementally by one unit.
Click the slider then use the Home key on the keyboard to move the slider to 100 and the End key to move
the slider to 0.
10. Click the Reset button on each slider to return them to their default values.
11. Experiment with different stretch types by selecting options from the Stretch Types drop-down list (Linear is
selected by default).

Working with the Overview Window


The Overview window provides a view of the full extent of the layers loaded into the Image window. Each time you
display a new layer, the Overview window is resized to encompass the extents of all layers in the Image window. The
Overview window is not populated until pyramids are built for the image, therefore it may appear blank for several
seconds when you first load an image while pyramids are being built.
The View box is a small, partially transparent window inside the Overview window that shows the extent of the imagery
visible in the Image window.

5
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom

View box

1. Increase or decrease the size of the View box by clicking and dragging a corner of that box. This will zoom in or
out on the image displayed in the Image window. As you click and drag a side, the View box adjusts shape to
maintain the proper aspect ratio of the Image window.
2. Click inside of the View box and drag it to any location within the Overview window to dynamically update the
Image window.
3. Click outside of the View box in the Overview window to recenter the View box on the spot where you clicked.

Performing RX Anomaly Detection


RX Anomaly Detection processing uses the Reed-Xiaoli Detector algorithm to detect the spectral or color differences
between a region to test and its neighboring pixels or the entire dataset. This algorithm extracts targets that are
spectrally distinct from the image background. Results from RXD analysis are unambiguous and have proven very
effective in detecting subtle spectral features.
1. From the menu bar, select Processing RX
Anomaly Detection. The Select Input File dialog
appears.
2. RX Anomaly Detection works with all bands of a
multispectral file, so you will not need to perform any
spectral subsetting. The filename jsp99hym.eff is
already highlighted in the Select Input File dialog. Click
OK. The RX Anomaly Detection Parameters dialog
appears.
3. In the Algorithm drop-down list, use the default RXD
algorithm.
4. For this tutorial, the mean spectrum will be derived
from the entire dataset. In the Mean source dropdown list, use the default value of Global.
5. Click the File or Memory button to select Output
Result To Memory.
6. Click OK. The Process Manager in the lower-right corner of the ENVI Zoom window shows the processing status
of the RX Anomaly Detection algorithm.

7. When processing is complete, the resulting image appears in the Layer Manager as
"Raster 3: {Memory} RXD Result," and it is automatically displayed in the Image window.

6
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom


8. Explore this image, when you are finished looking at it, right-click on the Raster 3: {Memory} RXD Result in
the Layer Manager and select Remove Selected Layer to remove it from the display.
on the toolbar. Notice that the RXD result is still available (it has not been
9. Click the Data Manager button
deleted; it is at the bottom of the list). You have just removed it from the display.
10. Close the Data Manager.

Working with a Portal


A Portal is a window inside the Image window that allows you to view multiple layers in the Layer Manager
simultaneously. A Portal works as a separate layer (inside the Portals folder) in the Layer Manager. In this step, you will
compare the true-color and CIR Jasper Ridge layers.
1. In the Layer Manager, right-click on the Raster 2: jsp99hym.eff (the true-color image) and select Order
Layer Bring to Front. This will place the Raster 2 image at the top of the layer list.
on the toolbar. ENVI Zoom creates a new Portal from the second layer in the Layer
2. Click the Portal button
Manager, which is the Raster 1 CIR image. ENVI Zoom adds the new Portal to the Portals folder in the Layer
Manager.
3. Click and drag inside the Portal to move it around the Image window.
4. Click and drag on a corner or side of the portal to resize it.
on the ENVI Zoom toolbar. Grab the true-color image (click outside of the Portal) and
5. Click the Pan button
drag it around in the Image window. Notice how the Portal stays in one location while the image moves behind it.
6. Click the Select button

to exit the Pan tool.

Pinning the Portal to the Image


You can attach (or pin) the Portal to the image so that the Portal moves with the data (vice moving and panning with the
image as you did in the last exercise). This way, when you pan the image, the Portal stays fixed to its original position
relative to the data.
1. Click once inside the Portal to select it, then place your cursor at the top inside of the Portal to display the Portal
toolbar.

2. Click the Pin button

. The button changes to Unpin.


7
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom


3. Click the Pan button
on the ENVI Zoom toolbar. Grab the true-color image (click outside of the Portal) and
drag it around in the Image window. Notice how the Portal stays fixed to the image.
4. Click the Select button

on the ENVI Zoom toolbar to exit the Pan tool.

5. Click once inside the Portal to select it, then place your cursor at the top inside of the Portal to display the Portal
toolbar.
6. Click the Unpin button

on the Portal toolbar.

Working with Blend, Flicker, and Swipe


ENVI Zoom provides tools that help you compare two different layers. You can use these tools for comparing entire
images or you can use them inside of a Portal, as you will do in this tutorial. These tools are enabled only when you have
two or more layers open in the Layer Manager, and when you display at least one layer in the Image window. For optimal
viewing when using these tools, it is recommended that you not use the transparency enhancement slider.

Blending
Blending allows you to gradually transition from one image to another, by increasing the transparency of one image.
1. Right-click inside of the Portal and select Blend. Blending automatically begins between the true color and CIR
layers.
2. Experiment with the speed of the blend, using the
3. Click the Pause button

and

buttons available on the Portal toolbar.

on the Portal toolbar to stop the blend.

Flickering
Flickering allows you to toggle between two images at a desired speed.
1. Right-click inside of the Portal and select Flicker. Flickering automatically begins between the true color and CIR
layers.
2. Experiment with the speed of the flicker, using the
3. Click the Pause button

and

buttons available on the Portal toolbar.

on the Portal toolbar to stop the flicker.

4. If you paused the flicker action while the true color image was displayed, your Portal will appear transparent.
Right-click in the Portal and select Load New Layer Raster 1: jsp99hym.eff.

Swiping
Swiping allows you to spatially transition from one image to another using a vertical dividing line that moves between two
images.
1. Right-click inside of the Portal and select Swipe. Swiping automatically begins between the between the true
color and CIR layers.
2. Experiment with the speed of the swipe, using the
3. Click the Pause button

and

buttons available on the Portal toolbar.

on the Portal toolbar to stop the swipe.

To exit blend, flicker, or swipe, you must close the Portal, unless you want the Portal to appear in the screen capture you
will create in the next step.

8
ENVI Tutorial: Working with ENVI Zoom

Tutorial: Working with ENVI Zoom


Chipping and Saving
In this step, you will use Chip from Display to take a screen capture of the contents of the Image window, and save
the image. Any enhancements, zooming, rotating, or Portals that are displayed in the Image window are burned into the
output image. ENVI Zoom creates an 8-bit, three-band image at screen resolution.
1. Click the Chip from Display button
appears.

on the ENVI Zoom toolbar. The Chip From Display Parameters dialog

2. From the Output File drop-down list, select JPEG.


3. Click the File Select button

. The Select Output Filename dialog appears.

4. Browse to a preferred location on your hard drive, type zoomtutorial as the file name, and click Open.
5. Click OK on the Chip From Display Parameters dialog. ENVI Zoom adds the output file to the Data Manager,
where you can open and view the new JPEG image.

Resetting Preferences and Closing ENVI Zoom


1. From the menu bar, select File Preferences. The ENVI Zoom Preferences dialog appears.
2. Click the Restore Defaults button at the bottom of the dialog.
3. Click OK to save these preferences.
4. From the menu bar, select File Exit and click OK to exit ENVI Zoom.

9
ENVI Tutorial: Working with ENVI Zoom

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 2

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Interactive Display Functions

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2
OPENING A PANCHROMATIC (SPOT) IMAGE FILE ..............................................................................................................2
PERFORMING INTERACTIVE CONTRAST STRETCHING...........................................................................................................2

Linear Stretching Options...................................................................................................................................3


Gaussian Stretching Options...............................................................................................................................4
Equalization Stretching Options ..........................................................................................................................4

APPLYING ENVI COLOR TABLES ...................................................................................................................................4


USING THE PIXEL LOCATOR.........................................................................................................................................5
DISPLAYING THE GEOREFERENCED CURSOR LOCATION........................................................................................................5
APPLYING INTERACTIVE FILTERS ..................................................................................................................................6
COMPARING IMAGES USING DYNAMIC OVERLAYS ..............................................................................................................6
REVIEWING GEOSPOT MAP INFORMATION.......................................................................................................................6
OPENING AND OVERLAYING DXF VECTOR FILES ...............................................................................................................7
COMPOSING A BASIC MAP ..........................................................................................................................................8

Adding a Grid to Your Image..............................................................................................................................8


Annotating the Image with a Map Key ................................................................................................................8
Saving and Restoring Annotation ........................................................................................................................8
Saving and Outputting an Image (Burn-In)..........................................................................................................9

ENDING THE ENVI SESSION .......................................................................................................................................9

Tutorial: Interactive Display Functions


Overview of This Tutorial
This tutorial provides an introduction to using ENVI with Panchromatic (SPOT) data, including display, contrast
enhancement, basic information about ENVI and some suggestions for your initial investigations of the software. It is
designed to introduce first-time ENVI users to the basic concepts of the package and to explore some of its key features.
It assumes that you are already familiar with general image-processing concepts. It is recommended that new users
begin with either the Quick Start to ENVI tutorial or the Introduction to ENVI tutorial before beginning this tutorial.

Files Used in This Tutorial


ENVI Resource DVD: envidata\enfidavi
File
enfidavi.bil
enfidavi.hdr
enfidavi.dsc
enfidavi.rep
enfidavi.rsc
dxf.txt
alti.dxf
energy.dxf
hydro.dxf
industry.dxf
physio.dxf
popu.dxf
transpor.dxf
copyrite.txt

Description
SPOT Panchromatic Data, Enfidaville, Tunisia
ENVI Header for Above
GeoSpot Volume Descriptor File
GeoSpot report file (REP/B: GEOSPOT Structure)
GeoSpot Raster Source Description File
DXF coding descriptor file
Spot height DXF file
Oil or Gas Pipeline DXF file
Hydrology DXF file
Industrial Areas DXF file
Physiographic areas DXF file
Urban Features (Population Centers) DXF file
Transportation Networks DXF file
Data Copyright Notice Panchromatic Data and Vector Overlays

This dataset is a SPOT Panchromatic image and corresponding DXF files of Enfidaville, Tunisia, courtesy of ITT Visual
Information Solutions International France. These data are Copyright CNES-Spot Image and IGN France.

Opening a Panchromatic (SPOT) Image File


Before attempting to start the program, ensure that ENVI is properly installed as described in the Installation Guide that
shipped with your software.
1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\enfidavi directory, select the file enfidavi.bil from the list, and click Open. The
Available Bands List appears on your screen. This is a SPOT Panchromatic image of Enfidaville, Tunisia, courtesy
of ITT Visual Information Solutions France. The data in this file is copyrighted as Copyright CNES-Spot Image and
IGN France.
3. Select Band 1.
4. Ensure the Gray Scale radio button is selected - then click Load Band to load the image into a new display.
5. Examine the image in the display group.

Performing Interactive Contrast Stretching


Interactive contrast stretching plots a histogram and allows you to interactively control the contrast of the displayed
image. Many different types of stretches can be applied. By default, a linear 2% stretch is applied to the data when it is
first displayed.
2
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


1. From the Display group menu bar, select Enhance Interactive Stretching. An Interactive Stretching dialog
for the displayed band appears. This dialog allows you to change the contrast stretch of the displayed image.
Two histogram plots display the color or gray scale range of the input image (left) and the output image after
contrast stretching (right). Initially, the input and output histograms reflect the default stretch applied to the data
when the image was displayed.

2. Input histogram information can be extracted from the Image window, from the Scroll window (subsampled),
from the Zoom window, from the entire image band (all pixels of the data), or from a user defined region-ofinterest (ROI). Explore the options available in the Histogram_Source menu on the Interactive Stretching
dialog menu bar.

Linear Stretching Options


When images are loaded into the display group, a 2% linear contrast stretch is applied by default. This can be modified
by selecting File Preferences from the Display group menu bar, then clicking the Display Defaults tab.
1. From the Interactive Stretching dialog menu bar, select Stretch_Type Linear. Two vertical dotted lines
appear in the input histogram plotthese bars can be repositioned to control the minimum and maximum value
used in the contrast stretch.
2. In the Input Histogram window, there are two dotted vertical bars on either
side of the histogram. These bars can be repositioned to control the minimum
and maximum value used in the contrast stretch. Position the mouse cursor
over the left bar then click and hold the left mouse button as you drag the bar
from side to side. As the dotted vertical bar is moved across the plot,
numbers appear on the status bar of the Interactive Stretching dialog.
Whenever the left mouse button is clicked over the histogram plot, the status
bar displays the current data value, the number of pixels and percentage of
pixels that have that value, and the cumulative percentage of pixels with
values less than or equal to the current value.
3. You can choose to have stretching or histogram changes applied to your images automatically, by selecting
Options Auto Apply from the Interactive Stretching dialog menu bar. To have changes applied to your image
only when you click the Apply button, toggle the Auto Apply option off. For this exercise, toggle the Auto
Apply option on.
4. Position the left dotted vertical bar in the Input Histogram window so that a cumulative percentage of pixels
equaling approximately 5% is selected. Now move the right bar so that the cumulative percentage is
approximately 95% of the pixels.
3
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


5. You can also position the bars by entering a minimum and maximum value (numbers or percentages) in the
Stretch fields provided in the dialog. Enter 4% in the left text field and 96% in the right text field and press
the Enter key. The % values are converted to digital numbers and the left and right bars in the display are
updated with the data values at 4% and 96%, respectively.

Gaussian Stretching Options


The default Gaussian stretch is centered at a mean of 127 with the data values 3 standard deviations set to 0 and 255.
1. From the Interactive Stretching dialog menu bar, select Stretch_Type Gaussian.
2. From the Interactive Stretching dialog menu bar, select Options Set Gaussian Stdv to set the standard
deviation. The Set Gaussian Stdv dialog appears allowing you to adjust the standard deviation value and see the
effect when the new setting is applied to the display group.

3. Set the Gaussian Stdvs to 4.00 and click OK.


4. You can choose to have the stretch automatically applied to the image display group by ensuring
Options Auto Apply is selected from the Interactive Stretching dialog menu bar.

Equalization Stretching Options


You can use the Equalization option in the Interactive Stretching dialog to automatically scale the data to equalize the
number of digital numbers in each histogram bin.
1. From the Interactive Stretching dialog menu bar, select Stretch_Type Equalization.
2. You can choose to have the stretch automatically applied to the image display group by ensuring
Options Auto Apply is selected from the Interactive Stretching dialog menu bar.
3. From the Interactive Stretching dialog menu bar, click File Cancel to close the Interactive Stretching dialog.

Applying ENVI Color Tables


You can use Color Mapping to apply color tables to images, create
interactive density sliced images, control the RGB image planes and to
change classification color mapping.
1. From the Display group menu bar, select Tools Color
Mapping ENVI Color Tables. The ENVI Color Tables dialog
appears.
2. Explore the color options in the Color Table list and observe the
color-coded image.
3. Use the Stretch Bottom and Stretch Top sliders to apply quick
stretches to the displayed image.
4. From the Color Tables dialog menu bar, select Options Reset
Color Table to return to the original stretch and gray scale color
table.
5. From the Color Tables dialog menu bar, select File Cancel to
close the Color Tables dialog.

4
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


Using the Pixel Locator
The Pixel Locator allows exact positioning of the cursor. You can manually enter a sample and line location to position
the cursor in the center of the Zoom window. If an image contains georeferenced data, you can optionally locate pixels
using map coordinates. If the image contains an associated DEM, elevation information displays. The Pixel Locator
pertains to the display group from which it was opened. You can open a Pixel Locator for each display group shown on
your screen.
1. From the Display group menu bar, select Tools Pixel Locator to open the Pixel Locator dialog.

2. Place the cursor in any of the three windows of the display group and click the left mouse button. Notice that the
Pixel Locator provides the pixel location for the selected pixel.
next to the projection field to toggle between true map coordinates and
3. Click the toggle button
latitude/longitude geographic coordinates. You can also choose to change the selected projection by clicking the
Change Proj button.
4. From the Pixel Locator dialog menu bar, select File Cancel to close the Pixel Locator dialog.

Displaying the Georeferenced Cursor Location


You can use ENVIs Cursor Location/Value to view image values and geographic location. The Cursor Location/Value
option displays the sample (horizontal, X) and line (vertical, Y) coordinates of the cursor along with the data value of the
pixel at the cursor location. The position is continuously updated as you move the cursor around the image.
1. From the Display group menu bar, select Tools Cursor Location/Value. The Cursor Location/Value dialog
box appears displaying the location of the cursor in the Image, Scroll, or Zoom windows. The dialog also displays
the screen value (color) and the actual data value of the pixel underneath the crosshair cursor.

2. From the Cursor Location/Value dialog menu bar, select File Cancel to close the Cursor Location/Value dialog.
5
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


Applying Interactive Filters
ENVI gives you the ability to apply several different pre-defined or user-defined filters to a display. The following exercise
shows you how to apply a pre-defined filter to the image in the Image window.
1. From the Display group menu bar, select Enhance Filter and choose a desired filter type to apply to the
displayed image.
2. Experiment with the different sharpening, smoothing, and median filters on the displayed image.
3. From the Available Bands List, click the Display #1 drop-down button and select New Display to create a
second display group.
4. Select Band 1 and click Load Band to load the image into the second display.
5. From the Display group menu bar in image #2, select Enhance Filter and select a filter different from that
applied to Image #1.

Comparing Images Using Dynamic Overlays


Use image linking and dynamic overlays to overlay portions of multiple images simultaneously (or flicker images) and to
perform identical operations on multiple images from within a single Image window.
1. From the Display group menu bar, select Tools Link Link Displays. You can also right-click in the image
and select Link Displays.
2. Click OK in the Link Displays dialog to establish the link.
3. Click the left mouse button in one of the Image windows to see the image displays overlaid on one another.
4. To create a smaller overlay area, position the mouse cursor anywhere in either Image window (or Zoom window)
and hold down and drag with the middle mouse button. Upon button release, the smaller overlay area is set
and a small portion of the linked image will be superimposed on the current Image window.
5. Click the left mouse button in the Image window and drag the small overlay window around the image to see the
overlay effects.
6. Resize the overlay area at by clicking and dragging the middle mouse button until the overlay area is the desired
size.

Reviewing GeoSpot Map Information


You can review the GeoSpot Map information for this image in the ENVI Header
file.
1. In the Available Bands List, right click on the Map Info icon and select
Edit Map Information. The Edit Map Information dialog appears.
2. Note that the data are in UTM projection, Zone 32 utilizing the NAD27
datum.
3. Click Cancel to close the Edit Map Information dialog.

6
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


Opening and Overlaying DXF Vector Files
1. From the ENVI main menu bar, select File Open Vector File.
2. In the Select Vector Filenames dialog, click the Files of type drop-down list and select DXF (*.dxf).
3. Navigate to the envidata\enfidavi directory and select all of the files with the .dxf extension (use the Shift
key to select multiple files).
4. Click Open or OK. The Import Vector Files Parameters dialog appears.
5. In the Native File Projection section of the dialog (near the bottom), click on UTM. This field refers to the map
units of the imported vector data.
6. Click the Datum button. The Select Geographic Datum dialog appears.
7. Select the Mexico (NAD27) datum from the list and click OK.
8. In the Zone field of the Import Vector Files Parameters dialog, type 32 and click the N radio button.
9. Click the Apply Projection to Undefined button then click OK to load the DXF files and convert them to .evf
(ENVI Vector Files). The Available Vectors List dialog appears.
10. On the Available Vectors List, click the Select All Layers button.
11. Click the Load Selected button. A Load Vector dialog appears which lists all of the available displays.
12. On the Load Vector Dialog, select Display #1 and click OK. The #1 Vector Parameters dialog appears showing
the named vector layers.
13. Click on one of the layer names in the #1 Vector Parameters dialog. In the Image window click and drag using
the left mouse button and observe map coordinates for the selected vectors in the #1 Vector Parameters dialog.

7
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


Composing a Basic Map
In this exercise, you will create a basic map. You will add grid lines, annotate your image, and save and output your
image.

Adding a Grid to Your Image


You can use Grid Lines to overlay one or more grids on an image. Grids can be pixel-based or map-coordinate and/or
latitude/longitude based (for georeferenced images). Each display group can have its own set of grids, which are
displayed in the Image, Scroll, and Zoom windows.
1. From the Display group menu bar, select Overlay Grid Lines. The Grid Line Parameters dialog appears.
Note that an image border is automatically added when you overlay grid lines (visible in the Scroll window).
2. Using the Grid Line Parameters dialog menu bar Options menu, you can adjust the grid lines by setting the line
thickness and color and the grid spacing.
3. When you have added a satisfactory grid, click Apply in the Grid Line Parameters dialog.

Annotating the Image with a Map Key


ENVIs flexible annotation features allow you to add text, polygons, color bars, and other symbols to your plots and
images.
1. From the Display group menu bar, select Overlay Annotation. The Annotation dialog appears.

2. To annotate a map key corresponding to the DXF overlays, select Object Map Key from the Annotation
dialog menu bar.
3. Click the Edit Map Key Items button to edit the map key characteristics. The Map Key Object Definition dialog
appears.
4. You can change the names, colors, and fill (for polygons) using the Map Key Object Definition dialog. Click OK to
return to the Annotation dialog.
5. Add a background color by clicking the color swatch in the Annotation dialog. Use the right-click menu to select a
color from a list.
6. Click the left mouse button to place the map key in the Image window. Reposition the map key by clicking, or by
clicking and dragging with the left mouse button. Set the map key by clicking the right mouse button in the
image.

Saving and Restoring Annotation


You can save your image annotation to a file. If you do not save your annotation in a file, it will be lost when you close
the Annotation dialog (you will be prompted to save the annotation if you close without first saving)
1. From the Annotation dialog menu bar, select File Save Annotation.
8
ENVI Tutorial: Interactive Display Functions

Tutorial: Interactive Display Functions


2. You can also restore saved annotation files by selecting File Restore Annotation from the Annotation dialog
menu bar.
3. To suspend annotation operations and return to normal ENVI functionality temporarily, select the Off radio
button at the top of the Annotation dialog. This allows you to use the scroll and zoom features in your display
without losing your annotations.
4. To return to the annotation function, select the radio button for the window in the display group that you are
annotating.

Saving and Outputting an Image (Burn-In)


ENVI gives you several options for saving and outputting your filtered, annotated, gridded images. You can save your
work in ENVIs image file format, or in several popular graphics formats (including Postscript) for printing or importing
into other software packages. You can also output directly to a printer. For this exercise, you will save the file in
GEOTIFF format.
1. From the Display group menu bar, select File Save Image As Image File. The Output Display to Image
File dialog appears.
2. Click the Output File Type drop-down list and select TIFF/GeoTIFF output from the pull-down menu. If the
displayed image is annotated and gridded, both the annotation and grid lines will be automatically saved.
3. Type or choose an output filename in the field provided and click OK to save the image. Because this is a
georeferenced image, ENVI automatically saves it as a GEOTIFF.

Ending the ENVI Session


You can quit your ENVI session by selecting File Exit from the ENVI main menu.

9
ENVI Tutorial: Interactive Display Functions

ENVI Tutorial:
Landsat TM and SPOT Data
Fusion

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2
DATA FUSION .........................................................................................................................................................3

Preparing Images..............................................................................................................................................3

LONDON, UK, DATA FUSION EXAMPLE ...........................................................................................................................4

Read and Display ER Mapper Images ..................................................................................................................4


Resize Images to the Same Pixel Size .................................................................................................................4
Manual HSV Data Fusion....................................................................................................................................4

Forward HSV Transform.......................................................................................................................................................5


Create a Stretched SPOT Image to Replace TM "Value" Band.................................................................................................5
Inverse HSV Transform........................................................................................................................................................5
Display Results ....................................................................................................................................................................5

Automated HSV Data Fusion ..............................................................................................................................6

BREST, FRANCE, DATA FUSION EXAMPLE ........................................................................................................................7

Open and Display Images ..................................................................................................................................7


Resize Images to Same Pixel Size .......................................................................................................................7
Fuse the SPOT Panchromatic Image ...................................................................................................................8
Display and Compare Results .............................................................................................................................8

Tutorial: Landsat TM and SPOT Data Fusion


Overview of This Tutorial
This tutorial is designed to demonstrate selected ENVI data fusion capabilities. For additional data fusion details, please
see ENVI Help. Two examples are provided for this tutorial.
The first uses Landsat TM and SPOT data from London, UK (Data Courtesy of ITT Visual Information Solutions
International UK, Ltd). The TM data are Copyright, European Space Agency, and distributed by Eurimage/NRSC. The
SPOT data are Copyright CNES, 1994, distributed by Spot Image/NRSC. Both datasets are used with permission (NRSC,
1999).
The second example uses multispectral and panchromatic SPOT data from Brest, France (Data Courtesy of ITT Visual
Information Solutions International, France, Copyright CNES-Spot image, 1998. Used with permission of SPOT, 1999.
These data may not be used for commercial purposes).

Files Used in This Tutorial


ENVI Resource DVD:
File
Description
TM/SPOT example (envidata/lontmsp)
lon_spot
London SPOT data
lon_spot.ers
ER Mapper header for above
lon_tm
London Landsat TM data
lon_tm.ers
ER Mapper header for above
SPOT example (envidata/brestsp)
s_0417_1.bil (.hdr) Brest SPOT panchromatic data
s_0417_2.bil (.hdr) Brest SPOT-XS multispectral data
copyright.txt
Data copyright statement

2
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Tutorial: Landsat TM and SPOT Data Fusion


Data Fusion
Data fusion is the process of combining multiple image layers into a single composite image. It is commonly used to
enhance the spatial resolution of multispectral datasets using higher spatial resolution panchromatic data or single-band
SAR data.
The following sections demonstrate the preparation required to fuse image datasets in ENVI, and how to perform data
fusion.

Preparing Images
To perform data fusion in ENVI, the files must either be georeferenced (in which case spatial resampling is performed on
the fly), or, if not georeferenced, cover the same geographic area, have the same pixel size, have the same image size,
and have the same orientation. The files used in this exercise are not georeferenced. Therefore, the low spatial resolution
images must be resampled to have the same pixel size as the high spatial resolution image (using nearest-neighbor
resampling).

3
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Tutorial: Landsat TM and SPOT Data Fusion


London, UK, Data Fusion Example
Read and Display ER Mapper Images
The London data consist of TM and SPOT data binary files with ER Mapper header files. ENVI has ER Mapper routines to
automatically read the data.
1. From the ENVI main menu bar, select File Open External File IP Software ER Mapper. A file
selection dialog appears.
2. Navigate to envidata\lontmsp and use the <Shift> key to select lon_tm.ers and lon_spot.ers. Click
Open.
3. In the Available Bands List, select the RGB Color radio button, then click Load RGB to display the true-color
Landsat TM image (lon_tm).
4. In the Available Bands List, click Display #1 and select New Display.
5. Select the Gray Scale radio button. Under lon_spot, select the Pseudo Layer band and click Load Band to
display the gray scale SPOT image.

Resize Images to the Same Pixel Size


The Dims field of the Available Bands List shows that the spatial dimensions of the SPOT image are 2820 x 1569, and
those of the Landsat TM are 1007 x 560. The Landsat data have 28 m spatial resolution, while the SPOT data have 10 m
spatial resolution. You will need to resize the Landsat image by a factor of 2.8 to create 10 m data that match the SPOT
data.
1. From the ENVI main menu bar, select Basic Tools Resize Data (Spatial/Spectral). A Resize Data Input
File dialog appears.
2. Select lon_tm and click OK. A Resize Data Parameters dialog appears.
3. In the xfac field, enter 2.8. In the yfac field, enter 2.8009. You must use a value of 2.8009 rather than 2.8 to
add an extra pixel to the y dimension, so the images will exactly match. This difference is insignificant for the
purposes of this exercise.
4. In the Enter Output Filename field, enter resize_lon_tm and click OK.
5. In the Available Bands List, click Display #2 and select Display #1.
6. Select the RGB Color radio button. Load resize_lon_tm as an RGB composite into Display #1.
7. From a Display group menu bar, select Tools Link Link Displays. A Link Displays dialog appears. Click OK
to link the resized image (Display #1) to the SPOT panchromatic image (Display #2). Compare the two images.
8. When you are finished, select Tools Link Unlink Displays from a Display group menu bar.

Manual HSV Data Fusion


Manually performing data fusion may help you better understand the data fusion process. First, transform the color TM
image into hue-saturation-value (HSV) color space. Replace the value band with the higher resolution SPOT data and
stretch the value band from 0 to 1 to fill the correct data range. Then transform the TM hue and saturation data and
SPOT data values back to RGB color space. This produces an output image that contains the colors from the TM data with
the spatial resolution of the SPOT data.
4
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Tutorial: Landsat TM and SPOT Data Fusion


Forward HSV Transform
1. From the ENVI main menu bar, select Transform Color Transforms RGB to HSV. An RGB to HSV Input
dialog appears.
2. Select Display #1 (which contains resize_lon_tm) and click OK. An RGB to HSV Parameters dialog appears.
3. In the Enter Output Filename field, enter out_hsv and click OK to perform the transform.
4. In the Available Bands List, under out_hsv, display the resulting Hue, Sat, and Val bands as individual gray
scale images or as an RGB composite in Display #1.

Create a Stretched SPOT Image to Replace TM "Value" Band


1. From the ENVI main menu bar, select Basic Tools Stretch Data. A Data Stretch Input File dialog appears.
2. Select lon_spot and click OK. A Data Stretching dialog appears.
3. In the Output Data section of the Data Stretching dialog, enter 0 in the Min field and 1.0 in the Max field.
4. In the Enter Output Filename field, enter stretch_lon_spot and click OK to stretch the SPOT data to
floating-point data with a range of 0 to 1.0.

Inverse HSV Transform


1. From the ENVI main menu bar, select Transform Color Transforms HSV to RGB. An HSV to RGB Input
Bands dialog appears.
2. Select the Hue and Sat bands under out_hsv as the H and S bands for the transform. Select the Stretch band
under stretch_lon_spot as the V band. Click OK. An HSV to RGB Parameters dialog appears.
3. In the Enter Output Filename field, enter fused_london and click OK to perform the inverse transform.

Display Results
1. In the Available Bands List, load fused_london as an RGB composite into Display #1.
2. In the Available Bands List, click Display #1 and select New Display.
3. Load resize_lon_tm as an RGB composite into Display #3. Following is a summary of what each display group
contains at this point:
Display #1: Fused TM/SPOT image (fused_london)
Display #2: SPOT panchromatic image (lon_spot)
Display #3: Resized TM image (resize_lon_tm)
4. From a Display group menu bar, select Tools Link Link Displays. A Link Displays dialog appears.
5. Click OK to link all three display groups. Click in the Image window to use dynamic overlay to compare the
images.

5
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Tutorial: Landsat TM and SPOT Data Fusion


Automated HSV Data Fusion
1. From the ENVI main menu bar, select Transform Image Sharpening HSV. A Select Input RGB dialog
appears.
2. Select Display #3 (the resized TM image) and click OK. A High Resolution Input File dialog appears.
3. Select the Pseudo Layer band under lon_spot and click OK. An HSV Sharpening Parameters dialog appears.
4. In the Enter Output Filename field, enter lontmsp.img and click OK.
5. In the Available Bands List, click Display #3 and select New Display.
6. Load lontmsp.img as an RGB composite into Display #4.
7. From a Display group menu bar, select Tools Link Link Displays. A Link Displays dialog appears. Click OK
to link all four display groups.
Below is a comparison between the original TM image (left) and the fused TM/SPOT image (right) for
approximately the same area.

8. Try the same process using the Color Normalized (Brovey) Transform by selecting Transform Image
Sharpening Color Normalized (Brovey) from the ENVI main menu bar.
9.

When you are finished comparing images, close all files and display groups.

6
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Tutorial: Landsat TM and SPOT Data Fusion


Brest, France, Data Fusion Example
Open and Display Images
1. From the ENVI main menu bar, select File Open Image File. Navigate to envidata\brestsp and select
s_0417_2.bil. Click Open. This is a SPOT-XS multispectral data file.
2. In the Available Bands List, select the RGB Color radio button. Click Load RGB to display s_0417_2.bil as a
false-color infrared composite.
3. From the ENVI main menu bar, select File Open Image File. Select s_0417_1.bil. Click Open. This is a
SPOT panchromatic data file.
4. In the Available Bands List, select the Gray Scale radio button. Select Band 1 under s_0417_1.bil, and click
Load Band to display the SPOT panchromatic data.

Resize Images to Same Pixel Size


1. The Dims field of the Available Bands List shows that the spatial dimensions of the panchromatic image are 2835
x 2227, and those of the SPOT-XS image are 1418 x 1114. The SPOT-XS data have 20 m spatial resolution, while
the SPOT panchromatic data have 10 m spatial resolution. You will need to resize the SPOT-XS image by a factor
of 2.0 to create 10 m data that match the SPOT data.
2. From the ENVI main menu bar, select Basic Tools Resize Data (Spatial/Spectral). A Resize Data Input
File dialog appears.
3. Select s_0417_2.bil (the SPOT-XS image) and click OK. A Resize Data Parameters dialog appears.
4. In the xfac and yfac fields, enter 1.999. You must use a value of 1.999 rather than 2.0 to add an extra pixel to
the x and y dimensions, so the images will exactly match. This difference is insignificant for the purposes of this
exercise.
5. In the Enter Output Filename field, enter resize_spotxs and click OK.
6. In the Available Bands List, click Display #1 and select New Display.
7. Display the resized image as an RGB composite in Display #2.
8. From a Display group menu bar, select Tools Link Link Displays to link the resized SPOT-XS image
(Display #2) with the SPOT panchromatic image (Display #1). Click in an Image window to use the dynamic
overlay to compare the two images.

7
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Tutorial: Landsat TM and SPOT Data Fusion

The above comparison shows the SPOT-XS data (20 m spatial resolution, left) and the SPOT panchromatic data
(10 m spatial resolution, right).

Fuse the SPOT Panchromatic Image


1. From the ENVI main menu bar, select Transform Image Sharpening HSV. A Select Input RGB dialog
appears.
2. Select Display #2 (which contains the resized SPOT-XS image) and click OK. A High Resolution Input File dialog
appears.
3. Select Band 1 under s_0417_1.bil and click OK. An HSV Sharpening Parameters dialog appears.
4. In the Enter Output Filename field, enter brest_fused.img and click OK.

Display and Compare Results


1. In the Available Bands List, click Display #2 and select New Display.
2. Load the fused image (brest_fused.img) as an RGB composite into Display #3.
3. From a Display group menu bar, select Tools Link Link Displays. A Link Displays dialog appears. Click
OK to link the fused image to the two original SPOT images.
4. When you are finished comparing the images, exit ENVI.

8
ENVI Tutorial: Landsat TM and SPOT Data Fusion

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 3

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Classification Methods

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2
EXAMINING A LANDSAT TM COLOR IMAGE ......................................................................................................................2

Reviewing Image Colors ....................................................................................................................................3


Using the Cursor Location/Value .........................................................................................................................3
Examining Spectral Plots....................................................................................................................................4

EXPLORING UNSUPERVISED CLASSIFICATION METHODS.......................................................................................................4

Applying K-Means Classification ..........................................................................................................................4


Applying Isodata Classification............................................................................................................................5

EXPLORING SUPERVISED CLASSIFICATION METHODS ..........................................................................................................6


Selecting Training Sets Using Regions of Interest (ROI) .........................................................................................................6

Applying Parallelepiped Classification ..................................................................................................................6


Applying Maximum Likelihood Classification .........................................................................................................7
Applying Minimum Distance Classification............................................................................................................7
Applying Mahalanobis Distance Classification .......................................................................................................7

EXPLORING SPECTRAL CLASSIFICATION METHODS .............................................................................................................8


Collecting Endmember Spectra .............................................................................................................................................8

Applying Binary Encoding Classification ...............................................................................................................9


Applying Spectral Angle Mapper Classification......................................................................................................9

EXPLORING RULE IMAGES ......................................................................................................................................... 10


POST CLASSIFICATION PROCESSING ............................................................................................................................ 11

Extracting Class Statistics................................................................................................................................. 11


Generating a Confusion Matrix.......................................................................................................................... 12
Clumping and Sieving ...................................................................................................................................... 12
Combining Classes .......................................................................................................................................... 13
Overlaying Classes .......................................................................................................................................... 13

EDITING CLASS COLORS .......................................................................................................................................... 14


WORKING WITH INTERACTIVE CLASSIFICATION OVERLAYS ................................................................................................. 14
OVERLAYING VECTOR LAYERS .................................................................................................................................... 15

Converting a Classification to a Vector............................................................................................................... 15

ADDING CLASSIFICATION KEYS USING ANNOTATION ........................................................................................................ 15


ENDING THE ENVI SESSION ..................................................................................................................................... 16

Tutorial: Classification Methods


Overview of This Tutorial
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.

Files Used in This Tutorial


ENVI Resource DVD: envidata\can_tm
File
can_tmr.img
can_tmr.hdr
can_km.img
can_km.hdr
can_iso.img
can_iso.hdr
classes.roi
can_pcls.img
can_pcls.hdr
can_bin.img
can_bin.hdr
can_sam.img
can_sam.hdr
can_rul.img
can_rul.hdr
can_sv.img
can_sv.hdr
can_clmp.img
can_clmp.hdr
can_comb.img
can_comb.hdr
can_ovr.img
can_ovr.hdr
can_v1.evf
can_v2.evf

Description
Caon City, Colorado TM reflectance image
ENVI header for above
K-meansf 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

Examining a Landsat TM Color Image


This portion of the exercise will familiarize you with the spectral characteristics of the Landsat TM data of Caon 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 that
shipped with your software.
1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\can_tm directory, select the file can_tmr.img from the list, and click Open. The
Available Bands List appears on your screen.
3. Click on the RGB Color radio button in the Available Bands List. Red, Green, and Blue fields appear in the middle
of the dialog.

2
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


4. Select Band 4, Band 3, and Band 2 sequentially from the list of bands at the top of the dialog by clicking on
the band names. The band names are automatically entered in the Red, Green, and Blue fields.
5. Click Load RGB to load the image into ENVI.
6. Examine the image in the display group.

Reviewing Image Colors


The color image displayed below can be used as a guide to classification. This image is the equivalent of a false color
infrared photograph. Even in a simple three-band image, its 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 and
urbanization classes are also readily apparent.

Using the Cursor Location/Value


Use ENVIs Cursor Location/Value option to preview image values in the displayed spectral bands.
1. From the Display group menu bar, select Tools Cursor
Location/Value. Alternatively, double-click the left mouse button
in the Image window to toggle the Cursor Location/Value dialog on
and off.
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.

3
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Examining Spectral Plots
Use ENVIs integrated spectral profiling capabilities to examine the
spectral characteristics of the data.
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.

Exploring Unsupervised Classification Methods


Unsupervised classification can be used to cluster pixels in a dataset based on statistics only, without any user-defined
training classes. The available unsupervised classification techniques are K-Means and ISODATA.

Applying K-Means Classification


K-Means unsupervised classification calculates initial class means
evenly distributed in the data space, then iteratively clusters the
pixels into the nearest class using a minimum-distance technique.
Each iteration recalculates class means and reclassifies pixels with
respect to the new means. All pixels are classified to the nearest
class unless a standard deviation or distance threshold is specified, in
which case some pixels may be unclassified if they do not meet the
selected criteria. 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.
1. From the ENVI main menu bar, select Classification
Unsupervised K-Means or review the pre-calculated
results of classifying the image by opening the can_km.img
file in the can_tm directory.
2. Select the can_tmr.img file and click OK. The K-Means
Parameters dialog appears.
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.
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 (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.

4
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Applying ISODATA Classification
ISODATA unsupervised classification calculates class means evenly distributed in the data space 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.
1. From the ENVI main menu bar, select Classification Unsupervised IsoData, or review the precalculated results of classifying the image by opening the can_iso.img file in the can_tm directory.
2. Select the can_tmr.img file and click OK. The ISODATA Parameters dialog appears.
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 #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 (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.

5
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Exploring Supervised Classification Methods
Supervised classification can be used to cluster pixels in a dataset into classes corresponding to user-defined training
classes. This classification type requires that you 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, Minimum Distance, Mahalanobis Distance, Maximum
Likelihood, Spectral Angle Mapper, Binary Encoding, and Neural Net. In this tutorial, you will experiment with two
methods for selecting training areas, also known as regions of interest (ROIs).

Selecting Training Sets Using Regions of Interest (ROI)


As described in the tutorial, An Introduction to ENVI and summarized here, ENVI lets you 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. In this exercise, you will restore predefined ROIs.
1. From the #1 Display group menu bar, select Tools Region of Interest ROI Tool. The ROI Tool dialog
appears.
2. From the ROI Tool dialog menu bar, select File Restore ROIs. The Enter ROI Filenames dialog appears.
3. Select the classes.roi file and click Open. Click OK. The ROIs appear in the Image window.

Applying Parallelepiped Classification


Parallelepiped classification uses a simple decision rule to classify multispectral data. The decision boundaries form an ndimensional parallelepiped classification in the image data space. The dimensions of the parallelepiped classification are
defined based upon a standard deviation threshold from the mean of each selected class. If a pixel value lies above the
low threshold and below the high threshold for all n bands being classified, it is assigned to that class. If the pixel value
falls in multiple classes, ENVI assigns the pixel to the last class matched. Areas that do not fall within any of the
parallelepiped classifications are designated as unclassified.
1. From the ENVI main menu bar, select Classification Supervised Parallelepiped, or review the precalculated results of classifying the image by opening the can_pcls.img file in the can_tm directory.
2. Select the can_tmr.img file and click OK. The Parallelepiped Parameters dialog appears.
3. Click the Select All Items button to select the ROIs.
4. Select to output the result to Memory using the radio button provided.
5. Click the Output Rule Images toggle button to select No, then click OK. The new band is loaded into the
Available Bands List.

6
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods

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.

Applying Maximum Likelihood Classification


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).
1. Using the steps above as a guide, perform a Maximum Likelihood classification.
2. Try using the default parameters and various probability thresholds.
3. Use image linking and dynamic overlay to compare this classification to the color composite image and previous
unsupervised and supervised classifications.

Applying Minimum Distance Classification


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.
1. Using the steps above as a guide, perform a Minimum Distance classification.
2. Try using the default parameters and various standard deviations and maximum distance errors.
3. Use image linking and dynamic overlay to compare this classification to the color composite image and previous
unsupervised and supervised classifications.

Applying Mahalanobis Distance Classification


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

7
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


method. All pixels are classified to the closest ROI class unless you specify a distance threshold, in which case some pixels
may be unclassified if they do not meet the threshold.
1. Using the steps above as a guide, perform a Mahalanobis Distance classification.
2. Try using the default parameters and various maximum distance errors.
3. Use image linking and dynamic overlay to compare this classification to the color composite image and previous
unsupervised and supervised classifications.
4. When you are finished, close all classification display groups.

Exploring Spectral Classification Methods


The following methods are described in the ENVI Users Guide. These were developed specifically for use on
hyperspectral data, but they 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 Supervised menu
option.

Collecting Endmember Spectra


The Endmember Collection:Parallel dialog is a standardized means of collecting spectra for supervised classification from
ASCII files, ROIs, spectral libraries, and statistics files.
1. From the ENVI main menu bar, select Classification Endmember Collection. The Classification Input File
dialog appears.
2. Select the can_tmr.img file and click OK.
3. The Endmember Collection dialog appears with the Parallelepiped classification method selected by default. The
available classification and mapping methods are listed under the Algorithm menu. You will use this dialog in
the following exercises.

8
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Applying Binary Encoding Classification
The binary encoding classification technique encodes the data and endmember spectra into zeros and ones, based on
whether a band falls below or above the spectrum mean. An exclusive OR function compares each encoded reference
spectrum with the encoded data spectra, and ENVI produces a classification image. 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.
1. From the Endmember Collection:Parallel dialog menu bar, select Algorithm Binary Encoding or review the
pre-calculated results of classifying the image by opening the can_bin.img file in the can_tm directory. These
results were created using a minimum encoding threshold of 75%.
2. For this exercise, you will use the predefined ROIs in the
classes.roi file that you used on page 6. From the
Endmember Collection:Parallel dialog menu bar, select
Import from ROI/EVF from input file. The Select
Regions for Stats dialog appears.
3. Click the Select All Items button, and click OK.
4. In the Endmember Collection:Parallel dialog, click Select
All then click Plot to view the endmember spectral plots
for the ROIs collected in the Endmember Collections
dialog.
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.

Applying Spectral Angle Mapper Classification


The Spectral Angle Mapper (SAM) is a physically-based spectral classification that uses an 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. SAM
compares the angle between the endmember spectrum vector and each pixel vector in n-dimensional space. Smaller
angles represent closer matches to the reference spectrum. Pixels further away than the specified maximum angle
threshold in radians are not classified.
1. Using the steps in the last exercise as a guide, perform a Spectral Angle Mapper classification, or review the
pre-calculated results of classifying the image by opening the can_sam.img file in the can_tm directory.
2. Use image linking and dynamic overlay to compare this classification to the color composite image and previous
unsupervised and supervised classifications.
3. When you are finished, close all classification display groups, plots, and the Endmember Collection dialog.

9
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Exploring Rule Images
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 gray scale images: one for each
ROI or endmember spectrum used in the classification.
The rule image pixel values represent different things for different types of classifications, for example:
Classification Method
Parallelepiped
Minimum Distance
Maximum Likelihood
Mahalanobis Distance
Binary Encoding
Spectral Angle Mapper

Rule Image Values


Number of bands satisfying the parallelepiped criteria
Sum of the distances from the class means
Probability of pixel belonging to class
Distances from the class means
Binary match in percent
Spectral angle in radians (smaller angles indicate closer
match to the reference spectrum)

1. From the ENVI main menu bar, select File Open Image
File.
2. Navigate to the envidata\can_tm directory, select the file
can_rul.img from the list, 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 Color Tables and drag the Stretch
Bottom and Stretch Top sliders to opposite ends of the dialog.
Areas with low spectral angles (more similar spectra) appear
bright.

10
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Post Classification Processing
Classified images require post-processing to evaluate classification accuracy and to generalize classes for export to imagemaps and vector GIS. Post Classification can be used to classify rule images; to calculate class statistics and confusion
matrices; to apply majority or minority analysis to classification images; to clump, sieve, and combine classes; to overlay
classes on an image; to calculate buffer zone images; to calculate segmentation images; and to output classes to vector
layers. ENVI provides a series of tools to satisfy these requirements.

Extracting Class Statistics


This function allows you to extract statistics from the image used to produce the classification. Separate statistics
consisting of basic statistics, histograms, and average spectra are calculated for each class selected.
1. From the ENVI main menu bar, select Classification Post Classification Class Statistics. The
Classification Input File dialog appears.
2. Click the Open drop-down button and select New File.
3. Navigate to the envidata\can_tm directory, select the file can_pcls.img from the list, and click Open. The
Statistics Input File appears.
4. Select the can_tmr.img file and click OK. The Class Selection dialog appears.
5. Click the Select All Items button and click OK. The Compute Statistics Parameters dialog appears.
6. Click the Basic Stats, Histograms, Covariance, and Covariance Image check boxes in the Compute
Statistics Parameters dialog to calculate all the possible statistics.
7. Click OK to compute the statistics. The Class Statistics Results dialog appears.

11
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Generating a Confusion Matrix
ENVIs 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. In this exercise, you will compare the Parallelepiped and SAM classification images using the
Parallelepiped classification image as the ground truth.
1. From the ENVI main menu bar, select Classification Post Classification Confusion Matrix Using
Ground Truth Image. The Classification Input File dialog appears.
2. Select the can_pcls.img file and click OK. The Ground
Truth Input File appears.
3. Click the Open drop-down button and select New File.
4. Navigate to the envidata\can_tm directory, select the file
can_sam.img from the list, and click Open.
5. Select the can_sam.img file 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.

Clumping and Sieving


Clump and Sieve are used to generalize classification images. Sieve is usually run first to remove the isolated pixels
based on a size (number of pixels) threshold, then clump is run to add spatial coherency to existing classes by combining
adjacent similar classified areas.
1. From the ENVI main menu bar, select Classification Post Classification Sieve Classes. The
Classification Input File dialog appears.
2. Select the can_sam.img file within the Select Input File section of this dialog and click OK. The Sieve
Parameters dialog appears.
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 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.
12
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


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 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.
1. From the ENVI 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.

13
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Editing Class Colors
When a classification image is displayed, you can change the color associated with a specific class by editing the class
colors.
1. From the Display group menu bar, select Tools Color Mapping Class Color Mapping. The Class Color
Mapping dialog appears.
2. Click on one of the class names in the Class Color Mapping dialog and change the color by dragging the
appropriate color sliders or entering the desired data values. Changes are applied to the classified image
immediately.
3. To make the changes permanent, select Options Save Changes from the menu bar in this the dialog.

Working with Interactive Classification Overlays


In addition to the methods above for working with classified data, ENVI also provides an interactive classification overlay
tool. This tool allows you to interactively toggle classes on and off as overlays on a displayed image, to edit classes, get
class statistics, merge classes, and edit class colors.
1. From the Available Bands List, load Band 4 of can_tmr.img as a gray scale image.
2. From the Display group menu bar, select Overlay Classification. The Interactive Class Tool Input File dialog
appears.
3. Select the can_sam.img file and click OK. The Interactive Class Tool appears with each class listed along with
its corresponding colors.
4. Click each On check box to change the display of each class as an overlay on the gray scale image.
5. Explore the various options for assessing the classification using the Interactive Class Tool Options menu.
6. Interactively change the contents of specific classes using the Interactive Class Tool Edit menu.
7. From the Display group menu bar, select File Save Image As Image File to burn in the classes and
output to a new file.
8. From the Interactive Class Tool menu bar, select File Cancel to exit the interactive tool.
14
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Overlaying Vector Layers
You can load pre-calculated vector layers onto a gray scale reflectance image for comparison to raster classified images,
or convert one of the classification images to vector layers.
1. Load the can_clmp.img into a display group.
2. From the Display group menu bar, select Overlay Vectors. The Vector Parameters: Cursor Query dialog
appears.
3. From the Vector Parameters: Cursor Query dialog menu bar, select File Open Vector File.
4. Navigate to the envidata\can_tm directory, and use the Shift key on your keyboard to select the files
can_v1.evf and can_v2.evf. Click Open. The vectors derived from the classification polygons will outline the
raster classified pixels.

Converting a Classification to a Vector


1. From the ENVI main menu bar, select Classification Post Classification Classification to Vector. The
Raster to Vector Input Band dialog appears.
2. Select the can_clmp.img file Clump result within the Select Input File section of this dialog and click OK. The
Raster to Vector Parameters dialog appears.
3. Using the Shift key on your keyboard, select Region #1 and Region #2 from the Select Input Class field.
4. In the Enter Output Filename field, type canrty and click OK to begin the conversion. The layers are loaded
into the Available Vectors List.
5. Select Region #1 and Region #2s in the Available Vectors List dialog then click Load Selected.
6. Select a display number from the Load Vector dialog and click OK.
7. From the Vector Parameters dialog menu bar, select Edit Edit Layer Properties to change the colors and fill
of the vector layers to make them more visible.
8. Using image linking and dynamic overlays, compare the combined class image to the classified images and the
Select

Adding Classification Keys Using Annotation


ENVI provides annotation tools to put classification keys on images and in map layouts. The classification keys are
automatically generated.
1. From the Display group menu bar, select Overlay
Annotation for either one of the classified images,
or for the image with the vector overlay.
2. From the Annotation menu bar, select Object
Map Key to start annotating the image. You can edit
the key characteristics by clicking the Edit Map Key
Items button in the dialog and changing the desired
characteristics.
3. Click once with the left mouse button in the Image
window to place the map key in the image window.
4. Click and drag the map key using the left mouse
button in the display to place the key.
5. Click in the display with the right mouse button to
finalize the position of the key. For more information
about image annotation, please see the ENVI Users
Guide.

15
ENVI Tutorial: Classification Methods

Tutorial: Classification Methods


Ending the ENVI Session
You can quit your ENVI session by selecting File Exit from the ENVI main menu.

16
ENVI Tutorial: Classification Methods

ENVI Tutorial:
Vegetation Analysis

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................1

Files Used in This Tutorial ..................................................................................................................................1

ABOUT VEGETATION ANALYSIS IN ENVI .........................................................................................................................1

Getting Started .................................................................................................................................................1

WORKING WITH THE VEGETATION INDEX CALCULATOR .......................................................................................................2

Opening the Vegetation Index Calculator.............................................................................................................3

VEGETATION ANALYSIS TOOLS .....................................................................................................................................5

The Agricultural Stress Tool ...............................................................................................................................5


The Fire Fuel Tool .............................................................................................................................................5
Running a Fire Fuel Vegetation Analysis ................................................................................................................................6

The Forest Health Tool ......................................................................................................................................7

EXITING ENVI ........................................................................................................................................................7

Tutorial: Vegetation Analysis


Overview of This Tutorial
This tutorial introduces vegetation analysis using ENVI. ENVI includes a suite of tools designed to help you determine the
overall state of different vegetation types from their reflectance properties.
The application-specific vegetation analysis tools in ENVI classify the scene for vegetation analysis specific to agricultural
stress, fire fuel distribution, and overall forest health. This method enables you to perform vegetation analysis using tools
that guide index selections for a specific outcome.
In this tutorial, you will calculate vegetation indices using ENVIs Vegetation Index Calculator, then perform some manual
analysis of a few of the resultant indices.
In order to run this tutorial, you must have ENVI installed on your computer.

Files Used in This Tutorial


ENVI Resource DVD: envidata\flaash\hyperspectral\flaash_results
File
JasperRidge98av_flaash_refl.img (and .hdr)
jasper_aviris_urban_mask (and .hdr)

Description
AVIRIS Reflectance
image sample file
Mask for major roads
and buildings

About Vegetation Analysis in ENVI


Remote sensing offers an efficient way to estimate vegetation properties over large geographic areas. Vegetation indexes
(VIs) are constructed from reflectance measurements in two or more wavelengths and can be used to analyze specific
characteristics of vegetation, such as total leaf area and water content. Successfully applying VIs with ENVI and
analyzing their results requires the following:

An understanding of the structure and function of vegetation and its reflectance properties. This enables you to
link vegetative structures and their condition to their reflectance behavior in an ecological system of interest.

An understanding of the vegetation properties that can be estimated by calculating VIs on hyperspectral
reflectance data, and knowledge of how these VIs work.

Using ENVIs Vegetation Index Calculator to calculate applicable VIs, then analyzing the output to determine the
vegetation conditions in your data.

Using ENVIs Vegetation Analysis Tools to apply classifications to the various ecologies of the indices and
analyzing the classifications for specific conditions, such as agricultural stress, fire fuel distribution, and overall
forest health.

The vegetation analysis component of ENVI includes complete documentation. The ENVI Users Guide that shipped with
your software, as well as the ENVI Help, offer extensive documentation on vegetation analysis using ENVI. They detail
what comprises vegetation, how strong vegetation differs from weak vegetation, how vegetation properties and health
affect the reflectance spectra of plants and plant canopies, and how to use this information to analyze plant and
ecosystem vegetative conditions using ENVI.

Getting Started
Before attempting to start the program, ensure that ENVI is properly installed as described in the Installation Guide that
shipped with your software.
1. From the ENVI main menu bar, select File Open Image File.

1
ENVI Tutorial: Vegetation Analysis

Tutorial: Vegetation Analysis


2. Navigate to the envidata\flaash\hyperspectral\flaash_results directory, select the file
JasperRidge98av_flaash_refl.img from the list, and click Open. The Available Bands List appears on your
screen.
3. Click the RGB Color radio button.
4. Select FLAASH (Band 53). The band you have chosen is displayed in the field marked R.
5. Select FLAASH (Band 29). The band you have chosen is displayed in the field marked G.
6. Select FLAASH (Band 19). The band you have chosen is displayed in the field marked B.
7. Click Load RGB to load the image into a new display group.
This data is an AVIRIS scene of Jasper Ridge Ecological Reserve. A color infrared image of this hyperspectral scene is
visible. You can see the preserve as a large forested area to the left of the reservoir, with a major highway and the city
of Palo Alto, CA to the right. We will attempt to analyze this scene for forest fire risk.

Working with the Vegetation Index Calculator


First, you will use ENVI to calculate all of the available vegetation indices for our input image. ENVIs Vegetation Index
Calculator can be used to determine the vegetation indices that can be calculated for a given input file and to calculate
the indices that are applicable.

2
ENVI Tutorial: Vegetation Analysis

Tutorial: Vegetation Analysis


ENVI provides 27 VIs you can use to detect the presence and relative abundance of various vegetation properties. These
VIs are combinations of surface reflectance at two or more wavelengths designed to highlight a particular property of
vegetation. Each index is grouped into a category by the main function of the index. They are detailed in the ENVI Help
and the User Guide that shipped with your software.

Greenness VIs are designed to measure the overall quantity, amount, and vigor of green vegetation in each
pixel.

Light use efficiency VIs are designed to provide a measure of the efficiency with which vegetation is able to
use incident light for photosynthesis, which is closely related to carbon uptake and vegetation growth rates.

The Canopy nitrogen VI is designed to provide a measure of nitrogen concentration of remotely sensed foliage.

Dry or senescent carbon VIs are designed to provide an estimate of the amount of carbon in its dry states of
lignin and cellulose.

Leaf pigment VIs are designed to provide a measure of stress-related pigments, including carotenoids and
anthocyanins, present in vegetation. These pigments are present in higher concentrations in weakened
vegetation.

Canopy water content VIs are designed to provide a measure of the amount of water contained in the foliage
canopy.

Opening the Vegetation Index Calculator


Once you select your input file, the Vegetation Index Calculator
automatically determines which of the available 27 indices can be
calculated on your input file based on the wavelengths present in your
file. If no indices can be calculated because the correct wavelengths
are not present, you will be warned at this time.
1. From the ENVI main menu bar, select Spectral
Vegetation Analysis Vegetation Index Calculator.
The Vegetation Indices Input File dialog appears.
2. Select the JasperRidge98av_flaash_refl.img input file and
click OK. The Vegetation Indices Parameters dialog appears,
showing all of the available indices for the dataset. You can
see that for this dataset, 25 of the 27 VIs in ENVI are available
and all are selected by default. You could choose to calculate
only a subset of these indices by selecting the desired indices
from the list. For this exercise, you will calculate all of the
available VIs.
3. Ensure that the Biophysical Cross Checking toggle is set to
On. Biophysical cross check is one of the truly unique features
of the vegetation analysis component in ENVI. If enabled, it
allows the comparison of different indices at each pixel to
validate their results. If conflicting values exist between
indices, for example, a greenness index shows insufficient
vegetation to support the water content measurement from a
canopy water index, those data values are ignored.
4. Click the File radio button and type or choose an output
filename. The output data will be stored in a new file, with one
band for each VI calculated, and the band name will contain
the name of the VI, ready for use in additional processing in
ENVI.
5. Click OK to begin processing. The result is passed into the Available Bands List. You can see that each band in
the new file is identified by the name of the VI it represents.

3
ENVI Tutorial: Vegetation Analysis

Tutorial: Vegetation Analysis


6. From the Available Bands List, select the Normalized Difference Vegetation Index (NDVI) result (a
Greenness VI) then click Load Band. Explore this image. You can see that the greenness values appear high in
the forested areas, and lower in the urban portions of the scene.

7. Explore some of the other greenness VI results (displayed in the Available Bands List from Normalized
Difference Vegetation Index through Red Edge Position Index). As you examine some of the greenness
indices, you can see that they all look similar overall, but each highlights different areas in different ways.
Determining which VI most closely describes the field conditions requires some field measurements to be taken.
8. Explore some of the dry carbon and water content VI results (displayed in the Available Bands List from
Normalized Difference Lignin Index through Plant Senescence Reflectance Index). These can be used
for fire fuel measurements. You can see that much of the forested area in these results is masked out. These
regions are masked by the biophysical cross check because there is too much green vegetation in the pixels for
these VIs to work correctly.
9. Explore some of the canopy water content VI results (displayed in the Available Bands List from Water Band
Index to Normalized Difference Infrared Index). The Water Band Index and Normalized Difference
Water Index (NDWI) are good water content indices, and we can see again that the NDWI has much of its area
masked by the biophysical cross check. The VI results are now available for use for further processing in ENVI, if
desired.

4
ENVI Tutorial: Vegetation Analysis

Tutorial: Vegetation Analysis


Vegetation Analysis Tools
ENVI provides three application-specific vegetation analysis tools, each specific to one kind of vegetation property:
agricultural stress, fire fuels, and forest health. These tools allow you to perform vegetation analysis by guiding you
through index selections aimed at a specific outcome. The tools are available from the ENVI main menu bar by selecting
Spectral Vegetation Analysis. This tutorial will introduce each tool and explore using the Fire Fuel Tool.
Each of the tools is similar in design and operation as well as in strengths and limitations. The results are relative to the
particular input image only and cannot be generalized to other areas or other images. This means that the classes
cannot be directly compared between images, as vegetative variability in the image affect the output class distribution.
In addition, it is important to field check the results and link the classes in your image to conditions on the ground.

The Agricultural Stress Tool


The Agricultural Stress tool is designed to create a spatial map
showing the distribution of crop stress. This tool is intended
specifically for use on agricultural land to support precision
agriculture analysis. The conditions that cause agricultural
stress are the same as those that cause forest stress;
however, agricultural stress analysis concentrates more on
growth efficiency. Dry or dying crops do not efficiently use
nitrogen and light, indicating agricultural stress, whereas a
crop showing healthy, productive vegetation indicates low
stress. The Agricultural Stress tool uses the following VI
categories:
Greenness, to indicate areas of idle cropland, weak
vegetation, and healthy crops.
Canopy water content, to show levels of water
stress.
Canopy nitrogen, to estimate relative nitrogen
levels.
Light use efficiency, to show vegetation growth
rate.
Leaf pigments, to highlight vegetation stress.
To use this tool, you select one VI from each category, and
ENVI combines the information to produce a classification
map. The classification map rates the scene from one, representing the least crop stress, to nine, representing the most.
The classes are displayed using a color ramp where purple and blue represent low stress, or healthy vegetation, and
yellow and reds indicate high stress, or the weakest crops.

The Fire Fuel Tool


The Fire Fuel tool creates a spatial map showing the distribution of fire fuels and burn hazard for a region. Fire fuel
mapping can be useful for forest planners, as well as local governments attempting to mitigate fire risks within the rapidly
growing forest/urban interface. High fire fuel distributions contain dry or dying plant material, which contains less water,
whereas low fire fuel distributions typically comprise lush, green plants. Fire fuel analysis uses the following VI
categories:
y Greenness, to show the bulk amount of green vegetation.
y Canopy water content, to show the water content of the vegetation.
5
ENVI Tutorial: Vegetation Analysis

Tutorial: Vegetation Analysis


y

Dry or senescent carbon, to highlight non-photosynthetic vegetation (NPV).

Running a Fire Fuel Vegetation Analysis


You will now use the Fire Fuels Tool to analyze your data.
1. From the ENVI main menu bar, select Spectral
Vegetation Analysis Fire Fuel. The Vegetation
Products Calculation Input File dialog appears.
2. Because this image displays mixed terrain with both
forest and urban types, you will use a mask to
exclude much of the urban area from classification.
Click the Open drop-down button and select New
File.
3. Navigate to the Jasper_aviris_urban_mask file,
select it, and click Open.
4. From the Select Input File area, click to select the
file you created in the Vegetation Index Calculator
exercise.
5. Click the Select Mask Band button, select the
Jasper_aviris_urban_mask Mask Band file and click
OK.
6. Click OK on the Vegetation Products Calculation Input
File dialog. The Fire Fuel Parameters dialog appears.
7. Increase the Minimum valid greenness value to
0.2000, which will mask regions with NDVI less than
.2 (major roads and buildings). Accept the other
default field values.
8. Click the Memory radio button to output to memory.
9. Click OK to begin processing. ENVI begins calculating the three selected VIs then combines them to create the
classification map. The result is passed into the Available Bands List.
10. From the Available Bands List, select the Fire Fuel result then click Load Band. Examine your classification
result. The classification appears to have selected most of the urban areas, including roads as highest risk, and
the forest as lowest risk. This highlights the difficulty of using the tools in mixed terrain types, in this case mixed
forest and urban.

6
ENVI Tutorial: Vegetation Analysis

Tutorial: Vegetation Analysis

The areas of highest risk (red) around the roads largely consist of dry grasslands. These orange areas, which can
be seen in the VI results as areas where timber is not present, favoring drier underbrush, are clearly identified as
areas of interest. There are still some medium high risk (yellow) areas that are probably miss-classified due to
urban clutter, but these areas do not detract from the remainder of the result. We can see that much of this
forest is too green to burn efficiently, but that there are still areas within it that are worthy of closer examination.

The Forest Health Tool


The Forest Health tool can be used to create a spatial map showing the overall health and vigor of a forested region.
Forest health mapping can be useful for detecting pest and blight conditions in a forest, and is useful in assessing areas
of timber harvest. A forest exhibiting low stress conditions is usually made up of healthy vegetation, whereas a forest
under high stress conditions shows signs of dry or dying plant material, very dense or sparse canopy, and inefficient light
use. The Forest Health analysis uses the following VI categories:

Greenness, to show the distribution of green vegetation.

Leaf pigments, to show the concentration of carotenoids and anthocyanin pigments for stress levels.

Canopy water content, to show the concentration of water.

Light use efficiency, to show the forest growth rate.

To use this tool, you select one VI from each category, and ENVI combines the information to produce a classification
map. The classification map rates the scene from one, representing the least healthy forest (weakest) to the healthiest
forest (strongest)which help to assess relative forest health conditions within the scene. The classes are displayed using
a color ramp where purple and blue represent least healthy and yellow and reds indicate the most healthy.

Exiting ENVI
End the ENVI session by selecting File Exit from the ENVI main menu then click OK to terminate ENVI when
prompted.

7
ENVI Tutorial: Vegetation Analysis

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 4

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Image Georeferencing and Registration

Table of Contents
OVERVIEW OF THIS TUTORIAL ...............................................................................................................................................................2
GEOREFERENCED IMAGES IN ENVI ........................................................................................................................................................2
OPENING AND DISPLAYING GEOREFERENCED DATA ..............................................................................................................................3
Viewing Map Info in the ENVI Header ..............................................................................................................................................3
Displaying the Cursor Location and Value........................................................................................................................................3
IMAGE TO IMAGE REGISTRATION ............................................................................................................................................................4
Opening and Displaying a Landsat TM Image File...........................................................................................................................4
Displaying the Cursor Location and Value........................................................................................................................................4
Starting Image Registration and Loading Ground Control Points ....................................................................................................4
Working with GCPs ...........................................................................................................................................................................5
Warping Images .................................................................................................................................................................................5
Comparing Warp Results .................................................................................................................................................................................... 6

IMAGE TO MAP REGISTRATION ...............................................................................................................................................................7


Opening and Displaying a Landsat TM Image File...........................................................................................................................7
Selecting Image-to-Map Registration and Restoring GCPs ..............................................................................................................7
Adding Map GCPs Using Vector Display of DLGs ...........................................................................................................................7
RST and Cubic Convolution Warping................................................................................................................................................8
Displaying and Evaluating Results ....................................................................................................................................................8
ENDING THE ENVI SESSION ...................................................................................................................................................................9

Tutorial: Image Georeferencing and Registration


Overview of This Tutorial
This tutorial provides basic information about georeferenced images in ENVI and provides a starting point for conducting
image-to-image and image-to-map registration using ENVI. It assumes that you are already familiar with general imageregistration and resampling concepts. This tutorial is designed to be completed in about 1 to 2 hours.

Files Used in This Tutorial


ENVI Resource DVD: envidata\bldr_reg
File
bldr_sp.img (.hdr)
bldr_tm.img (.hdr)
bldr_tm.pts
bldrtm_m.pts
bldr_rd.dlg
Generated Files
bldr_tm1.wrp (.hdr)
bldr_tm2.wrp (.hdr)
bldr_tm3.wrp (.hdr)
bldr_tm4.wrp (.hdr)
bldr_tm5.wrp (.hdr)
bldrtm_m.img (.hdr)
bldrtmsp.img (.hdr)

Description
Boulder SPOT georeferenced image subset
Non-georeferenced Boulder TM data
GCPs for TM-SPOT image-to-image registration
GCPs for TM-Map registration
Boulder roads DLG

Image-to-image result using RST and nearest neighbor


Image-to-image result using RST and bilinear interpolation
Image-to-image result using RST and cubic convolution
Image-to-image result using 1st degree polynomial and cubic
convolution
Image-to-image result using Delaunay triangulation and cubic
convolution
Image-to-map result using RST and cubic convolution for the Boulder
TM data
Boulder TM/SPOT sharpening result using HSV sharpening, 10 meter
pixels

Georeferenced Images in ENVI


ENVI provides full support for georeferenced images in numerous predefined map projections including UTM and State
Plane. In addition, ENVIs user-configurable map projections allow construction of custom map projections utilizing 6 basic
projection types, over 35 different ellipsoids, and more than 100 datums to suit most map requirements.
ENVI map projection parameters are stored in an ASCII text file map_proj.txt that you can edit or modify using ENVI
map projection utilities. The information in this file is used in the ENVI header files associated with each image and allows
simple association of a reference pixel location with known map projection coordinates. Selected ENVI functions can then
use this information to work with the image in georeferenced data space.
ENVIs image registration and geometric correction utilities allow you to reference pixel-based images to geographic
coordinates and/or correct them to match base image geometry. Ground control points (GCPs) are selected using the
Image and Zoom windows for both image-to-image and image-to-map registration. Coordinates are displayed for both
base and uncorrected image GCPs, along with error terms for specific warping algorithms. Next GCP point prediction
allows simplified selection of GCPs.
Warping is performed using resampling, scaling and translation (RST), polynomial functions (of order 1 through n), or
Delaunay triangulation. Resampling methods supported include nearest-neighbor, bilinear interpolation, and cubic
convolution. Comparison of the base and warped images using ENVIs multiple dynamic overlay capabilities allows quick
assessment of registration accuracy.
The following sections provide examples of some of the map-based capabilities built into ENVI. Consult ENVI Help for
additional information.
2
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


Opening and Displaying Georeferenced Data
Before attempting to start the program, ensure that ENVI is properly installed as described in the Installation Guide that
shipped with your software.
1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\bldr_reg directory, select the file bldr_sp.img from the list, and click Open.
The Available Bands List appears.
3. From the Available Bands List, select the Georeferenced SPOT band from the list and click Load Band to load
the image into a new display group.

Viewing Map Info in the ENVI Header


1. In the Available Bands List, right click on the Map Info icon and
select Edit Map Information. The Edit Map Information dialog
appears.
This dialog lists the basic map information used by ENVI in
georeferencing. The image coordinates correspond to a reference
pixel used by ENVI as the starting point for the map coordinate
system. Because ENVI knows the map projection, pixel size, and
map projection parameters based on this header information and
the map projection text file, it can calculate the geographic
coordinates of any pixel in the image. You can enter coordinates
in either map coordinates or geographic (latitude/longitude)
coordinates.
to display the
2. Click on the projection field toggle button
latitude/longitude coordinates for the UTM Zone 13 North map
projection. Note that ENVI makes this conversion on-the-fly.
3. Click the DDEG button then click the DMS to toggle between
degrees-minutes-seconds, and decimal degrees, respectively.
4. Click Cancel to exit the Edit Map Information dialog.

Displaying the Cursor Location and Value


You can choose to display the location of your mouse cursor, screen value (RGB color), and the data value of the pixel
underneath the crosshair cursor using the Cursor Location/Value dialog. When several display groups are open, this
dialog specifies which display groups location and value are being reported.
1. To display the cursor location and value, select Window Cursor Location/Value from either the ENVI main
menu bar or the Display group menu bar. You can also double-click inside the Image window.
2. Move the mouse cursor over the Image, Scroll, or Zoom windows to display location and value information in the
Cursor Location/Value dialog. Note that the coordinates are given in both pixels and georeferenced coordinates
for this georeferenced image. Also note the relation between map coordinates and latitude/longitude.
3. From the Cursor Location/Value menu bar, select File Cancel to close the dialog.
4. Keep the display group open for the next exercise.

3
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


Image to Image Registration
This section of the tutorial takes you step-by-step through Image to Image Registration. The georeferenced SPOT image
will be used as the base image, and a pixel-based Landsat TM image will be warped to match the SPOT.

Opening and Displaying a Landsat TM Image File


1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\bldr_reg directory, select the file bldr_tm.img from the list, and click Open.
The Available Bands List appears and the RGB image is automatically loaded into a new display group.

Displaying the Cursor Location and Value


1. Double-click in the Image window to display the Cursor Location/Value tool.
2. Move the mouse cursor over the Image, Scroll, or Zoom windows to display location and value information in the
Cursor Location/Value dialog. Note that the coordinates are given in pixels since this is a pixel-based image rather
than a georeferenced image like the SPOT data you used in the previous exercise.
3. From the Cursor Location/Value menu bar, select File Cancel to close the dialog.

Starting Image Registration and Loading Ground Control Points


1. From the ENVI main menu bar, select Map Registration Select GCPs: Image to Image. The Image to
Image Registration dialog appears.
2. In the Base Image field, select Display #1 (the SPOT image). In the Warp Image field, select Display #2
(the TM image).
3. Click OK to start the registration. The Ground Control Points Selection dialog appears.

The Predict button allows


prediction of new GCPs based
on the current warp model.

4. You can add individual ground control points (GCPs) by positioning the cursor in the two images to the same
ground location. In the Base field, type 753 for the x location and 826 for the y location. Press the Enter key
after typing each value, to move the cursor in the SPOT image. In the Warp field, type 331 for the x location
and 433 for the y location to move the cursor in the TM image.
5. Examine the locations in the two Zoom windows and adjust the locations if necessary by clicking the left mouse
button in each Zoom window at the desired locations. Note that sub-pixel positioning is supported in the Zoom
windows. The larger the zoom factor, the finer the positioning capabilities.
6. In the Ground Control Points Selection dialog, click Add Point to add the GCP to the list. Click Show List to view
the GCP list. Try this for a few points to get a feel for selecting GCPs. Note the list of actual and predicted points
in the dialog. Once you have at least 4 points, the RMS error is reported.

4
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


7. From the Ground Control Points Selection dialog menu bar, select Options Clear All Points to clear all of
your points.
8. From the Ground Control Points Selection dialog menu bar, select File Restore GCPs from ASCII.
9. Navigate to the envidata\bldr_reg directory, select the file bldr_tm.pts from the list, and click Open.
Previously saved GCP parameters are loaded into the dialog.
10. Try positioning the cursor at a new location in the Image window containing the SPOT image. Click the Predict
button to move the cursor position in the TM image to match its predicted location based on the warp model.
11. The exact position can now be interactively refined by moving the pixel location slightly in the TM data.
12. Click Add Point in the Ground Control Points Selection dialog to add the new GCP to the list.

Working with GCPs


The following image provides descriptions of the features and functions available in the Image to Image GCP List. Click
Show List to view the GCP list. Click on individual GCPs in the Image to Image GCP List dialog and examine the
locations of the points in the two images, the actual and predicted coordinates, and the RMS error. Resize the dialog to
observe the total RMS Error listed in the Ground Control Points Selection dialog.

Clicking on the On/Off button in the


Image to Image GCP List dialog
removes selected GCPs from
consideration in the Warp model and
RMS calculations. These GCPs are
not actually deleted, just
disregarded, and can be toggled
back on using the On/Off button.

Clicking the Delete button


removes a GCP from the list.
Positioning the cursor location
in the Zoom window and
clicking the Update button
updates the selected GCP to
the current cursor locations.

Warping Images
Images can be warped from the displayed band, or multiband images can be warped all bands at once. For this exercise
you will warp only the displayed band.
1. From the Ground Control Points Selection dialog menu bar, select Options Warp Displayed Band. The
Registration Parameters dialog appears.
2. Click the Method drop-down list and select RST.
3. Ensure the Resampling drop-down list has the Nearest Neighbor option selected.
4. In the Enter Output Filename field, type bldr_tm1.wrp as the new filename and click OK. The warped
image is listed in the Available Bands List when the warp is completed.
5. From the Ground Control Points Selection dialog menu bar, select Options Warp Displayed Band. The
Registration Parameters dialog appears.
6. Click the Method drop-down list and select RST.

5
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


7. Click the Resampling drop-down list and select Bilinear.
8. In the Enter Output Filename field, type bldr_tm2.wrp as the new filename and click OK. The warped
image is listed in the Available Bands List when the warp is completed.
9. Repeat steps 5 8 using the RST method and Cubic Convolution resampling, then name the output file
bldr_tm3.wrp.
10. Repeat steps 5 8 using the Polynomial method and Cubic Convolution resampling, then name the output
file bldr_tm4.wrp.
11. Repeat steps 5 8 using the Triangulation method and Cubic Convolution resampling, then name the output
file bldr_tm5.wrp.

Comparing Warp Results


Now you will use dynamic overlays to compare your warp results:
1. In the Available Bands List, click once to select the bldr_tm.img file, then select File Close Selected File
from the menu bar. In the subsequent ENVI warning dialog, click Yes to close the associated display group.
2. In the Available Bands List, select the bldr_tm1.wrp file, click the Display # drop-down button, select New
Display, then click Load Band to load the file into the new display.
3. Right-click in the Image window and select Link Displays. The Link Displays dialog appears.
4. Click OK in the Link Displays dialog to link the SPOT and the registered TM image.
5. Compare the SPOT and the TM images using the dynamic overlay by clicking the left mouse button in the Image
window of the TM image.
6. Load bldr_tm2.wrp and bldr_tm3.wrp into new displays and use the image linking and dynamic overlays to
compare the effect of the three different resampling methods: nearest neighbor, bilinear interpolation, and cubic
convolution.
Note how jagged the pixels appear in the nearest neighbor resampled image. The bilinear interpolation image
looks much smoother, but the cubic convolution image is the best result, smoother, but retaining fine detail.
7. Close the bldr_tm1.wrp and bldr_tm2.wrp display groups (select File Cancel from the associated Display
group menu bars).
8. Load bldr_tm4.wrp and bldr_tm5.wrp into new display groups, and use the image linking and dynamic
overlays to compare to bldr_tm3.wrp (RST Warp).
9. Note the effect of the three different warping methods: RST, 1st degree Polynomial, and Delaunay Triangulation
on the image geometry.
10. Use dynamic overlay to compare to the georeferenced SPOT data.
11. To display the Cursor Location/Value tool, double-click in the Image window.
12. Browse the georeferenced datasets and note the effect of the different resampling and warp methods on the data
values.
13. From the Display group menu bar, select File Cancel to close the dialog.
14. From the ENVI main menu bar, select File Close All Files to close all of the data files. Click Yes on the
corresponding warning dialog.

6
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


Image to Map Registration
This section of the tutorial will take you step-by-step through an Image to Map registration. Many of the procedures are
similar to Image to Image registration and will not be discussed in detail. The map coordinates picked from the
georeferenced SPOT image and a vector Digital Line Graph (DLG) will be used as the base image, and the pixel-based
Landsat TM image will be warped to match the map data.

Opening and Displaying a SPOT Image File


1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\bldr_reg directory, select the file bldr_sp.img from the list, and click Open.
The Available Bands List appears.
3. Select Georeferenced SPOT under bldr_sp.img, and click Load Band. The georeferenced SPOT image
appears in a new display group.

Opening and Displaying a Landsat TM Image File


1. From the ENVI main menu bar, select File Open Image File.
2. Navigate to the envidata\bldr_reg directory, select the file bldr_tm.img from the list, and click Open. A
Landsat TM RGB image is automatically loaded into a new display group.

Selecting Image-to-Map Registration and Restoring GCPs


1. From the ENVI main menu bar, select Map Registration Select GCPs: Image to Map. The Image to
Map Registration dialog appears.
2. From the Display #1 drop-down menu, select Display #2. You will warp the Landsat TM image (in Display #2)
to match the georeferenced SPOT image.
3. Ensure UTM is selected as the projection.
4. Type 13 in the Zone field.
5. Enter 10.0 in the X/Y Pixel Size fields. SPOT data have a spatial resolution of 10m.
6. Click OK to start the registration. The Ground Control Points Selection dialog appears.
7. From the Ground Control Points Selection dialog menu bar, select File Restore GCPs from ASCII.
8. Navigate to the envidata\bldr_reg directory, select the file bldrtm_m.pts from the list, and click Open.
Previously saved ground control point parameters are loaded into the dialog.
9. In the Ground Control Points Selection dialog, click Show List. The Image to Map GCP List dialog appears.
Examine the base map coordinates, the actual and predicted image coordinates, and the RMS error.

Adding Map GCPs Using Vector Display of DLGs


1. From the ENVI main menu bar, select File Open Vector File.
2. From the Files of type drop-down list, select USGS DLG.
3. Navigate to the envidata\bldr_reg directory, select the file bldr_rd.dlg from the list, and click Open.
The Import Vector Files Parameters dialog appears.
4. In the Import Vector Files Parameters dialog, click the Memory radio button, then click OK to read the DLG
data. The Available Vectors List dialog appears.
5. Select the ROADS AND TRAILS: BOULDER, CO file, then click Load Selected.
6. Select Display #1 and click OK. The Vector Parameters: Cursor Query dialog appears.
7
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


7. Return to the Load Vector dialog (from The Available Vectors List dialog, select the ROADS AND TRAILS:
BOULDER, CO file then click Load Selected).
8. Select New Vector Window, and click OK. This loads the vectors into a new vector window.
9. Click and drag the mouse in the vector
window to activate a crosshair cursor.
The map coordinates of the cursor will
be listed at the bottom of the vector
window.
10. From the Display group menu bar in the
TM image, select Tools Pixel
Locator.
11. Type 402 in the Sample field and 418
in the Line field then click Apply to
place the cursor on the road intersection.
Note that sub-pixel positioning accuracy
is again available in the Zoom window.
12. In the Vector window, position the
vector cursor at the road intersection at
approximately 477593.74, 4433240.0
(40d 3m 3s N, -105d 15m 45s W) by
clicking and dragging with the left mouse
button and releasing when the circle at
the crosshair intersection overlays the
intersection of interest.
13. Right-click in the vector window and
select Export Map Location. The new map coordinates will appear in the Ground Control Points Selection
dialog.
14. In the Ground Control Points Selection dialog, click Add Point to add the map-coordinate/image pixel pair and
observe the change in RMS error.

RST and Cubic Convolution Warping


1. From the Ground Control Points Selection dialog menu bar, select Options Warp File. The Input Warp
Image dialog appears.
2. Select the bldr_tm.img file, and click OK to select all six TM bands for warping. The Registration Parameters
dialog appears.
3. Click the Method drop-down list, and select RST.
4. Click the Resampling drop-down list, and select Cubic Convolution.
5. In the Background field, type 255.
6. In the Enter Output Filename field, type bldrtm_m.img as the new filename, and click OK. The warped
image is listed in the Available Bands List and automatically loaded into a new display group when the warp is
completed.
Note the skew of the image resulting from removal of the Landsat TM orbit direction. This image is
georeferenced, but at 30 meter resolution versus the 10 meter resolution provided by the SPOT image.

Displaying and Evaluating Results


1. From the ENVI main menu bar, select File Open Image File.
8
ENVI Tutorial: Image Georeferencing and Registration

Tutorial: Image Georeferencing and Registration


2. Navigate to the envidata\bldr_reg directory, select the file bldr_sp.img from the list, and click Open.
The Available Bands List appears.
3. From the Available Bands List, select the Georeferenced SPOT band from the list, click the Display # dropdown button and select New Display.
4. Click Load Band to load the SPOT image into a new display group.
5. Compare the image geometries and scale.
6. From the Ground Control Points Selection dialog menu bar, select File Cancel to close that dialog. Save the
GCPs if desired.
Now that you have learned how to perform Image to Image and Image to Map registration, refer to the Map Composition
tutorial for guidance on adding grid lines and creating image maps in ENVI.

Ending the ENVI Session


You can quit your ENVI session by selecting File Exit from the ENVI main menu.

9
ENVI Tutorial: Image Georeferencing and Registration

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 5

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Mosaicking in ENVI

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2
MOSAICKING IN ENVI ...............................................................................................................................................3

Feathering........................................................................................................................................................3
Virtual Mosaics..................................................................................................................................................3

PIXEL-BASED MOSAICKING EXAMPLE .............................................................................................................................4

Import and Position Images ...............................................................................................................................4


More on Positioning Images ...............................................................................................................................5

MAP BASED MOSAICKING EXAMPLE ...............................................................................................................................8

Create the Map Based Mosaic Image ..................................................................................................................8


View the Top Image, Cut-line and Virtual, Non-Feathered Mosaic ..........................................................................8
Create the Output Feathered Mosaic ...................................................................................................................9

COLOR BALANCING DURING MOSAICKING ..................................................................................................................... 10

Create the Mosaic Image without Color Balancing .............................................................................................. 10


RGB Mosaic Preview ........................................................................................................................................ 11
Output the Mosaic Without Color Balancing ....................................................................................................... 11
Output the Mosaic With Color Balancing ............................................................................................................ 11

Tutorial: Mosaicking in ENVI


Overview of This Tutorial
This tutorial is designed to give you a working knowledge of ENVIs image mosaicking capabilities. For additional details,
please see ENVI Help.

Files Used in this Tutorial


ENVI Resource DVD: envidata/avmosaic
File
Pixel-based mosaicking
dv06_2.img (.hdr)
dv06_3.img (.hdr)
dv06a.mos

Description
AVIRIS Scene 02
AVIRIS Scene 03
Mosaic template for end-to-end AVIRIS
mosaic
Mosaic template for feathered overlapping
AVIRIS mosaic
Feathered mosaic

dv06b.mos
dv06_fea.img (.hdr)
Georeferenced mosaicking
lch_01w.img (.hdr)
lch_01w.ann
lch_02w.img (.hdr)
lch_a.mos
lch_mos1.img (.hdr)
Color balancing during mosaicking
mosaic1_equal.dat (.hdr)

mosaic_2.dat (.hdr)

Warped, histogram-matched image


Cut-line feathering annotation for above
Warped, histogram matched image
Mosaic template for georeferenced image
mosaicking
Georeferenced mosaic result
Subset of a Landsat-7 ETM image with a
histogram equalization stretch
independently applied to each band
Another subset from the same Landsat-7
ETM image, without any stretching applied

2
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI


Mosaicking in ENVI
Mosaicking involves combining multiple images into a single composite image. ENVI provides interactive capabilities for
placing non-georeferenced images within a mosaic, and automated placement of georeferenced images within a
georeferenced output mosaic. ENVI also provides transparency, histogram matching, and automated color balancing.
ENVIs Virtual Mosaic allows you to create and display mosaics without creating large output files.
The following sections provide useful information about mosaics in ENVI before you start the exercises. The actual
exercises begin with the section Pixel-Based Mosaicking Example on page 4.

Feathering
To blend or blur the seams between mosaicked images, you can feather the edges of overlapping areas using either edge
feathering or cut-line feathering over a specified distance. To use feathering when mosaicking images, import the bottom
image without feathering. Then import the overlapping images with edge or cut-line feathering.

Edge Feathering
Edge Feathering uses a pixel distance you specify to blend the seams along
the edges of the mosaicked image. The edge is blended using a linear ramp
that averages the two images across the specified distance. For example, if
the specified distance is 20 pixels, 0% of the top image is used in the
blending at the edge and 100% of the bottom image is used to make the
output image. At 20 pixels from the edge, 100% of the top image is used to
make the output image and 0% of the bottom image is used. At 10 pixels
from the edge, 50% of each image is used to make the output image.

Cut-line Feathering
Cut-line Feathering uses a pixel distance and annotation file you specify to
blend the image boundaries. You must define cut-lines using the annotation
tools prior to mosaicking. The annotation file must contain a polyline defining
the cut-line that is drawn from edge-to-edge, and you must place a symbol in
the region of the image that will be cut off. The cut-line distance is used to
create a linear ramp that averages the two images across that distance from
the cut-line outwards. For example, if the specified distance is 20 pixels,
100% of the top image is used in the blending at the cut-line and 0% of the
bottom image is used to make the output image. At 20 pixels from the cutline,
0% of the top image is used to make the output image and 100% of the
bottom image is used. At 10 pixels from the cutline, 50% of each image is
used to make the output image.

Virtual Mosaics
You can use a mosaic template file to construct a Virtual Mosaic, one that can be displayed and used by ENVI without
actually creating a mosaic output file. You cannot use feathering when creating a Virtual Mosaic in ENVI.
After creating a mosaic, save the template file by selecting File Save Template from the Image Mosaicking dialog
menu bar. This creates a small text file describing the mosaic layout.
To use the Virtual Mosaic, select File Open Image File from the ENVI main menu bar and open the mosaic template
file. All of the images used in the mosaic are opened and their bands are listed in the Available Bands List. Display or
process any of the bands in the Virtual Mosaic, and ENVI treats the individual images as if they were an actual mosaic
output file. The new processed file has the specified size of the mosaic, and the input files are in their specified positions
within the mosaic.

3
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI


Pixel-Based Mosaicking Example
Before attempting to start the program, ensure that ENVI is properly installed as described in the Installation Guide that
shipped with your software.

Import and Position Images


1. From the ENVI main menu bar, select Map Mosaicking Pixel Based. The Pixel Based Mosaic dialog
appears.
2. From the Pixel Based Mosaic dialog menu bar, select Import Import Files. The Mosaic Input Files dialog
appears.
3. Select Open New File. Navigate to envidata\avmosaic and select dv06_2.img. Click Open.
4. Repeat Step 3 for dv06_3.img.
5. In the Mosaic Input Files dialog, click <Shift> to select both images. Click OK. The Select Mosaic Size dialog
appears.
6. In the Mosaic Xsize field, enter 614. In the Mosaic Ysize field, enter 1024. Click OK. A Pixel Mosaic dialog
appears:

7. The bottom of the Pixel Mosaic dialog lists the current position of the images. Select dv06_3.img, enter 513 in
the Y0 field, and press <Enter>. The file dv06_3.img is placed directly below dv06_2.img.

4
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI

8. From the Pixel Mosaic dialog menu bar, select File Apply. A Mosaic Parameters dialog appears.
9. In the Enter Output Filename field, enter dv06.img and click OK to create the mosaic.
10. To create a Virtual Mosaic instead of a new mosaic file, select File Save Template from the Pixel Based
Mosaic dialog menu bar. When the Output Mosaic Template dialog appears, enter the output filename
dv06a.mos.
11. In the Available Bands List, select Mosaic (Band 1) under dv06.mos (or dv06a.mos from Step 9) and click
Load Band.

More on Positioning Images


The second part of this example shows you how to position the two images into a composite mosaic image by entering
X0 and Y0 values, or by dragging the images to the desired locations within the Pixel Mosaic dialog. The example also
includes edge feathering.
1. In the Pixel Mosaic dialog, select Options Change Mosaic Size. The Select Mosaic Size dialog appears.
2. In the Mosaic Xsize and Mosaic Ysize fields, enter 768. Click OK.
3. In the Pixel Mosaic dialog, click the image surrounded by a green box (dv06_2.img) and drag it to the lowerright corner of the dialog.
4. Right-click inside this image and select Edit Entry. An Entry: dialog appears.
5. In the Data Value to Ignore field, enter 0.

5
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI


6. In the Feathering Distance field, enter 25.
7. Leave the default values for other fields and click OK.
8. Click the image surrounded by a red box (dv06_3.img) and drag it to the upper-left corner of the dialog. Then,
repeat steps 4-7 for this image.

9. From the Pixel Mosaic menu bar, select File Save Template. An Output Mosaic Template dialog appears.
10. In the Enter Output Filename field, enter dv06b.mos. Click OK.
11. In the Available Bands List, select Virtual Mosaic (Band 1) and click Load Band. No feathering is performed
with a Virtual Mosaic.
12. Make the same image as a feathered mosaic by creating an output file. From the Pixel Mosaic dialog menu bar,
select File Apply. A Mosaic Parameters dialog appears.
13. In the Enter Output Filename field, enter dv06f.img.
14. In the Background Value field, enter 255. Click OK.
15. In the Available Bands List, click Display #1 and select New Display.
16. Select Mosaic (Band 1) under dv06f.img and click Load Band. If you cannot see the entire image in the
Image window, click and drag a corner of the Image window to resize it.
17. Compare the Virtual Mosaic and the feathered mosaic using image linking and dynamic overlays. The following
figure shows the feathered output mosaic produced by overlapping the two AVIRIS scenes.
6
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI

18. From the Available Bands List menu bar, select File Close All Files.
19. Close the Pixel Mosaic dialog and all display groups.

7
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI


Map Based Mosaicking Example
Create the Map Based Mosaic Image
1. From the ENVI main menu bar, select Map Mosaicking Georeferenced. A Map Based Mosaic dialog
appears.
2. From the Map Based Mosaic dialog menu bar, select File Restore Template. A file selection dialog appears.
3. Navigate to envidata\avmosaic and select lch_a.mos. Click Open. This opens the files associated with the
mosaic template and restores the mosaic parameters necessary for a georeferenced, feathered mosaic.
You can also individually import georeferenced images and set the feathering options by selecting Import
Import Files from the Map Based Mosaic dialog menu bar. Images will automatically be placed in their
correct geographic locations. The location and size of the georeferenced images will determine the size of the
output mosaic.

View the Top Image, Cut-line and Virtual, Non-Feathered Mosaic


1. In the Available Bands List, select Warp under lch_01w.img and click Load Band.
2. Right-click in the Image window and select Toggle Display Scroll Bars. Click the horizontal scroll bar until a
good portion of the image is visible.
3. From the Display group menu bar, select Overlay Annotation. An Annotation dialog appears.
4. From the Annotation dialog menu bar, select File Restore Annotation. A file selection dialog appears.
5. Select lch_01w.ann and click OK. The display group shows a red cut-line used to blend the two images in this
mosaic.
6. In the Available Bands List, click Display #1 and select New Display.
7. Select Warp under lch_02w.img and click Load Band.
8. Can you identify the relationship between the cut-line and this image?
9. From the ENVI main menu bar, select File Open Image File. A file selection dialog appears.
10. Select lch_a.mos and click Open.
11. In the Available Bands List, click Display #2 and select New Display.
12. Select Virtual Mosaic under lch_a.mos and click Load Band.
13. Examine the non-feathered edge between the two images that were used to create the mosaic:

8
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI

Create the Output Feathered Mosaic


1. From the Mosaic dialog menu bar, select File Apply. A Mosaic Parameters dialog appears.
2. In the Enter Output Filename field, enter lch_mos.img and click OK to create the feathered mosaic.
3. Close Display #1 (lch_01w.img) and Display #2 (lch_02w.img).
4. In the Available Bands List, click Display #3 and select New Display.
5. Select Warp under lch_01w.img and click Load Band.
6. Compare the feathered mosaic to the non-feathered mosaic using image linking and dynamic overlays.

9
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI


Color Balancing During Mosaicking
This tutorial describes the procedure for creating a georeferenced mosaic using automated color balancing. For this
exercise, you will use two overlapping subsets from a Landsat-7 ETM image.

Create the Mosaic Image without Color Balancing


First, you will create a mosaic without color balancing. You will start by importing both of the images without any
feathering so you can clearly see the seams between the images.
1. From the ENVI main menu bar, select Map Mosaicking Georeferenced. A Map Based Mosaic dialog
appears.
2. From the Map Based Mosaic dialog menu bar, select Import Import Files. A Mosaic Input Files dialog
appears.
3. In the Mosaic Input Files dialog, click Open and select New File. Navigate to envidata\avmosaic and select
mosaic1_equal.dat. Click Open. A histogram equalization stretch was independently applied to each band in
this image.
4. Repeat Step 3 for mosaic_2.dat.
5. In the Mosaic Input Files dialog, Click <Shift> to select mosaic_2.dat and mosaic1_equal.dat. Click OK.
The two images are automatically placed in their correct geographic locations in the Mosaic dialog. By default, a
2% contrast stretch is applied to the images.

10
ENVI Tutorial: Mosaicking in ENVI

Tutorial: Mosaicking in ENVI


RGB Mosaic Preview
1. Right-click inside the image surrounded by a green box (mosaic1_equal.dat) and select Edit Entry. An
Entry: dialog appears.
2. Click the Mosaic Display toggle button to select RGB.
3. In the Red field, enter 1. In the Green field, enter 2. In the Blue field, enter 3.
4. Click OK. The file mosaic1_equal.dat is now displayed in color in the Mosaic dialog.
5. Repeat steps 1 through 4 for the other file in the mosaic (mosaic_2.dat).
By default, ENVI automatically creates an RGB composite in the Mosaic dialog using the first band as red, the second
band as green, and the third band as blue. If an image has more than three bands, the Mosaic dialog only shows a gray
scale version of Band 1.

Output the Mosaic Without Color Balancing


You should remember that what you see in the Mosaic dialog is not necessarily what you will see in the final mosaic. In
the Mosaic dialog, the two images are stretched independently. If the images are mosaicked into one image and
displayed, ENVI calculates a contrast stretch from the two images combined.
1. From the Mosaic menu bar, select File Apply. A Mosaic Parameters dialog appears.
2. In the Enter Output Filename field, enter mosaic_unbalanced.dat and click OK.
3. In the Available Bands List, click RGB Color. Select Band 1, Band 2, and Band 3, and click Load RGB. The
seams between the two images are quite obvious.

Output the Mosaic With Color Balancing


You will now apply the mosaic again, this time using color balancing to minimize the contrast between the two images in
the final mosaic.
1. In the Mosaic dialog, right-click inside the image surrounded by a green box (mosaic1_equal.dat) and select
Edit Entry. An Entry: dialog appears.
2. Click the Adjust radio button. The contrast of this image will be adjusted to match the other image. Click OK.
3. In the Mosaic dialog, right-click inside the image surrounded by a red box (mosaic_2.dat) and select Edit
Entry. An Entry: dialog appears.
4. Click the Fixed radio button. The contrast of this image will not change. The other image will be adjusted to
match this image. Click OK.
5. From the Mosaic dialog menu bar, select File Apply. A Mosaic Parameters dialog appears with a Color Balance
option near the bottom. Leave the default value "stats from overlapping regions." Color balancing is usually better
when based on statistics calculated from only the overlapping regions. The other option (stats from complete
files) is used when the mosaicked images have little or no overlap between them.
6. In the Enter Output Filename field, enter mosaic_balanced.dat and click OK.
7. In the Available Bands List, click RGB Color. Under mosaic_balanced.dat, select Band 1, Band 2, and
Band 3, and click Load RGB. The seams between the two images are nearly invisible now.
11
ENVI Tutorial: Mosaicking in ENVI

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 6

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
3D SurfaceView and Fly-Through

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2
3D VISUALIZATION IN ENVI .......................................................................................................................................3

Load a 3D SurfaceView......................................................................................................................................3

Open and Display Landsat TM Data ......................................................................................................................................3


Open and Display DEM as a Gray Scale Image ......................................................................................................................3
Start 3D SurfaceView ...........................................................................................................................................................3

Interactively Control 3D Visualization ..................................................................................................................4


3D SurfaceView Controls Dialog..........................................................................................................................4

Rotation/Scale/Translation Controls ......................................................................................................................................4


Surface Properties ...............................................................................................................................................................5
Perspective Controls ............................................................................................................................................................6
Other Visualization Controls..................................................................................................................................................6

3D SurfaceView Position Controls Dialog .............................................................................................................7


3D SurfaceView Motion Controls Dialog ...............................................................................................................7

Define Flight Path and Begin Flying.......................................................................................................................................7

Build a Visualization Sequence Using Annotation ..................................................................................................8


Animate Sequence ............................................................................................................................................9
Save Visualizations .......................................................................................................................................... 10
3D SurfaceView as an Analysis Tool .................................................................................................................. 10

Tutorial: 3D SurfaceView and Fly-Through


Overview of This Tutorial
This tutorial uses Landsat Thematic Mapper (TM) data to demonstrate ENVIs 3D SurfaceView and fly-through capabilities.
The 3D SurfaceView function allows you to overlay a gray scale or color-composite image over a digital elevation model
(DEM), interactively change the 3D visualization, and create a 3D fly-through. The 3D SurfaceView function also provides
limited analysis capabilities.

Files Used in This Tutorial


ENVI Resource DVD: envidata\bh_3d
File
bhtmsat.img (.hdr)
bhdemsub.img (.hdr)
bhdemsub.pat
bhdemsub.ann

Description
Landsat TM saturation-enhanced, RGB composite of
Bighorn Basin, Wyoming
USGS DEM at 30 m resolution
Fly-through path file
Fly-through path annotation file

2
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


3D Visualization in ENVI
ENVI provides numerous tools for viewing and analyzing image data in two dimensions. The 3D SurfaceView tool is the
first step toward extending data analysis into three dimensions.
The 3D SurfaceView tool allows you to display a DEM as a wire frame, ruled grid or points, or with a gray scale or color
image draped over it. You can rotate, translate, and zoom in or out of the 3D surface in real-time using the mouse. You
can add each 3D view to a list to use later for animation. Use saved views, or interactively draw a flight path (using
ENVI's annotation tool) to fly through the 3D data. You can set the vertical exaggeration, vertical and horizontal view
angles, and altitude. The cursor is linked to the draped 3D image, allowing you to extract profiles in the X, Y, and Z
(spectral) directions. You can also use the Cursor Location/Value tool in the 3D image.

Load a 3D SurfaceView
If you are running ENVI on a Windows system, you must set the display to 24bit color mode before starting ENVI.

Open and Display Landsat TM Data


1. From the ENVI main menu bar, select File Open Image File. An
Enter Data Filenames dialog appears.
2. Navigate to envidata\bh_3d and select bhtmsat.img. Click Open.
ENVI automatically loads bands 1, 2, and 3 into a new display group.
You can adjust the displayed contrast stretch by selecting Enhance
from the Display group menu bar.

Open and Display DEM as a Gray Scale Image


Displaying the associated DEM is not required, but it is recommended to
ensure that you have a matched DEM/image pair.
1. From the ENVI main menu bar, select File Open Image File. An
Enter Data Filenames dialog appears.
2.

Select bhdemsub.img and click Open. A gray scale image of the


Bighorn DEM is automatically loaded to a new display group.

Start 3D SurfaceView
1. From the ENVI main menu bar, select Topographic 3D
SurfaceView. A 3D SurfaceView: Select Input Display dialog appears.
2. Select Display #1 and click OK. An Associated DEM Input File dialog
appears.
3. Select DEM Elevation under bhdemsub.img and click OK. A 3D
SurfaceView Input Parameters dialog appears.
4. Select the desired DEM Resolution (number of pixels) used for the
3D plot. The DEM will be resampled to the selected resolution.
Using higher DEM resolutions will significantly slow the visualization and should only be used when sufficient
computing power is available. You can select more than one resolution. Typically, you should use the lowest
resolution (64) while you are determining the best flight path. Then, use a higher resolution to display your final
fly-through sequence.

3
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


5. In the DEM min plot value field, enter 1219. In the DEM max plot value field, enter 1707. (You can always
experiment with different values later if you find you need to cut out background pixels or limit the elevation
range of the DEM.) DEM values lower than the minimum value and higher than the max value will not be plotted
in the 3D view.
6. Set the Vertical Exaggeration field to 15.
7. Select the Full radio button under Image Resolution. (If you select Other, the image is resampled to the
number of pixels selected for the DEM.)
8. Click OK to start the visualization. A 3D SurfaceView dialog appears with the 3D image.

Interactively Control 3D Visualization


1. Click-and-drag the left mouse button in a horizontal direction to rotate the surface around the z-axis. Click-anddrag in a vertical direction to rotate the surface around the x-axis.
2. Click-and-drag the middle mouse button to translate, or pan, the image in the corresponding direction.
3. Click-and-drag the right mouse button in a horizontal direction to zoom in or out.
4. Double-clicking on a pixel in the 3D SurfaceView moves the Zoom window to that pixel. Double-clicking links the
3D cursor location to selected functions that are active in the display group (see 3D SurfaceView as an Analysis
Tool on page 10 for more information).
You can also control the rotation, translation, and zoom factor; and reset the 3D view to its original position, using the
SurfaceView Controls dialog described in the following section.

3D SurfaceView Controls Dialog


Access the 3D SurfaceView Controls, Position Controls, or Motion Controls dialogs from the Options menu of the 3D
SurfaceView dialog. These dialogs determine how the surface is displayed, how the perspective is positioned, and how
the surface is animated, respectively.
The 3D SurfaceView Controls dialog allows you to make fine adjustments, to edit surface properties, and to rotate the
surface around a perspective view.

Rotation/Scale/Translation Controls
The 3D SurfaceView Controls dialog allows you to make fine adjustments.
1. From the 3D SurfaceView dialog menu bar, select Options Surface Controls. The 3D SurfaceView Controls
dialog appears.

4
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


buttons to change the rotation of the surface plot in the desired direction. Use the
2. Click the
adjacent Inc field to set the rotation increment.
buttons to zoom in or out of the surface plot, respectively. Use the adjacent Inc field to set
3. Click the
the zoom increment.
4. Click the
buttons to move (translate) the surface plot in the desired direction. Use the adjacent
Inc field to set the translation increment.

Surface Properties
1. Click the Surface Style drop-down list and select different wireframe options. The figures below show Wire
(upper-left), Ruled XZ (upper-right), Ruled YZ (lower-left), and Points (lower-right).
2. Experiment with different Vertical Exaggeration values. Higher factors increase the vertical exaggeration.

5
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through

Perspective Controls
This section of the 3D SurfaceView Controls dialog allows you to click a point in the 3D SurfaceView plot to specify a
perspective origin around which the surface is rotated.

1. Click

to toggle the cursor to "select" mode.

2. Move the cursor to the 3D SurfaceView plot and click somewhere in the plot to set the origin of the rotation. The
view zooms to the new origin of the perspective, which is set at a height that is 0.05 normalized units (default)
above the surface. Rotation begins.
3. You can modify the height of the perspective origin above the surface using the Translation controls in the 3D
SurfaceView Controls dialog.
4. Click Stop to pause the current rotation. If the cursor is in "select" mode, but you did not choose a perspective
origin, clicking Stop toggles the cursor out of "select" mode.
5. Click Start to start a rotation that was stopped; or, if no perspective rotation was started, to begin rotating the
surface around its center point.
6. Enter the desired value for Rotation Delay, which is the number of seconds to wait between the successive
renderings of the rotating surface. The default value is 0.05. Setting the value to 0.0 sets the rotation speed to
your computer's limits for calculating the transformation matrix and rendering the surface.
7. You can change the direction of the rotation of the surface by clicking Direction and selecting Left or Right.
Direction refers to the rotation direction of the surface, not the viewer's perspective.

Other Visualization Controls


1. To change the color of the background in the 3D SurfaceView dialog, select Options Change Background
Color.
6
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


2. To smooth a surface that appears pixelated, select Options Bilinear Interpolation from the 3D SurfaceView
dialog menu bar. To turn off the smoothing effect, reselect this option.
3. To reset the surface view to the default view, select Options Reset View from the 3D SurfaceView dialog
menu bar.

3D SurfaceView Position Controls Dialog


Use this dialog to view the surface panoramically (as if you are
standing in the image), thus setting the view to a specific position
and direction.
1. From the 3D SurfaceView dialog menu bar, select
Options Position Controls. The SurfaceView Position
Controls dialog appears.
2. Double-click inside the Display #1 Image window to start
the Cursor Location/Value tool. Move the cursor to a
preferred viewing position and note the corresponding
pixel or map coordinates.
3. Click the Pixel Coord toggle button to toggle between
pixel coordinates and map coordinates. Enter the
coordinates from Step 2 into the Sample/Line or E/N
fields. A good starting point is Sample 3600 and Line 3000.
4. Experiment with different Azimuth, Elevation, and
Height Above Ground values to see how they change
the 3D SurfaceView. Start with an Azimuth (look direction)
of 90, an Elevation (look angle) of -90 (looking straight
down), and a Height Above Ground of 2000 m. Change the
height from 2000 to 1000 to 500. Click Apply.
5. Use the interactive rotation and zooming to see the 3D SurfaceView from the selected viewpoint.

3D SurfaceView Motion Controls Dialog


ENVIs 3D SurfaceView function can be used to build an animation sequence or fly-through of the 3D visualization.
Try restoring a previously saved flight path and playing the animation sequence.
1. From the 3D SurfaceView dialog menu bar, select Options Motion
Controls. The 3D SurfaceView Motion Controls dialog appears.
2. From the 3D SurfaceView Motion Controls dialog menu bar, select
File Restore Sequence. A file selection dialog appears.
3. Select bhdemsub.pat and click Open.
4. Set the Frames field to 500 and click Play Sequence. Click Stop
Sequence to stop the fly-through.

Define Flight Path and Begin Flying


1. Click Clear in the 3D SurfaceView Motion Controls dialog. Use the mouse
or arrow buttons (in the 3D SurfaceView Controls dialog) to select the
starting viewpoint, and click Add in the 3D SurfaceView Motion Controls
dialog to add this projection as the starting point of the flight path.
7
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


2. Use the mouse or arrow buttons to select another viewpoint, and click Add to add this view to the flight path.
Repeat this step until you have selected as many visualization steps as desired (at least two are required). When
you select the number of frames and play the visualization, the flight path is smoothly interpolated between the
different views. A larger number of frames results in a smoother flight path, but it slows down the animation.
Select a view number and click Replace to replace a projection in the flight path list.
Select a view number and click Delete to delete a projection in the flight path list.
Click Clear to clear the flight path list.
From the 3D SurfaceView dialog menu bar, select Options Animate Sequence to build a full animation
and to control the speed and direction of the fly-through (see Animate Sequence below)

Build a Visualization Sequence Using Annotation


1. From the 3D SurfaceView Motion Controls dialog menu bar, select Options Motion:Annotation Flight Path
to use a flight path drawn in the display group using ENVI annotation. An Input Annotation Flight Path dialog
appears. You can draw a polyline, polygon, rectangle, or ellipse annotation object to define the flight path, or use
a saved file as input instead.
2. Select the Input Annotation from File radio button and click OK. A file selection dialog appears.
3. Select bhdemsub.ann and click Open. An Input Annotation Object dialog appears.
4. Select Ann Object #1: Green and click OK. The selected annotation file and number of nodes are shown in the
middle of the 3D SurfaceView Motion Controls dialog, and the flight path is plotted on the surface in the 3D
SurfaceView dialog.
5. In the 3D SurfaceView Motion Controls dialog, keep the number of Frames at 500. To smooth the flight path
using a running average of points along the line, enter a Flight Smooth Factor value of 1000.
6. Set the Flight Clearance field to 1000.
7. Set the Up/Down field to -60. A vertical look angle of -90 degrees looks straight down at the surface. A look
angle of 0 degrees looks straight ahead (horizontal). Leave the Left/Right look angle at 0. A horizontal look angle
of -90 degrees looks to the left, a look angle of 0 degrees looks straight ahead, and a look angle of 90 degrees
looks to the right.
8. Click Play Sequence to animate the fly-through. Try different values in each of the parameters and observe the
effect they have on the visualization. Also, fly over the surface at a constant elevation by clicking the toggle
button to select Flight Elevation, and enter the desired elevation above sea level.
9. Select the flight path from a saved annotation file by selecting File Input Annotation File from the 3D
SurfaceView Motion Controls dialog menu bar. A file selection dialog appears.
10. Select bhdemsub.ann and click OK. An Input Annotation Object dialog appears.
11. Select Ann Object #2: Red and click OK.
12. Set the Frames value to 100.
13. Set the Flight Smooth Factor field to 10000.
14. Set the Flight Clearance field to 1000.
15. Set the Up/Down field to -60, and leave the Left/Right value at 0.

8
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


16. Click Play Sequence to animate the fly-through. Try different values in each of the parameters and observe the
effect they have on the visualization.
17. Try creating your own annotation objects and animating the fly-through by selecting Overlay Annotation
from the Display group menu bar, selecting File Input Annotation from the SurfaceView Motion Controls
dialog menu bar, and clicking Play Sequence.

Animate Sequence
The Animate Sequence option allows you to control the speed and direction of the 3D SurfaceView animation.
1. Use the same values in Steps 12-15 above for the ellipse flight path, then select Options Animate
Sequence from the SurfaceView Motion Controls dialog to load the individual frames into the animation. The 3D
SurfaceView Controls dialog changes to show an interactive tool for controlling the animation:

2. Control the speed of the fly-through by increasing the Speed value. Higher values result in faster animation.
3. Control the direction of the fly-through by clicking the appropriate button at the bottom of the dialog:

reverse animation

9
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


forward animation

continuous forward/reverse animation

pause animation
When the animation is paused, click-and-drag the slider to step through the animation one or more frames at a
time.
4. From the Animation Window menu bar, select File Cancel to return to the 3D SurfaceView Motion Controls
dialog.

Save Visualizations
The ENVI 3D SurfaceView function also offers several options to save the visualization results and/or path. Select the
following from the SurfaceView Motion Controls dialog:
Select File Save Sequence to File from the SurfaceView Motion Controls dialog menu bar to save the
current path to an ENVI path (.pat) file that can be restored to a 3D visualization session
Select File Restore Sequence Path from File from the SurfaceView Motion Controls dialog menu bar to
restore a saved flight path when the visualization is in the User Defined mode
Select File Input Annotation from Display from the SurfaceView Motion Controls dialog menu bar to get
annotation from the current display group when the visualization is in the Annotation mode
Select File Input Annotation from File from the SurfaceView Motion Controls dialog menu bar to get
annotation from an ENVI annotation file when the visualization is in the Annotation mode
Select File Save Surface As Image File from the 3D SurfaceView menu bar to output the currently
displayed view to an ENVI image
Select File Print from the 3D SurfaceView menu bar to perform direct printing of the currently displayed view
Select File Save Surface As VRML from the 3D SurfaceView menu bar to output the 3D visualization to a
VRML file that can be viewed in a web browser

3D SurfaceView as an Analysis Tool


ENVIs 3D SurfaceView tool provides powerful visualization capabilities for viewing images draped on DEMs. Because of
the way you can dynamically link ENVI display groups and dialogs, this function also allows you to perform DEM analysis
using the 3D SurfaceView tool. Analysis tools are described below.
1. Start the 3D SurfaceView tool and display the desired 3D surface.
2. Cursor Location/Value: Double-click in the Image window to start the Cursor Location/Value tool. Read the cursor
location (pixel and map coordinates) and value by moving the cursor in the 3D SurfaceView window.
3. Spatial and Spectral Pixel Editors: From the Display group menu bar, select Tools Spatial Pixel Editor or
Tools Spectral Pixel Editor. Double-click on a pixel in the 3D SurfaceView window to position the cursor in
the ENVI display group to the appropriate location. Edit the desired pixel values.

10
ENVI Tutorial: 3D SurfaceView and Fly-Through

Tutorial: 3D SurfaceView and Fly-Through


4. X and Y Profiles: From the Display group menu bar, select Tools Profiles X Profile or Tools
Profiles Y Profile. Double-click on a pixel in the 3D SurfaceView window to position the cursor in the ENVI
display group to the appropriate location. The X or Y Profiles are updated to match the selected cursor location,
and the location is marked with a red vertical line in the selected profile.
5. Z Profile (Spectral Profile): From the Display group menu bar, select Tools Z Profile or Tools Profiles
Additional Z Profile. Double-click on a pixel in the 3D SurfaceView window to position the cursor in the ENVI
display group to the appropriate location. The Z Profile spectrum is extracted from the data to match the selected
cursor location.
6. Spectral Analyst: Display a Z Profile, then select Spectral Spectral Analyst from the ENVI main menu bar. A
Spectral Analyst Input Spectral Library dialog appears. Open the desired spectral library by clicking Open
Spectral Library. The Edit Identify Methods Weighting dialog appears. Click OK. From the Spectral Analyst
dialog menu bar, select Options Auto Input via Z-Profile to link the Spectral Analyst to a specific spectral
profile. Once the Spectral Analyst is set up, double-click on a pixel in the 3D SurfaceView window to position the
cursor in the ENVI display group to the appropriate location.
The Z Profile spectrum is extracted from the data to match the selected cursor location, and the Spectral Analyst
calculates a match to the library spectrum.
7. When you are finished, select File Exit from the ENVI main menu bar.

11
ENVI Tutorial: 3D SurfaceView and Fly-Through

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 7

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Vector Overlay and GIS Analysis

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................3

Sources and Files Used in this Tutorial ................................................................................................................3

ESRI Data and Maps Version 1 CD-ROM................................................................................................................................3


Space Imaging/EOSAT CarterraTM Agriculture Sampler Data .................................................................................................3

Required Files ...................................................................................................................................................3

VECTOR OVERLAY AND GIS CONCEPTS...........................................................................................................................5

Capabilities .......................................................................................................................................................5
Concepts ..........................................................................................................................................................6

ENVI Vector Files (.evf)........................................................................................................................................................6


The Available Vectors List ....................................................................................................................................................6
Create World Boundaries .....................................................................................................................................................7
The Vector Parameters Dialog and Vector Window Menu .......................................................................................................8
ENVI Attributes ...................................................................................................................................................................9

PART 1: STAND-ALONE VECTOR GIS........................................................................................................................... 10

Open a Shapefile............................................................................................................................................. 10
Work with Vector Point Data ............................................................................................................................ 10
Create USA State Boundaries Using IDL Map Sets .............................................................................................. 10
Work with Vector Polygon Data ........................................................................................................................ 11
Retrieve Vector Information and Attributes........................................................................................................ 11
View Attributes and Use Point-and-Click Query .................................................................................................. 11
Query Attributes.............................................................................................................................................. 12
Add a Map Key in Vector Window ..................................................................................................................... 12
Close all Windows and Files.............................................................................................................................. 13

PART 2: RASTER AND VECTOR PROCESSING................................................................................................................... 14

Load Image Data to Combined Image/Vector Display ......................................................................................... 14


Open a Vector Layer and Load to Image Display ................................................................................................ 14
Track Attributes with the Cursor ....................................................................................................................... 14
Heads-up (On-screen) Digitizing ....................................................................................................................... 15
Edit Vector Layers ........................................................................................................................................... 16

Tutorial: Vector Overlay and GIS Analysis


Query Operations ............................................................................................................................................ 16
Convert Vectors to ROIs .................................................................................................................................. 17
Display Image Map Results .............................................................................................................................. 17
Close Windows and Files.................................................................................................................................. 18
Export ROI to Vector Layer .............................................................................................................................. 18

Open and Display an Image ............................................................................................................................................... 18


Load Predefined ROIs ........................................................................................................................................................ 18
Convert ROIs to Vectors..................................................................................................................................................... 18
Close All Windows and Files ............................................................................................................................................... 19

Export a Classification Image to Vector Polygons ............................................................................................... 19

Load and Display a Classification Image.............................................................................................................................. 19


Generalize the Classification Image..................................................................................................................................... 19
Convert the Generalized Classification Image to Vector Polygons.......................................................................................... 19

2
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


Overview of This Tutorial
This tutorial introduces ENVIs vector overlay and GIS analysis capabilities using vector data from ESRIs Maps and Data
CD-ROM; a simulated 4 m resolution Space Imaging/EOSAT multispectral dataset; and associated vector data of
Gonzales, California, USA.
Part 1 of this tutorial demonstrates the following:
Stand-alone vector GIS analysis, including input of shapefiles and associated DBF attribute files
Display in vector windows
Viewing and editing attribute data
Point-and-click spatial query
Math and logical query operations
Part 2 of this tutorial demonstrates the following:
ENVIs combined image display/vector overlay and analysis capabilities
o Cursor tracking with attribute information
o Point-and-click spatial query
o Heads-up digitizing and vector layer editing
Generation of new vector layers using math and logical query operations
Raster-to-vector conversion of ENVI regions of interest (ROIs) and classification images
ENVIs vector-to-raster conversion, using vector query results to generate ROIs for extraction of image statistics
and area calculations

Sources and Files Used in this Tutorial


The data used in this tutorial are provided courtesy of the Environmental Systems Research Institute Inc. and Space
Imaging/EOSAT and may not be redistributed without explicit permission from those organizations.

ESRI Data and Maps Version 1 CD-ROM


Example data used in Part 1 of this tutorial come from the ESRI Data and Maps Version 1 CD-ROM distributed with
ArcView Version 3.0. ITT Visual Information Solutions strives to maintain import/export compatibility with ESRI GIS
products and data formats, including ArcView shapefiles, ArcGRID files, and ArcInfo export files (.e00, non-compressed).

Space Imaging/EOSAT CarterraTM Agriculture Sampler Data


Example images and vector data used in Part 2 of this tutorial come from the Space Imaging/EOSAT Carterra Agriculture
Sampler CD-ROM (Copyright 1997, Space Imaging/EOSAT) and are used with their explicit permission. This sample
dataset covers an agricultural area near Gonzales, California, USAthe north-central portion of the Palo Escrito Peak, CA
USGS 7.5 minute quadrangle. The digital imagery are simulated data products designed to be similar to the space-based
image data products collected and distributed by Space Imaging/EOSAT in early 1998. Space Imaging/EOSAT provides
these simulated data products as examples of information extracted from their imagery products. The simulated imagery
datasets were generated from digital image data collected by an airborne multispectral scanner. The airborne data were
geometrically rectified, corrected for solar effects, and mosaicked at a spatial resolution simulating the Carterra data
products. However, radiometric and geometric differences exist between these data and satellite-based products planned
for delivery. Please see the Carterra Sampler readme.txt file included in the si_eosat subdirectory for additional
information.

Required Files
ENVI Resource DVD:
Paths: envidata/esri_gis (Part 1 of this tutorial)
envidata/si_eosat (Parts 1 and 2 of this tutorial)
envidata/can_tm
(Part 2 of this tutorial)

3
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


Required vector GIS files for Part 1 (envidata\esri_gis)
File
Description
cities.shp (.shx, .dbf)
USA cities (points)
states.shp (.shx, .dbf)
USA states (polygons)
Optional vector GIS files for Part 1 (envidata\esri_gis)
File
Description
counties.shp (.shx, .dbf)
USA counties (polygons)
drainage.shp (.shx, .dbf)
USA states (polygons)
lakes.shp (.shx, .dbf)
USA lakes (polygons)
rivers.shp (.shx, .dbf)
USA rivers (polylines)
roads.shp (.shx, .dbf)
USA roads (polylines)
Required image files for Part 2 (envidata\si_eosat)
File
Description
0826_ms.img (.hdr)
4 m multispectral data and ENVI header
Required image files for Part 2 (envidata\can_tm)
File
Description
can_tmr.img (.hdr)
Caon City TM data and ENVI header
can_sam.img (.hdr)
Caon City SAM classification and ENVI header
can_pcls.img (.hdr)
Caon City parallelepiped classification and ENVI
header
can_sv.img (.hdr)
Sieved classification (threshold = 5) and ENVI
header
can_clmp.img (.hdr)
Clumped (5 x 5) after sieve and ENVI header
can_tm1.roi
Caon City TM ROI #1
can_tm2.roi
Caon City TM ROI #2
Required vector GIS files for Part 2 (envidata\si_eosat)
File
Description
vectors.shp (.shx, .dbf) Field outlines (polygons)
Optional vector GIS files for Part 2 (envidata\si_eosat)
File
Description
gloria.evf (.dbf)
Query results (polygons)
lanini.evf (.dbf)
Query results (polygons)
sharpe.evf (.dbf)
Query results (polylines)
si_eosat.vec
ENVI vector template for the above three
vectors

4
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


Vector Overlay and GIS Concepts
Capabilities
ENVI provides extensive vector overlay and GIS analysis capabilities. These include the following:
Import support for industry-standard GIS file formats, including shapefiles and associated DBF attribute files,
ArcInfo interchange files (.e00, uncompressed), MapInfo vector files (.mif) and attributes from associated
.mid files, Microstation DGN vector files, DXF, and USGS DLG and SDTS formats. ENVI uses an internal ENVI
Vector Format (EVF) to maximize performance.
Vector and image/vector display groups provide a stand-alone vector plot window for displaying vector data
and composing vector maps. More importantly, ENVI provides vector overlays in display groups (Image
windows, Scroll windows, and Zoom windows).
You can generate world boundary vector layers, including low- and high-resolution political boundaries,
coastlines, and rivers, and USA state boundaries. You can display all of these in vector windows or overlay them
in image display groups.
You can perform heads-up (on-screen) digitizing in a vector or raster display group. Heads-up digitizing
provides an easy means of creating new vector layers by adding polygons, lines, or points.
Image- and vector window-based vector editing allows you to modify individual polygons, polylines, and points
in vector layers using standard editing tools, taking full advantage of the image backdrop provided by raster
images in ENVI.
ROIs, specific image contour values, classification images, and other raster processing results can be
converted to vector format for use in GIS analysis.
Latitude/longitude and map coordinate information can be displayed and exported for image-to-map
registration. Attribute information can be displayed in real-time as each vector is selected.
ENVI supports linked vectors and attribute tables with point-and-click query for both vector and raster
displays. Click on a vector in the display group, and the corresponding vector and its associated information is
highlighted in the attribute table. Click on an attribute in the table, and the display scrolls to and highlights the
corresponding vector.
Scroll and pan through rows and columns of vector attribute data. Edit existing information or replace attributes
with constant values, or with data imported from ASCII files. Add or delete attribute columns. Sort column
information in either forward or reverse order. Export attribute records as ASCII text.
Query vector database attributes directly to extract information that meets specific search criteria. You can
perform GIS analysis using simple mathematical functions and logical operators to produce new information and
layers. Results can either be output to memory or to a file for later access.
You can set vector layer display characteristics and modify line types, fill types, colors, and symbols. Use
attributes to control labels and symbol sizes. Add custom vector symbols.
You can reproject vector data from any map projection to another.
You can convert vector data to raster ROIs for extraction of statistics, calculation of areas, and use in ENVIs
many raster analysis functions.
Generate maps using ENVI annotation in either vector or image windows. Set border widths and background
colors, and configure graphics colors. Automatically generate vector layer map keys. Insert objects such as
5
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


rectangles, ellipses, lines, arrows, symbols, text, and image insets. Select and modify existing annotation objects.
Save and restore annotation templates for specific map compositions.
Create shapefiles and associated DBF attribute files and indices, or DXF files, from the internal ENVI
Vector Format (EVF). New vector layers generated using ENVIs robust image processing capabilities, and
changes made to vector layers in ENVI are exported to industry-standard GIS formats.
Use ENVIs direct printing capabilities to output to printers and plotters.

Concepts
ENVIs vector overlay and GIS analysis functions generally follow the same paradigms as ENVIs raster processing
routines, including the same procedures for opening files and the use of standard dialogs for output to memory or file.
The following sections describe some of the basic concepts.

ENVI Vector Files (.evf)


External vector files imported into ENVI are automatically converted into EVF, with the default file extension .evf. The
EVF format speeds processing and optimizes data storage. When you select output to memory (instead of to a file), ENVI
retains the external vector format without creating an EVF file.

The Available Vectors List


Much like the Available Bands List used to list and load image bands, the Available Vectors List provides access to all
vector files open in ENVI. It appears when needed, or you can invoke it by selecting Window Available Vectors List
from the ENVI main menu bar. Vectors are loaded to either vector or image display groups when you select them from
the Available Vectors List and click Load Selected. If you have an image display group open, you can load the vectors to
that display group, or to a new vector window. In addition to listing and loading vector layers, the Available Vectors List
provides utilities to open vector files, to start new vector windows, to create world boundaries and new vector layers, and
to export analysis results to ROIs (through raster-to-vector conversion), shapefiles, and ancillary files.

6
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


Create World Boundaries
ENVI uses IDL map sets to generate low- and high-resolution world boundaries in EVF. Select Options Create World
Boundaries from the Available Vectors List, or Vector Create World Boundaries from the ENVI main menu bar.
You can also generate political boundaries, coastlines, rivers, and USA state boundaries.
High-resolution format is available only if the IDL high-resolution maps are installed. If these are not currently installed on
your system, you can install them using the ENVI Installation CD, modifying your installation to include the highresolution maps.

7
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


The Vector Parameters Dialog and Vector Window Menu
When vectors are overlaid on an image, the Vector Parameters dialog appears to let you control the way vectors are
displayed and the functions that are available for vector processing and analysis.
When vectors are loaded into a vector window (not in an image display group), the vector window has the same menu
functions available in the Vector Parameters dialog.
The Vector Parameters dialog and the vector window menu bar allow you to open vector files, import vector layers from
the Available Vectors List, arrange vector layer precedence, set plot parameters, and annotate plots. They also control the
mode of operation in the vector window or image display group, toggling between cursor query and heads-up digitizing
and editing. The Vector Parameters dialog or the vector window menu initiate ENVIs GIS analysis functions, including
real-time vector information, attribute viewing and editing, and vector query operations. Finally, the Vector Parameters
dialog and the vector window menu bar provide utilities for exporting analysis results to shapefiles and ancillary attribute
files, or to ROIs (through vector-to-raster conversion). You can also save the current configuration of vector overlays to a
template, so you can later restore them.

8
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


ENVI Attributes
ENVI provides access to fully attributed GIS data in a shapefile DBF format. Attributes are listed in an editable table,
allowing point-and-click selection and editing.
Double-clicking in a particular cell selects that cell for editing. The table also supports full column substitution using a
uniform value and replacement with values from an ASCII file. Options include adding and deleting individual columns
and sorting data forward and backward based on information within a column. You can save attributes to an ASCII file or
to a DBF file.
Point-and-click spatial query is supported in ENVI attribute tables to help you locate key features in images or in a vector
window. Select specific records by clicking the label at the left edge of the table for a specific row in the table. The
corresponding vector is highlighted in a contrasting color in the image display group or vector window. You can select
multiple records, including non-adjacent records, by holding down the <Ctrl> key as you click the additional row labels.

9
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


Part 1: Stand-Alone Vector GIS
This part of the tutorial demonstrates how to use ENVI as a simple stand-alone vector processing and analysis system for
GIS data. You will use data from the ESRI Data and Maps 1 CD-ROM, which are provided on the ENVI Resource DVD.
Before attempting to start the program, ensure ENVI is properly installed as described in the installation guide.

Open a Shapefile
1. From the ENVI main menu bar, select File Open Vector File. A Select Vector Filenames dialog appears.
2. Navigate to envidata\esri_gis. Click the Files of type drop-down list in the Select Vector Filenames dialog,
and select Shapefile.
3. Select cities.shp. Click Open. The Import Vector Files Parameters dialog appears. This dialog allows you to
select file or memory output, enter an output filename for the ENVI .evf file, and enter projection information if
ENVI is unable to find the projection information automatically.
4. Click the Memory radio button. Accept the default values by clicking OK. A status window indicates the number
of vector vertices being read, and the Available Vectors List appears when the data have been converted.
5. Select cities.shp in the Available Vectors List and click Load Selected. The Vector Window #1 dialog
appears with USA cities plotted. The default mode (shown in the title bar or in the lower-right corner of the
dialog) is Cursor Query.

Work with Vector Point Data


1. Click and drag the cursor around in Vector Window #1. Latitudes and longitudes are displayed in the lower-left
corner of the dialog.
2. Zoom into the contiguous 48 states by positioning the cursor in the far northwest part of the U.S. and clicking
and dragging the middle mouse button to define a box covering the desired region. Release the middle mouse
button in the far southeast part of the U.S.
Multiple levels of zoom are possible. Click the middle mouse button while holding the <Shift> key to zoom into
the display centered on the cursor. Right click in the Vector Window #1 dialog and select Previous Range to step
backward through the previous zoom levels. Right-click and select Reset Range, or click the middle mouse button
in the Vector Window #1 dialog to reset the zoom level and to set the vector display back to the original range.
3. Change the symbol used to mark the cities. From the Vector Window #1 menu bar, select Edit Edit Layer
Properties. An Edit Vector Layers dialog appears. Click the Point Symbol drop-down list and select Flag. Click
OK. You can add your own symbols by defining them in the file usersym.txt in the menu directory of your
ENVI installation.
4. Experiment with changing the color, symbol, and size. Click Preview to view your changes as you go.

Create USA State Boundaries Using IDL Map Sets


1. From the Available Vectors List menu bar, select Options Create World Boundaries. The Create Boundaries
dialog appears.
2. Select the USA States check box, select the Memory radio button, and click OK to create the USA States
boundaries, which is loaded into the Available Vectors List.
3. In the Available Vectors List, select USA States [full range] and click Load Selected. The Load Vector dialog
appears.
10
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


4. Select Vector Window #1 as the location to load the vector. Click OK. The cities and the state boundaries both
appear in the Vector Window #1 dialog. The state boundaries are polylines, which are not true polygons because
of the way they were digitized and stored.
5. From the Vector Window #1 dialog menu bar, select Edit Edit Layer Properties. The Edit Vector Layers
dialog appears.
6. Select USA States [full range]. Change parameters for the state boundaries, including color, line style, and
thickness. To change the color, click on the colored box until you see the color you want, or right-click on the
colored box and select a color from the menu that appears. Click OK when you are finished.
7. Clear the state boundaries by clicking USA States [full range] in the Available Vectors List, then clicking
Remove Selected.

Work with Vector Polygon Data


1. From the Vector Window #1 dialog menu bar, select File Open Vector File. A Select Vector Filenames dialog
appears.
2. Click the Files of type drop-down list in the Select Vector Filenames dialog, and select Shapefile. Select
states.shp and click Open. A Import Vector Files Parameters dialog appears.
3. Select the Memory radio button, and accept the default values by clicking OK.
4. A status window reports the number of vector vertices being read, and the Available Vectors List appears when
the data have been converted. The vector layer states.shp is loaded into the Available Vectors List.
5. In the Available Vectors List, select states.ship and click Load Selected. The Load Vector dialog appears.
6. Select Vector Window #1 as the location to load the vector. Click OK. The cities and the state boundaries both
appear in the Vector Window #1 dialog. The state boundaries are polylines, which are not true polygons because
of the way they were digitized and stored.
7. From the Vector Window #1 dialog menu bar, select Edit Edit Layer Properties. The Edit Vector Layers
dialog appears.
8. Select Layer:states.shp and change the color to green. Click the Polygon Fill drop-down list and select Line.
Click OK.

Retrieve Vector Information and Attributes


1. Right-click in the Vector Window #1 dialog and select Select Active Layer Layer: cities.shp. From the
Vector Window #1 dialog menu bar, select Options Vector Information to open the Vector Information
dialog. Click and drag over the city flags in the Vector Window #1 dialog to see the basic attribute information
(from cities.dbf) in the Vector Information dialog.
2. Find your hometown or a nearest city by examining the AREANAME attribute in the Vector Information window.
The latitude and longitude appear at the bottom of the Vector Window #1 dialog.

View Attributes and Use Point-and-Click Query


1. While cities.shp is still the active layer and Cursor Query is the active mode, select Edit
View/Edit/Query Attributes from the Vector Window #1 dialog menu bar. A Layer Attributes table appears.
This is a fully editable table of the attributes for the selected layer.

11
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


2. Click in the left column (on the record number) to do a spatial query on a selected city. The corresponding city
flag is highlighted in the Vector Window #1 dialog. If desired, zoom to the selected city by clicking and dragging
a box around it with the middle mouse button. Zoom back out by clicking the middle mouse button in the Vector
Window #1 dialog.
3. Verify that you have selected the correct city by clicking the city flag in the Vector Window #1 dialog and
observing the attributes in the Vector Information window.
4. Edit the AREALAND value for the selected city by scrolling to the right in the Layer Attributes table until you see
the AREALAND column. Double-click in the corresponding AREALAND table cell. Enter a new value and press
<Enter> to change the value.
5. Perform a map-based query by clicking a city flag. The corresponding record is highlighted in the Layer Attributes
table. In the Vector Window #1 dialog, drag the vector cursor from one city flag to another, and note how the
Layer Attributes table scrolls to follow the selected cities.

Query Attributes
1. Ensure that cities.shp is still the active layer. From the Vector Window #1 dialog menu bar, select Options
Select Active Layer Layer:cities.shp.
2. From the Vector Window #1 dialog menu bar, select Edit Query Attributes. A Layer Attribute Query dialog
appears.
3. In the Query Layer Name field, enter Where State==California. Click Start. A Query Expression section
appears at the top of the Layer Attribute Query dialog.
4. Click the AREANAME drop-down list and select ST.
5. Click the > drop-down list and select ==.
6. In the String field, enter CA (be sure to match this case).
7. Click the Memory radio button and click OK. ENVI creates a new vector layer and associated DBF file based on
the results of the query. The new layer appears in the Available Vectors List and is loaded into Vector Window
#1. Zoom to the selected vectors using the middle mouse button to draw a box around the state of California.
8. Right-click in the Vector Window #1 dialog and select Select Active Layer Layer:Where
State==California. Open the DBF attribute file by selecting Edit View/Edit/Query Attributes from the
Vector Window #1 dialog menu bar. The Layer Attributes table appears.
9. Perform some point-and-click query operations as described in the previous section to see the association
between the selected cities, their locations in the vector window, and their attributes. You can select multiple
cities from the attribute table by holding down the <Ctrl> key while you click on the record labels on the left side
of the table.
10. Click the AREANAME column name at the top of the table to highlight the entire set of attributes. From the Layer
Attributes table menu bar, select Options Sort by selected column forward to sort the column
alphabetically. Scroll down the column and click the Sacramento row (record 334) to highlight the location of
Californias capital in a different color in the Vector Window #1 dialog.

Add a Map Key in Vector Window


You can generate a vector map from the Vector Window dialog, using annotation tools. See the Map Composition tutorial
or ENVI Help for further details. The following exercise shows you how to add a map key.
1. From the Vector Window #1 dialog menu bar, select Options Annotate Plot. An Annotation dialog appears.
12
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


2. From the Annotation dialog menu bar, select Object Map Key to automatically create a map key for the
vector layers. Click once inside the Vector Window #1 dialog to show the map key, and click and drag the red
diamond handle to move it. To change the characteristics of the map key, click Edit Map Key Items in the
Annotations dialog and change the settings in the Map Key Object Definition dialog.
3. Right-click in the Vector Window #1 dialog to lock the map key in place. Annotation in the vector window
behaves the same way as annotation in display groups. See the Map Composition tutorial or ENVI Help for further
details.
The following image shows the results of the attribute queries and annotations; your results may be slightly
different.

Close all Windows and Files


1. In the Available Vectors List, click Select All Layers. Click Remove Selected. From the Available Vectors List
menu bar, select File Cancel.
2. Close the vector window and all associate dialogs and attribute tables by selecting File Cancel from the
Vector Window #1 dialog menu bar.

13
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


Part 2: Raster and Vector Processing
This section of the tutorial demonstrates how to use vector overlays and GIS data and attributes in combination with
raster images from Space Imaging/EOSAT.

Load Image Data to Combined Image/Vector Display


Open an image file to use as a backdrop for vector layers.
1. From the ENVI main menu bar, select File Open Image File. A file selection dialog appears.
2. Navigate to envidata\si_eosat and select 0826_ms.img. Click Open.
The Available Bands List appears with four spectral bands listed. The data simulate a 4 m Space Imaging/EOSAT
multispectral dataset with spectral band coverage similar to the first four spectral bands of Landsat Thematic Mapper
data. A true-color image is automatically loaded into a new display group.

Open a Vector Layer and Load to Image Display


1. From the Display group menu bar, select Overlay Vectors. A Vector Parameters dialog appears.
2. From the Vector Parameters dialog menu bar, select File Open Vector File. This menu option is also
accessible from the ENVI main menu bar. A Select Vector Filenames dialog appears.
3. Click the Files of type: drop-down list and select Shapefile. Select vectors.shp and click Open. An Import
Vector Files Parameters dialog appears.
4. Select File or Memory output, and enter an output filename for the ENVI .evf file if you selected File.
5. In the Native Projection list, select State Plane (NAD 83). Click Set Zone. A Select State Plane Zone dialog
appears.
6. Select (404, 3351) California IV and click OK.
7. Select Memory output and click OK. A status window reports the number of vector vertices being read. When
the data have been converted, they are automatically loaded into the Vector Parameters dialog and displayed in
white on the image. The vectors.shp layer should be highlighted in the Vector Parameters dialog.
8. Click the Current Layer colored box to select a more visible color for the vector layer or right-click on the box
and select from the menu. Click Apply to update the vector color.

Track Attributes with the Cursor


1. In the Vector Parameters dialog, select Options Vector Information. A Vector Information dialog appears.
2. Click and drag inside the image to view the attribute information for the vectors. Also observe the latitude and
longitude listed in the Vector Parameters dialog. Select the Scroll or Zoom radio button in the Vector Parameters
dialog to allow vector tracking in the corresponding window. Select the Off radio button to allow normal scrolling
in the Scroll and Main windows and zooming in the Zoom window. Try different zoom factors in the Zoom window
to assess the accuracy of the vectors.
3. Ensure that you are in Cursor Query mode by selecting Mode from the Vector Parameter dialog menu bar.
4. From the Vector Parameters dialog menu bar, select Edit View/Edit/Query Attributes. A Layer Attributes
table appears. Select random records by clicking the numbered columns to highlight specific polygons on the

14
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


image. You may want to change the Current Highlight color in the Vector Parameters dialog to something that is
more visible in your display group.

Heads-up (On-screen) Digitizing


ENVI provides vector editing routines for adding your own vectors to an existing vector layer or for creating new vector
layers. These vector editing routines are similar in function to ENVIs annotation polygons, polylines, and points. ENVI
heads-up vector digitizing allows you to create new polygons, polylines, points, rectangles, and ellipses.
1. Create a new vector layer by selecting File Create New Layer from the Vector Parameters dialog. A New
Vector Layer Parameters dialog appears.
2. Enter a Layer Name. Click the Memory radio button, and click OK.
3. In the Vector Parameters dialog, click the new layer name to initialize a new DBF file.
4. From the Vector Parameters dialog menu bar, select Mode Add New Vectors.
5. For this exercise, you will create a polygon vector. From the Vector Parameters dialog menu bar, select Mode
Polygon.
Since the Image radio button is selected by default in the Vector Parameters dialog, you will define the new
polygon in the Image window. You can specify which display group window you want to edit your vectors in, by
selecting the appropriate radio button in the Vector Parameters dialog.
You may want to change the new vector layer color from white to something more visible before drawing new
polygons.
6. Draw a few polygons using field outlines on the image as guides. In the Image window, use the mouse to define
the new polygon area as follows:
Click the left mouse button to draw polygon segments.
Click the middle mouse button to erase polygon segments.
Click the right mouse button to fix the polygon. Right-click again and select Accept New Polygon to
accept the polygon.
To move the Image box in the Scroll window to a new location, you must click the Off radio button in the
Vector Parameters dialog. When you are finished moving around the image, click the Image radio button
to resume adding new vectors.
7. To add attributes to the new polygons, select Edit Add Attributes from the Vector Parameters dialog menu
bar. An Add Attributes Choice dialog appears.
8. Select Define new attributes interactively. Click OK. An Attribute Initialization dialog appears.
9. In the Name field, type Field_ID.
10. Click the Type drop-down list and select Character.
11. Click Add Field.
12. For the second attribute, type Field_Area in the Name field.
13. Click the Type drop-down list and select Numeric.
14. Click OK to create the attribute table. A Layer Attributes table appears.

15
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


15. Double-click in a field, enter the value, and press the <Enter> key. To see which rows are associated with which
fields, select Mode Cursor Query from the Vector Parameters dialog, and click the row labels in the Layer
Attributes table. The corresponding polygon is highlighted in the Image window.
16. From the Layer Attributes dialog menu bar, select File Cancel. When you are prompted to save the attribute
table, click Yes.

Edit Vector Layers


1. In the Vector Parameters dialog, select the new vector layer and select Mode Edit Existing Vectors.
2. In the Image window, click one of the polygons you created in the last section. The polygon is highlighted and its
nodes are marked with diamonds. When the vector is selected, you can make the following changes:
Delete the entire polygon by right-clicking it and selecting Delete Selected Vector.
To move a node, click and drag it to a new location.
After making changes to a polygon, right-click it and select Accept Changes.
Exit the editing function without making any changes by clicking the middle mouse button, or right-click
and select Clear Selection.
To add or remove nodes from a polygon, right-click to display the shortcut menu and select from the
following options:
o

To add a node, right-click and select Add Node, then drag the node to a new location.

To remove a node, right-click it and select Delete Node from the shortcut menu.

To change the number of nodes added at one time, right-click and select Number of Nodes to
Add. Enter the number of nodes in the dialog that appears.

To remove a range of nodes, right-click on the first node and select Mark Node. Right-click on the
last node and select Mark Node again. Right-click again and select Delete Marked Nodes.

3. To finish this section, select Window Available Vectors List from the ENVI main menu bar to display the
Available Vectors List. Delete any new layers you have created by selecting them in the Available Vectors List and
clicking Remove Selected. Do not remove the vectors.shp layer.

Query Operations
1. From the Vector Parameters dialog menu bar, select Mode Cursor Query.
2. In the Vector Parameters dialog, highlight vectors.shp. Select Edit View/Edit/Query Attributes. A Layer
Attributes table appears.
3. Examine the RANCH column and note the predominance of three owners gloria, lanini, and sharpe. Close
the attribute table by selecting File Cancel.
4. From the Vector Parameters dialog menu bar, select Edit Query Attributes. A Layer Attribute Query dialog
appears.
5. In the Query Layer Name field, type Gloria Ranch. Click Start.
6. In the Query Expression section that appears at the top of the Vector Parameters dialog, click the AREA dropdown list and select RANCH.
16
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


7. Click the > drop-down list and select ==.
8. In the Value field, type gloria. (Be sure to match the case in the attribute table).
9. Select the Memory radio button and click OK. The Gloria Ranch layer generated by the query appears in the
Vector Parameters dialog.
10. In the Vector Parameters dialog, select the Gloria Ranch layer and select Edit Edit Layer Properties from
the menu bar to change layer parameters. An Edit Vector Layers dialog appears.
11. Click the Polygon Fill drop-down list and select Line. Click OK. The Gloria Ranch polygons are highlighted as a
new layer.
12. To examine the attributes for this layer, select Gloria Ranch in the Vector Parameters dialog, and select Edit
View/Edit/Query Attributes from the menu bar. A Layer Attributes table appears. Examine the query results.
13. Close the Layer Attributes table and repeat the query for the "lanini" and "sharpe" ranches, highlighting each in a
different color or pattern.
14. Try other queries on combinations of attributes by choosing one of the logical operators in the Layer Attribute
Query dialog.

Convert Vectors to ROIs


ENVI provides several important links between vector analysis and raster image processing. This portion of the exercise
describes how to create ROIs from vector processing results and extract ROI statistics.
1. From the Display group menu bar, select Overlay Region of Interest. The ROI Tool dialog appears.
2. In the Vector Parameters dialog, highlight a layer name and select File Export Active Layer to ROIs. An
Export EVF Layers to ROI dialog appears.
3. Select Convert all records of an EVF layer to one ROI, and click OK.
4. Repeat Steps 2-3 for each layer you created earlier from the query operations. The layers appear in the ROI Tool
dialog.
5. In the ROI Tool dialog, select the Gloria Ranch ROI by clicking in the far left column of its row. Click Stats. An
ROI Statistics Results dialog appears with image statistics for the Gloria Ranch polygons and multispectral data.
Now that you have converted these vector polygons to ROIs, you can use ENVIs raster processing capabilities to analyze
the image data, with respect to the ROIs. This includes masking, statistics, contrast stretching, and supervised
classification.

Display Image Map Results


ENVI provides tools to generate image maps from the combined raster/vector data in a display group. These include
annotation tools used for image and plot annotation, as well as QuickMap tools. The following example shows you how to
add a map key to the display group. See the Map Composition tutorial or ENVI Help for further details on annotation.
1. From the Display group menu bar, select Overlay Annotation. An Annotation dialog appears.
2. From the Annotation dialog menu bar, select Object Map Key.
3. Click once inside the Image window to show the map key. Click and drag the diamond handle to move the map
key.
17
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


4. Click Edit Map Key Items in the Annotation dialog. A Map Key Object Definition dialog appears. Change the
map key characteristics as desired and click OK.
5. Once you have placed the map key where you want it, right-click in the Image window to lock it in place.

Close Windows and Files


1. In the Available Vectors List, click Select All Layers, followed by Remove Selected. From the Available Vectors
List menu bar, select File Cancel.
2. From the ENVI main menu bar, select File Close All Files.

Export ROI to Vector Layer


ENVI can convert raster processing results (such as ROIs) for use in ENVI vector processing and analysis and for export
to external GIS software such as ArcGIS. The following exercises illustrate the export of raster information to vector GIS.

Open and Display an Image


Open a Landsat TM image of Caon City, Colorado, USA, to use as background for ROI definition and export to vector:
1. From the ENVI main menu bar, select File Open Image File. A file selection dialog appears.
2. Navigate to envidata\can_tm and select can_tmr.img. Click Open.
3. In the Available Bands List, select TM Band 4, select the Gray Scale radio button, and click Load Band.

Load Predefined ROIs


1. From the Display group menu bar, select Overlay Region of Interest. An ROI Tool dialog appears.
2. From the ROI Tool dialog menu bar, select File Restore ROIs.
3. Navigate to envidata\can_tm and select can_tm1.roi. Click Open. An ENVI Message dialog reports what
regions have been restored. Click OK. The predefined ROI is loaded into the ROI Tool dialog and plotted on the
image.
4. Repeat Step 3 for the file can_tm2.roi.

Convert ROIs to Vectors


1. To convert these ROIs to vector polygons, select File Export ROIs to EVF from the ROI Tool dialog menu
bar. An Export Region to EVF dialog appears.
2. Select a region from the Select ROIs to Export field.
3. Select All points as one record.
4. Enter an Output Layer Name, click Memory, and click OK to convert the first ROI.
5. Repeat Steps 1-4 for the second ROI. The layers appear in the Available Vectors List.
6. In the Available Vectors List, click Select All Layers, followed by Load Selected. A Load Vector dialog
appears.
7. Select New Vector Window and click OK. The vectors are loaded as polygons into the Vector Window #1
dialog.
18
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


8. From the Vector Window #1 dialog menu bar, select Edit Add Attributes.
9. Add attributes as described in Steps 8-15 on page 12.
You can now use these polygons with query operations and GIS analysis with other vector data, or you can export them
to shapefiles by selecting File Export Active Layer to Shapefile from the Vector Window Parameters dialog.

Close All Windows and Files


1. In the Available Vectors List, click Select All Layers, followed by Remove Selected.
2. From the Available Vectors List menu bar, select File Cancel.
3. From the Vector Window #1 dialog menu bar, select File Cancel.
4. From the ENVI main menu bar, select File Close All Files.

Export a Classification Image to Vector Polygons


You can export classes from a classification image to one or more vector layers, and you can select individual image
brightness levels for export as a vector layer.

Load and Display a Classification Image


Open a parallelepiped classification image of Caon City TM data (with three classes) to use as a background for ROI
definition and export to vector:
1. From the ENVI main menu bar, select File Open Image File. A file selection dialog appears.
2. Navigate to envidata\can_tm and select can_pcls.img. Click Open.
3. In the Available Bands List, click Load Band.

Generalize the Classification Image


To conduct successful raster-to-vector conversions, you should typically generalize the results of raster processing. If you
do not generalize, you will have vector polygons around individual pixels and small groups of pixels. To demonstrate the
results of generalizing the classification image, load and display the results of a 5-pixel sieve operation, followed by a 5 x
5 clump operation as follows:
1. Open and display can_sv.img (the sieve results) in Display #1, replacing can_pcls.img.
2. Open and display can_clmp.img (the clump results) in Display #1, replacing can_sv.img.

Convert the Generalized Classification Image to Vector Polygons


1. From the ENVI main menu bar, select Classification Post Classification Classification to Vector. A
Raster to Vector Input Band dialog appears.
2. Select Clump under can_clmp.img and click OK. A Raster to Vector Parameters dialog appears.
3. Select Region #1, press the <Shift> key, and select Region #2 (to select both).
4. Click the Output toggle button to select One Layer per Class.
5. Select Memory and click OK. The new vector layers appear in the Available Vectors List.
6. In the Available Vectors List, select Region #1, press the <Shift> key, and select Region #2 (to select both).

19
ENVI Tutorial: Vector Overlay and GIS Analysis

Tutorial: Vector Overlay and GIS Analysis


7. Click Load Selected. A Load Vectors dialog appears.
8. Select Display #1 and click OK. A Vector Parameters dialog appears.
9. In the Vector Parameters dialog, select Region #1. Select Edit Edit Layer Properties from the Vector
Parameters menu bar. An Edit Vectors Layers dialog appears.
10. Right-click the Color box and select Items 1:20 White. Click the Polygon Fill drop-down list and select
Line. Click OK.
11. In the Vector Parameters dialog, select Region #2. Select Edit Edit Layer Properties from the Vector
Parameters menu bar. An Edit Vectors Layers dialog appears.
12. Right-click the Color box and select Items 1:20 Yellow. Click the Polygon Fill drop-down list and select
Line. Click OK.
13. Examine the results in Display #1. You can also overlay the vectors onto a gray scale image of can_tmr.img
Band 3 if desired. This overlay is show in the following figure.

14. From the ENVI main menu bar, select File Exit.

20
ENVI Tutorial: Vector Overlay and GIS Analysis

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 8

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

ENVI Tutorial:
Map Composition

Table of Contents
OVERVIEW OF THIS TUTORIAL .....................................................................................................................................2
MAP COMPOSITION IN ENVI .......................................................................................................................................3

Open and Display Landsat TM Data ....................................................................................................................3


Build the QuickMap Template .............................................................................................................................3

MAP ELEMENTS .......................................................................................................................................................5

Adding Virtual Borders .......................................................................................................................................5

Automatically ......................................................................................................................................................................5
Using the Display Preferences ..............................................................................................................................................5
Using the Annotation Function..............................................................................................................................................5

Adding Grid Lines ..............................................................................................................................................6


Working with Annotation....................................................................................................................................6

Text and Symbol Annotation ................................................................................................................................................7


Polygon and Shape Annotation .............................................................................................................................................7
Line and Arrow Annotation ...................................................................................................................................................7
Scale Bar Annotation ...........................................................................................................................................................8
Declination Diagrams ...........................................................................................................................................................8
Map Key Annotation.............................................................................................................................................................8
Color Ramp Annotation ........................................................................................................................................................9
Image Insets as Annotation .................................................................................................................................................9
Plot Insets as Annotation .....................................................................................................................................................9

Overlaying Classification Images....................................................................................................................... 10


Overlaying Contour Lines ................................................................................................................................. 10
Incorporating Regions of Interest ..................................................................................................................... 10
Overlaying Vector Layers ................................................................................................................................. 10

CUSTOMIZE THE MAP LAYOUT.................................................................................................................................... 12

Load the QuickMap Template ........................................................................................................................... 12

SAVE THE RESULTS ................................................................................................................................................. 13

Saving for Future Modification .......................................................................................................................... 13


Saving as a Burned-in Image......................................................................................................................... 13
Saving as an Image File................................................................................................................................... 13
Printing .......................................................................................................................................................... 13

Tutorial: Map Composition


Overview of This Tutorial
This tutorial is designed to give you a working knowledge of ENVIs map composition capabilities. You can use ENVIs
QuickMap utility to generate a basic map template and add more information using ENVIs annotation capabilities. For
additional information on map composition, see ENVI Help.

Files Used in This Tutorial


ENVI Resource DVD: envidata/ys_tmsub
File
ysratio.img (.hdr)
ysratio.ann
ysratio.grd
ys_loc.tif

Description
Yellowstone National Park TM Ratio Subset Image
Saved annotation result for above
Saved grid parameters for above
Location image for above

2
ENVI Tutorial: Map Composition

Tutorial: Map Composition


Map Composition in ENVI
Map composition should be a simple, quick process of creating an image-based map from a remote sensing image and
interactively adding key map components. In ENVI, the map composition process usually consists of basic template
generation (or restoring a saved template) using the QuickMap utility, followed by interactive customization (if required)
using ENVI annotation or other image overlays.
QuickMap allows you to set the map scale and the output page size and orientation; to select the image spatial subset to
use for the map; and to add basic map components such as map grids, scale bars, map titles, logos, projection
information, and other basic map annotation. Other custom annotation types include map keys, declination diagrams,
arrows, images or plots, and additional text. Using annotation or grid line overlays means you can modify QuickMap
default overlays and place all map elements in a custom manner.
You can save your map composition in a display group and restore it for future modification or printing. Using annotation,
you can build and save individual templates of common map objects.

Open and Display Landsat TM Data


Before attempting to start the program, ensure that ENVI is properly installed as described in the installation guide.
1. From the ENVI main menu bar, select File Open Image File. A file selection dialog appears.
2. Navigate to envidata\ys_tmsub and select ysratio.img. Click Open. The 5/7, 3/1, and 3/4 ratio bands are
automatically loaded into the R, G, and B fields of the Available Bands List, respectively.
3. Click Load RGB. Once the image appears in a display group, complete the following steps to build a QuickMap
template and to add individual map components.

Build the QuickMap Template


1. From the Display group menu bar, select File QuickMap New QuickMap. The QuickMap Default Layout
dialog appears. This dialog allows you modify the output page size, page orientation, and map scale.
2. For this exercise, accept the default values but change the Map Scale to 200000. Click OK. A QuickMap Image
Selection dialog appears.
3. Use the full image for this exercise. Click and drag the lower-right corner of the red box downward so that the
whole image is selected. Click OK. The QuickMap Parameters dialog appears.
4. Click inside the Main Title field and type Yellowstone National Park Image-Map.
5. Right-click inside the Lower Left Text field and select Load Projection Info to load the image map projection
information from the ENVI header.
6. For this exercise, you should leave the Scale Bars, Grid Lines, and North Arrow check boxes selected.
7. Click the Declination Diagram check box to select it.
8. Click Save Template at the bottom of the dialog. A Save QuickMap Template to File dialog appears.
9. In the Enter Output Filename field, enter ysratio.qm. Click OK to save the QuickMap results as a QuickMap
template file. You can recall this template later and use it with any image of the same pixel size by displaying the
desired image and selecting File QuickMap from Previous Template from the Display group menu bar.
10. Click Apply in the QuickMap Parameter dialog to display the QuickMap results in a display group. If desired, you
can modify the settings in the QuickMap Parameters dialog and click Apply to change the displayed QuickMap.
3
ENVI Tutorial: Map Composition

Tutorial: Map Composition


11. At this stage, you can output the QuickMap to a printer or a Postscript file. See Save the Results and Printing
on page 14 for more information. Save or print a copy if desired. Otherwise, continue with the next step.
12. Review the QuickMap results and observe the map grids, scale bars, north arrow, and positioning of the default
text.

4
ENVI Tutorial: Map Composition

Tutorial: Map Composition


Map Elements
ENVI offers many options for customizing your map composition. Options include virtual borders, text annotation, grid
lines, contour lines, plot insets, vector overlays, and classification overlays. You can use the display group (Image
window, Scroll window, or Zoom window) to perform additional, custom map composition. (If you are working in the
Scroll window, you may want to enlarge it by dragging one of the corners to resize the display.) The following sections
describe the different elements and provide general instructions.

Adding Virtual Borders


Default display groups contain only the image, with no surrounding blank space. Map composition typically requires some
map objects to reside outside the image. ENVI provides a virtual border capability that allows annotation in the image
borders without creating a new image. You can add virtual borders to an image in several ways, which are described in
the following sections.

Automatically
When you generate a QuickMap, ENVI automatically adds a virtual border to all sides of the image to accommodate the
QuickMap grid, and it displays a default grid.
1. To change the default border, select Overlay Grid Lines from the Display group menu bar associated with
the QuickMap. A Grid Line Parameters dialog appears.
2. From the Grid Line Parameters dialog menu bar, select Options Set Display Borders. A Display Borders
dialog appears.
3. Enter values as shown in the following figure.

4. Click OK. The new virtual border characteristics are immediately applied to the image. If you select File Save
Setup from the Grid Line Parameters dialog menu bar, the border information will be saved with the grid and will
be restored when you restore the grid parameters file later.

Using the Display Preferences


You can also change virtual borders and other display settings using the Display Preferences dialog.
1. From the Display group menu bar associated with the QuickMap, select File Preferences. A Display
Parameters dialog appears with a Display Border section similar to the above figure.
2. Enter the desired values and select the desired color for the border.
3. Click OK. The new borders are immediately applied to the image.

Using the Annotation Function


You can also control virtual borders in the Annotation dialog.

5
ENVI Tutorial: Map Composition

Tutorial: Map Composition


1. From the Display group menu bar associated with the QuickMap, select Overlay Annotation. An Annotation
dialog appears.
2. From the Annotation dialog menu bar, select Options Set Display Borders. A Display Borders dialog
appears.
3. Enter the desired border characteristics and click OK. The new virtual border characteristics are immediately
applied to the image. If you save an annotation to a file, the border information is also saved and restored when
you restore the annotation file later.

Adding Grid Lines


ENVI supports simultaneous pixel, map coordinate, and geographic (latitude/longitude) grids. A 100-pixel virtual border
(which can be adjusted as described in Adding Virtual Borders on page 6) is automatically appended to the image to
accommodate grid labels when grids are applied. To add or modify image grids, follow these steps:
1. From the Display group menu bar associated with the QuickMap, select Overlay Grid Lines. A Grid Line
Parameters dialog appears and a default grid is displayed with default grid spacings.
2. In the Grid Spacing field, enter 4000.
3. To change line and label characteristics for the grid, select Options Edit Map Grid Attributes or Edit
Geographic Grid Attributes from the Grid Line Parameters dialog menu bar. Alternatively, you can access grid
line parameters by clicking Additional Properties in the QuickMap Parameters dialog.
4. Click OK to apply the selected attributes.
5. In the Grid Line Parameters dialog, click Apply to post the new grid to the displayed image.
6. To save grid parameters for later use, select File Save Setup from the Grid Parameters dialog menu bar and
select an output file. This saves a template of the grid parameters, which you can recall later and use with
another map composition (select File Restore Setup from the Grid Parameters dialog menu bar).

Working with Annotation


ENVI's annotation utility provides a way to insert and position map objects in an ENVI display group for map composition.
Several classes of map objects are available.
1. From the Display group menu bar associated with the QuickMap, select Overlay Annotation. An Annotation
dialog appears.
2. From the Annotation dialog menu bar, select Object and choose the desired annotation object.
3. In the Annotation dialog, select the Image, Scroll, or Zoom radio button to indicate where the annotation will
appear.
4. Drag the object to a preferred location, then right-click to lock it in place.
5. To reselect and modify an existing annotation object, select Object Selection/Edit from the Annotation
dialog menu bar. Then select the object by drawing a box around it. You can move the selected object by clicking
the associated handle and dragging the object to a new location. You can delete or duplicate an object by
choosing the appropriate option from the selected menu. Right-click to relock the annotation in place.
6. Remember to select the Off radio button in the Annotation dialog before attempting non-annotation mouse
functions in the display group.
7. Keep the Annotation dialog open for the following exercises.
6
ENVI Tutorial: Map Composition

Tutorial: Map Composition


Text and Symbol Annotation
ENVI currently has a wide variety of text fonts and different standard symbol sets. In addition, ENVI can use TrueType
fonts installed on your system. This provides access to a wide range of different text fonts and symbols. You can
interactively scale and rotate these fonts and symbols, and you can set different colors and thickness.
ENVI provides some useful symbols (including special north arrows) as a custom TrueType font. To modify the font
characteristics, click Font and select ENVI Symbols in the Annotation dialog. Following are some examples of ENVI
Symbols:

Text:
1. Select Object Text from the Annotation dialog menu bar.
2. Click Font and select a font.
3. Select the font size, color, and orientation using the appropriate buttons and fields in the Annotation dialog. For
information on adding additional fonts, see Using Other TrueType Fonts with ENVI in ENVI Help. TrueType
fonts provide more flexibility. Select one of the TrueType fonts available on your system by clicking Font,
selecting a True Type option, and selecting the desired font.
4. Type your text in the empty field in the Annotation dialog.
5. Drag the text object to a preferred location in the image and right-click to lock it in place.
Symbols:
1. Select Object Symbol from the Annotation dialog menu bar.
2. Select the desired symbol from the table of symbols that appears in the Annotation dialog.
3. Drag the text object to a preferred location in the image and right-click to lock it in place.

Polygon and Shape Annotation


You can draw rectangles, squares, ellipses, circles, and free-form polygons in an image. These can be an outline only, or
filled with a solid color or a pattern. Placement is interactive, with easy rotation and scaling.
1. Select Object Rectangle, Ellipse, or Polygon from the Annotation dialog menu bar.
2. Enter object parameters as desired in the Annotation dialog.
3. Drag the shapes to a preferred location in the image and right-click to lock them in place. For polygons, use the
left mouse button to define polygon vertices and the right mouse button to close the polygon.

Line and Arrow Annotation


You can draw polylines (lines) and arrows in an image. You have full control over the color, thickness and line type, and
the fill and head characteristics for arrows.
Arrows:
1. Select Object Arrow from the Annotation dialog menu bar.

7
ENVI Tutorial: Map Composition

Tutorial: Map Composition


2. Enter object parameters as desired in the Annotation dialog.
3. To draw an arrow, click and hold the left mouse button and drag the cursor in the image to define the length and
orientation of the arrow. Release the left mouse button to complete the arrow. You can move it by dragging the
red diamond handle. Right-click to lock the arrow in place.
Lines:
1. Select Object Polyline from the Annotation dialog menu bar.
2. Enter object parameters as desired in the Annotation dialog.
3. To draw a free-form line, click and hold the left mouse button as you are drawing. To draw a straight line, click
repeatedly (without holding the left mouse button) to define the vertices. Right-click to complete the line. You
can move it by dragging the red diamond handle. Right-click again to lock the line in place.

Scale Bar Annotation


ENVI automatically generates map scales based on the pixel size of the image in the map composition. Units include feet,
miles, meters, or kilometers. You can place map scales individually, or in groups. You can configure the number of major
and minor divisions, and the font and character size.
1. Select Object Scale Bar from the Annotation dialog menu bar.
2. Enter object parameters as desired in the Annotation dialog.
3. Click once in the image to show the scale bar. Move it to a preferred location by dragging the red diamond
handle. Right-click to lock the scale bar in place.

Declination Diagrams
ENVI generates declination diagrams based on your preferences. You can specify the size of the diagram and enter
azimuths for true north, grid north, and magnetic north in decimal degrees.
1. Select Object Declination from the Annotation dialog menu bar.
2. Enter object parameters as desired in the Annotation dialog.
3. Click once in the image to show the declination diagram. Move it to a preferred location by dragging the red
diamond handle. Right-click to lock the diagram.

Map Key Annotation


Map keys are automatically generated for classification images and vector layers, but you can manually add them for all
other images. Following is an example of a map key:

1. Select Object Map Key from the Annotation dialog menu bar.
2. Click Edit Map Key Items to add, delete, or modify individual map key items.

8
ENVI Tutorial: Map Composition

Tutorial: Map Composition


3. Click once in the image to show the map key. Move it to a preferred location by dragging the red diamond
handle. Right-click to lock the map key in place.
4. If you want a border and title for the map key, you must add these separately as polygon and text annotations,
respectively:

Color Ramp Annotation


You can create gray scale ramps and color bars for gray scale and color-coded images, respectively. This option is not
available with RGB images.
1. Select Object Color Ramp from the Annotation dialog menu bar.
2. In the Annotation dialog, enter minimum and maximum values and intervals as desired. Also set vertical or
horizontal orientation.
3. Click once in the image to show the color ramp. Move it to a preferred location by dragging the red diamond
handle. Right-click to lock the color ramp in place.

Image Insets as Annotation


While mosaicking provides one way to inset an image into another, you can also inset images while composing and
annotating maps.
1. Ensure that the image to be inset is listed in the Available Bands List.
2. Select Object Image from the Annotation dialog menu bar.
3. Click Select New Image. An Annotation Image Input Bands dialog appears.
4. Select the image from the Available Bands List in the Annotation Image Input Bands dialog and perform optional
spatial subsetting. Click OK.
5. Click once in the image to show the inset. Drag the green diamond handle to resize the inset as desired. Rightclick to lock the inset in place.
Because 8-bit displays cannot easily assign a new color table to the inset image, ENVI only shows a gray scale image in
the display group. If your display has 24-bit color, a color image will be displayed.

Plot Insets as Annotation


You can easily inset ENVI plots into an image during the map composition/annotation process. These vector plots
maintain their vector character (meaning they will not be rasterized) when output to the printer or to a Postscript file.
They will not appear when output to an image.
1. You must have a plot window open, such as an X Profile, Y Profile, Z Profile, spectral plot, or arbitrary profile.
2. Select Object Plot from the Annotation dialog menu bar.
3. Click Select New Plot. A Select Plot Window dialog appears.

9
ENVI Tutorial: Map Composition

Tutorial: Map Composition


4. Select the plot and enter the desired dimensions to set the plot size. Click OK.
5. Click once in the image to show the plot. Right-click to lock the plot in place.
Because 8-bit displays cannot easily assign a new color table to the inset plot, ENVI only shows a representation of the
plot in the display group. The actual plot is placed when the image is output directly to the printer or to a Postscript file,
and the annotation is burned in. Again, this option does not produce a vector plot when output to Image.

Overlaying Classification Images


ENVI classification images can be used as overlays during map composition. First, classify the image (see ENVI Help for
procedures) or open an existing ENVI classification image. Once the classified image is listed in the Available Bands List,
then you can use it as an overlay.
1. From the Display group menu bar associated with the map composition, select Overlay Classification. A file
selection dialog appears.
2. Select an ENVI classification image and click OK. An Interactive Class Tool dialog appears.
3. Turn on specific classes to appear in the map composition by selecting the corresponding On check boxes. The
selected classes will appear in the appropriate color as an overlay on the image.
4. You can change class colors and names by selecting Options Edit class colors/names from the Interactive
Class Tool dialog menu bar.

Overlaying Contour Lines


You can contour Z values of images and overlay the contour lines as vectors on an image background. Digital elevation
models (DEMs) work best. Add contours to a map composition as follows:
1. From the Display group menu bar associated with the map composition, select Overlay Contour Lines. A
Contour Band Choice dialog appears.
2. Select the desired image to contour and click OK. A Contour Plot dialog appears.
3. To use the default contour values, click Apply. Otherwise, you can add new contour levels, edit contours, and
change colors and line types using the Contour Plot dialog. See ENVI Help for details.

Incorporating Regions of Interest


You can incorporate Regions of interest (ROIs) into ENVI map compositions. Generate ROIs by drawing them, by
thresholding specific image bands, by utilizing 2D or n-D scatter plots, or by performing vector-to-raster conversions. See
ENVI Help for details. Display an ROI in a map composition as follows:
1. From the Display group menu bar associated with the map composition, select Overlay Region of Interest.
An ROI Tool dialog appears, listing any existing ROIs having the same dimensions as the displayed image. These
ROIs appear in the image.
2. Add or modify ROIs as desired. See ENVI Help for further details.

Overlaying Vector Layers


ENVI can import shapefiles, MapInfo files, Microstation DGN files, DXF files, ArcInfo interchange files, USGS DLG files, or
ENVI vector files (.evf).

10
ENVI Tutorial: Map Composition

Tutorial: Map Composition


1. From the Display group menu bar associated with the map composition, select Overlay Vectors. A Vector
Parameters dialog appears.
2. From the Vector Parameters dialog menu bar, select File Open Vector File. A file selection dialog appears.
3. Select a file and click Open. An Import Vector Files Parameters dialog appears.
4. Select the appropriate map projection, datum, and units for the vector layer.
5. Click OK. ENVI converts the input vectors into an ENVI vector format (.evf).
6. Load the vectors into the map composition by clicking Apply in the Vector Parameters dialog.
7. In the Vector Parameters dialog, adjust the vector attributes to obtain the desired colors, thickness, and line
types. See the Vector Overlay and GIS Analysis tutorial or see ENVI Help for additional information.

11
ENVI Tutorial: Map Composition

Tutorial: Map Composition


Customize the Map Layout
This section uses several map elements described in the previous sections to demonstrate some of ENVIs custom map
composition capabilities.
The QuickMap you created earlier (see pages 2-4) will be used in the following exercises. If you already closed
ysratio.img, redisplay it as follows.
1. From the ENVI main menu bar, select File Open Image File. A file selection dialog appears.
2. Navigate to envidata\ys_tmsub and select ysratio.img. Click Open. The 5/7, 3/1, and 3/4 ratio bands are
automatically loaded into the R, G, and B fields of the Available Bands List, respectively.
3. Click Load RGB.

Load the QuickMap Template


Once the image is displayed, follow these steps to load the previously saved QuickMap template and to add individual
map components:
1. From the Display group menu bar, select File QuickMap from Previous Template. The Enter
QuickMapTemplate Filename dialog appears.
2. Navigate to your output directory, select ysratio.qm, and click Open. A QuickMap Parameters dialog appears.
3. Click Apply to generate the QuickMap image. The Load To: Current Display button is selected by default, so the
QuickMap parameters are applied to the display group from which you started QuickMap.
4. Restore saved grid parameters by selecting Overlay Grid Lines from the Display group menu bar associated
with the QuickMap. A Grid Line Parameters dialog appears.
5. From the Grid Line Parameters dialog menu bar, select File Restore Setup. A file selection dialog appears.
6. Navigate to envidata\ys_tmsub and select the saved grid parameters file ysratio.grd. Click Open,
followed by Apply.
7. Modify some of the grid line parameters and click Apply to show your changes on the image. Be sure to save any
changes by selecting File Save Setup from the Grid Line Parameters dialog menu bar.
8. Restore saved ENVI annotation by selecting Overlay Annotation from the Display group menu bar
associated with the QuickMap. The Annotation dialog appears.
9. Select File Restore Annotation from the Annotation dialog menu bar.
10. Navigate to envidata\ys_tmsub and select the saved annotation file ysratio.ann. Click Open.
11. In the Annotation dialog, click the Image radio button, select Object Selection/Edit from the menu bar,
and click and drag a box around the annotation objects in the QuickMap image window. A red diamond handle
appears for the selected objects.
12. Click and drag the handles to move the annotation objects. Modify some parameters for the selected objects.
Right-click the objects to lock them in place. Be sure to save any changes by selecting File Save Annotation
from the Annotation dialog menu bar. See ENVI Help for further details.

12
ENVI Tutorial: Map Composition

Tutorial: Map Composition


Save the Results
You can save a map composition for future modification as a display group, or with the map composition "burned in" to
an image.

Saving for Future Modification


This is the most flexible option.
1. From the Display group menu bar associated with the map composition, select File Save as Display Group.
2. Enter an output filename and click OK.
3. To restore this map composition, select File Restore Display Group from the ENVI main menu bar.

Saving as a Burned-in Image


1. From the Display group menu bar associated with the map composition, select File Save Image As
Postscript File. An ENVI QuickMap Print Option dialog appears.
Select Standard Printing and click OK to output a Postscript file. An Output Display to Postscript File
dialog appears. Change the page size and scaling parameters as desired. This option provides additional
control, but it may produce a map that does not fit well with the originally selected QuickMap scale.
Select Output QuickMap to Postscript, select an output filename, and click OK to output a Postscript
file with the specified QuickMap page size and scaling. If your additional annotation enlarged the image
so it will not fit in the specified page size, ENVI asks if you want to output to multiple pages. If so, click
Yes, and ENVI automatically creates multiple Postscript files.

Saving as an Image File


You can save your map composition as an image file. Output formats include ENVI (binary) image, BMP, HDF, JPEG,
PICT, PNG, SRF, TIFF/GeoTIFF, and XWD, as well as common image processing system formats such as ERDAS (.lan),
ERMAPPER, PCI, and ArcView Raster.
1. From the Display group menu bar associated with the map composition, select File Save Image As
Image File.
2. Set the resolution, output file type, and other parameters as described in ENVI Help; enter an output filename;
and click OK.

Printing
You can also select direct printing of the ENVI map composition, in which case, the map composition will be printed
directly to your printer using system software drivers.
1. From the Display group menu bar associated with the map composition, select File Print. An ENVI QuickMap
Print Preferences dialog appears.
2. Select Standard Printing or Output QuickMap to Printer as described above.
3. Choose your printer, then click OK.
In all of the output options listed above, graphics and map composition objects are burned into the image on output.
The following figure shows an example of a final map composition produced in ENVI using QuickMap and custom map
composition.

13
ENVI Tutorial: Map Composition

Tutorial: Map Composition

14
ENVI Tutorial: Map Composition

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 9

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

Tutorial: Integracin ENVI - ArcGIS

ENVI Tutorial:
Integracin ENVI ArcGIS
Descripcin del Tutorial
Este tutorial esta diseado para introducir al alumno en el uso integrado de herramientas GIS (EnviArcGis). Es necesario que usted tenga conocimientos generales de procesamiento de imagenes y uso
de ArcGis.
Para ejecutar este tutorial, usted debe tener instalado ENVI y ArcGis en su computadora.

Archivos utilizados en este Tutorial


DVD de datos del curso: envidata\Peru_tm
File
L5_008067_tm.dat
L5_008067_tm.hdr
Cuenca.shp
Geodatabase.gdb\curvas
Geodatabase.gdb\Rios

Description
Pativilca, Lima, TM Data.
ENVI Header for Above.
Shapefile, lmite cuenca Ro Pativilca.
Feature class, curvas de nivel.
Feature class, ros.

Iniciando ENVI

Windows: Seleccione Start Programs ENVI x.x


(donde x.x es el nmero de version)

Configurando las Preferencias


Para este tutorial cambiaremos la ubicacin del directorio temporal de envi, para que luego podamos
acceder a los archivos con mayor facilidad.
1. Desde la barra de menu, seleccione File Preferences. La ventana System Preferences aparece.
2. Ubiquese en el fichero Default Directories.
3. En la opcin Temp Directory presionar el boton Choose para cambiar la ubicacin. Se muestra la
venta de dialogo Browse For Folder
4. Navegar hasta el directorio envidata \Temp_Envi y Clic Aceptar. Si la carpeta Temp_Envi no existe,
puede crearla haciendo clic en el boton Crear nueva caperta
5. Clic OK, Clic S para salvar los cambios, Clic OK para guardar la configuracin y Clic S para
reemplazar el existente.

Abriendo y Desplegando una Imagen


1. Desde la barra de menu de ENVI , seleccione File Open Image File.
2. Navege hasta el directorio envidata\Peru_tm , seleccione el archivo L5_008067_tm.dat
de la lista, y clic Open.

1
ENVI Tutorial: Integracin ENVI - ArcGIS

Tutorial: Integracin ENVI - ArcGIS


Cargando una Imagen en Color
Ahora podr visualizar una imagen en color seleccionando tres bandas de la imagen usando la opcin
RGB Color.
1. Clic al radio boton RGB Color,
2. Seleccione B40:L5008067. en el campo marcado R.
3. Seleccione B30:L5008067. en el campo marcado G.
4. Seleccione B20:L5008067. en el campo marcado B.
5. Clic Load RGB para cargar la imagen en una nueva
ventana (display).

Aplicando un Realce de Contraste


Para mejorar el contraste siga los siguientes pasos:
1. Desde la barra de menu en la ventana Image,
seleccione Enhance y aplique el ajuste de contraste
[Image] Linear 2%.

Exportando la Imagen al entorno ArcMap de ArcGIS


ENVI posee la capacidad para compartir imagenes al entorno grafico de ArcGIS (ArcMap) conservando
todos los realces realizados a la imagen y manteniendo la referencia espacial.
Para exportar la imagen realice lo siguiente:
1. Desde la barra de menu en la ventana Image, seleccione File y utilice la opcin Export
Image to ArcMap.
NOTA: Si ArcMap no se ha iniciado, se ejecutara por defecto y aadir automticamente la imagen
exportada.

2
ENVI Tutorial: Integracin ENVI - ArcGIS

Tutorial: Integracin ENVI - ArcGIS

Superponiendo un Shapefile
1. Desde la barra de menu de la venta Image, selecccione Overlay Vectors. La venta Vector
Parameters aparece.
2. Desde la barra de menu de la venta Vector
Parameters, seleccione File Open Vector File. La
ventana de dialogo Select Vector Filenames se muestra.
3. Clic en Files of type: se despliega una lista y
seleccione Shapefile. Seleccione Cuenca.shp y clic
Open. La ventana de dialogo Import Vector Files
Parameters aparece.
4. Seleccione la salida Memory y clic OK.
Automaticamente se agrega en la ventana de dialogo
Vector Parameters dialog y se carga en la ventana de
Image.
5. Clic en el boton Current Layer para seleccionar un
color mas visible para el vector o boton derecho en el
recuadro de color y seleccionar desde el menu.
Clic Apply para actualizar el color del vector.

Exportando la Imagen y vector superpuesto al entorno ArcMap


Lo que realiza ENVI es exportar toda la composicin (imagen-vector) como una sola imagen fusionada
conteniendo dicha informacin.
Para exportar la imagen compuesta realice lo siguiente:
1. Desde la barra de menu en la ventana Image, seleccione File y utilice la opcin Export
Image to ArcMap.
NOTA: Si ArcMap est iniciado, se mostrar la ventana de dialogo ArcMap Instantes el cual nos
permite seleccionar el entorno de ArcMap cargado o uno nuevo (Start New Instance) para visualizar
el resultado de la exportacin.

3
ENVI Tutorial: Integracin ENVI - ArcGIS

Tutorial: Integracin ENVI - ArcGIS

Grabando una imagen en un GeodataBase


ENVI posee la capacidad de almacenar imgenes en un Geodatabase de ArcGIS de manera directa sin
necesidad de utilizar herramientas de exportacin que compliquen o demoren dicha tarea. El
almacenamiento corresponde a la imagen completa conteniendo todas las bandas y manteniendo la
referencia espacial.
1. Desde la barra de menu de ENVI , seleccione File Save File As ArcGIS Geodatabase. Se
muestra la ventana de dialogo Save to Arc Geodatabase Input File.
2. En Select Input File, seleccione L5_008067_tm.dat, en File Information se muestra toda la
informacin corresponiente a la imagen, clic OK. Aparece la ventana de dialogo Select Output
Geodatabase.
3. Clic en el boton Connect para seleccionar el Geodatabase de inters. Se muestra la ventana
Connection Properties. En esta ventana debemos seleccionar el tipo de Geodatabase (File, Personal o
Enterprise)
y en la
4. En Type seleccionar File Based Geodatabase, en el campo Path clic en el icono
venta Browse For Folder navegar hast el directorio en donde se encuentra el Geodatabase
envidata\Peru_tm\Geodatabase.gdb y clic en OK, luego clic en OK en la ventana Connection
Properties.
5. Clic en OK en la ventana de dialogo Select Output Geodatabase. De esta manera queda almacenada
la imagen en el File Geodatabase.

4
ENVI Tutorial: Integracin ENVI - ArcGIS

Tutorial: Integracin ENVI - ArcGIS

Accediendo a datos del Geodatabase


ENVI posee la capacidad de acceder al Geodatabase de ArcGIS de manera directa sin necesidad de
utilizar herramientas de importacin que compliquen o demoren dicha tarea, con la finalidad de
agregar datos al entorno de ENVI para realizar diferentes tipos de procesos.
1. Ejecutar ENVI Zoom,
de la barra de herramientas. La ventana Open aparece, navegar
2. Clic en el botn Open
hasta el directorio envidata\Peru_tm , seleccione el archivo L5_008067_tm.dat de la
lista, y clic Open.
3. Clic en el botn Data Manager
se muestra la ventana data Manager, seleccionar las
bandas en orden, primeo B40:L5008067, seguido B30:L5008067 y finalmente B20:L5008067,
clic en Load Data para visualizar la imagen en falso color (infrarrojo).
4. Desde la barra de menu seleccione File Remote Connection Manager. Aparece la
ventana Remote Connection Manager.
5. Desde la barra de menu de la ventana Remote Connection Manager seleccione Connection
New. Se muestra la ventana Connection Properties. En esta ventana debemos seleccionar
el tipo de Geodatabase (File, Personal o Enterprise)
y en la
6. En Type seleccionar File Based Geodatabase, en el campo Path en el icono
venta Browse For Folder navegar hast el directorio en donde se encuentra el Geodatabase
envidata\Peru_tm\Geodatabase.gdb y clic en OK, luego clic en OK en la ventana
Connection Properties.
7. En la ventana Remote Connection Manager, utilizando el mouse, seleccionar el feature class
Rios y clic en Open. Se muestra la ventana Available Vectors List conteniendo la capa Rios
agregada. Esta venta si desea la puede cerrar o de lo contrario clic en Load Selected para
desplegar el feature Rios en una nueva ventana de vetores o en una de imagen existente.
8. Repetir los mismos pasos para agregar el feature class curvas.

5
ENVI Tutorial: Integracin ENVI - ArcGIS

Tutorial: Integracin ENVI - ArcGIS

Finalizando ENVI
Para finalizar la sesin de ENVI seleccione File Exit desde la barra de menu de ENVI Zoom y de la
barra de menu principal de ENVI, luego OK o YES para terminar.

6
ENVI Tutorial: Integracin ENVI - ArcGIS

Curso: Introduccin a la Teledeteccin y


Procesamiento Digital de Imgenes utilizando ENVI

Unidad N 10

Av. Javier Prado Este N 1224 2do Piso


(51-1) 476-1599
(51-1) 476-1574

www.telematica.com.pe
soporte@telematica.com.pe

Tutorial: Extendiendo ENVI

ENVI Tutorial:
Extendiendo ENVI
Resumen de este Tutorial
Este tutorial est diseado para introducir al alumno en el uso bsico de la herramienta de
programacin IDL (Interactive Data Language)
Para ejecutar este tutorial, usted debe tener instalado ENVI + IDL en su computadora.

Archivos usados en este tutorial


ENVI Resource DVD: envidata\ext_envi
File
Plot.txt
image.tif
head.dat

Description
Archivo de texto en format ASCII
Imagen de satelite
Datos volumtricos

1
ENVI Tutorial: Extendiendo ENVI

Tutorial: Extendiendo ENVI


INICIANDO IDL

Windows: Seleccione Start Programs ENVI x.x IDL


(donde x.x es el nmero de version)

IDL (Interactive Data Language) es un lenguaje interpretado, orientado a los arreglos, anlisis
matemtico y el despliegue grfico. Interpretado significa que existe un programa intrprete que
procesa el cdigo escrito en este lenguaje. Por esta razn no es posible directamente generar un
programa ejecutable a partir de un programa hecho en IDL, estos dependen de la existencia del
intrprete en la plataforma sobre la cual se deseen correr los programas (Virtual Machine). Un
lenguaje orientado al arreglo es permite que los operadores puedan interactuar directamente sobre
arreglos sin tener que programar un loop para recorrer sus elementos. IDL adems posee numerosas
rutinas de anlisis numrico y estadstico que evita al programador tener que estarlas programando o
usando librerias externas. IDL tambin soporta varios formatos tanto de imgenes (bmp, gif, jpeg)
como de almacenamiento de datos cientficos (cdf, hdf, netcdf2).

Abriendo el Entorno de trabajo


1. En la pantalla de Bienvenida inicial seleccione Entorno de trabajo

Panel Multi-Documento
Espacio de trabajo

Historial de comandos

Panel de vista
Linea de Comando

2
ENVI Tutorial: Extendiendo ENVI

Tutorial: Extendiendo ENVI


Tipos, definicin y manipulacin de variables
Existen los siguientes tipos
Tipo de datos
Byte
Integer
Long

de variables:
Definicin
Entero de 8 bits (sin signo)
Entero de 16 bits (con signo)
Entero de 32 bits (con signo)

Arreglos
bytarr
Intarr
Lonarr

Float
Double
Complex
Double Complex

Nmero real de 32 bits de simple precisin


Nmero real de 64 bits de doble precisin
Nmero complejo de simple precisin
Nmero complejo de doble precisin

Fltarr
Dblarr
Complexarr
Dcomplexarr

String

Secuencia de caracteres

Strarr

Las variables son definidas por un texto seguido de un signo igual (=) y el valor de la variable
1. En la Lnea de comando defina las siguientes variables (Los comandos aceptados aparecern
en la vista consola de color verde):
IDL> a=3
IDL> b=5
IDL> c=intarr(2,3)
IDL> e=ENVI
IDL> f=IDL
Nota: Si desea puede ir a la vista variables y visualizar todas las variables ingresadas
2. Ahora Ud. imprimir las variables en pantalla usando el comando print (aparecer en la vista
consola el valor de la variable en color negro)
IDL> print, a
IDL> print, b
IDL> print, c
IDL> print, e+ +f
3. Ahora ejecutaremos algunas operaciones sencillas.
IDL> print, a*b
IDL> d=a+c
IDL> print, d
IDL> b=sqrt(b)
IDL> print, b
IDL> d=a*sin(b)
IDL> print, d

3
ENVI Tutorial: Extendiendo ENVI

Tutorial: Extendiendo ENVI


Leyendo y escribiendo datos
IDL puede leer diferentes formatos de datos para este ejemplo usaremos dos tipos: ASCII y TIF.
Formatos estndar soportados por IDL: BMP, GEO TIFF, Interfile, JPEG, NRIF, PICT, PNG, PPM, SRF,
TIFF, XWD, X11 Bitmap.
Formatos cientficos soportados por IDL: CDF, HDF, HDF-EOS, netCDF.
Otros formatos soportados por IDL: ASCII, Binary, DICOM, DXF, WAV, XDR.

Leyendo y ploteando datos ASCII


1. En la lnea de comandos inserte lo siguiente:
IDL> plottemplate=ascii_template(); y
seleccione el archivos ubicado en C:\
envidata\ext_envi\plot.txt. Esto creara una
plantilla para leer los datos despus de maneta
correcta.
2. Aparecer la siguiente pantalla, un asistente con 3
pasos.
3. En este Paso 1 dirjase el cuadro Data Start at
line coloque 3, y haga clic en siguiente
4. En el Paso 2 acepte las opciones por defecto y
haga clic en siguiente.
5. Finalmente en el Paso 3 cambie los nombres de
los campos Field1 por Time, Field2 por Temp1
y Field3 por Temp2.
6. Ahora ejecute el siguiente comando: IDL>
plot_ascii=read_ascii(filepath('plot.txt',sub
dir=['examples', 'data']), template=
plottemplate). Este comando permite que IDL
lea los datos ASCII en funcin de la plantilla
creada en los primeros pasos.
7. Ahora imprima en pantalla los datos ledos con el
siguiente comando: IDL> print, plot_ascii
8. Finalmente puede visualizar sus datos en grficos
2D usando el siguiente comando IDL>
plot,plot_ascii.Time,plot_ascii.Temp1
9. Tambien puede probar con el siguiente comando:
IDL>
plot,plot_ascii.Time,plot_ascii.Temp1,title='
Temperature Over Time',xtitle='Time in
Seconds',ytitle='Temperature Celsius'

Leyendo y escribiendo imgenes TIF


1. Para leer un archive que se encuentra en formato
TIF introduzca el siguiente comando: IDL>nyny=read_tiff('C:\
envidata\ext_envi\image.tif'), el archivo quedara cargado en memoria.
2. Para visualizar la imagen digite lo siguiente. IDL>tv, nyny
3. Finalmente para escribir una copia del archivo se introduce el siguiente comando: IDL>
write_tiff,'copynyny.tif',nyny

4
ENVI Tutorial: Extendiendo ENVI

Tutorial: Extendiendo ENVI


Visualizando en 3D y creando un procedimiento
1. Para crear un nuevo procedimiento en IDL
dirjase al men Archivo Nuevo
Archivo fuente de IDL. Se creara un nuevo
archivo de trabajo donde podr escribir el
cdigo IDL de su aplicacin.
2. A continuacin escriba el siguiente cdigo:
pro vizualiza3d
a=read_binary('C:\
envidata\ext_envi\head.dat',data_dims=[80,100,57],data_type=1)
adata=ptr_new(a)
slicer3,adata
end
3. como se muestra en figura.

4. Haga clic en el men Ejecutar Compilar o presiones Ctrl+F8


5. Le pedir que guarde el archivo, deje todo por defecto incluido el nombre y haga clic en
aceptar.
6. Ahora clic en el men Ejecutar Ejecutar Visualiza3d o presione F8
7. Se mostrara un aplicacin que puede explorar intuitivamente.

Ingresando a ENVI
Ud. tambin puede ingresar a ENVI desde IDL ejecutando el siguiente comando IDL>envi

5
ENVI Tutorial: Extendiendo ENVI

También podría gustarte