| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Examples :: Related |
| Back to top |
| Back to top |
imgfuse(fili_ref, fili_org, fili_loc, dbic_ref, dbic_org, filo, dbseg, maxgain, ksize)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI_REF * | str | Input reference image | 1 - 191 | |
| FILI_ORG * | str | Input target image | 1 - 191 | |
| FILI_LOC | str | Input locked image | 0 - 191 | |
| DBIC_REF * | List[int] | Input reference channel(s) | 1 - 1 | |
| DBIC_ORG * | List[int] | Input target channel(s) | 1 - 16 | |
| FILO * | str | Output image | 1 - 191 | |
| DBSEG | List[int] | Transformation channel | 0 - 1 | |
| MAXGAIN | List[int] | Maximum model gain | 0 - 1 | Default: 3 |
| KSIZE * | List[int] | Kernel length | 1 - 1 |
| Back to top |
FILI_REF
Specifies the name of file that contains the hi-resolution reference image.
FILI_ORG
Specifies the name of the low-resolution target image file to be enhanced.
FILI_LOC
Specifies the name of the (locked) low-resolution reference file, which was created by downsampling the hi-resolution file with IMGLOCK.
If the input reference (FILI_REF), and original image (FILI_ORG) file are georeferenced and share a compatible georeferencing system, this parameter may be omitted; a working locked file will be created and discarded when the function runs.
DBIC_REF
Specifies the input channel in FILI_REF that contains the hi-resolution reference image.
DBIC_ORG
Specifies the input low-resolution image channel(s) in FILI_ORG to be transformed to hi-resolution. All channels specified must be of the same type.
FILO
Specifies the name of the new hi-resolution file to be created, which will contain the transformed image channels from the low-resolution target file. The output file is automatically created and must not already exist.
DBSEG
Specifies the text segment in the input locked image file (FILI_LOC) that contains the forward and backward transformations on the low-resolution reference file. This segment is generated by TRANSFRM run by the IMGLOCK script.
If the input images are compatibly georeferenced, the FILI_LOC (InputLock) and DBSEG (TransferText) parameters may be omitted; a low-resolution image and transformation will be prepared based on the georeferencing.
If this parameter is not specified, the first text segment in the input locked file (FILI_LOC) will be used. This parameter only needs to be set if the locked image file contains more than one transformation segment.
MAXGAIN
Specifies the maximum model gain to be used for the modeling process for the CROSSMOD task.
KSIZE
Specifies the size of the linear kernels over which the cross correlation modeling is performed. Correlation is done on a window of size ((2 x KSIZE + 1) x 3) pixels.
| Back to top |
IMGFUSE takes a low- and high-resolution precision registered image pair (FILI_ORG and FILI_LOC respectively) and, using the high-resolution image as a reference, enhances the resolution and features of the low-resolution image.
The end result is a copy of the low-resolution image that has had its resolution enhanced with detail from the high-resolution image.
Unlike IHS-type resolution enhancements, the ImageLock Data Fusion mechanism preserves radiometric values on each band individually; there is no mixing across bands. The resulting data can be used in classification and other statistical calculations because the low-frequency information and radiometric values have been preserved.
The IMGFUSE procedure is designed to make image fusion (resolution enhancement) convenient to use, by automating all the necessary cross-modeling and registration steps.
Overview
IMGFUSE is typically run after running IMGLOCK to lock the low- and high-resolution images. The result of the IMGLOCK process is a precision-corrected low-resolution copy of the high-resolution image; the image also contains transformation information in a text segment (DBSEG), describing the resolution transformations between the low- and high-resolution images.
If the low-resolution (FILI_ORG), and high-resolution (FILI_REF) images are already geocoded products, the image-locking process (IMGLOCK) may be omitted, and IMGFUSE can be run directly. In this case, the FILI_LOC and DBSEG parameters can be defaulted; the required information will be derived from the geocoded images. For this process to work, the geocoded images must be in the same georeferencing system; they cannot be in different projections.
A flow diagram is provided in the Details section.
The procedure loops through each selected channel in the target image, first performing a cross-modeling (CROSSMOD), which produces B0 and B1 images. These temporary B0 and B1 images are then passed through NEWGCP to generate appropriate GCP segments to upsample the images. Next, each image is registered using a 2nd order registration, and the resulting images are combined with the source image to produce a statistically equivalent target image of enhanced resolution.
The IMGFUSE run time is dominated by the cost of the image cross-correlation (CROSSMOD), which must be done for each channel processed.
In circumstances where a lot of rotation is being applied as the target image is resampled to match the reference image, the REG function may report that it is thrashing. This is not an error, and it will eventually complete, but setting the MEMSIZE parameter to a larger value may speed up the process, as described in the REG function documentation.
The linear relationship between the two input images is determined by applying a least-squares method to the window of data determined by KSIZE (Kernel Length). This relationship is characterized by a gain and offset (that is, contrast and brightness). The gain shows the amount of contrast change between the original image (FILI_ORG) and the locked image (FILI_LOC). MAXGAIN is the upper limit of the gain values. If a gain is found that is larger than MAXGAIN, the original data from FILI_ORG is passed into the output via unity gain and zero offset settings. This helps to keep uncorrelated detail (new buildings, roads, etc.) from being transferred from the high-resolution reference image to the output image.
Lower values of MAXGAIN reduce the tendency of the algorithm to introduce noise into otherwise low-texture or structured areas such as water regions. If MAXGAIN is too low however, too much of the original data from FILI_ORG will be passed through to the output, decreasing the amount of detail used to enhance the output image.
A typical starting point for MAXGAIN is 3. If there is resulting noise in the water regions, reduce this value. Reducing MAXGAIN to less than 1 will result in blurred edges. MAXGAIN has a range of 0 to 256, but the general operating range is from 1 to 10.
Correlation is done on a window of size ((2 x KSIZE + 1) x 3) pixels centered around pixel p.
Horizonal Kernel Vertical Kernel
+-+-+-+ ^
| | | | |
+-+-+-+-+-+-+-+ ^ +-+-+-+ |
| | | | | | | | | | | | | | KSIZE
+-+-+-+-+-+-+-+ | +-+-+-+ |
| | | |p| | | | | 3 pixels | | | | |
+-+-+-+-+-+-+-+ | +-+-+-+ v
| | | | | | | | | | |p| |
+-+-+-+-+-+-+-+ v +-+-+-+ ^
<-----> <-----> | | | | |
KSIZE KSIZE +-+-+-+ |
| | | | | KSIZE
+-+-+-+ |
| | | | |
+-+-+-+ v
<----->
3 pixels
For each pixel, the correlation coefficient is calculated for both the horizontal and vertical kernels (see figure above), but only the coefficient with the highest merit is used. If the merit falls below a certain level, showing that there is not a linear relationship between the two images, the original data from FILI_ORG will be used in the output.
In general, it is important to keep KSIZE small enough to reduce the effects of nearby edges, yet large enough to obtain a statistically accurate correlation coefficient. The effect of nearby edges or structures on the correlation coefficient will be reduced by keeping KSIZE small. This will allow CROSSMOD to get a more accurate reading of the local correlation coefficient. KSIZE cannot be too, because a large enough sampling of local pixels is requiered to provide a statistically accurate correlation coefficient. If KSIZE is too large, nearby edges and structures will offset the correlation coefficient. Using a KSIZE of less than 3 will produce noisier images because the kernel is not large enough to calculate a statistically accurate correlation, while sizes greater than 7 may blur edges because of the offset in the correlation due to nearby edges. The correct KSIZE to use depends on the amount of structure and detail in the image.
Disk space
IMGFUSE requires considerable temporary disk space in the current working directory while processing. Approximately 2 to 3 times the size of one channel from the high-resolution reference image will be required, as well as space for the output file, which will be N times the size of the hi-resolution reference image (where N is the number of channels from the low-resolution target to be enhanced/corrected).
| Back to top |
The low-resolution image irvine.pix (30m pixels) is resolution-enhanced to match the resolution of eltoro.pix (10m pixels). Because both images are already geocoded in a common projection (UTM 11 S), the locked image (FILI_LOC) and transformation segment (DBSEG) are not required, and the IMGLOCK task is not needed.
from pci.imgfuse import imgfuse fili_ref = 'eltoro.pix' # input reference file fili_org = 'irvine.pix' # input original file fili_loc = '' dbic_ref = [1] # reference channel dbic_org = [1,2,3,4,5] # original channels filo = 'irvine_10m.pix' dbseg = [] maxgain = [3] # maximum model gain ksize = [3] # kernel length imgfuse( fili_ref, fili_org, fili_loc, dbic_ref, dbic_org, filo, dbseg, maxgain, ksize )
The low-resolution file 'ms.pix' is enhanced to match the resolution of the high-resolution file 'pan.pix'. The result is written to the file 'enhanced.pix', which is created by IMGFUSE.
The 'output.pix' locked image was created from the high-resolution reference image 'pan.pix' at the same resolution as the low-resolution 'ms.pix' using IMGLOCK. It contains the transformation image relating the otherwise ungeocoded 'pan.pix', and 'ms.pix' files.
from pci.imgfuse import imgfuse fili_ref = 'pan.pix' # input reference file fili_org = 'ms.pix' # input original file fili_loc = 'output.pix' dbic_ref = [1] # reference channel dbic_org = [1,2,3] # original channels filo = 'enhanced.pix' dbseg = [3] # text segment on fili_loc maxgain = [3] # maximum model gain ksize = [3] # kernel length imgfuse( fili_ref, fili_org, fili_loc, dbic_ref, dbic_org, filo, dbseg, maxgain, ksize )
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.