MOSAIC

Image Mosaicking


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


Moves image data from an input image database file to an output image database file. The mosaicking process may be controlled by a vector segment defining the mosaic cutline. In addition, the input image database data may be modified by a lookup table before it is moved to the output database.
Back to top

Parameters


Name Type Caption Length Value range
FILI * String Input file name 1 - 192  
DBIC * Integer Input raster channel(s) 1 -    
DBVS Integer Input vector segment 0 - 1  
DBLUT Integer Input Lookup Table 0 -    
FILO * String Output file name 1 - 192  
DBOC * Integer Output raster channel(s) 1 -    
BLEND Float Blend distance 0 - 1 0 -
Default: 0
BACKVAL Float Background gray-level value 0 - 1 Default: 0
MONITOR String Monitor mode 0 - 3 ON, OFF
Default: ON

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the file that contains the input data to be processed. FILI and FILO must overlap in their georeference bounds.

DBIC

Specifies the input channel(s) to read from FILI and move to FILO.

DBVS

Specifies the vector segment in the input file (FILI) that defines the line to use for mosaicking.

If no vector segment is specified, the input data from FILI is moved to and overwrites the corresponding data in FILO.

If this parameter is specified, the vector segment units must be the same as the georeferencing units for the input (FILI) and output (FILO) files. The vector segment containing the cutline must consist of a SINGLE line with three or more vertices that define a polygon of the area of interest for FILI. If it does not form a closed polygon, MOSAIC assumes that it closes between the last and first vertices.

Note: If the vector segment has more than one structure, MOSAIC will print a warning ("E108"), indicating that it will use only the first structure in the segment. The polygon should contains less than 1023 vertices.

DBLUT

Specifies the lookup table segment from the input file (FILI) to modify the input image data before it is moved to the output file (FILO). If this parameter is not defined, the image data from FILI is moved unchanged to FILO.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

FILO

Specifies the name of the file to receive the output data.

FILO must already exist before running MOSAIC. FILI and FILO must overlap in their georeference bounds.

Note: Use the CREMOS script if you have a list of georeferenced files and you want to create an output file that will hold all the images.

DBOC

Specifies the output channel(s) in the output file (FILO) to receive the output image data.

BLEND

Specifies the distance from the mosaic cutline for blending pixel values from the input (FILI) and output (FILO) files. If defaulted, no blending is applied.

If defined, the specified value indicates will be the distance in FILO pixels for weighting the FILI and FILO data in the overlap area; that is, where the FILO pixels are not equal to the background gray-level value defined by BACKVAL, which by default is zero.

BLEND makes the mosaic seam less visible by weighting the FILI and FILO pixels within the specified distance of the mosaic cutline. For example, FILI pixels outside and on the blend distance from the FILI side of the cutline are given full weighting and are moved unchanged. Approaching the cutline, the FILI pixels are sequentially given less weight (but more than non-background FILO pixels) until at, the cutline, the FILI and non-background FILO pixels have equal weighting. Moving away from the FILI coverage, more weighting is assigned to non-background FILO pixels up to and beyond the BLEND distance on the FILO side of the cutline, where the FILO pixels will have full weighting.

If BLEND extends outside the overlap area, it will have no effect; that is, there can only be blending where there is both FILI and non-background FILO data.

BACKVAL

Specifies the gray-level value in the output file (FILO) for non-image background data.

Normally, FILO should be cleared using the CLR function after it is created and before any image data is moved to it. In such a case, BACKVAL should be set to the value (VALU) used to initialize the FILO channel. If BACKVAL is not defined, it is assumed to be zero.

MONITOR

The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.

Available options are:

Back to top

Details

MOSAIC transfers image data from an image channel (DBIC) on the input file (FILI) to an image channel (DBOC) on the output file (FILO). FILI and FILO must overlap in their georeference bounds.

MOSAIC is normally used to mosaic imagery that has been already geometrically corrected, and it is assumed the imagery in "Input" and "InputMaster" have the same pixel size and are on the same grid. MOSAIC does NOT resample the input imagery or geometrically correct it to the output imagery. If a geometric correction is required, use a geometric correction program such as REG prior to running MOSAIC.

It is worth noting that if the FILI (Input) image was produced by an averaging resampling method (for example, bilinear interpolation or cubic convolution, but not nearest neighbor), the pixels near the edges may be darker or lighter than the interior pixels. This may result from reusing, and in effect weighting, the edge pixels where the averaging window extends beyond the input image bounds. In such a case, the seam might be visible on output from MOSAIC, even with blending. To avoid this, one could move a subarea of the output image from REG, minus the edge pixels where the images are to be mosaicked, to a second image using the III function before running MOSAIC.

MOSAIC patches together the imagery to minimize any visible seams. This may be achieved by using one or more of the following functions:
  1. Defining a mosaic cutline with one vector from a vector segment (DVBS/InputVector) on FILI. The units of the vector segment will be in the same units (for example, UTM) as the georeferencing units of FILI (Input) and FILO (InputMaster). The cutline will be one vector with three or more vertices that define a polygon of the area of interest for FILI. If it does not form a closed polygon, MATCH assumes that it closes between the last and first vertices.

    It is worth noting that the processing for the vector data is sequential for each pixel in the overlap area where there is FILI and non-background FILO data; the more vertices there are in the cutline, the greater the processing time for the mosaicking. If DBVS (InputVector) is defaulted so that no mosaic cutline is defined, the FILI imagery data will simply overwrite the corresponding image data in FILO.

  2. Modify the input image data using a lookup table (DBLUT/InputLUT) from the input file. If DBLUT (InputLUT) is defined, the input image data is transformed by that lookup table before it is blended and/or moved to the output file.

  3. Define a blend distance (BLEND) from the defined mosaic cutline. If BLEND (BlendDistance) is defined, a weighting is assigned to the FILI and FILO image data (if the FILO data is not equal to BACKVAL/BackVal), depending on its distance from the cutline.

    For example, FILI pixels outside and on the blend distance from the FILI side of the cutline are given full weighting and are moved unchanged. Approaching the cutline, the FILI pixels are sequentially given less weight (but more than non-background FILO pixels) until at, the cutline, the FILI and non-background FILO pixels have equal weighting. Moving away from the FILI coverage, more weighting is assigned to non-background FILO pixels up to and beyond the BLEND distance on the FILO side of the cutline, where the FILO pixels will have full weighting.

Back to top

Example

In the following example, the file "eltoro.pix" is mosaicked into the file "irvine.pix".

It is assumed that the image data for both files have the same pixel size and are on the same grid. Because the mosaicking options (DBVS, DBLUT and BLEND) are defaulted, the second file's imagery will overwrite the first file's imagery where they overlap.

EASI>fili	=	"eltoro.pix"
EASI>dbic	=	1	! use channel 1
EASI>dbvs	=		! default, no cutline defined
EASI>dblut	=		! default, no lookup table
EASI>filo	=	"irvine.pix"
EASI>dboc	=	1	! overwrite channel 1
EASI>blend	=		! default, no blending
EASI>backval	=		! default, 0

EASI>R MOSAIC
      

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.