BuildMosaicRaster Task

This task builds a mosaic raster based on a set of input rasters.

The virtual raster associated with this task is ENVIMosaicRaster.

See the Before You Begin section of the Seamless Mosaic help topic for tips on acceptable input formats, preprocessing steps, and working with hyperspectral images.

If you use the Export method to save a multi-band mosaic to disk, the output mosaic will have a band-interleaved-by-pixel (BIP) format. This ensures optimal performance during the export step.

Example

The example uses sample images that available from our ENVI Tutorials web page. Click the Mosaic link to download the .zip file to your achine, then unzip the files. Update the file references in the example with the correct locations.

; Start the application

e = ENVI()

 

; Open two aerial photos

File1 = '2002apr01.dat'

Raster1 = e.OpenRaster(File1)

File2 = '2004apr13_warp.dat'

Raster2 = e.OpenRaster(File2)

 

; Get the catalog of ENVITasks

Task = ENVITask('BuildMosaicRaster')

 

; Define inputs

Task.INPUT_RASTERS = [Raster1, Raster2]

Task.COLOR_MATCHING_ACTIONS = ['Reference', 'Adjust']

Task.COLOR_MATCHING_METHOD = 'Histogram Matching'

Task.COLOR_MATCHING_STATISTICS = 'Entire Scene'

Task.FEATHERING_METHOD = 'Edge'

Task.FEATHERING_DISTANCE = 15

Task.DATA_IGNORE_VALUE = 0

 

; Run the task

Task.Execute

 

; Get the collection of data objects currently available in the Data Manager

DataColl = e.Data

 

; Add the output to the Data Manager

DataColl.Add, Task.OUTPUT_RASTER

 

; Display the result

View = e.GetView()

Layer = View.CreateLayer(Task.OUTPUT_RASTER)

View.Zoom, /FULL_EXTENT

Syntax

Result = ENVITask('BuildMosaicRaster')

Input parameters (Set, Get): COLOR_MATCHING_ACTIONS, COLOR_MATCHING_METHOD, COLOR_MATCHING_STATISTICS, DATA_IGNORE_VALUE, FEATHERING_DISTANCE, FEATHERING_METHOD, INPUT_RASTERS, OUTPUT_RASTER_URI, SEAMLINE_METHOD

Output parameters (Get only): OUTPUT_RASTER

Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.

Input Parameters

COLOR_MATCHING_ACTIONS (optional)

Set this parameter to an array of strings that indicates how each element of the INPUT_RASTERS array should be treated with regard to color matching: as a reference image, an adjusted image, or no color matching. The number of elements in this array must match the number of input scenes in the INPUT_RASTERS array. Valid strings are as follows; these are not case-sensitive.

By default, the first scene in the INPUT_RASTERS array is set to the reference image. All other images are set to Adjust.

Suppose that you define an array of input scenes as follows:

scenes = [raster1, raster2, raster3, raster4]

If you want raster2 to be the reference image, set this parameter as follows:

Task.COLOR_MATCHING_ACTIONS = ['Adjust', 'Reference', 'Adjust', 'Adjust']

COLOR_MATCHING_METHOD (optional)

Set this parameter to a string that indicates the color matching method to perform.

COLOR_MATCHING_STATISTICS (optional)

Set this parameter to one of the following strings indicating what parts of the reference and adjusted images are used to compute statistics for color matching, if COLOR_MATCHING_METHOD is set to Histogram Matching.

DATA_IGNORE_VALUE (optional)

Set this parameter to a pixel value that will be used to fill areas where no valid data appear in the output raster. The following rules apply:

You can set the data ignore value to an NaN (not a number) value as follows:

Task.DATA_IGNORE_VALUE = !VALUES.F_NAN

FEATHERING_DISTANCE (optional)

Set this parameter to an array of integers indicating the number of pixels used for edge or seamline feathering for each INPUT_RASTER. The number of elements in this array must match the number of input scenes in the INPUT_RASTER array. Set values to 1 or greater.

FEATHERING_METHOD (optional)

Set this parameter to one of the following strings that indicates the feathering method to use:

If you set this parameter to a value other than None, you must also specify FEATHERING_DISTANCE. If you set this parameter to Seamline, you must also set the SEAMLINE_METHOD parameter.

INPUT_RASTERS (required)

Specify an array of rasters to mosaic.

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path to export the associated OUTPUT_RASTER.

RESAMPLING (optional)

Specify the resampling method to use when creating the spatial grid:

Cubic convolution resampling is significantly slower than the other methods.

SEAMLINE_METHOD (optional)

Set this parameter to a string that indicates the method used to automatically generate seamlines:

If SEAMLINE_METHOD is set to Geometry, then FEATHERING_METHOD must be set to Seamline.

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.

Output Parameters

OUTPUT_RASTER

This is a reference to the output raster of filetype ENVI.

If you use the Export method to save a multi-band mosaic to disk, the output mosaic will have a band-interleaved-by-pixel (BIP) interleave format. This ensures optimal performance during the export step.

Methods

Execute

Parameter

ParameterNames

Properties

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History

ENVI 5.3

Introduced

ENVI 5.4. 1

Renamed the BACKGROUND parameter to DATA_IGNORE_VALUE

ENVI 5.5

OUTPUT_RASTER_URI now supports '*', which allows OUTPUT_RASTER to be virtual output.

See Also

ENVITask, ENVIMosaicRaster, Masking Support in ENVITasks