Tutorial 4
Tutorial 4
Image Georeferencing
and Registration
The following topics are covered in this tutorial:
File Description
Required Files
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
Generated Files
bldr_tm1.wrp Image-to-Image Result Using RST and Nearest
Neighbor
bldr_tm1.hdr ENVI Header for Above
File Description
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 Boulder TM/SPOT sharpening result using HSV
sharpening, 10 meter pixels
bldrtmsp.hdr ENVI Header for Above
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 loaded and executed.
2. When the Enter Data Filename file-selection dialog appears, navigate to the
bldr_reg subdirectory of the envidata directory and select the file
bldr_sp.img from the list.
3. Click OK.
4. When the Available Bands List dialog appears, click on the Gray Scale radio
button and select the SPOT band listed at the top of the dialog by clicking on
the band with the left mouse button.
The band you have chosen will be displayed in the field marked Selected
Band:.
5. Click the Load Band button to load the image into a new display.
2. When the Edit Header Input File dialog appears, select the file
bldr_sp.img and click OK.
3. The Header Info: [filename] dialog opens. In this dialog, select the Edit
Attributes button and Map Info from the pull-down menu 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.
4. Click on the spin box arrow next to the Projection/Datum field to see the
latitude/longitude coordinates for the UTM Zone 13 North map projection.
ENVI makes this conversion on-the-fly.
5. Click on the active DMS or DDEG button to toggle between Degrees-
Minutes- Seconds, and Decimal Degrees, respectively.
6. Click Cancel to exit the Map Information dialog.
Cursor Location/Value
To open a dialog box that displays the location of the cursor in the Main Image,
Scroll, or Zoom windows, do the following.
1. From the Main Image window menu bar, select Tools → Cursor
Location/Value.
You can also open this dialog from both the ENVI main menu and the Main
Image window menu bar, by selecting Window → Cursor Location/Value.
Figure 4-2: The Cursor Location dialog displays the pixel and georeferenced
coordinates for georeferenced images.
Note that the coordinates are given in both pixels and georeferenced
coordinates for this georeferenced image.
2. Move the cursor around the image and examine the coordinates for specific
locations and note the relation between map coordinates and
latitude/longitude.
3. Select File → Cancel to dismiss the dialog when finished.
2. In the new dialog, select File → Restore Setup. A file selection dialog opens.
3. In the Enter Grid Parameters Filename dialog, select the file bldr_sp.grd
and click Open.
Previously saved grid parameters are loaded into the dialog.
4. In the #1 Grid Line Parameters dialog you can examine the map parameters
by selecting Options → Edit Map Grid Attributes from the dialog menu bar.
An Edit Map Attributes dialog opens.
5. In the Edit Map Attributes dialog, note the grid spacing and the parameters
that control the color and other characteristics of the lines, labels, corners, and
the box (outlining box).
6. Click File → Cancel to close the dialog when you are finished.
7. Now in the #1 Grid Line Parameters dialog you can examine the geographic
parameters by selecting Options → Edit Geographic Grid Attributes from
the menu bar. This opens the Edit Grid Attributes dialog.
Note again the parameters for the geographic (latitude/longitude) grid. Click
Cancel to close the dialog when you are finished.
8. 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
1. In the Main Image display, select Overlay → Annotation. This opens the #1
Annotation: Text dialog.
2. In the new dialog, select File → Restore Annotation. Doing this opens a
standard file selection dialog.
3. In the Enter Annotation Filename dialog, choose the file bldr_sp.ann
from the file list and click OK.
The pre-saved map annotation is loaded onto the image.
4. Enlarge the Scroll window by grabbing one of the corners and dragging.
Reposition the resized Scroll window so you can see the Main Image window
simultaneously.
5. In the resized Scroll window, move the main image indicator box using the left
mouse button and examine the map elements which appear in the Main Image
window.
6. In the #1 Annotation: Text dialog, click and hold the Object menu to examine
the objects you can use to annotate the map.
The Change Graphics Overlay Selections button opens a dialog of the same
name which allows you to add or delete many graphics overlay options,
including annotations and gridlines.
The Change Image Border Size button also opens a dialog of the same name.
This dialog allows you to change the top, bottom, left, and right border widths
and also the border color 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 layered onto the output
image.
3. You can choose whether you want your result to be saved to a file on disk or to
memory by selecting either the radio button labeled Memory, or the File radio
button. This time, select Memory and click OK to output the image.
4. The Available Bands List now has the new image available. Open another
display by clicking on the Display #1 button pull-down menu in the Available
Bands List and choosing New Display from the menu.
5. Select the RGB Color radio button and load the image in from memory by
selecting the R, G, and B (Georeferenced SPOT) data bands successively.
6. Then select the Load RGB button to display the results of the annotation as a
raster image.
Saving your Image to Postscript
To save your work to a Postscript file perform the following.
1. In the Main Image window, select File → Save Image As → Postscript File.
The Output Display to Postscript File dialog appears. 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.
Figure 4-4: The Display to Postscript dialog for output of the above image map.
2. Enter the desired size of the output image in the xsize and ysize parameter text
fields. By clicking the left mouse button in the representational graphic you
can see the new image size outline and position in the graphical representation
of the output page in the dialog.
3. Click the right mouse button in the graphic to center the image on the page.
• If you’d like scaled map output, enter the desired map scale in the Map
Scale text box, and then click the left mouse button in the graphic
representation to see the result.
If the scale makes the image larger than the available page size, ENVI
automatically creates a multi-page Postscript document.
4. If you have a large-scale plotter, change the Page size to the plot size and the
scaled image will be output to a Postscript file that can be plotted to scale
directly on the plotter.
Note
Create the Postscript file only if you can print color output and print the file using
your standard operating system procedures for printing Postscript output.
Direct Printing
ENVI also allows direct printing to devices supported by your operating system.
1. From the Main Image window, select File → Print. This opens your operating
systems standard Print dialog, and you can now follow your standard printing
procedures.
2. Once you have selected all of the parameters in the operating system’s
standard Print dialog and clicked OK, ENVI opens an Output Display to
Printer dialog to allow you to set additional basic ENVI printing parameters
similar to those used for postscript output procedure (see above). Adjust these
print settings as desired and click OK to begin printing.
2. The Image to Image Registration dialog appears. For the Base Image, click
on Display #1 (the SPOT image) to select it. For the Warp Image select
Display #2 (the TM image).
3. Click OK to start the registration. This opens the Ground Control Points
Selection dialog.
Individual ground control points (GCPs) are added by positioning the cursor
position in the two images to the same ground location.
Figure 4-5: The Ground Control Points Selection dialog used for image to image
registration.
4. 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.
5. 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.
6. 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.
7. 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 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.
8. In the Ground Control Points Selection dialog, select Options → Clear All
Points to clear all of your points.
9. In the Ground Control Points Selection dialog, choose File → Restore
GCPs from ASCII.
10. In the Enter Ground Control Points Filename dialog, select the file name
bldr_tm.pts, and click OK to load a list of pre-saved GCPs.
11. 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.
Figure 4-6: Image to Image GCP LIst dialog for image to image registration.
• In the Image to Image GCP List dialog, clicking on the Delete button
removes a GCP from the list.
• Positioning the cursor location in the two Zoom windows and clicking the
Update button in the Image to Image GCP List dialog updates the selected
GCP to the current cursor locations.
• The Predict button in the Image to Image GCP List dialog allows prediction
of new GCPs based on the current warp model.
1. Try positioning the cursor at a new location in the Main Image containing 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.
2. The exact position can then be interactively refined by moving the pixel
location slightly in the TM data.
3. In the Ground Control Points Selection dialog, click Add Point 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.
1. In the Ground Control Points Selection dialog, select Options → Warp
Displayed Band.
2. The Registration Parameters dialog appears. Use the Warp Method button
menu to select RST, and the Resampling button menu to select Nearest
Neighbor resampling.
Figure 4-8: Ground Control Points Selection dialog for Image to Map
Registration.
5. 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)).
6. Enter the known map coordinates manually into the E (Easting) and N
(Northing) text boxes and click Add Point to add the new GCP.
7. Select File → Restore GCPs from ASCII in the dialog and open the file
bldrtm_m.pts.
8. In the Ground Control Points Selection dialog, click the Show List button.
The Image to Map GCP List dialog appears. Examine the base map
coordinates, the actual and predicted image coordinates, and the RMS error.
Resize the dialog to see the RMS error.
Figure 4-9: Image to Map GCP LIst dialog for image to map registration.
The map coordinates of the cursor will be listed in the Location field of the
Vector Window Parameters dialog.
8. Position the image cursor on the road intersection at 402, 418 in the Main
Image display by selecting Tools → Pixel Locator, entering the values, and
clicking Apply.
Note that sub-pixel positioning accuracy is again available in the Zoom
window.
9. In the Vector window, position the vector cursor at the road intersection at
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.
10. Click Export in the Vector Window Parameters #1 dialog. The new map
coordinates will appear in the Ground Control Points Selection dialog.
11. 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.
4. Select File → Cancel in the Ground Control Points Selection dialog to close
that dialog. Save the GCPs if desired.
Overlay Annotation
1. From the HSV Main Image menu bar, select Overlay → Annotation.
2. In the Annotation: Text dialog for the HSV image display, select
File → Restore Annotation and choose the file bldrtmsp.ann from the file
list that appears and click Open (OK on UNIX).
The pre-saved map annotation will be loaded onto the image.
• Optionally, enlarge the Scroll window by grabbing one of its corners and
dragging it.