0% found this document useful (0 votes)
24 views18 pages

Tutorial 7

This tutorial provides a comprehensive guide on using ENVI's image mosaicking capabilities, covering both pixel-based and georeferenced mosaicking examples. It includes detailed instructions on preparing images, performing histogram matching, feathering edges, and creating virtual mosaics. The tutorial also outlines the necessary files and steps to effectively combine multiple images into a single composite image using ENVI software.

Uploaded by

Silue
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views18 pages

Tutorial 7

This tutorial provides a comprehensive guide on using ENVI's image mosaicking capabilities, covering both pixel-based and georeferenced mosaicking examples. It includes detailed instructions on preparing images, performing histogram matching, feathering edges, and creating virtual mosaics. The tutorial also outlines the necessary files and steps to effectively combine multiple images into a single composite image using ENVI software.

Uploaded by

Silue
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Tutorial 7:

Mosaicking Using ENVI

The following topics are covered in this tutorial:

Overview of This Tutorial . . . . . . . . . . . . . 174 Pixel-Based Mosaicking Example . . . . . . 183


Mosaicking in ENVI . . . . . . . . . . . . . . . . . 176 Georeferenced Mosaicking Example . . . . 187

ENVI Tutorials 173


174 Tutorial 7: Mosaicking Using ENVI

Overview of This Tutorial


This tutorial is designed to give you a working knowledge of ENVI's image
mosaicking capabilities. For additional details, please see the ENVI 3.5 User’s Guide
or the ENVI Online Help.

Files Used in this Tutorial


CD-ROM: ENVI Tutorial and Data CD No. 1
Path: envidata/avmosaic

File Description

Pixel-Based Mosaicking
dv06_2.img AVIRIS Scene 02
dv06_2.hdr ENVI Header for above
dv06_3.img AVIRIS Scene 03
dv06_3.hdr ENVI Header for above
[Link] Mosaic Template for end-to-end AVIRIS mosaic
[Link] Mosaic Template for feathered overlapping AVIRIS
mosaic
dv06_fea.img Feathered Mosaic image
dv06_fea.hdr ENVI Header for above
Georeferenced Mosaicking
lch_01w.img Warped, histogram matched image
lch_01w.hdr ENVI Header for above
lch_01w.ann Cut-line feathering annotation for above
lch_02w.img Warped, histogram matched image
lch_02w.hdr ENVI Header for above
lch_a.mos Mosaic Template for Georeferenced Image
Mosaicking

Overview of This Tutorial ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 175

File Description
lch_mos1.img Georeferenced mosaic result
lch_mos1.hdr ENVI Header for above

ENVI Tutorials Overview of This Tutorial


176 Tutorial 7: Mosaicking Using ENVI

Mosaicking in ENVI
Mosaicking is the art of combining multiple images into a single composite image. It
can be used to combine pixel-based images, to lay out images for publication or map
composition, or as a means for combining georeferenced images into an image
covering a larger geographic area. ENVI provides interactive capabilities for placing
pixel-based images within a mosaic, and automated placement of georeferenced
images within a georeferenced output mosaic. The software provides tools for
common mosaic requirements such as blending edges (feathering), image border
transparency, and histogram matching. ENVI's Virtual Mosaic capability allows
users to optionally create and display mosaics without creating large output files.

General Topics
The following sections walk you through some of the preparation required to make
mosaics in ENVI. The actual exercises begin with the section “Pixel-Based
Mosaicking Example” on page 183 or alternatively, for georeferenced mosaics, in the
section “Georeferenced Mosaicking Example” on page 187.

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.
Preparing Images
Raw image data can be mosaicked together if desired (ENVI can be used to easily
produce multiband mosaics of multiple data types), however, most mosaics are for
output and usually require scaling (contrast stretching), and histogram matching to
minimize image differences in the output mosaic.
The first step in creating a mosaic using ENVI is usually to contrast stretch the
images. This is done by displaying the bands to be mosaicked and either using one of
ENVI's quick (default) stretches or using ENVI's interactive contrast stretching
capabilities.

Mosaicking in ENVI ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 177

Start in either of the following Pixel-Based (“Steps for Creating a Pixel-Based


Mosaic” on page 180) or the Georeferenced Image Mosaic (“Create the
Georeferenced Mosaic Image” on page 187) sections and open the appropriate
images by navigating to the avmosaic subdirectory of the envidata directory on
the ENVI Tutorial and Data CD No. 1, selecting the desired image file and opening it
just as you would in any other application.
Open the Files
1. Select File → Open Image File. An Enter Data Filenames file selection
dialog appears. Select the desired file.
Note
On some platforms you must hold the left mouse button down to display the
submenus from the Main Menu.

2. Display the image(s) by selecting the desired bands in the Available Bands
List and clicking Load Band.
3. Select Enhance → [Image] Linear 2% to stretch the displayed image, or
select Enhance → Interactive Stretching.
4. Stretch the image to enhance the desired image features and output to memory
or a new file by selecting File → Save Image As → Image File in the Main
Display window.
Histogram Matching
When mosaicking two or more images that overlap, it is usually necessary to choose
a base image and balance gray scale values in the rest of the images to match the base
image. This is called histogram matching (Richards, 1993). ENVI provides an
interactive tool to perform histogram matching. The procedure for performing the
histogram matching is described below.
The following steps are provided for information and are not to be executed as part of
this tutorial.
1. Display the two images to be histogram matched in two display windows.
Select one of the images as the base image and stretch that image as desired
using either the default stretches under the Enhance menu or
Enhance → Interactive Stretching.
2. Identify the overlap areas, position the Zoom windows of both images within
the overlap, and resize and/or reposition the Zoom window to cover exactly the
same region in both images (try to cover as large an area as possible and a
broad range of cover types).

ENVI Tutorials Mosaicking in ENVI


178 Tutorial 7: Mosaicking Using ENVI

3. Select Enhance → Histogram Matching from the Main Image Display menu
bar of the image you want to match to the base image. The Histogram
Matching Input dialog appears.
4. Select the display number of the base image to match, click on the Zoom radio
button, and then click OK.
The output histogram from the base image is applied to the histogram of the
second image and histogram matching is complete. The two images should
now have the same gray scale characteristics.
5. Save the two contrast stretched images by selecting File → Save Image
As → Image File in both Main Displays.
6. Select to save the stretched files either to memory or to new output files.
7. Repeat for additional overlapping images as required.
You may want to try the histogram matching yourself on the input file for the
“Georeferenced Mosaicking Example” on page 187. However, for the purpose of this
exercise, the pre-stretched, histogram-matched images lch_01w.img and
lch_02w.img are provided as input to the georeferenced mosaicking function.

Feathering
It is often desirable to blend or blur the seams between mosaicked images. ENVI
provides the capability of feathering the edges of overlapping areas using either edge
feathering or cutline feathering over a user specified distance. To use feathering when
mosaicking images, import the bottom image without feathering. Import the
overlapping images with feathering, either edge or cutline, as desired.
Edge Feathering
Edge Feathering uses the distance
specified in the Edge feathering
distance (pixels) text box in the
Mosaic Entry Input Parameters
dialog to blend the image seams along
the edges of the image. The edge
feathering distance specified is blended
using a linear ramp that averages the
two images across that distance. For
example, if the specified distance is 20 Figure 7-1: Edge Feathering
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

Mosaicking in ENVI ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 179

output image. At the specified distance (20 pixels) in 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 in from the edge, 50% of each image is used to make the output image.
Cut-Line Feathering
Cut-Line Feathering uses the distance
specified in the Cutline feathering
distance (pixels) text box and the
annotation file selected from Ann File in
the Mosaic Entry Input Parameters
dialog to blend the image boundaries.
Cutlines must be defined using the
annotation tools prior to mosaicking.
The annotation file must contain a
polyline defining the cutline that is
drawn from edge-to-edge and a symbol Figure 7-2: Cutline Feathering
placed in the region of the image that
will be cut off. The cutline distance
specified is used to create a linear ramp that averages the two images across that
distance from the cutline outwards. For example, if the specified distance is 20 pixels,
100% of the top image is used in the blending at the cutline and 0% of the bottom
image is used to make the output image. At the specified distance (20 pixels) out
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 in from the cutline, 50% of each image is used
to make the output image.

Virtual Mosaics
ENVI allows use of the mosaic template file as a means of constructing a “Virtual
Mosaic” — a mosaic that can be displayed and used by ENVI without actually
creating the mosaic output file.
1. To create a virtual mosaic, create the mosaic and save the template file using
File → Save Template in the Image Mosaicking dialog. This creates a small
text file describing the mosaic layout
2. To use the virtual mosaic, select File → Open Image File from the ENVI
main menu 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.

ENVI Tutorials Mosaicking in ENVI


180 Tutorial 7: Mosaicking Using ENVI

Steps for Creating a Pixel-Based Mosaic


The following describes the steps required to create a pixel-based image mosaic.

Set up the Mosaicking Dialog


1. Select Map → Mosaicking → Pixel Based from the ENVI main menu.
The pixel-based option can also be used to place georeferenced images, where
the georeferencing information will not be retained. Pixel-based images can
also be placed within a georeferenced image using the
Map → Mosaicking → Georeferenced option.
2. For pixel-based images, set the size of the output mosaic by entering the
desired size in pixels in X Size (Samples) and Y Size (Line) parameters in the
dialog.
3. Also set the “Snap” factor, which controls a grid to which images will be
placed or snapped (for example, a snap of 5 means that pixel-based images will
be placed at the nearest intersection of a pixel grid with 5 x 5 pixel spacing).
Set the snap factor by selecting Options → Set Snap Value.
Import Images
Use one of the following methods to import images depending on the type of mosaic
and whether the images have overlapping areas.
Importing Images Without Feathering
Images that do not overlap, or images that do not require blending should be imported
using the Import file without feathering option as follows:
1. Select Import → Import file without feathering from the menu bar in the
pixel-based or georeferenced Mosaicking dialog.
2. Open and select the desired image in the Mosaic Input File dialog and
spectrally and/or spatially subset it if desired.
The image description will be listed in the dialog, and a graphic representing
the image and its position in the mosaic will be displayed in the draw widget
within the dialog.
3. Open and import the remaining images in the mosaic in the same fashion.

Mosaicking in ENVI ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 181

Importing Images With Feathering


Images that overlap may require feathering of the overlap areas to avoid obvious
seams in the final mosaic.
1. Select Import → Import file with feathering from the menu bar in the
Mosaicking dialog.
If cutline feathering is being used, the cutline must already have been drawn as
a polyline annotation and saved to an annotation file as described in the section
“Cut-Line Feathering” on page 179.
2. For both cutline and edge feathering, specify a distance over which to feather
as described in “Feathering” on page 178.
Feathering blends adjoining images, but mosaicking with feathering is
computationally intensive and requires a long time to run, especially for large
mosaics.
Importing Images With a Background Value to Ignore
This option allows image transparency for overlapping images.
1. Select Import → Import file with feathering regardless of whether or not
you want to feather the images. This allows you to set a background value to
ignore when images overlay one another.
2. If feathering (which is used for mosaicking images with constant digital
number value borders) is desired, enter the desired values, however, if
feathering is not desired, leave the feathering values set to zero.
3. Enter the data value to be ignored in the labeled text box.
The overlap areas with this value will be transparent, allowing underlying images to
show through. This value will also be ignored during the feathering process if
selected.
Create a Virtual Mosaic or an Output Mosaic
Complete one of the following steps, either creating a template (virtual mosaic) or
creating an output mosaic:
1. To create a virtual mosaic, described in “Virtual Mosaics” on page 179, select
File → Save Template, enter the output filename, and click OK. To view this
mosaic, select File → Open Image File from the ENVI main menu, choose
the mosaic template file as the input file and click Open. Click on the mosaic
band name in the Available Bands List and then Load Band to automatically

ENVI Tutorials Mosaicking in ENVI


182 Tutorial 7: Mosaicking Using ENVI

get the required images and display the virtual mosaic to the ENVI Image
Display.
2. Alternatively, to actually create the mosaic as a new file, select File → Apply
in the Mosaic dialog and enter an output filename. The output mosaic is a
standard ENVI file and can be displayed using the Available Bands List.

Mosaicking in ENVI ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 183

Pixel-Based Mosaicking Example


This section leads you through creation of pixel-based mosaics using ENVI’s
mosaicking tools.
1. Start the ENVI pixel-based mosaic function by selecting
Map → Mosaicking → Pixel Based from the ENVI main menu.
2. The Pixel Based Image Mosaicking dialog appears.

Figure 7-3: The Pixel Based Image Mosaicking Dialog

Import and Position Images


To position pixel-based images:
1. Import each of the following two images, dv06_2.img and dv06_3.img, by
selecting Import → Import file without feathering from the Pixel Based
Image Mosaicking dialog.
2. Specify the mosaic size by entering the 614 for the X Size and 1024 for the Y
Size in the text boxes at the top of the Pixel Based Image Mosaicking dialog.
3. Click on the second image in the list of images in the dialog (dv06_3.img ).

ENVI Tutorials Pixel-Based Mosaicking Example


184 Tutorial 7: Mosaicking Using ENVI

The current position of the image in pixels will be listed in the text box at the
bottom of the dialog.
4. Change the image position by entering the desired XO (x offset) and YO (y
offset) values in pixels in the corresponding text boxes. Enter a value of 513
for the YO for dv06_3.img to place it directly below dv06_2.img.
Note
Images can also be positioned by clicking and holding the left mouse button on the
desired image in the mosaic diagram on the right side of the dialog, dragging the
selected image to the desired location, and releasing the left mouse button to place
the image.

5. Select File → Apply from the Pixel Based Image Mosaicking dialog menu
and enter the output filename [Link] and click OK to create the mosaic.
6. Choose File → Save Template from the Pixel Based Image Mosaicking
dialog and enter the output filename [Link].
7. Display the mosaicked image by clicking on the [Link] band name in
the Available Bands List and then clicking Load Band.
The second part of this example shows positioning of the two images into a
composite mosaic image, accomplished by either entering the XO and YO values, or
dragging the images to the desired locations within the dialog. The example also
includes edge feathering.

Pixel-Based Mosaicking Example ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 185

Figure 7-4: Two Single-band AVIRIS Images (left) and the Final Seamless Join
of the Two (right)

1. Using the images already displayed, enter a value of 768 into both the Mosaic
X Size and Y Size text boxes to change the size of the output mosaic
2. Left-click within the green graphic outline of image #2 in the Pixel Based
Image Mosaicking dialog. Drag the #2 image to the lower right hand corner of
the diagram.
3. Edit the mosaic characteristics by selecting Options → Edit Entry in the
Pixel Based Image Mosaicking dialog. Enter a value of 25 for the Edge
Feathering Distance and a Background Data Value to Ignore of 0, and click
OK. Repeat for the second image.
4. Choose File → Save Template and enter the output filename [Link].
Click on the mosaic template name in the Available Bands List and select

ENVI Tutorials Pixel-Based Mosaicking Example


186 Tutorial 7: Mosaicking Using ENVI

Load Band to display it. No feathering is performed when using virtual


mosaic.
5. Now make the same image as a feathered mosaic by actually creating the
output file. In the Pixel Based Image Mosaicking dialog, select
File → Apply and click OK.
6. Enter an output filename, and a Background Value of 255, then click OK.
Display the mosaic now listed in the Available Bands List in a new display
window.
7. 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 as described above.

Figure 7-5: The Final Feathered Mosaic

Pixel-Based Mosaicking Example ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 187

Georeferenced Mosaicking Example


Putting together georeferenced, overlapping images requires considerable
preparation, including histogram matching and usually feathering. The following
sections of this tutorial describe some of the requirements and how to accomplish
these using ENVI.

Create the Georeferenced Mosaic Image


1. Start the ENVI Georeferenced Mosaic function by selecting
Map → Mosaicking → Georeferenced from the ENVI main menu.
Load the Mosaic Template
Select File → Restore Template and select the file lch_a.mos. This opens the files
and restores the mosaic parameters necessary for a georeferenced, feathered mosaic.

Figure 7-6: The Georeferenced Image Mosaicking Dialog

ENVI Tutorials Georeferenced Mosaicking Example


188 Tutorial 7: Mosaicking Using ENVI

Optionally Input and Position Images


Optionally, to manually position the georeferenced images and set the feathering
options, import the images individually. 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, Cutline and Virtual, Non-Feathered Mosaic


1. In the Available Bands List, select the file lch_01w.img and display as a
gray scale by clicking on the band name and then the Load Band button.
2. Choose Overlay → Annotation from the Main Image Display menu bar to
start the Annotation dialog.
3. Select File → Restore Annotation and choose the file lch_01w.ann to
display the cutline used to blend the two images in this mosaic.
4. Display the second image lch_02w.img and examine the nature of the cutline
with respect to this image.
5. View the virtual, non-feathered mosaic. Select File → Open Image File from
the ENVI main menu and choose lch_a.mos as the input file. Load this
image to a new display using the Available Bands List and examine the non-
feathered edge between the two images used to create the mosaic.

Create the Output Feathered Mosaic


1. Select File → Apply in the Georeferenced Image Mosaicking dialog and
enter the output filename lch_mos.img and click OK to create the feathered
mosaic.
2. Close the two Image Display Windows containing the individual warped
images and load the mosaic image into a new display.
3. Compare the feathered mosaic to the non-feathered mosaic using image
linking and dynamic overlays.

Georeferenced Mosaicking Example ENVI Tutorials


Tutorial 7: Mosaicking Using ENVI 189

In the following figure, the left images show the warped, histogram-matched images
with the cutline selected. The right image is the mosaic resulting from using cutline
feathering.

Figure 7-7: Examples of Georeferenced Image Mosaicking

ENVI Tutorials Georeferenced Mosaicking Example


190 Tutorial 7: Mosaicking Using ENVI

Additional Options in the Pixel Based and Georeferenced


Mosaicking Dialogs
The following list describes additional options when using the mosaicking dialogs:
• To edit the characteristics of an image, such as modifying feathering distances,
setting the Background Data Value to Ignore (transparency), or changing the X
and Y image offsets, select Options → Edit Entry and enter the desired
values.
• To replace an image currently in a mosaic with another image of the same size,
select the image to be replaced, and select Options → Replace Entry and
select the image to use for the replacement.
• To delete the currently selected image from the mosaic, select
Options → Delete Entry.
• To remove all images from the mosaic and clear the mosaic, select
Options → Clear All Entries.
The following Pixel Based Image Mosaicking dialog options are available only for
pixel-based images:
• To float the pixel-based image to the top of the stack of overlapping images,
click on the image in the list, or the mosaic diagram, and select
Options → Percolate Entry.
• To center all of the current images in the mosaic as a group, select
Options → Center Entries.
• To place an image as if their upper left corner has the x, y coordinates of (1,1),
select Options → Do Not Use Image Offset.
Do this for images which were previously created as subsets from other larger
images and which have an image offset value. This means that the upper left
corner of the image has X and Y values corresponding to its position in the
original image.
• To place images in the mosaic at the location specified by its location in the
original image from which it was subset, select Options → Use Image Offset.

End the ENVI Session


You can quit your ENVI session by selecting File → Exit (Quit on UNIX) in the
ENVI main menu, then click Yes to end the session. If you are using ENVI RT,
quitting ENVI will take you back to your operating system.

Georeferenced Mosaicking Example ENVI Tutorials

You might also like