Geometric Correction

advertisement
CEE 6150: Digital Image Processing
Lab 5: Image registration
Lab 5: Image Georeferencing and Registration
This document is adapted for CEE 6150 from an ENVI Tutorial
This exercise addresses image-to-image and image-to-map registration using ENVI. All images used in
this exercise are available on the course web site.
Examine Georeferenced Data and Output Image-Map
1. Open and display the SPOT image: bldr_sp.img
2. View (and edit) map information in the ENVI header
a. In the Available Bands List, right click on the Map Info icon under the bldr_sp.img filename
and select Edit Map Information from the shortcut menu.
This dialog lists the basic map information used by ENVI
in georeferencing. The image coordinates correspond to a
"Magic Pixel" used by ENVI as the starting point for the
map coordinate system. The coordinate (1.0, 1.0) refers to
the top left corner of the top left pixel in the image (even
if the upper left corner is blank). Because ENVI records
pixel size, the map projection, and projection parameters,
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.
b. Click on the Change Proj. button to view the selection of
projections and datums available. Close the Projection
selection window. Note: Do NOT change the projection.
That would only change the information in the header and
would result in a mismatch between the header and the
image projection.
c. Click on the toggle arrow next to the text Proj./Datum
field to display the latitude/longitude coordinates for these
map projection coordinates. Within this window, click on
the DMS or DDEG button to switch between Degrees
Minutes, Seconds (DMS), and Decimal Degrees (DDEG).
d. Click Cancel to exit the Edit Map Information dialog.
e. In the ENVI Classic toolbar, select File > Edit ENVI Header, then select bldr_sp.img. All of the
basic map information is displayed in the File Information box. Note that this image has been
registered to UTM zone 13 using triangulation with cubic convolution resampling. Close the
window
3. Overlay Map Grids
a. In the Main Image window of the SPOT image, select Overlay > Grid Lines. The Grid Line
Parameters dialog will appear and a virtual border is added to the image to allow display of
map grid labels exterior to the image. The labels show the UTM coordinates.
Page | 1
CEE 6150: Digital Image Processing
Lab 5: Image registration
b. In the Grid Line Parameters dialog, click File > Restore Setup and select the file bldr_sp.grd
and click Open. Previously saved grid parameters will be loaded into the dialog. Click Apply
to display the changes. This overlay (in red) shows the Lat/Long coordinates.)
c. Now examine the map parameters by selecting Options > Edit Map Grid Attributes in the #1
Grid Line Parameters dialog. This display controls the UTM grid and allows for changes to
the color and other characteristics of the lines, labels, corners, and the outlining box. (Changes
do not take effect until you select "Apply" in the Grid Line Parameters window.) Select OK
to return to the previous menu.
d. Examine the geographic parameters by selecting Options > Edit Geographic Grid Attributes in
the #1 Grid Line Parameters dialog. This opens the Edit Geographic Attributes dialog
which displays the parameters for the geographic (latitude/longitude) grid. Click Cancel to
close the dialog when you are finished.
e. Click Apply in the Grid Line Parameters dialog to put the grids on the image if you have
made any changes that you wish to keep. ENVI allows simultaneous pixel, map, and
geographic coordinate grids.
f. Close the Grid Line Parameters dialog.
4. Overlay Map Annotation
a. Select Overlays > Annotation in the Main Image display. The #1 Annotation dialog will appear.
b. Select File > Restore Annotation in the dialog. Choose the file bldr_sp.ann from the file list
that appears and click Open. The pre-saved map annotation will be loaded onto the image.
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.
Image-to-Image Registration
This section illustrates 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.
1. Open and Display the Landsat TM Image File: bldr_tm.img.
2. Display Band 3 as a gray scale image. Band 3 is most similar in spectral range to the SPOT
panchromatic image and will provide the most direct comparison for selecting GCPs. Display and
examine the location of the cursor in the Main, Scroll, or Zoom windows. (Use the Cursor
Location/Value tool.) Note that the coordinates within the TM image are given in pixels only since
this is a pixel-based rather than georeferenced image like the SPOT data above. The coordinates in
the SPOT image include UTM and Lat/Long Coordinates as well as pixel coordinates.
3. Start Image Registration and Load GCPs
a. From the ENVI main menu bar, select Map > Registration > Select GCPs: Image-to-Image.
b. When the Image-to-Image Registration dialog appears, click on Display #1 (SPOT Data) to
select it for the Base image. For the Warp Image select Display #2 (TM Data).
c. 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.
d. Click "Show List" in the GCP Selection Window to display the Image to Image GCP List.
Expand the Image to Image GCP List until you see the RMS column.
Page | 2
CEE 6150: Digital Image Processing
Lab 5: Image registration
e. Enter 753, 826 into the GCP Selection dialog in the Base X and Y text boxes and press Enter.
This should move the cursor to the appropriate point in 331base image.
f. Enter 331, 433 into the dialog in the Warp X and Y text boxes. This should move the cursors
to the equivalent point in the zoom window of the warp image.
g. 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. You may also
use the arrow keys to move the crosshair.
Notes:
 Comparison is sometimes easier when the zoom images are displaying at comparable
scales. For example, set the SPOT zoom to 2x and the TM zoom to 7x.

Sub-pixel positioning is supported in the Zoom windows. The larger the zoom factor, the
finer the positioning capabilities. The keyboard arrow keys will always move the cursor in
one pixel increments. Use the mouse or change the values in the GCP selection window to
move the cursor in smaller increments.

The sharp pixel edges can be distracting, especially at high magnification. You may find it
easier to follow tonal trends and estimate sub-pixel locations by using a more aggressive
interpolation. Change the interpolation in the zoom window by clicking the right mouse
button in the Zoom window and making a selection from the Zoom Interpolation menu.
You may also set it through the System Preferences dialog (i.e., select File > Preferences).
h. When you are satisfied with the set of points, select Add Point in the Ground Control Points
Selection window. The point will appear in the Image to Image GCP list.
i. Identify new GCP's by lining up the cursors in the zoom windows of the two images. (Move
the zoom windows in the main image windows to the general area and then locate the cursor on
the pixels that correspond to the same feature in both images. Then, In the GCP Selection
Dialog Click Add Points to add the GCP to the list.
Try this for a few points to get the feel of selecting GCPs. Try several points in the urban area
and several points in the hills to the west of the city. See if you can select points over the full
area common to the two images.
Take note of the list of actual and predicted points in the dialog. Once you have at least 5
points, the RMS error is reported. At that point you may also select a point in the base (SPOT)
image and click on Predict in the GCP Selection Dialog. The current prediction should be
good enough to get the cursor close to the corresponding point in the warp (TM) image.
j. The errors reported in the GCP list are the predicted location of each point. An RMS error of
1.0 indicates a position error on the order of one sampling interval. If the RMS error of any
one point is particularly large, it is likely that there is a problem with that point. You can locate
the most problematic points by ordering the points by error. Select Options > Order Points by
Error. Examine the problem point and make adjustments as needed.
k. You may save your points to an ascii file by selecting File > Save GCP's to ASCII in the GCP
Selection dialog. For the following steps you may use your points or a set of pre-selected
points. If you choose to use your GCPs, skip steps l-o. I recommend that you use the preselected points first and try the same procedure with your points later.
l. In the Ground Control Points Selection dialog, select Options > Clear All Points to clear all of
your points.
Page | 3
CEE 6150: Digital Image Processing
Lab 5: Image registration
m. Choose File > Restore GCPs from ASCII in the GCP Selection dialog and click on the file
name BLDR_TM.PTS.
n. Click OK to load a list of pre-saved GCPs.
o. Click on individual GCPs in the Image to Image GCP List and examine the locations of the
points in the two images, the actual and predicted coordinates, and the RMS error. Is there any
commonality shared by the points with the highest RMS error?
4. Working with GCPs
The following bulleted descriptions are provided for information only. Given the limited time,
perform only the lettered Predict GCP button functions.
 Clicking on the "On/Off" button removes selected GCPs from consideration in the Warp
model and RMS calculations. These GCPs aren't actually deleted, just disregarded, and can
be toggled back on using the "On/Off button".
 Clicking on the "Delete" button removes the selected GCP from the list.
 Positioning the cursor location in the two zoom boxes and clicking the "Update" button
updates the selected GCP to the current cursor locations.
 The "Predict" button allows prediction of new GCPs based on the current warp model. This
will allow for incremental repositioning of the GCPs.
a. Position 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.
b. The exact position can then be interactively refined by moving the pixel location slightly in the
TM data.
c. Click "Add" to add the new GCP to the list.
7. Warp Images
Images can be warped from the displayed band, or all bands of a multiband images can be warped at
once. We will warp only the displayed band.
Select Options > Warp Displayed Band… in the GCP Selection dialog.
a. When the Registration Parameters dialog appears, select RST as the Warp Method and
"Nearest Neighbor" resampling. RST stands for Rotation, Stretch and Translation, i.e., it is a
linear transform.
b. Either select the memory button or enter an output filename: navigate to your temporary
directory and enter the filename BLDR_RST-NN.WRP and click OK.
The warped image will be listed in the Available Bands list when the warp is completed.
c. Now repeat using RST warping with Bilinear Interpolation and Cubic Convolution.
d. Output the results to BLDR_RST-BL.WRP and BLDR_RST-CC.WRP, respectively.
Page | 4
CEE 6150: Digital Image Processing
Lab 5: Image registration
8. Compare Warp Results Using Dynamic Overlays
a. Close the original TM band 3 image and save the GCPs to a file. (This is just to minimize
confusion.)
b. Load BLD_RST-NN.WRP into a new image display and link the georeferenced SPOT image
and the warped TM image.
c. Now compare the SPOT and the TM images using the Dynamic Overlay by left-clicking in the
Main Image display. (Rapid clicking will give a movie-like view of the difference between the
two images. Apparent movement  poor registration. No apparent movement  good
registration.) Be careful distinguish between registration problems and illumination
differences or real differences/changes in the images.
d. Note that the TM image has been resampled to match the sampling interval of the SPOT image,
i.e., single 30 m pixels have been converted to ~9 10 m pixels. This is apparent even when
using zoom interpolation.
e. Load BLDR_RST-BL.WRP and BLDR_RST-CC.WRP into new displays and use the image
linking and dynamic overlays to compare the effect of the different resampling methods:
nearest neighbor, and bilinear interpolation. Note how jagged the pixels appear in the nearest
neighbor resampled image. The Bilinear Interpolation image looks much smoother, but the
Cubic Convolution image yields the most pleasing result, smoother, but appearing to retain fine
detail.
9. Examine Map Coordinates
a. Bring up the Cursor Location/Value dialog
1. Browse the georeferenced data sets and note the effect of the different resampling and warp
methods on the data values.
10. Close All Files
Page | 5
CEE 6150: Digital Image Processing
Lab 5: Image registration
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
1. In the Available Bands List click on Band 3, select the Gray Scale button at the bottom of the
dialog, and then Load Band to load the TM band 3 image. (It is frequently less confusing to
choose points on a clear grayscale image rather than a color image.)
Select Image-to-Map Registration and Restore GCPs
1. Select Map > Registration> Select GCPs> Image-to-Map.
2. When the Image-to-Map Registration dialog appears, click
on UTM as the map projection to use and enter 13 N for the
Zone. (The Datum is North America 1927 – NAD 1927).
3. Leave the pixel size at 30 m and click OK to start the
registration.
4. Select File > Restore GCPs from ASCII in the dialog and
open the file bldr_tm.pts.
Image-to-Map GCP Selection dialog
Image-to-Map GCP Selection dialog
5. Select Show List. Examine the base map coordinates, the actual and predicted image coordinates,
and the RMS error. The map coordinates are in Northings and Eastings. The image coordinates
are in terms of the pixel location. The point (1,1) is the upper, left corner of the image).
Add Map GCPs Using Vector Display of Digital Line Graph (DLG)
In the ENVI Main Menu Select File > Open Vector File
1. Choose the file bldr_rd.dlg and click OPEN to open the file. (You may need to change the file
type to USGS DLG (*.ddf, *.dlg) in the OPEN dialog.)
2. Click Memory in the Import Optional DLG File Parameters dialog and click OK to read the
DLG data.
Page | 6
CEE 6150: Digital Image Processing
Lab 5: Image registration
3. When the Available Vectors List appears, click on the entry Roads and Trails, Boulder, CO and
then the Load Selected button.
4. In the Load Vector dialog, click New Vector Window. A Vector Window will appear and the
vector map will be drawn.
5. Expand the Vector Window, then 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 at the
bottom of the window
6. Use the Pixel Locator (Tools > Pixel
Locator in the image window) to
position the image cursor on the road
intersection at 402, 418 in the Image
Display window (the TM image).
Note that sub-pixel positioning
accuracy is again available in the
Zoom window.
7. Position the Vector cursor at the
matching road intersection on the vector
map at. It should be near 477587,
4433240 or 40d 3m 3s N, -105d 15m
45s W) by clicking and dragging with
the left mouse button and
releasing when the circle at the
cross-hair intersection overlays
the intersection of interest.
ENVI Vector Window
8. Leaving the cursor in position, click and hold the right mouse button and select Export Map
Location in the menu that appears. These map coordinates will appear in the Ground Control
Points Selection dialog.
9. Click Add Point to add the map-coordinate/image pixel pair and observe the change in RMS error.
If this is a good point, keep it. If it is not a good point, i.e., if the RMS error is on the high end of
the existing data, delete the point.
Warp Image using RST and Cubic Convolution
In the Ground Control Points Selection dialog, select Options > Warp File.
1.
2.
3.
4.
5.
Click on the file name BLDR_TM.IMG and click OK to select all 6 TM bands for warping.
Choose RST and Cubic Convolution resampling in the Registration Parameters dialog.
Enter the output file name BLDRTM_M.IMG in the output file text box.
Change the background value to 255.
Click OK to start the image-to-map warp. ENVI will automatically add the warped image to the
Available Bands List and display and RGB image in a new window using Bands 4, 3 & 2 for R, G
& B respectively.
Page | 7
CEE 6150: Digital Image Processing
Lab 5: Image registration
6. Display the warped TM 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.
7. Overlay the vector file.
a. In the image window for the warped TM image, select Overlay > Vectors to display the
Vector Parameters: Cursor Query window.
b. Select Options > Import Layers and select ROADS AND TRAILS: BOULDER, CO
c. Select the OFF radio button at the top of the Vector Parameters: Cursor Query window.
d. Examine how well the image fits with the overlay map.
Page | 8
Download