Previous ENVI User's Guide: Map Tools Next

Image Mosaicking

Use mosaicking to overlay two or more images that have overlapping areas (typically georeferenced) or to put together a variety of non-overlapping images and/or plots for presentation output (typically pixel-based). Individual bands, entire files, and multi-resolution georeferenced images can be mosaicked. You can use your mouse or pixel- or map-based coordinates to place images in mosaics and you can apply a feathering technique to blend image boundaries. You can save the mosaicked images as a virtual mosaic to avoid having to save an additional copy of the data to a disk file. Mosaic templates can also be saved and restored for other input files.

Building Pixel-Based Mosaics

Select Map  Mosaicking  Pixel Based. The Pixel-Based Mosaic window appears.

Importing Images

Use the Import menu to choose input bands for the mosaic.

  1. Select either Import  Import Files or Import  Import Files and Edit Properties. Use the second option if you want to enter a background see-through value, perform feathering, position the image on input, select which bands will appear in the mosaic display, or perform color balancing.
  2.  

  3. When the Mosaic Input File dialog appears, select the file or files and perform any spatial and spectral subsetting. For subsetting details, see "Selecting a Spatial Subset" and Selecting a Spectral Subset.
  4.  


    Note
    Individual bands or entire files can be mosaicked.

     

    To select individual bands, click the Select By arrow toggle button in the Mosaic Input File dialog to select Band.

     

  5. When you have selected the data to import, click OK.
  6.  

  7.  

    Figure 10-1: Image Mosaicking Dialog for Pixel-Based Image Mosaics

    Figure 10-1: Image Mosaicking Dialog for Pixel-Based Image Mosaics
    If you selected Import Files and Edit Properties, a dialog for each file selected appears that allows you to set the following parameters:
    • Enter a background see-through value to make pixels with that value transparent so that the underlying image is visible. (Use for mosaicking of images with constant DN value borders).
    •  


      Note
      The background value mask is built from the first band used in the file. If a pixel in the first band used contains this background value, then that pixel will be masked out for all bands in the mosaicking process.

       

    • Enter feathering parameters as needed (For more information, see Feathering).
    •  

    • Enter the upper-left coordinates in the Xoffset and Yoffset text boxes, in pixels, to position the image in the mosaic, or optionally use the x/ystart values from the header to compose a relative start location.
    •  

    • Use the arrow toggle button to select whether to display a Gray Scale or RGB color image in the mosaicking window. Enter the desired band numbers to display in the appropriate text boxes. Select the linear stretch percentage for the displayed bands by entering a value or clicking on the appropriate arrow increment buttons.
    •  

    • Select whether to apply color balancing to the images by clicking the No, Fixed, or Adjust button (see Color Balancing Images).

     

  8. The Select Mosaic Size dialog appears. Enter the desired output size of the mosaic image, in pixels, in the Mosaic X Size and Mosaic Y Size text boxes. A subsampled image will appear in the Mosaic window for each file imported.
  9.  

  10. Import other files as needed. Each image name and the outline color are listed below the mosaic image.

Positioning Images

The coordinates for the upper-left corner of the input image are listed in the X0 Y0 text boxes at the bottom of the Pixel Based Image Mosaicking dialog. Images with x start and y start values in their headers are automatically placed in the mosaic with the defined offset. Select from the following options:

Color Balancing Images

Use Color Balancing to match the statistics from one image to another (or many others) to balance the data range between different images. Gains and offsets are calculated from the fixed image and applied to the adjusted images so the adjusted images end up with the same statistical range. Gains and offsets are calculated individually for each band in the file. The statistics can be obtained from entire images or only from overlapping areas. To apply color balancing to a mosaic do the following.


Note
If you have data values to ignore, you must set a Data value to ignore value in the Edit Entry dialog so they will not be included in the calculated statistics.

  1. Right-click on one of the images and select Edit Entry.
  2.  

  3. Select the Fixed button under Color Balancing. This image will be used to calculate statistics only and will not be adjusted.
  4.  

  5. Click on the image to adjust and select Edit Entry from the right-click menu.
  6.  

  7. Select the Adjust button under Color Balancing.
  8.  

  9. Select Fixed or Adjust for any other images, as desired.
  10.  

  11. Select File  Apply to apply the color balancing and mosaicking.
  12.  


    Note
    Color balancing cannot be done when using virtual mosaics.

     

  13. When the Mosaic Parameters dialog appears, use the arrow toggle button to select whether to use the entire image or to use only the overlapping areas for statistics calculations. When there is a significant area of overlap, the best results are usually achieved by choosing only the overlapping areas for statistics calculations.
  14.  

  15. Enter a background DN value.
  16.  


    Note
    The background value mask is built from the first band used in the file. If a pixel in the first band used contains this background value, then that pixel will be masked out for all bands in the mosaicking process.

     

  17. When creating a mosaic of grayscale and RGB images, you can apply one band images as RGB. Doing this, in addition to color balancing creates an RGB mosaic where the grayscale images blend well with the color images.
  18.  

  19. Enter an output filename and click OK.

The resulting color balanced mosaic will appear in the Available Bands List.

The Mosaicking Right-Click Menu

Use the mosaicking right-click menus to change the image layer levels, edit image parameters or to remove an image from the mosaic.


Note
Right-click in the part of the mosaic window without an image to display a menu containing the Import and Options menu items.

Bringing an Image to the Front

To bring an image to the front of all other images in the mosaic:

  1. Click on either the image name or on the image thumbnail.
  2.  

  3. Right-click and select Raise Image to Top.
  4.  


    Note
    If the image is already on top, this Raise Image to Top option will not be available. You can raise or lower an image one level by selecting Raise Image One Position or Lower Image One Position from the right-click menu.

Editing Image Entry Parameters

To edit the background see-through value, feathering parameters, positioning, or displayed band:

  1. Click on either the image name or on the image thumbnail.
  2.  

  3. Right-click and select Edit Entry. For parameter descriptions see Importing Images.
Removing an Image

To remove an image from the mosaic:

  1. Click on either the image name or on the image thumbnail.
  2.  

  3. Right-click and select Remove Entry.

Pixel-Based Mosaicking Options

Use the Options menu to change mosaic size, select positioning options, turn on/off the image frame graphics, and to clear all the entries.

Changing the Mosaic Size

To enter a new size, in pixels, for the mosaic:

  1. Select Options  Change Mosaic Size. The Mosaic Size dialog will appear.
  2.  

  3. Enter the desired size, in pixels, in the Xsize and Ysize text boxes.
Positioning Images

To place the images into a grid, center the images, or lock the image positions so they can be moved as a group, see Positioning Images.

Using Thumbnail Images

To turn on/off the thumbnail images displayed in the mosaic window, select Options  Use Thumbnail Images menu item.

Turning On/Off Image Frames

To turn the colored graphic frames around the images in the mosaic off or on, select Options  Image Frames.

Clearing Entries

To clear all the entries from the mosaic, select Options  Clear All Entries.

Creating Virtual Mosaics

It is not necessary to save the mosaic to an output file unless feathering or color balancing was used. Instead, you can save the mosaic to a virtual mosaic. ENVI uses a virtual mosaic file (saved mosaic template) like an image file. When a virtual mosaic template file is opened, ENVI opens the individual image files that make up the mosaic and puts them together on-the-fly. ENVI cannot do feathering or color balancing on-the-fly, however. The mosaic template file can be displayed in ENVI and annotated, stretched, etc., like any other image. Using a virtual mosaic prevents having multiple files containing the same images and therefore saves disk space.

  1. In the Pixel Based Image Mosaicking dialog, select File  Save Template.
  2.  

  3. In the Output Mosaic Template dialog, enter an output filename with the extension .mos for consistency.
  4.  

  5. Choose whether to open the new virtual mosaic file.

The template file is a virtual mosaic file in ASCII format. It contains the mosaic size, filenames, bands used, data dimensions, and mosaic information. The Info field has the X and Y offsets, edge feathering distance, cutline feathering distance, and data value to ignore.

The mosaic template file appears in the Available Bands List and can be used as input for processing with other functions.


Note
The template file can be edited, using any text editor, to change the file or the bands used in the mosaic.

Restoring Saved Templates
  1. Select File  Restore Template.
  2.  

  3. When an ENVI file selection dialog appears, select the desired .mos filename to load into the mosaic.
  4.  

    Replace the files with new images by using Options  Replace Entry or edit the filenames in the ASCII .mos file (see Creating Virtual Mosaics).

Opening Virtual Mosaics

To open a virtual mosaic (saved template):

  1. From the ENVI main menu bar, select File  Open Image File.
  2.  

  3. In the file selection dialog, select the .mos file.

The virtual mosaic file and the files that make up the virtual mosaic are listed in the Available Bands List.

Building Mosaics

Use Apply to build a mosaic after all of the images for the mosaic are positioned. Building the mosaic outputs the mosaic to a file.


Note
It is not necessary to build the mosaic to an output file unless feathering or color balancing was used. The mosaic can be saved as a virtual mosaic to save time and disk space (see Creating Virtual Mosaics).

  1. Select File  Apply. The Mosaic Parameters dialog appears:
  2.  

  3. Select output to File or Memory.
  4.  

  5. Select the desired background DN value (DN value for areas without image) for the output mosaic.
  6.  


    Note
    The background value mask is built from the first band used in the file. If a pixel in the first band used contains this background value, then that pixel will be masked out for all bands in the mosaicking process.

     

  7. If color balancing is selected, use the arrow toggle button to select whether to use the entire image or to use only the overlapping areas for statistic calculations.
  8.  

  9. Click OK to start the mosaicking operation.

A status window displays the percent complete while the mosaic is being built. The mosaic name appears in the Available Bands List upon completion.

Closing the Dialog

To close the Pixel Based Mosaic dialog, select File  Cancel.

Building Georeferenced Mosaics

Use Georeferenced Mosaicking to automatically overlay multiple georeferenced images. You can mosaic multi-resolution georeferenced images, apply feathering and color balancing to the images, and import georeferenced images and non-georeferenced images into the same mosaic.

  1. To build mosaics using georeferenced images, select Map  Mosaicking  Georeferenced.
  2.  

  3. The Map Based Mosaic dialog appears. Use the dialog to set the output mosaic parameters and to select images to mosaic.

 

Figure 10-2: Image Mosaicking Dialog for Georeferenced Image Mosaics

Figure 10-2: Image Mosaicking Dialog for Georeferenced Image Mosaics

Importing Images

Use the Import menu to select input files for the mosaic. The first image imported into the mosaic must be a georeferenced image. The mosaic size will be set to the georeferenced image size.

  1. Select either Import  Import Files or Import  Import Files and Edit Properties. Use the second option if you wish to enter a transparent background value, perform feathering, select which bands will appear in the mosaic display, or to perform color balancing.
  2.  


    Note
    The background value mask is built from the first band used in the file. If a pixel in the first band used contains this background value, then that pixel will be masked out for all bands in the mosaicking process.

     

  3. When the Mosaic Input File dialog appears, select a file or files and perform any spatial and spectral subsetting. For subsetting details, see "Selecting a Spatial Subset" and Selecting a Spectral Subset.
  4.  


    Note
    Individual bands or entire files can be mosaicked.

     

    To select individual bands click the Select By arrow toggle button in the Mosaic Input File dialog to select Band.

     

    When you select the first input file for the mosaic, a thumbnail image will appear and the mosaic size is set.

     

  5. If you selected Import Files and Edit Properties a dialog for each file selected appears that allows you to set the following parameters:
    • Enter a transparent background value to make pixels with that value transparent so that the underlying image is visible (Use for mosaicking of images with constant DN value borders).
    •  


      Note
      The background value mask is built from the first band used in the file. If a pixel in the first band used contains this background value, then that pixel will be masked out for all bands in the mosaicking process.

       

    • Enter feathering parameters as needed (For more information, see Feathering).
    •  

    • Use the arrow toggle button to select whether to display a Gray Scale or RGB color image in the mosaicking window. Enter the desired band numbers to display in the appropriate text boxes. Select the linear stretch percentage for the displayed bands by entering a value or clicking on the appropriate arrow increment buttons.
    •  

    • Select whether to apply color balancing to the images by clicking the No, Fixed, or Adjust button (see Color Balancing Images).

     

  6. Import additional georeferenced images to the mosaic as needed.
  7.  

    Georeferenced images are automatically positioned within the output mosaic according to their geographic coordinates. New images are placed in front of the other images and the mosaic size is automatically adjusted to accommodate the new images. If a properly georeferenced image is imported with map coordinates that lay outside the current map extent of the mosaic, the mosaic size is automatically changed to include the new image location.

     

    For multi-resolution mosaicking, the output pixel size is entered on output and ENVI automatically resamples the lower resolution images to match.

     

  8. Import additional non-georeferenced images as needed. These images can be positioned in the same manner as Pixel Based Mosaicking (for more information, see Positioning Images). Each image name and the outline color are listed below the mosaic image.
  9.  


    Note
    You cannot adjust the mosaic positions of georeferenced images.

The Mosaicking Right-Click Menu

Use the mosaicking right-click menus to change the image layer levels, edit image parameters or to remove an image from the mosaic.


Tip
Right-click in the part of the mosaic window without an image to access the Import and Options menus.

Georeferenced Image Mosaicking Options

Use the Options menu to change the base projection, turn on/off the thumbnail images, turn on/off the colored image frame graphics, and to clear all the entries.


Note
The other unavailable options on this menu are used only in Pixel Based Mosaicking.

Changing the Base Projection

To change the base projection of the images, select Options  Change Base Projection. Select the new projection and enter the necessary parameters (for more information, see Selecting Map Projection Types).

Using Thumbnail Images

To turn on/off the thumbnail images displayed in the mosaic window, select Options  Use Thumbnail Images menu item.

Turning On/Off Image Frames

To turn off or on the graphic frames around the images in the mosaic, select Options  Image Frames.

Clearing Entries

To clear all the entries from the mosaic, select Options  Clear All Entries.

Creating Virtual Mosaics

It is not necessary to save the mosaic to an output file unless feathering, multi-resolution data, or color balancing were used. Instead, you can save the mosaic to a virtual mosaic. ENVI uses a virtual mosaic file (saved mosaic template) like an image file. When a virtual mosaic template file is opened, ENVI opens the individual image files that make up the mosaic and puts them together on-the-fly. ENVI cannot do feathering, multi-resolution resampling, or color balancing on-the-fly, however. The mosaic template file can be displayed in ENVI and annotated, stretched, etc., like any other image. Using a virtual mosaic prevents having multiple files containing the same images and therefore saves disk space.

  1. In the Georeferenced Image Mosaicking dialog, select File  Save Template.
  2.  

  3. In the Output Mosaic Template dialog, enter an output filename with the extension .mos for consistency.
  4.  

  5. Choose whether to open the new virtual mosaic file.

The template file is a virtual mosaic file in ASCII format. It contains the mosaic size, filenames, bands used, data dimensions, and mosaic information. The Info field has the X and Y offsets, edge feathering distance, cutline feathering distance, and data value to ignore.

The virtual mosaic option appears in the Available Bands List and can be used as input for processing with other functions.

Restoring Saved Templates
  1. Select File  Restore Template.
  2.  

  3. When an ENVI file selection dialog appears with all the .mos files listed by default, select the desired filename to load that template into the mosaic.
Opening Virtual Mosaics

To open a virtual mosaic (saved template):

  1. From the ENVI main menu bar, select File  Open Image File.
  2.  

  3. In the file selection dialog, select the .mos file.

The virtual mosaic file and the files that make up the virtual mosaic are listed in the Available Bands List.

Building Mosaics

Use Apply to build a mosaic after all of the images for the mosaic are positioned. Building the mosaic outputs the mosaic to a file.


Note
It is not necessary to save the mosaic to an output file unless feathering, multiresolution data, or color balancing were used. The mosaic can be saved as a virtual mosaic file to save time and disk space (see Creating Virtual Mosaics).

  1. Select File  Apply. The Mosaic Parameters dialog appears with the output pixel size defaulted to the highest resolution of input images. ENVI automatically resamples lower resolution images to match. Non-georeferenced images in the mosaic are not resampled.
  2.  

    To change the output pixel size, enter the desired size in map units (i.e. meters, degrees, etc.) in the appropriate text boxes.

     

  3. Select the type of multi-resolution resampling (nearest neighbor, bilinear, or cubic convolution) from the Resampling menu. Nearest Neighbor resampling is recommended.
  4.  

  5. Select output to File or Memory.
  6.  

  7. Enter the desired background DN value for the output mosaic.
  8.  


    Note
    The background value mask is built from the first band used in the file. If a pixel in the first band used contains this background value, then that pixel will be masked out for all bands in the mosaicking process.

     

  9. If color balancing is selected, use the arrow toggle button to select whether to use the entire image or to use only the overlapping areas for statistics calculations.
  10.  

  11. Click OK to start the mosaicking operation.

A status window showing the percent complete appears while the mosaic is being built. The mosaic name will appear in the Available Bands List when completed.

Closing the Dialog

To exit the Georeferenced Image Mosaicking dialog, select File  Cancel.

Feathering

Use Feathering to blend the edges of overlapping areas in input images for pixel-based and georeferenced mosaicking. The two types of feathering in ENVI are edge feathering and cutline feathering.


Tip
To use feathering when mosaicking images, import the bottom image without feathering. Import the overlapping images with edge or cutline feathering as desired.

Using Edge Feathering

Use edge feathering to blend the edge of a top image with the bottom image based on a specified blending distance (see Figure 10-3). The distance specified is used to create a linear ramp that averages the two images across that distance. For example, if the specified distance is 20 pixels, 0% of the top image is used in the blending at its edge and 100% of the bottom image is used to make the output image. At the specified distance (20 pixels) into the image from the edge, 100% of the top image is used to make the output image and 0% of the bottom image is used. 50% of each image is used to make the output at 10 pixels in from the edge.

Figure 10-3: Example of Edge Feathering

Figure 10-3: Example of Edge Feathering

  1. In the mosaic dialog, select Import  Import Files and Edit Properties or right-click on the image and select Edit Entry. The Entry dialog appears.
  2.  

  3. In the Edge feathering distance (pixels) text box, enter the distance over which to blend the images.

Using Cutline Feathering

Use Cutline feathering to blend the boundary between two overlapping images based on a user-defined cutline. A specified blending distance is used to blend the images along the cutline (see ).


Note
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 placed in the region of the image that will be cut off (see Annotating Images).

The 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. 50% of each image is used to make the output at 10 pixels out from the cutline.

  1. In the mosaic dialog, select Import  Import Files and Edit Properties or right-click on the image and select Edit Entry.
  2.  

  3. When the Entry dialog appears, click Select Cutline Annotation File and select an annotation file.
  4.  

  5. In the Feathering Distance text box that appears in the Cutline Feathering Frame, specify the distance used to blend the image boundaries.
  6.  

    Figure 10-4: Example of Cutline Feathering

    Figure 10-4: Example of Cutline Feathering

The cutline will appear as a graphic overlaid on the image.

Opening Mosaic Tiled QuickBird Files

Large QuickBird datasets are split into tiles. A QuickBird tile file (.til) is usually provided as a descriptive header for these tiles. The tile file contains information about the number of tiles, the name of each tile, and their spatial relationship to one another. ENVI uses this file to access the tiles and automatically create a virtual mosaic of the entire dataset. The resulting dataset can then be used as a single entity within ENVI.

To read a QuickBird tile file and automatically create a virtual mosaic of its tiles, use the steps in Opening Mosaic Tiled QuickBird Files.

  ENVI Online Help (August 12, 2005)