IMGLOCK

Image registration lock


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

Back to top

Description


Resamples a reference image to the resolution of a target image and registers the reference image to the target.
Back to top

Parameters


Name Type Caption Length Value range
FILI_REF * String Input reference file name 1 - 191  
FILI_IMA * String Input file name 1 - 191  
FILO * String Output file name 1 - 191  
DBIC_REF * Integer Input reference image channel 1 - 1  
DBIC_IMA * Integer Input target image channel 1 - 16  
DBGC Integer Input GCP segment 0 - 1  
WCHUNKS Integer Whitening chunk size 0 - 1 8 - 32
Default: 32
CG_XOFF Integer X offset for start of correlation 0 - 1 32 -
Default: 128
CG_YOFF Integer Y offset for start of correlation 0 - 1 32 -
Default: 128
PATCH Integer Correlation patch size 0 - 1 0 - 255
Default: 16
SEARCH Integer Correlation search window size 0 - 1 0 - 255
Default: 32
PFA Float Probability of false alarm 0 - 1 0.0 - 0.5
Default: 0.01
ISONOFAC Float Isolated noise factor 0 - 1 0.0 - 1.0
Default: 0.0

* Required parameter
Back to top

Parameter descriptions

FILI_REF

Specifies the name of the high-resolution reference image file.

This image will be downsampled, warped, and registered to the image specified in FILI_IMA.

FILI_IMA

Specifies the name of the low-resolution target file to be registered.

This image will be registered and enhanced by the IMGFUSE function.

FILO

Specifies the name of the output file to receive the downsampled correlation image and transformations, which are used in the next stage of processing (IMGFUSE).

The output file is automatically created by IMGLOCK, and must not already exist.

Upon successful completion, the output file will contain the following data:

DBIC_REF

Specifies the input channel that contains the high-resolution reference image to be downsampled and registered.

DBIC_IMA

Specifies the input channel that contains the low-resolution target file to which the reference image will be registered.

DBGC

Specifies the input reference segment that contains the ground control points for downsampling to low resolution. Ground control points may be manually collected using CATALYST Professional Focus.

If this parameter is not specified and user-supplied GCPs are not provided, and if the input images are geocoded in compatible georeferencing systems or relatable projections, this function will automatically create a GCP segment. If this occurs, a message is displayed, and this parameter will be updated to refer to the created GCP segment.

Note: This parameter MUST be in terms of pixel/line coordinates for both the reference image, and the target image. If the second set of GCPs is in terms of georeferenced coordinates in the target image, use GCPPRO to reproject the coordinates to the target image pixel/line coordinates.

See the section on GCP collection in Details below for more information.

WCHUNKS

Specifies the size of the chunk of data used to whiten (edge enhance) the input reference and input original images. This value must be a power of 2, and 32 or less. Typically, the value 32 is best, though a value of 16 will speed up processing, at the cost of reduced accuracy.

CG_XOFF

Specifies the correlation grid X offset. This provides a means of controlling where the first correlation GCPs will be calculated. In general, the correlation grid should be offset at least 32 pixels to remove the possibility of edge effects. Another use is to set the start of the correlation grid on an area that has some type of structure, such as rough terrain or an urban area, instead of water or desert, where AUTOREG will have trouble locating a correct correlation.

CG_XOFF must be >= 1/2 Search size. The minimum is 32.

See the Details section for a diagram of correlation grid spacing and offsets.

CG_YOFF

Specifies the correlation grid Y offset. This provides a means of controlling where the first correlation GCPs will be calculated. In general, the correlation grid should be offset at least 32 pixels to remove the possibility of edge effects. Another use is to set the start of the correlation grid on an area that has some type of structure, such as rough terrain or an urban area, instead of water or desert, where AUTOREG will have trouble locating a correct correlation.

CG_YOFF must be >= 1/2 Search size. The minimum is 32.

See the Details section for a diagram of correlation grid spacing and offsets.

PATCH

Specifies the size of the correlation patch window size for the AUTOREG function. Sets the size of the image chip for cross-correlation of a small portion of the target image with a small portion of the reference image.

This parameter can range in value between 16 and 32 pixels square.

See the Details section for a diagram of correlation grid spacing and offsets.

Specifies the size of the correlation search window for the AUTOREG function. The search window is used to set the extent of the correlation search range. This search range (SEARCH - PATCH) corresponds to the amount of expected misregistration between the images input to AUTOREG. In other words, if there is at least a 3 pixel misregistration between the images input to AUTOREG, the search window should be at least 3 pixels larger than the patch size.

SEARCH >= PATCH.

See the Details section for a diagram of correlation grid spacing and offsets.

PFA

Specifies the probability of false alarm for the AUTOREG function. This parameter allows you to control the probability of AUTOREG choosing a correct GCP. Decreasing this parameter prunes out control points that are not likely to be due to image structure.

ISONOFAC

Specifies the isolated noise factor for the AUTOREG function. This parameter is not usually specified by the user.

Back to top

Details

IMGLOCK resamples a reference image to the resolution of a target image and register the reference to the target. This function is designed to automate all the up- and downsampling of imagery and running the necessary autoregistration and transformation programs.

The purpose of IMGLOCK is to warp the reference image down to the resolution of the target image and perform a correlation between the two. The final result is a set of transformations and a blurred version of the reference image precisely registered to the target image.

The images are first coarsely registered, downsampling the reference image to the same size and orientation as the target image. The results are passed to the autocorrelation function AUTOREG.

The results of AUTOREG, in the form of a set of high-precision GCPs, are next used to perform a fine precision registration of the images to precisely lock them. Again, the reference image is registered down to match the target image, the output being a precisely locked, but blurred (to match the target resolution) version of the reference image.

As a final operation, the inverse transformation from the precision-corrected image back to the original is calculated using the TRANSFRM function and stored in the output file for subsequent use by the data fusion (IMGFUSE) step.

The output file (FILO) will contain one image channel, which is the precision-geocoded reference image downsampled to match the resolution and region of the target image. The output file also contains a GCP segment (containing the fine-precision GCPs calculated by AUTOREG), and a TEXT segment that contains the transformation information.

Overview

As input, IMGLOCK requires a reference image and a target image. The reference image should normally be of higher resolution than the target image. To establish an approximate relationship between the reference and target images, it is necessary that they be compatibly geocoded, or that an input ground control point segment (DBGC) be provided relating pixel/line coordinates in one file with pixel/line coordinates in the other file.

It is also necessary to indicate a channel in the reference image and target image that should be used to perform the image correlation. As much as possible, these channels should be selected to maximize the spectral similarity, though AUTOREG is exceptionally forgiving of different spectral characteristics by comparison to other image matching methodologies.

Finally, it is necessary to review and fine-tune the image locking algorithm parameters (WCHUNK, CG_*, PATCH, SEARCH, PFA, and ISONOFAC).

Note: Achieving good results generally requires experimentation with the parameters; simply selecting all default values is not likely to achieve optimal output, as the parameter settings are highly data-dependent. It is possible to pick combinations of parameter values that will result in errors and even program failure (usually due to resulting numerical instability), or to receive anything from poor to unusable results. If such situations occur, go back and carefully check and adjust the settings you have used.

The high-resolution information from the input reference image will be modeled in the IMGFUSE output image. The high-resolution information will be fused into the low-resolution target image while preserving the statistical integrity of the image data.

If IMGLOCK is to be run on images that are not already precision-geocoded before IMGLOCK is invoked, the reference image file must have a ground control point (GCP) segment that contains at least three GCPs to downsample and register the reference image to the original image.

Note: The input reference image will actually be registered to the original image file (to match its size), with the results going into the first channel of the output file. The input reference image is not altered in any way. This is, in effect, the reverse of what might be expected during a normal registration process, and as a result of this, the collection of GCPs is also effectively reversed, with the reference image being treated as the 'uncorrected' image for GCP collection.

At the point where AUTOREG is called, the reference and target images have already been coarsely registered to each other and are ready to be finely registered. With AUTOREG, the images are divided up into chunks to make the correlation more memory-efficient. To increase the probability of obtaining a precise registration of the two chunks, a whitening algorithm is implemented to enhance the edges in the reference and target chunks. Once the high-frequency edge information has been emphasized, it becomes much easier to find the correct correlation between the reference and target chunks. The Whitening Chunk Size (WCHUNKS) parameter controls the size of the chunks that have been whitened.

The IMGLOCK process was designed to work with images that are already coarsely registered (this actual coarse registration being performed by IMGLOCK itself, based on the input GCP segment). Given this, the SEARCH window need not be much larger than the PATCH size, because by the time the images reach AUTOREG, they should already be close in registration.

The SEARCH window acts as a small piece of whitened (edge-enhanced) imagery over which the PATCH window is moved to look for correlation. The larger the SEARCH window, the larger the area of imagery the PATCH has to scan over.

The Probability of False Alarm (PFA) parameter

The PFA parameter controls the selection of correlation values, ensuring that the selected values have a high probability of being valid points. As the PATCH window scans over the SEARCH window finding correlations between the two, the PFA value helps to determine whether those correlation values are valid or false.

                  ^----------  2.0
                 /|\
                / | \
               /  | A\      A = SQRT(M)
              /   |---\
             /    |    \
            /|    |    |\
           / |    |    | \
         .---|----|----|---.-- 0
          PFA           PFA 
         |  -W    0    W   |

AUTOREG uses the PFA value to determine the threshold value (W) for correlations to be considered the result of an actual correlation. This is done by assuming that the non-valid correlation values follow a Gaussian distribution with a mean of 0 and a variance of M. The area under the positive and negative tails of the distribution, defined by +/-W, is thus equal to the PFA value (see diagram, above) so that:

W = SQRT(2xM) [ erfinv(1-PFA)

The number of expected correlation values large enough to be considered valid for a given possible GCP location is equal to MxPFA, where M is the total number of correlation values calculated. In other words, for a PATCH with AxA pixels and a search space with BxB pixels, MxM = (B-A)x(B-A).

To cause the expected number of correlation values greater than W to be less that 1, the PFA should generally be less than M ** -1. Lower values decrease the chance of invalid GCPs being chosen. Setting PFA too low, however, may cause valid correlations to be rejected.

In general, PFA should be set as low as possible so that the GCPs that are found are correct. As a guideline, the PFA should be approximately in the range of:

0.0001 <= PFA <= 0.1

The Isolated Noise Factor (ISONOFAC) parameter

The ISONOFAC value helps to determine whether a correlation peak is isolated. For a peak to be isolated, it must be the largest correlation peak, and its value should be unique. In other words, there should not be any other correlation peaks in the local area that are as large as or larger than the maximum.

If the following statement is satisfied, the correlation peak (CP) is thrown out:

 CP_Value + ISONOFAC (Noisefloor) > Maximum_CP                            
 where: 0 < ISONOFAC < 1

Noisefloor is defined as a threshold cutoff (W) for the Gaussian correlation distribution. This states that if the sum of the current correlation peak (CP_Value) and a certain percentage of the Noisefloor (ISONOFAC x Noisefloor) is larger than the maximum correlation peak value (Maximum_CP), then CP_Value is not a valid peak.

For example:

Therefore, as you increase ISONOFAC, you add on more and more Noisefloor, thereby making it increasingly more difficult for the maximum correlation peak to pass through.

ISONOFAC can be used to weed out correlation peaks that might be similar in value. This would mean that the maximum correlation peak is not an isolated peak. Normally, the ISONOFAC parameter can be set to 0, disabling the contribution from Noisefloor, but if AUTOREG latches onto bad GCPs, the ISONOFAC parameter should be raised to ensure that there are no matching correlation peaks throwing off the registration.

Interpreting results

None of the resulting outputs of IMGLOCK are intended for direct analysis by viewing. They are designed for use in further processing steps, such as Noise Filtering, Resolution Enhancement, and Change Detection.

To verify that the image matching was successful (that appropriate GCPs were selected), it is wise to review the resulting precision-geocoded image. This image can be loaded and overlaid on the target image in CATALYST Professional Focus. Then, by modifying the image plane combinations, it is possible to switch back and forth between the images to establish if they overlay well. If they do not, AUTOREG has collected inappropriate GCPs, and the resulting precision image locking is incorrect. In this case, you should review the original input GCPs and the IMGLOCK parameters to try to produce an accurate image locking.

The IMGLOCK run time is largely determined by the size of the image being manipulated. In circumstances where a lot of rotation is being applied as the reference image is resampled to match the target 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; see the documentation for REG for more information.

Geocoded image flow diagram

The following diagram shows the flow through IMGLOCK and IMGFUSE when precision-geocoded images are used:

    REFERENCE IMAGE (A)          TARGET IMAGE (B)
  ______________________   
 +                      +
 |   \               ++ |        ________________
 |    |      ><      ++ |       +                +
 |  OO OO OO OO OO OO   |       |        X8      |
 |     \             ++ |       | :       8 _    |
 |      |            ++ |       |        _8/     | 
 |                      |       | #     / 8      |
 +______________________+       +________________+
                \                    /
                 \                  /
                  \________________/
                      |
                      V
   Precision Downsampling of (A) to (B),
  where (A) is warped and matched to (B)
   (registration, warping & resolution)
  using the existing precision geocoding
                 |
                 |                    _______________
                 V                   +               +
        Output placed into           |   `       x   |
       Output Channel 1 (C1)         |  oo'oo oo oo  |
                 |                   |     `         | 
                 |                   |      '        |
                 |                   +_______________+
                 V
    GCPs automatically generated to
   describe relation between (A) and
     (B) images, and written to (A)
                 |
                 |
                 V
  Coefficients for the transformation
    between the reference image (A) 
       with the target image (B) 
       are extracted and stored
                 |
                 |
                 V
 End Results:
 A) 1 Output file of precise, lower
    resolution reference image
 B) Many generated GCPs
 C) Text segment containing the 
    transformation (coefficients)

Image to flow diagram

The following diagram shows the flow through IMGLOCK and IMGFUSE when working in Image-to-Image mode (that is, without using precision-geocoded images):

      REFERENCE IMAGE (A)          TARGET IMAGE (B)
    ______________________   
   +                      +
   |   \               ++ |        ________________
   |    |      ><      ++ |       +                +
   |  OO OO OO OO OO OO   |       |        X8      |
   |     \             ++ |       | :       8 _    |
   |      |            ++ |       |        _8/     | 
   |                      |       | #     / 8      |
   +______________________+       +________________+
                  \                    /
                   \                  /
                    \                /
                   GCPs Collected between
                 target and reference image
        o-> Reference image treated as uncorrected
        o-> Target image treated as master image
                |
                V
       Downsampling of (A) to (B),
       where (A) is matched to (B) 
  as closely as possible with respect to 
    registration, warping & resolution   
                |                       Channel 1 (C1)
                |                      ________________          
                |                     +################+              
                V                     |####   X8     ##| # = No   
          Results Placed Into         |####    8 _   ##|     Overlap
         Output Channel 1 (C1)        |####   _8/    ##|          
                |                     |####  / 8     ##|       
                |                     +####__________##+    
                V
 C1 Output correlated against Target (B)
     Generating a large set of GCPs
                |
                |
                V
  Precision Downsampling of (A) to (B),
 where (A) is warped and matched to (B)
  (registration, warping & resolution)
         using generated GCPs
                |
                |                      _______________
                V                     +               +
          Output placed into          |   `       x   |
         Output Channel 2 (C2)        |  oo'oo oo oo  |
                |                     |     `         | 
                |                     |      '        |
                V                     +_______________+
   (C1) erased, (C2) automatically 
          becomes new (C1)
                |
                |
                V
 Coefficients for the transformation
   between the reference image (A) 
      with the target image (B) 
      are extracted and stored
                |
                |
                V
 End Results:
 A) 1 Output file of precise, lower
    resolution reference image
 B) Many generated GCPs
 C) Text segment containing the 
    transformation (coefficients)

GCP collection

Because image locking operates by warping a copy of the reference image to match the size and orientation of the target image, it is necessary to reverse the normal process of GCP collection.

This reversal means that you must treat the reference image (FILI_REF) as your uncorrected image in CATALYST Professional Focus (or whatever mechanism you use for collecting GCPs), and treat your target image (FILI_IMA) as the georeferenced, or master file. By working in this manner, the GCPs are placed on the reference image, allowing it to be warped down to match the target for correlation.

Additionally, because image locking works by performing image-to-image registration without being based on georeferencing, it is necessary that the GCPs be in pixel/line coordinates, rather than any other georeferencing coordinates (projection system). If your GCPs are not in pixel/line coordinates (as indicated by REG failing when running IMGLOCK, or by checking the GCP segment using GCPREP), you can convert them to pixel/line using GCPPRO.

Note: Input GCPs do not need to be collected if the input reference and target images are already geocoded.

Choosing input parameters

To set the parameters for IMGLOCK (and hence, AUTOREG) correctly, follow these guidelines to get a good initial estimate of the appropriate initial parameter values to use:
  1. Choose the patchsize (PATCH) between 16 and 32.

    32 >= Patch >= 16
    
  2. Choose the search window size such that SEARCH is larger than PATCH.

    Search > Patch
    
  3. Make CG_YOFF >= 1/2 SEARCH; also make CG_XOFF = CG_YOFF for square images.

  4. Set the probability of false alarm (PFA) about equal to 0.10.

    Lower the PFA for a better correlation.

    Raise the PFA for a looser correlation.

  5. In general, the PFA should be set as low as possible so that the found GCPs are correct. As a guideline, the PFA should be approximately in the range of:

    0.0001 <= PFA <= 0.1
    
Back to top

Examples

We have a Spot scene (eltoro.pix - 10m x 10m pixels) and a Landsat scene (irvine.pix - 30m x 30m pixels) which we want to image lock. Because both scenes are already geocoded (UTM 11 S E000), we do not need to supply GCPs. Instead, IMGLOCK will compute GCPs and add them to eltoro.pix, the reference image.

EASI>fili_ref	=	'eltoro.pix'	! input reference file
EASI>fili_ima	=	'irvine.pix'	! input original file
EASI>filo	=	'elt_lock.pix'	! output file
EASI>dbic_ref	=	1	! input reference channel
EASI>dbic_ima	=	1	! channel with low-resolution target 
EASI>dbgc	=		! no input GCP segment
EASI>wchunks	=	32	! whitening chunk size
EASI>cg_xoff	=	32	! X offset for start of correlation
EASI>cg_yoff	=	32	! Y offset for start of correlation
EASI>patch	=	16	! correlation patch size
EASI>search	=	32	! correlation search window size
EASI>pfa	=	0.5	! probability of false alarm
EASI>isonofac	=	0	! isolation noise factor

EASI>run IMGLOCK

We have a raw panchromatic spot scene (pan.pix), and a multispectral MSS scene (ms.pix) that we want to image lock.

Because the scenes have not been geocoded, collect GCPs with CATALYST Professional Focus, using the reference scene (pan.pix), as the master image.

EASI>fili_ref	=	'pan.pix'	! input reference file
EASI>fili_ima	=	'ms.pix'	! input original file
EASI>filo	=	'output.pix'	! output file
EASI>dbic_ref	=	1	! input reference channel
EASI>dbic_ima	=	1	! channel with low-resolution target
EASI>dbgc	=	2	! input GCP segment 2
EASI>wchunks	=	32	! whitening chunk size
EASI>cg_xoff	=	50	! X offset for start of correlation
EASI>cg_yoff	=	50	! Y offset for start of correlation
EASI>patch	=	16	! correlation patch size
EASI>search	=	32	! correlation search window size
EASI>pfa	=	0.5	! probability of false alarm
EASI>isonofac	=	0	! isolation noise factor

EASI>run IMGLOCK

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