Create Seamless Mosaics

Mosaic Tutorial: Advanced Workflow

Use the Seamless Mosaic workflow to mosaic georeferenced images into one image. This workflow lets you apply color balancing and edge feathering to create a high-quality mosaic. To create a simple mosaic with no color balancing or edge feathering, see Create Quick Mosaics.

See the following sections:

You can also write a script to create a seamless mosaic using the BuildMosaicRaster task.

Before You Begin

The Seamless Mosaic tool has some requirements and limitations to be aware of regarding input data:

Consider processing the input scenes to remove unwanted artifacts before importing the scenes into the Seamless Mosaic tool. Here are some recommendations:

When working with hyperspectral data, keep in mind that the Seamless Mosaic tool was designed to create an image or map presentation from three bands of data (typically red/green/blue). Creating a mosaic of hyperspectral images is generally not recommended because:

If you will create a mosaic of hyperspectral images, use the Convert Interleave tool to convert each input image to band-interleaved-by-pixel (BIP) format. Then select the BIP images as input to the Seamless Mosaic tool.

Select Input Scenes

  1. From the Toolbox, select Mosaicking > Seamless Mosaic. A "Seamless Mosaic" view is added to the Layer Manager, and the Seamless Mosaic dialog appears.
  2. Click the Add Scenes button .
  3. Select one or more scene filenames from the Data Selection dialog, and click OK. The scenes appear in the display, and the Seamless Mosaic dialog lists the filenames. The first image you selected for input is at the bottom of the list.
  4. When you click on a scene in the display, the row for that scene is highlighted in the table (and vice-versa). Use Shift-click or Ctrl-click to select multiple scenes in the table. You may need to select multiple scenes if you want to change the stack order, to remove individual scenes, or to set the Data Ignore Value for multiple scenes at once.
  5. Here are some tips for displaying images and footprints:

Performance Considerations

The speed of opening and displaying scenes depends on various factors such as your processor speed, RAM, and graphics card. See the ENVI System Requirements topic.

If you are working on a large mosaic project, here are additional tips if performance becomes an issue:

Set Data Values to Ignore

You can define pixel values from input scenes that you want to exclude in the output mosaic; for example, background pixels or those with bad data.

The table in the Seamless Mosaic dialog contains a "Data Ignore Value" column. By default, the values listed for each scene are taken from the data ignore value field in the associated header file, for ENVI-format files. If the header file does not contain a data ignore value field, the default entry is "None."

Set the Scene Order

You can define how multiple scenes are ordered in the final output. The scene at the top of the list will be ordered first, followed by the second scene, and so forth. The first image you selected for input is at the bottom of the table and the order stack. The last image you selected is at the top of the list and the order stack.

Scene ordering only pertains to areas of overlap between two or more scenes. Parts of scenes that are underneath others will not be visible in the final mosaic output. The following figure shows an example:

The following options are available under the Order drop-down list once two or more scenes are listed in the Seamless Mosaic dialog. Select one or more scene filenames, and select an option to rearrange their position relative to the other scenes:

For the Reverse Current Order option, you must select at least two scenes. As you select a scene in the list, its footprint is highlighted with a cyan color. This helps to identify and select a scene that is hidden behind others.

Select the Mosaic Area

To select an output area for the final mosaic, click the Define Output Area button . Click and drag the cursor to draw a rectangle around the area that you want to subset. After releasing the mouse button, you can adjust the sides and corners of the rectangle as needed, then right-click and select Accept Subset Area. The output area is displayed with a light-grey dashed rectangle. Pixels outside of this rectangle will be discarded when you export the mosaic. To start over, click the Define Output Area button again. Or, right-click inside the selection and choose Clear Subset Area.

Perform Color Correction

Use Color Correction to improve color and tone consistency among the input scenes of the mosaic. This is an optional step.

  1. Enable the Show Preview option to preview the changes you make in the steps that follow.
  2. Click the Color Correction tab.
  3. Select the Histogram Matching option to map discrete greyscale levels from the histogram of an adjusted scene to the corresponding greyscale levels in the reference scenes. If you do not select this option, no color correction will be applied.
  4. Select the area of the reference and adjusted images that will be used to compute statistics for color correction. The following options are available:
  5. Click the Main tab.
  6. The Color Matching Action column becomes available for updating once you select the Histogram Matching option. Right-click on each table row and select an option:

Add Seamlines

A seamline is the line along which overlapping scenes will be mosaicked. They help make scene boundaries less visible and are useful when scenes are not aligned well at their boundaries. They are also helpful when overlapping areas have significant differences in features. For example, an agricultural field can appear differently in one image compared to an overlapping image from a different date.

ENVI uses an automated geometry-based method to generate seamlines (Pan et al., 2009). This method uses seamline networks formed by area Voronoi diagrams with overlap. The Voronoi edge lies in the overlapping part between adjacent areas. Auto seamline generation creates effective mosaic polygons that define the pixels of each input image used for the final mosaic.

Reference: Pan, J., M. Wang, D. Li, and J. Li. "Automatic Generation of Seamline Network Using the Area Voronoi Diagram with Overlap." IEEE Transactions on Geoscience and Remote Sensing 47, No. 6 (2009): 1737-174.

Follow these steps to create seamlines:

  1. Set any data ignore values before editing seamlines.
  2. Click the Seamlines drop-down list and select Auto Generate Seamlines. When processing is complete, the boundaries of the effective mosaic polygons are displayed in green. The following diagram shows a simple example with two images.
  3. When you have more than two scenes, a seamline is generated for each pair of overlapping images:

    The automatically generated seamline provides a starting point for further editing. For best results, you should edit the seamline so that it follows a natural feature such as a road or river. You are not creating a new seamline; instead, you are editing the existing seamline to avoid areas with defects, clouds, etc.

  4. Click the Seamlines drop-down list and select Start editing seamlines.
  5. Stay within the image overlap area and draw a line that crosses the existing seamline in two places. The image below shows an example. Click in multiple spots to define polygon line segments. You can also click-and-drag the cursor to draw a continuous line with many vertices. This produces a more accurate seamline but may increase processing time when previewing and exporting the mosaic.
  6. You can hover the cursor over any vertex until a circle icon appears. Then select an option:
    • Move the vertex to a new location if desired.
    • Right-click and select Delete Vertex to remove the vertex.
    • Right-click and select Add Vertex Before or Add Vertex After to insert a vertex.
  7. Double-click (or press the Enter key) to complete and accept the polygon.
  8. Draw more polygons as needed along the seamline, completing and accepting each polygon.

Here are some more tips for editing seamlines:

Set the Feathering Distance

You can set the feathering distance for one or more scenes, which is the number of pixels across the edge or seamline that scenes will be blended with underlying scenes. You can combine feathering with color correction to create a smoother transition between adjacent scenes in the output mosaic. By default, no feathering is applied until you perform these steps:

  1. Click the Seamlines/Feathering tab.
  2. Choose a Feathering method:
  3. If the Show Preview option is enabled, you can switch between the Edge Feathering and Seamline Feathering options to compare their results. When switching to Edge Feathering, any seamlines you have will be ignored but not lost. Any edits you made to seamlines will be preserved and applied to the output mosaic if you have the Apply Seamines option selected.

  4. Click the Main tab, then scroll to the right in the table of input scenes to the Feathering Distance (Pixels) column.
  5. To edit the Feathering Distance (Pixels) for selected scenes, double-click inside their respective table cells and enter the number of pixels to feather.

Export the Mosaic

  1. Click the Export tab.
  2. From the Output Format drop-down list, select ENVI or TIFF format for the output mosaic.
  3. Choose a directory and filename for the output mosaic. By default, the mosaic raster is saved to the directory specified in ENVI's Temporary Directory preference. The output filename includes the time the file was created. It follows a convention similar to the acquisition time format in ENVI header files.
  4. In the Data Ignore Value field, enter a pixel value that will be used to fill areas where no valid image data appear in the output raster.
  5. The following rules apply:

  6. From the Resampling drop-down list, select one of the following options:
    • Nearest Neighbor: Uses the nearest pixel without any interpolation to create the image.
    • Bilinear: Performs a linear interpolation using four pixels to resample the image.
    • Cubic Convolution: Uses 16 pixels to approximate the sinc function using cubic polynomials to resample the image. Cubic convolution resampling is significantly slower than the other methods.
  7. To select a spectral subset of bands to export, click the Select Output Bands button. Use Ctrl-click or Shift-click to select multiple bands to export in the Select Mosaic Output Bands dialog.
  8. Click OK to create the mosaic.

A mosaic of multispectral images will have a band-interleaved-by-pixel (BIP) interleave. A mosaic of single-band images will have a band-sequential (BSQ) interleave.