| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Related |
| Back to top |
| Back to top |
mosaic(fili, dbic, dbvs, dblut, filo, dboc, blend, backval)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | str | Input file name | 1 - | |
| DBIC * | List[int] | Input raster channel(s) | 1 - | |
| DBVS | List[int] | Input vector segment | 0 - 1 | |
| DBLUT | List[int] | Input Lookup Table | 0 - | |
| FILO * | str | Output file name | 1 - | |
| DBOC * | List[int] | Output raster channel(s) | 1 - | |
| BLEND | List[float] | Blend distance | 0 - 1 | 0 - Default: 0 |
| BACKVAL | List[float] | Background gray-level value | 0 - 1 | Default: 0 |
| Back to top |
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.
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.
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.
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.
| Back to top |
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.
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.
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.
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 |
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.
from pci.mosaic import mosaic fili = "eltoro.pix" dbic = [1] # use channel 1 dbvs = [] # default, no cutline defined dblut = [] # default, no lookup table filo = "irvine.pix" dboc = [1] # overwrite channel 1 blend = [] # default, no blending backval = [] # default, 0 mosaic( fili, dbic, dbvs, dblut, filo, dboc, blend, backval )
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.