ENVI Tutorial #3:

Image Georeferencing and Registration


The following topics are covered in this tutorial:

Overview of This Tutorial

Background - Georeferenced Images in ENVI

Examine Georeferenced Data and Output Image-Map

Image-to-Image Registration

Image-to-Map Registration

IHS Merge of Different Resolution Georeferenced Data Sets


Overview of This Tutorial

This tutorial provides basic information about Georeferenced images in ENVI and Image-to-Image and Image-to-Map Registration using ENVI. It covers step-by-step procedures for successful registration, discusses how to make image-maps using ENVI and illustrates the use of multi-resolution data for IHS Sharpening. It is designed to provide a starting point to users trying to conduct image registration. It assumes that you are already familiar with general image-registration and resampling concepts. This tutorial is designed to be completed in about 1 to 2 hours.

Files Used in This Tutorial

You must have the ENVI CD-ROM mounted on your system to access the files used by this tutorial or copy the files to your disk.

The files used in this tutorial are contained in the BLDR_REG subdirectory of the tutorial data directory on the ENVI CD-ROM.

Required Files

The files listed below, along with associated .hdr files, are required to run this exercise.

BLDR_SP.IMG	Boulder SPOT Georeferenced Image Subset
BLDR_SP.HDR	ENVI Header for Above
BLDR_SP.GRD	Boulder SPOT Map Grid Parameters
BLDR_SP.ANN	Boulder SPOT Map Annotation
BLDR_TM.IMG	Non-Georeferenced Boulder TM Data
BLDR_TM.HDR	ENVI Header for Above
BLDR_TM.PTS	GCPs for TM-SPOT Image-to-Image Registration
BLDRTM_M.PTS	GCPs for TM-Map Registration
BLDR_RD.DLG	Boulder Roads DLG
BLDRTMSP.GRD	Merged TM-SPOT Map Grids
BLDRTMSP.ANN	Merged TM-SPOT Annotation

Files Generated During This Tutorial

BLDR_TM1.WRP	Image-to-Image Result Using RST and Nearest Neighbor
BLDR_TM1.HDR	ENVI Header for Above
BLDR_TM2.WRP	Image-to-Image Result Using RST and Bilinear Interpolation
BLDR_TM2.HDR	ENVI Header for Above
BLDR_TM3.WRP	Image-to-Image Result Using RST and Cubic Convolution
BLDR_TM3.HDR	ENVI Header for Above
BLDR_TM4.WRP	Image-to-Image Result Using 1st degree polynomial and Cubic Convolution
BLDR_TM4.HDR	ENVI Header for Above
BLDR_TM5.WRP	Image-to-Image Result Using Delaunay Triangulation and Cubic Convolution
BLDR_TM5.HDR	ENVI Header for Above
BLDR_TM5.HDR	ENVI Header for Above
BLDRTM_M.IMG	Image-to-Map Result using RST and Cubic Convolution for the Boulder TM data
BLDRTM_M.HDR	ENVI Header for Above
BLDRTMSP.IMG	Bouler TM/SPOT sharpening result using IHS sharpening, 10 meter pixels.
BLDRTMSP.HDR	ENVI Header for Above

Background - Georeferenced Images in ENVI

ENVI provides full support for georeferenced images in numerous predefined map projections including UTM and State Plane. In addition, ENVI's 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 can be modified by ENVI map projection utilities or edited directly by the user. The information in this file is used in the ENVI Header files associated with each image and allows simple association of a "Magic Pixel" location with known map projection coordinates. Selected ENVI functions can then use this information to work with the image in georeferenced data space.

ENVI's 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 full resolution (Main 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 ENVI's 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 the ENVI User's Guide for additional information.


Examine Georeferenced Data and Output Image-Map

This portion of the exercise will familiarize you with the use of georeferenced data in ENVI, allow you to construct an image-map complete with map grids and annotation, and produce an output image.

Start ENVI

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

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

Open and Display SPOT Data

To open the Georeferenced SPOT data:

Select File->Open Image File on the ENVI Main Menu.

The band you have chosen will be displayed in the field marked "Selected Band:".

  1. Click "Load Band" to load the image into a new display.

Edit Map Info in ENVI Header

Select File->Edit ENVI Header.

  1. When the Edit Header Input dialog appears, select the file BLDR_SP.IMG and click "OK".
  2. When the Header Information dialog appears, select Edit Attributes->Map Info to start the Map Information dialog.

This dialog lists the basic map information used by ENVI in georeferencing. The image coordinates correspond to the "Magic 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 is able to calculate the geographic coordinates of any pixel in the image. Coordinates can be entered in either map coordinates or geographic coordinates.

  1. Click on the toggle arrow next to the text "UTM Zone 13 North" to see the latitude/longitude coordinates for these map projection coordinates.

ENVI makes this conversion on-the-fly.

  1. Click on the "DMS<->DD" button to toggle between Degrees Minutes, Seconds, and Decimal Degrees.
  2. Click "Cancel" to exit the Map Information dialog.
  3. Click "Cancel" to exit Edit ENVI Header dialog.

Cursor Location/Value

To bring up a dialog box that displays the location of the cursor in the Main, Scroll, or Zoom windows.

Select Basic Tools->Cursor Location/Value from the ENVI Main Menu.

Note that the coordinates are given in both pixels and georeferenced coordinates for this georeferenced image.

  1. Move the cursor around the image and examine the coordinates for specific locations and note the relation between map coordinates and latitude/longitude.
  2. Select File->Cancel to dismiss the dialog when finished.

Overlay Map Grids

Click the right mouse button in the Main Image display to toggle on the Display Menu and select Functions->Overlays->Grid Lines.

The Grid Line Parameters dialog will appear and a virtual border will be added to the image to allow display of map grid labels exterior to the image.

  1. Click File->Restore Setup and select the file BLDR_SP.GRD and click "OK".

Previously saved grid parameters will be loaded into the dialog.

  1. Now examine the map parameters by selecting Options->Edit Map Grid Atrributes.
  2. Note the grid spacing and the parameters that control the color and other characteristics of the lines, labels, corners (ticks), and the box (outlining box). Click Cancel to close the dialog when you are finished.
  3. Now examine the geographic parameters by selecting Options->Edit Geographic Grid Atrributes. Note again the parameters for the geographic (latitude/longitude) grid. Click Cancel to close the dialog when you are finished.
  4. Click "Apply" in the Grid Line Parameters dialog to put the grids on the image.

ENVI allows simultaneous pixel, map, and geographic coordinate grids.

Overlay Map Annotation

Select Functions->Overlays->Annotation in the Main Image display.

The #1 Annotation dialog will appear.

  1. Select File->Restore Annotation in the dialog.
  2. Choose the file BLDR_SP.ANN from the file list that appears and click "OK".

The presaved map annotation will be loaded onto the image.

  1. Enlarge the Scroll window by grabbing one of the corners and dragging.
  2. Now move the Main Image indicator box around the Scroll Window using the left mouse button and examine the map elements in the Main Image Window.
  3. Pull down the Object menu in the Annotation dialog and examine the objects used to build the map.
  4. You may also add additional map elements or text annotation.

Output to Image or Postscript

ENVI gives you several options for saving and outputting your image-maps. 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.

Saving your Image in ENVI Image Format

To save your work in ENVI's native format (as an RGB file):

Select Functions->Output Display->Image File in the Main window.

  1. When the Ouput Display to Image File dialog appears, select Output File Type, Graphics Overlay Selections (including annotations and gridlines), and Change Image Border Size if desired.

If you have left your annotated and gridded color image on the display, both the annotation and grid lines will be automatically listed in the graphics options. You can also select other annotation files to be "burned in" to the output image.

  1. Select output either to "Memory" or to a "File" on disk.

Select Memory and click "OK" to output the image. Load into another display and examine the results of the annotation as a raster image.

Saving your Image to Postscript

To save your work to a Postscript file:

Select Functions->Output Display- >Postscript File in the Main window.

The Display to Postscript Parameters dialog will appear. Both the annotation and grid lines will be automatically listed in the graphics options. A graphical representation of the output page appears at the right top of the dialog.

  1. Enter the desired size of the output image in the xsize and ysize parameters and the outline of the image on the page will change.
  2. Click the right mouse button in the graphic to center the image on the page.
  3. If you'd like scaled map output, enter the desired map scale in the "Map Scale" text box.

If the scale makes the image larger than the available page size, ENVI will automatically create a multipage Postscript document.

Direct Printing

ENVI also allows direct printing to devices supported by your operating system.

Select Output Display->Printer and follow your standard printing procedures.

For example in Microsoft Windows, you would select the Printer from the pulldown Name: menu, change the properties as desired, and click on OK to print the image.

  1. Once you have selected all of the parameters and clicked OK, a dialog appears to allow you to set additional basic ENVI printing parameters. Set these as desired and click OK to begin printing

Image-to-Image Registration

This section of the tutorial will take you step-by-step through an 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.

Open and Display Landsat TM Image File

Select File->Open Image File.

  1. When the Enter Input Data File file-selection dialog appears, navigate to the BLDR_REG subdirectory of the ENVI tutorial data directory and select the file BLDR_TM.IMG from the list.
  2. Click "OK" to load the TM image bands into the Available Bands List.
  3. Click on Band 3, the "New" button and then "Load Band" to load the TM band 3 image into a new display.

Display the Cursor Location/Value

To bring up a dialog box that displays the location of the cursor in the Main, Scroll, or Zoom windows:

Select Basic Tools->Cursor Location / Value on the ENVI Main Menu.

  1. Move the cursor around the TM image in the Main, Scroll, and Zoom windows.

Note that the coordinates are given in pixels as this is a pixel-based rather than georeferenced image like the SPOT data above.

  1. Select File->Cancel to dismiss the dialog.

Start Image Registration and Load GCPs

Select Register ->Select Ground Control Points->Image-to-Image.

  1. When the Image-to-Image Registration dialog appears, click on Display 1 (SPOT Data) for the Base image and Display 2 (TM Data) for the Warp image.
  2. Click "OK" to start the registration.

The Ground Control Points Selection dialog will appear. Individual GCPs are added by positioning the cursor position in the two images to the same ground location.

Figure 5: Image-to-Image GCP Selection dialog

  1. Move the cursor in the SPOT image to 753, 826 by entering the values into the Ground Control Points Selection dialog in the Base X and Y text boxes.
  2. Move the cursor in the TM image to 331, 433 by entering the values in the same way into the dialog in the Warp X and Y text boxes.
  3. Examine the locations in the two Zoom windows and adjust the locations if necessary by clicking the middle 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.

  1. Click "Add" to add the GCP to the list. Try this for a few points to get the feel of 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.

  1. Now select GCPs->Clear GCPs in the dialog to clear all of your points.
  2. Choose File->Restore GCPs from ASCII in the dialog and click on the file name BLDR_TM.PTS.
  3. Click "OK" to load a list of pre-saved GCPs.
  4. Click on individual GCPs in the list and examine the locations of the points in the two images, the actual and predicted coordinates, and the RMS error.

Edit, On/Off, Delete, Update, and Predict GCPs

The following descriptions are provided for information only. Perform only the numbered Predict GCP button functions.

Try positioning the cursor at a new location in the SPOT image. Click on the "Predict" button and the cursor position in the TM image will be moved to match its predicted location based on the warp model.

  1. The exact position can then be interactively refined by moving the pixel location slightly in the TM data.
  2. Click "Add" to add the new GCP to the list.

Warp Images

Images can be warped from the displayed band, or multiband images can be warped all bands at once. We will warp only the displayed band.

Select Options->Warp Displayed Band in the Ground Control Points Selection dialog.

  1. When the Registration Parameters dialog appears, select "RST" as the Warp Method and "Nearest Neighbor" resampling.
  2. Enter the filename BLDRTM_1.WRP and click "OK".

The warped image will be listed in the Available Bands list when the warp is completed.

  1. Now repeat using RST warping with both Bilinear Interpolation, and Cubic Convolution.
  2. Output the results to BLDR_TM2.WRP and BLDR_TM3.WRP, respectively.
  3. Perform both a 1st degree polynomial warp and a Delaunay Triangulation warp using Cubic Convolution.
  4. Output the results to BLDR_TM4.WRP and BLDR_TM5.WRP respectively.

Compare Warp Results Using Dynamic Overlays

Click on the original TM band 3 image name BLDR_TM.IMG in the Available Bands list and then select File->Close from the menu bar.

  1. In the subsequent dialog, click "Yes" to close the associated image file.
  2. Load BLDRTM_1.WRP into a new image display by clicking on the band name in the Available Bands List, clicking "New", and clicking "Load Band".
  3. Click the right mouse button in the Main window and select Functions > Link > Link Displays.
  4. Click "OK" in the Link Displays dialog to link the SPOT and the registered TM image.
  5. Now compare the SPOT and the TM images using the Dynamic Overlay by dragging in the Main Image display with the left mouse button depressed.
  6. Load BLDRTM_2.WRP and BLDRTM_3.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.

  1. Close the displays containing BLDRTM_1.WRP (RST, Nearest Neighbor) and BLDRTM_2.WRP (RST, Bilinear Interpolation) by clicking the right mouse button in the appropriate Main Image display and selecting Functions->Cancel.
  2. Load BLDRTM_4.WRP and BLDRTM_5.WRP into two new displays and use the image linking and dynamic overlays to compare to BLDR_3.WRP (RST Warp).

Note the effect of the three different warping methods, RST, 1st degree polynomial, and Delaunay Triangulation on the image geometry.

  1. Use dynamic overlay to compare to the georeferenced SPOT data.

Examine Map Coordinates

To bring up the Cursor Location/Value dialog:

Select Basic Tools->Cursor Location/Value.

  1. Browse the georeferenced data sets and note the effect of the different resampling and warp methods on the data values.
  2. Select File->Cancel in to close the dialog.

Close All Files

  1. To close all of the data files, select File ->Close All Files from the ENVI Main Menu.

 


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 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, and the pixel-based Landsat TM image will be warped to match the map data.

Open and Display Landsat TM Image File

Select File->Open Image File.

  1. When the Enter Input Data File dialog appears, navigate to the BLDR_REG subdirectory of the ENVI tutorial data directory and select the file BLDR_TM.IMG from the list.
  2. Click "OK" to load the TM image bands into the Available Bands List. Click on Band 3, the "New" button and then "Load Band" to load the TM band 3 image into a new display.

Select Image-to-Map Registration and Restore GCPs

Select Register->Select Ground Control Points->Image-to-Map.

  1. When the Image-to-Map Registration dialog appears, click on "UTM" as the map projection to use and enter 13 for the "Zone".
  2. Leave the pixel size at 30 m and click "OK" to start the registration.

The Ground Control Points Selection dialog will appear as for image-to-image registration.

  1. Add Individual GCPs by moving the cursor position in the warp image to a ground location for which you know the map coordinate (either read from a map or ENVI vector file (see below)).
  2. Enter the known map coordinates manually into the "E" (Easting) and "N" (Northing) text boxes and click "Add" to add the new GCP.
  3. Select File->Restore GCPs in the dialog and open the file BLDRTM_M.PTS .
  4. Examine the base map coordinates, the actual and predicted image coordinates, and the RMS error.

Figure 7: Image-to-Map GCP Selection dialog.

Add Map GCPs Using Vector Display of DLGs

Select File->Open Vector File->USGS DLG on the ENVI Main Menu.

  1. Choose the file BLDR_RD.DLG and click "OK" to open the file.
  2. Click "Memory" in the Import Optional DLG File Parameters dialog and click "OK" to read the DLG data.
  3. When the Available Vectors List appears, click on the box next to the entry "Roads and Trails, Boulder, CO" and then the "Load Selected" button.
  4. In the Load Vector dialog, click "New Vector Window".

The Vector Window Parameters dialog and a new Vector Window will appear.

  1. Click "Apply" in the Vector Window Parameters dialog to plot the vectors in the vector window.
  2. Click and drag the left mouse button in the vector window to activate a cross-hair cursor.

The map coordinates of the cursor location will be listed in the Vector Window Parameters dialog.

  1. Position the image cursor on the road intersection at 402, 418 in the image display by selecting Functions->-Interactive Analysis->Pixel Locator, entering the value, and clicking Apply.

Note that sub-pixel positioning accuracy is again available in the Zoom window.

 

Figure 9: ENVI Vector Window

Warp Image using RST and Cubic Convolution

In the Ground Control Points Selection dialog, select Options->Warp File.

  1. Click on the file name BLDR_TM.IMG and click "OK" to select all 6 TM bands for warping.
  2. Choose RST and Cubic Convolution resampling in the Registration Parameters dialog.
  3. Enter the output file name BLDRTM_M.IMG in the output file text box.
  4. Change the background value to 255.
  5. Click "OK" to start the image-to-map warp.

Display Result and Evaluate using Cursor Location/Value

Click on the RGB radio button in the Available Bands List followed by clicking on bands 4, 3, and 2 (RGB) of the warped image.

  1. Click "New" and then "Load RGB" to load the TM warped color image.

Note the skew 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.

If desired, load the SPOT image into a new display window and compare the image geometries and scale.

Close Selected Files

You can leave BLDRTM_M.IMG and BLDR_SP.IMG open as you will use these files in the next exercise.

Click on any other file names in the Available Bands list and click select File->Close Selected File to close these images.

  1. Click "Cancel" in the Vector Window Params #1 dialog to close the Vector Window.
  2. Select File->Cancel in the Available Vectors list to close that dialog.
  3. Select File->Cancel in the Ground Control Points Selection dialog to close that dialog. Save the GCPs if desired.

 


IHS Merge of Different Resolution Georeferenced Data Sets

This portion of the tutorial describes the procedures for merging two georeferenced data sets containing different pixel sizes. We will use the TM color-composite image registered above as the low-resolution color image and the georeferenced SPOT image as the high resolution image. The result is a color composite image with enhanced spatial resolution.

Display 30 m TM Color Composite

If you closed the registered TM image, reopen the file BLDRTM_M.IMG .

  1. Click on the "RGB" toggle button in the Available Bands List, and load bands 4, 3, and 2 (RGB) into a new display.

Display 10 m SPOT Data

If you closed the SPOT image, open the file BLDR_SP.IMG

  1. Click on the "Grayscale" toggle button in the Available Bands List, the "New" button, and the "Load Band" button to load the SPOT data into a new display.

Compare with the TM data above and note the similar image geometry, but different spatial coverage and image scales.

Perform IHS Sharpening

Select Transforms->Image Sharpening->IHS from the ENVI Main Menu.

  1. If you have the color image displayed, choose the appropriate display in the Select Input RGB dialog. Otherwise, choose bands 4, 3, and 2 from the TM Image in the Select Input RGB Input Bands dialog and click OK.
  2. Choose the SPOT image in the High Resolution Input File dialog and click "OK".
  3. Enter the output file name BLDRTMSP.IMG and click "OK" in the IHS Sharpening Parameters dialog.

A processing status box will appear and the new image will be listed in the Available Bands List when the processing is completed.

Display 10 m Color Image

Load the enhanced color image into a new display by selecting the RGB Color radio button in the Available Bands List dialog, selecting the R, G, and B bands from the new file from list and clicking "Load RGB" .

Compare the IHS sharpened color image to both the original TM color composite and to the SPOT data.

  1. Try the same process using the Color Normalized (Brovey) Transform by selecting Transforms->Image Sharpening->Color Normalized (Brovey), entering the required file information and clicking OK.

Overlay Map Grid

Click the right mouse button in the Main Image and select Functions->Overlays->Grid Lines.

The Grid Line Parameters dialog will appear and a virtual border will be added to the image to allow display of map grid labels exterior to the image.

  1. Select File->Restore Setup, select BLDRTMSP.GRD , and click "OK".

Previously saved grid parameters will be loaded into the dialog.

  1. Click "Apply" to put the grids on the image.

Overlay Annotation

Select Functions->Overlays->Annotation in the Main Image display.

  1. Select File->Restore Annotation in the dialog and choose the file BLDRTMSP.ANN from the file list that appears and click "OK".

The presaved map annotation will be loaded onto the image.

Output Image Map


End the ENVI Session

This concludes the Registration Tutorial.

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


Copyright 1993 - 1998, BSCLLC, All rights reserved. ENVI is a registered trademark of Better Solutions Consulting LLC, Lafayette, Colorado,Web: http://www.envi-sw.com, Email: envi@bscllc.com. .(Last Update, December 10, 1997)