Tutorial 2:
Introduction to
Panchromatic Data and
Vector Overlays
The following topics are covered in this tutorial:
Overview of This Tutorial . . . . . . . . . . . . . . 74 Panchromatic Data and Vector Overlays . . 75
ENVI Tutorials 73
74 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
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. This dataset is a SPOT Panchromatic image and corresponding DXF files
of Enfidaville, Tunisia, courtesy of Research Systems International France. These
data are Copyright CNES-Spot Image and IGN France.
Files Used in This Tutorial
CD-ROM: ENVI Tutorial and Data CD No. 1
Path: envidata/enfidavi
File Description
enfidavi.bil SPOT Panchromatic Data, Enfidaville, Tunisia
enfidavi.hdr ENVI Header for above
enfidavi.dsc GeoSpot Volume Descriptor File
enfidavi.rep GeoSpot report file (REP/B: GEOSPOT Structure)
enfidavi.rsc GeoSpot Raster Source Description File
dxf.txt DXF coding descriptor file
alti.dxf Spot height DXF file
energy.dxf Oil or Gas Pipeline DXF file
hydro.dxf Hydrology DXF file
industry.dxf Industrial Areas DXF file
physio.dxf Physiographic areas DXF file
popu.dxf Urban Features (Population Centers) DXF file
transpor.dxf Transportation Networks DXF file
copyrite.txt Data Copyright Notice
Overview of This Tutorial ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 75
Panchromatic Data and Vector Overlays
Start ENVI
Before attempting to start the program, ensure that ENVI is properly installed as
described in the installation guide.
• To open ENVI in UNIX, enter envi at the UNIX command line.
• To open ENVI from a Windows or Macintosh system, double-click on the
ENVI icon.
The ENVI main menu appears when the program has successfully loaded and
executed.
Open a Panchromatic (SPOT) Image File
To open an image file:
1. From the ENVI main menu, select File → Open Image File.
Note that on some platforms you must hold the left mouse button down to
display the submenus from the main menu.
An Enter Data Filenames file selection dialog appears.
2. In the file selection dialog, navigate to the enfidavi subdirectory of the
envidata directory on the ENVI Tutorial and Data CD No. 1 just as you
would in any other application and select the file enfidavi.bil from the list
and click Open (on Windows) or OK (on UNIX).
This is a SPOT Panchromatic image of Enfidaville, Tunisia, courtesy of RSI
France. The data in this file is copyrighted as Copyright CNES-Spot Image and
IGN France.
The Available Bands List dialog appears on your screen. This list allows you
to select spectral bands of the image for display and processing. You have the
choice of loading either a gray scale or an RGB color image of the available
bands.
Select and Load an Image Band
1. Select the band listed at the top of the dialog by clicking on the band with the
left mouse button.
The band you have chosen is displayed in the field marked Selected Band:.
ENVI Tutorials Panchromatic Data and Vector Overlays
76 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
2. Click the Load Band button to load the image into a new display.
ENVI has many interactive functions, and the mouse button combinations and
actions are different for each one. The Mouse Button Descriptions dialog is
provided to tell you what the mouse buttons do in each graphics window.
3. To bring up the Mouse Button Descriptions dialog, select
Window → Mouse Button Descriptions from either the ENVI main menu or
the Main Image display menu bar.
Spatially Browse the Image
1. Move the Scroll window indicator box around the scroll image to display
different portions of the image in the Main Image display at full resolution.
Another method for scrolling the full resolution image is to add scroll bars to
the Main Image window. You can easily do this using the Zoom window
controls. In Zoom window position the cursor over the right-most control in
the lower left corner of the window. Double-click the right mouse button to
activate scroll bars in the Main Image window.
2. Now look at the image in greater detail. To do this, click and drag the Zoom
box around in the Main Image display using the left mouse button. When the
Zoom box is over an area of interest, release the mouse button and you’ll see
the image in greater detail in the Zoom window. You can also click and release
the left mouse button anywhere in the Main Image display to reposition the
Zoom box.
3. Position the Zoom box at various locations in the Main Image window and
examine the data.
Perform 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.
• To access ENVI’s interactive contrast stretching functions, select
Enhance → Interactive Stretching from the Main Image window menu bar.
An Interactive Stretching dialog for the displayed band appears. This dialog
allows you to change the contrast stretch of the displayed image (Figure 2-1).
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
Panchromatic Data and Vector Overlays ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 77
and output histograms reflect the default stretch applied to the data when the
image was displayed.
Figure 2-1: The Interactive Stretching Dialog.
• The Stretch_Type pull-down menu at the top of the histogram has a
variety of contrast-stretching options. Try applying the methods described
below and observe the results in the Main Image window.
• Also, try selecting both Histogram_Source → Zoom and
Histogram_Source → Scroll from the Interactive Stretching menu bar
and note the differences in the histograms and stretches of the Zoom
window and Scroll window.
Linear
When images are loaded into the Main Image window, a 2% linear contrast stretch is
applied by default.
Note
This default can be set by selecting File → Preferences → Display Defaults from
the ENVI main menu. You can edit the Display Default Stretch in the
Preferences: Display Defaults dialog which appears.
1. In the Main Image display, select Enhance → Interactive Stretching. An
Interactive Stretching dialog appears.
2. In the menu bar of the new dialog, choose Stretch_Type → Linear.
ENVI Tutorials Panchromatic Data and Vector Overlays
78 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
Note
Two vertical dotted lines appear in the input histogram plot—these bars can be
repositioned to control the minimum and maximum value used in the contrast
stretch.
3. Position the mouse cursor on the left bar and hold down the left mouse button
as you drag the bar from side to side.
As the left mouse button is pressed and the dotted vertical bar is moved across
the plot, numbers appear on the status bar of the 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 the percentage of pixels that have
that value, and the cumulative percentage of pixels with values less than or
equal to the current value.
4. Since you’ll be changing the stretch conditions, it may be helpful to have the
changes automatically applied. To do this, select Options → Auto Apply On
from the Interactive Stretching dialog menu bar.
If you don’t wish the changes to be made until after you’re finished, then select
Options → Auto Apply Off, and use the Apply button on the dialog to apply
the stretch and observe the results.
5. Try positioning the left bar 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.
You can also position the bars by entering a minimum and maximum value in
the Stretch text fields of the dialog. You can enter either data values or
percentages.
6. 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.
Equalize
1. Select Stretch_Type → Equalization and note the change in the Output
Histogram plot in the dialog.
2. Again, you can choose to have the stretch automatically applied to the image
display group by ensuring the Options → Auto Apply On is selected from the
Interactive Stretching dialog menu.
Panchromatic Data and Vector Overlays ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 79
If you don’t wish the changes to be made until after you’re finished, then select
Options → Auto Apply Off, and use the Apply button on the dialog to apply
the stretch and observe the results.
Gaussian
1. From the Interactive Stretching dialog, select Stretch_Type → Gaussian.
2. Set the standard deviation by selecting Options → Set Gaussian Stdv.
3. The Set Gaussian Stdv dialog appears. You can adjust the standard deviation
value and see the effect when the new setting is applied to the image display
group.
4. Again, you can choose to have the stretch automatically applied to the image
display group by ensuring the Options → Auto Apply On is selected from the
Interactive Stretching dialog menu.
If you don’t wish the changes to be made until after you’re finished, then select
Options → Auto Apply Off, and use the Apply button on the dialog to apply
the stretch and observe the results.
5. Select File → Cancel to close the contrast stretching dialog.
Color Mapping
ENVI provides tools for quickly color slicing gray scale images.
1. Select Tools → Color Mapping → ENVI Color Tables from the Main Image
window menu bar. The ENVI Color Tables dialog appears.
ENVI Tutorials Panchromatic Data and Vector Overlays
80 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
Figure 2-2: The ENVI Color Tables dialog.
2. Apply quick stretches to the displayed image by sliding the Stretch Bottom
and Stretch Top sliders back and forth and observe the stretched image.
3. Click on several of the color table names in the Color Table list in the ENVI
Color Tables dialog and observe the color-coded image. Change the stretch as
in the previous step.
4. Select Options → Reset Color Table in the ENVI Color Tables dialog to
return to the original stretch and gray scale color table.
5. Select File → Cancel to close the ENVI Color Tables dialog.
Pixel Locator
The Pixel Locator dialog allows exact positioning of the cursor and displays the
screen and data values of the selected pixel.
Panchromatic Data and Vector Overlays ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 81
1. Select Tools → Pixel Locator from the Main Image display menu bar to
display the Pixel Locator dialog.
Figure 2-3: The Pixel Locator dialog allows exact positioning of the cursor and
displays the screen and data values of the selected pixel.
2. Move and set the cursor in any of the three image displays to observe the
dialog as it reflects the pixel location for the current pixel.
3. The Pixel Locator dialog shows the pixel location in pixel coordinates by
default. To see the location in map coordinates, select Options → Map
Coordinates from the Pixel Locator menu bar.
4. Use the Proj:/Datum: spin box controls to toggle between true map
coordinates and latitude/longitude geographic coordinates. You can change the
selected projection by clicking on the Change Proj... button.
5. Close the Pixel Locator dialog by selecting File → Cancel from the dialog
menu.
Display the Georeferenced Cursor Location
Use ENVI’s cursor location/value function to view image values and geographic
location.
1. To display the cursor location and value, select Tools → Cursor
Location/Value from the Main Image window menu bar. You can also display
ENVI Tutorials Panchromatic Data and Vector Overlays
82 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
it from the ENVI main menu by selecting Window → Cursor
Location/Value.
The Cursor Location / Value dialog box appears displaying the location of
the cursor in the Main Image, Scroll, or Zoom windows (Figure 2-4). The
dialog also displays the screen value (color) and the actual data value of the
pixel underneath the crosshair cursor.
Figure 2-4: The Cursor Location dialog displays the screen and data values of
the selected pixel.
2. To dismiss the dialog, select File → Cancel from the dialog pull-down menu.
Apply an Interactive Filter
ENVI gives you the ability to apply several different pre-defined or user-defined
filters to a display (file-based filtering is also available and is accessed via the Filter
menu on the ENVI main menu). The following example shows you how to apply a
pre-defined filter to the image in the Main Image window.
Choose a Filter
1. From the Main Image window menu bar, select Enhance → Filter and choose
the desired filter type from the pull-down filter menu to apply to the displayed
image.
2. Try the different sharpening, smoothing, and median filters on the displayed
image.
Panchromatic Data and Vector Overlays ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 83
Display Image in a Second Display and Apply a Different Filter
1. From the Available Bands List, select the Display #1 → New Display from
the pull-down menu button at the bottom of the dialog to create a second
display group.
2. Select the image band to be displayed in the second display group, and click
Load Band to load the image into the second display.
3. From the Main Image window of Image #2, choose Enhance → Filter and
select a filter different from that applied to Image #1 from the pull-down filter
menu.
Compare Images Using Dynamic Overlays
1. Select Tools → Link → Link Displays from the menu bar of either of the
Main Image windows and click OK to link the images.
2. Use the middle mouse button to resize the dynamic overlay and the left mouse
button to move the region for comparison. Note that the overlay area is defined
from the lower left corner of the display.
Review GeoSpot Map Information
To review the GeoSpot Map information in the ENVI Header file:
1. From the ENVI main menu, select File → Edit ENVI Header.
2. In the Edit Header Input File dialog, select enfidavi.bil as the input file,
and click OK.
The Header Info dialog appears.
Figure 2-5: The Header Info dialog.
ENVI Tutorials Panchromatic Data and Vector Overlays
84 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
3. Click the Edit Attributes button and select Map Info from the pull-down
menu. The Map Information dialog appears. Note that the data are in UTM
projection, Zone 32 utilizing the NAD27 datum.
4. Click Cancel in the Map Information dialog and Cancel in the Header Info
dialog.
Open and Overlay DXF Vector Files
1. From the ENVI main menu, select File → Open Vector File → DXF. A
standard file selection dialog called Enter DXF Filenames appears.
2. In the file selection dialog, navigate to the ENVI Tutorial and Data CD No. 1
envidata/enfidavi directory. Set the file filter to *.dxf and select all of
the files with the .dxf extension. Click Open at the bottom of the file
selection dialog on Windows and Macintosh or click OK on UNIX to open the
Import DXF File Parameters dialog.
3. Midway down the Import DXF File Parameters dialog is the selection list of
projections. Select UTM as the Output Projection. This field refers to the map
units that the imported vector data is in.
4. Click the Datum button to bring up the Select Geographic Datum dialog.
Highlight the Mexico (NAD27) datum in the list and click OK.
5. In the Import DXF File Parameters dialog enter the UTM Zone as 32 North.
6. Click OK to load the DXF files and convert to .evf (ENVI Vector Files).
7. The Available Vectors List dialog appears. Click on the Select All Layers
button. Next, click on the Load Selected button.
8. A Load Vector dialog appears which lists all of the available Main Image
windows. Select Display #1 from the list.
9. The #1 Vector Parameters dialog appears showing the named vector layers.
10. Click Apply to load the vectors onto the display.
11. Click on one of the layer names in the #1 Vector Parameters dialog. In the
Main Image display click and drag the left mouse button to move the cursor in
the image and observe map coordinates for the selected vectors in the #1
Vector Parameters dialog.
Panchromatic Data and Vector Overlays ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 85
Basic Map Composition
Add Grid Lines
Add a grid to your image:
1. To overlay grid lines on your image, select Overlay → Grid Lines from the
Main Image window menu bar. An image border is automatically added when
you overlay grid lines.
2. You can adjust the grid lines by setting the line thickness and color and the
grid spacing using the Options pull-down menu.
3. When you have added a satisfactory grid, click Apply in the Grid Line
Parameters dialog.
Annotate the Image with a Map Key
ENVI’s flexible annotation features allow you to add text, polygons, color bars, and
other symbols to your plots and images.
1. To annotate the image, select Overlay → Annotation. The #1 Annotation:
Text dialog appears.
2. To annotate a map key corresponding to the DXF overlays, select
Object → Map Key in the #1 Annotation: Text dialog.
3. Edit the map key characteristics by clicking the Edit Map Key Items button in
the dialog. 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 #1 Annotation: Text
dialog.
5. Add a background color by selecting the color pull-down menu next to the
Back color swatch in the #1 Annotation: Text dialog.
6. Click the left mouse button to place the map key in the Main 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
1. You can save your image annotation by selecting File → Save Annotation in
the #1 Annotation: Text dialog.
ENVI Tutorials Panchromatic Data and Vector Overlays
86 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
Note
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).
2. You can also restore saved annotation files by selecting File → Restore
Annotation in the dialog.
Suspending the Annotation Function Temporarily
1. To suspend annotation operations and return to normal ENVI functionality
temporarily, select the Off radio button at the top of the Annotation: Text
dialog.
2. This allows you to use the scroll and zoom features in your display without
losing your annotations.
3. To return to the annotation function, select the radio button for the window you
are annotating.
Save and Output an Image (Burn-In)
ENVI gives you several options for saving and outputting your filtered, annotated,
gridded images. You can save your work in ENVI’s 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.
Save your Image in GEOTIFF Format
To save your work as a GEOTIFF:
1. Select File → Save Image As → Image File in the Main Image window.
The Output Display to Image File dialog appears.
2. Click on the Output File Type button and select TIFF/GeoTIFF output from
the pull-down menu.
If you have left your annotated and gridded color image on the display, both
the annotation and grid lines will be automatically saved.
3. If output filename shown is not the one you want, enter an output filename in
the text box; otherwise, click OK to save the image.
• Because this is a georeferenced image, ENVI automatically saves it as a
GEOTIFF.
Panchromatic Data and Vector Overlays ENVI Tutorials
Tutorial 2: Introduction to Panchromatic Data and Vector Overlays 87
Note
If you select other graphics file formats from the Output File Type button, your
choices will be slightly different.
End the ENVI Session
This concludes the Tutorial. You can quit your ENVI session by selecting
File → Exit (Quit on UNIX) on the ENVI main menu, then click OK to exit IDL. If
you are using ENVI RT, quitting ENVI will take you back to your operating system.
ENVI Tutorials Panchromatic Data and Vector Overlays
88 Tutorial 2: Introduction to Panchromatic Data and Vector Overlays
Panchromatic Data and Vector Overlays ENVI Tutorials