Home
About Isis
Support
Download

Isis 3

Documentation
Tutorials
Technical Documents

Isis 2

Documentation
Tutorials
Technical Documents

Search

USGS

Isis 3 Application Documentation


coreg

Printer Friendly View | TOC | Home

Subpixel registration of a pair of images

Overview Parameters Example 1

Description

This program co-regsisters two images using an image-wide averaged sample/line translation with the TRANSLATE option or a set of variable sample/line translations with the WARP option. The program computes local translations spaced evenly throughout the image. The number and spacing of local translations is user defined. This allows for many output options including 1) directly creating the translated image, 2) creating a control network which can be used in other programs (e.g., qnet, warp), especially if the translation is not constant across the image, or 3) creating a flat-field file usable in spreadsheets or plotting packages to visualize magnitude and direction of varying translations. For the TRANSLATE option, this implies that the internal geometry of both images be nearly the same so that the translation can be computed. That is, this program will not work if the translation varies significantly throughout the image. If condition of near constant translation is met then the translation can be computed to sub-pixel accuracy. If the internal geometry of both images do not match well, or a simple line/sample shift is not sufficient to register the images, the WARP option is a better choice than TRANSLATE because this uses the local translations to perform a rubber-sheet transformation. This option must be used with caution.

NOTE: This program can utilize many different techniques for computing the translation. It is recommended that you review the Pattern Matching page from the "Related Objects and Documents" section below. It is essential for using this application to understand how to create a "registration definition" file and how to size your search and pattern chips. We will continue with the discussion of functionality of this program assuming the reader has a fundamental knowledge of Automatic Registration. Below we give an example of a defintion file (DEFFILE):

      Object = AutoRegistration
        Group = Algorithm
          Name         = MaximumCorrelation
          Tolerance    = 0.7
        EndGroup

        Group = PatternChip
          Samples = 20
          Lines   = 20
          ValidMinimum = 1400
          ValidPercent = 75
        EndGroup

        Group = SearchChip
          Samples = 90
          Lines   = 90
          ValidMinimum = 1400
          ValidPercent = 75
        EndGroup
      EndObject
    

For further discussion of the parameters used in this DEFFILE, see the Pattern Matching document. Briefly, the example DEFFILE will allow a successful registration only where the MaximumCorrelation algorithm's goodness-of-fit result is >=0.7, pixel value is >1400, and at least 75% of the pixels in both the PatternChip or the SearchChip are valid pixels.

This program requires two input cubes, one which will be translated (FROM) and the other is held fixed (MATCH). The images must have the same number of samples and lines and can have only one band (use cube attributes if necessary). A grid will be defined across the held image using either the user parameters, ROWS and COLUMNS, or calculated based on the image size and the search chip size as follows: COLUMNS = (image samples - 1) / search chip samples + 1, and similarly for ROWS. Conceptually, the sparse grid defined by ROWS and COLUMNS will be laid on top of both images with even spacing between the rows (or columns) and but no row will touch the top or bottom of the image. That is, the grid is internal to the image.

At each grid intersection, the local translation will be computed. This is done by centering the search chip at the grid intersection for the image to be translated (FROM) and centering the pattern chip at the grid intersection for the held image (MATCH). The pattern chip is walked through the search chip to find the best registration (if any). Again, see the Pattern Matching document for further details. The local translation is recorded at all grid intersections that had a successful registration. The results are written to a control network and/or flat-file if requested. The average of the local translations is then used to compute an overall sub-pixel translation which can be applied to the FROM image and written as the output image (TO).

Some tips to improve odds of a successful registration are provided. In general a small pattern chip size makes registration more difficult. Depending on your dataset, 20x20 is probably a good starting point. The larger the translation, the larger the search chip size will need to be; if your translation is only a couple of pixels, you should make the search chip only slightly larger than the pattern (e.g., 25x25 vs 20x20). However if the translation is large you will need to expand the search area. For example, if the translation is roughly 45 pixels and your pattern is 20x20 the search area should be, roughly, 20+2*45 or 110x110.


Categories


Related Applications in Previous Versions of Isis

This application replaces the following applications existing in previous versions of Isis, which have been deprecated from the current version of Isis:
  • coreg2
  • coregpr
  • coregpr2

Related Objects and Documents

Applications

Documents


History

Kris Becker2000-08-07 Original Version.
Elizabeth Ribelin2005-08-25 Ported to Isis3.0.
Elizabeth Miller2005-10-14 Added warp option and fixed bug in control net creation.
Elizabeth Miller2006-03-23 Fixed appTest.
Jacob Danton2006-01-06 Fixed appTest to comply with changes made to the ControlMeasure class.
Jacob Danton2006-04-05 Added error reporting when the registration was a failure.
Kris Becker2006-06-15 Set the MATCH file as the reference image so it can be used in subsequent processing. Implemented use of unique serial numbers for each image. Issues still remain with handling band-to-band registrations within files. One alternative is to extract bands to separate files as a fallback approach is to use filenames as the serial number. This solution/alterntive is unique to coreg, however.
Brendan George2006-10-02 Modified call for current time to point to Time class, instead of Application class.
Brendan George2006-12-08 Modified to reflect changes to the SerialNumber class.
Steven Lambright2008-06-23 Updated to properly check AutoReg::Register()'s return status.
Noah Hilt2008-08-13 Added two new optional arguments to AutoReg: WindowSize and DistanceTolerance. These two arguments affect how AutoReg gathers and compares data for surface modeling and accuracy. Added more statistics to the Translation group, including min/max and standard deviation of line/sample changes. Added the AutoReg statistics to be displayed as well.
Travis Addair2009-08-10 Auto registration parameters are now placed into the print file.
Eric Hyer2010-02-09 Auto registration parameters now placed into the print file before potential throwing of exceptions.
Janet Barrett2010-07-30 Changed REGDEF parameter name to DEFFILE. Changed CNETFILE parameter name to ONET.
Debbie A. Cook and Tracie Sucharski2011-06-07 Changed point types "Ground" to "Fixed" and "Tie" to "Free".
Kris Becker2011-09-26 Corrected parameter change to warp application (CONTROL is now CNET); added application test for parameter changes.
Kris Becker2011-10-07 The documentation has been updated with review and contributions from Ella Lee, Chris Isbell and Moses Millazzo.
Travis Addair2012-01-26 Added back GoodnessOfFit to Control Network and flatfile, mistakenly removed during binary Control Network conversion.

Parameter Groups

Input Files

Name Description
FROM Input Image to be Translated
MATCH The input image which will be held as a reference.
DEFFILE The Auto Registration template

Output Cube

Name Description
TO Output Cube
TRANSFORM Tranformation Type
DEGREE Degree for Warp Transformation
INTERP Interpolation used for transformation

ControlNetOptions

Name Description
ONET Pvl file of ControlNet
FLATFILE Text file of coreg data
ROWS Number of Rows of Points to use.
COLUMNS Number of Columns of Points to use.
X

Input Files: FROM


Description

This cube will be translated to match the MATCH cube.

Type cube
File Mode input
Filter *.cub
Close Window
X

Input Files: MATCH


Description

This cube will be held as the reference and the FROM cube will be translated to match this cube.

Type cube
File Mode input
Filter *.cub
Close Window
X

Input Files: DEFFILE


Description

The template to use with the AutoReg class. Default will be maximum correlation function with a tolerance of 0.7, a search cube of 50x50 pixels, and a pattern cube of 20x20 pixels. There will also be other templates available in the default directory.

Type filename
File Mode input
Default Path $base/templates/autoreg
Default $base/templates/autoreg/coreg.maxcor.p2020.s5050.def
Filter *.def
Close Window
X

Output Cube: TO


Description

Output cube containing the translated or warped data.

Type cube
File Mode output
Internal Default None
Filter *.cub
Close Window
X

Output Cube: TRANSFORM


Description

The tranformation type to use on the output file. The options are TRANSLATE or WARP. If WARP is selected, the ONET and DEGREE parameters are required. Defaults to TRANSLATE.

Type string
Default TRANSLATE
Option List:
Option Brief Description
TRANSLATE Output Translated Image Runs the translate application on the input file to get the output file.

Exclusions

  • DEGREE
WARP Output Warped Image Runs the warp application on the input file to get the output file. If this option is selected, the ONET and DEGREE parameters must also be entered.
Close Window
X

Output Cube: DEGREE


Description

The degree to be used in the warp transformation for the linear regression model. Defaults to 1.

Type integer
Default 1
Close Window
X

Output Cube: INTERP


Description

This will be the interpolation type used to generate the output file in either the translate or warp application. Defaults to NEARESTNEIGHBOR.

Type string
Default CUBICCONVOLUTION
Option List:
Option Brief Description
NEARESTNEIGHBOR Nearest Neighbor Interpolation Nearest Neighbor Interpolation will be used in the transformation to create the output file.
BILINEAR Bilinear Interpolation Bilinear Interpolation will be used in the transformation to create the output file.
CUBICCONVOLUTION Cubic Convolution Interpolation Cubic Convolution Interpolation will be used in the tranformation to create the output file.
Close Window
X

ControlNetOptions: ONET


Description

This file will contain the ControlNet created in the coreg application. The data will be in Pvl format. This option is required if the WARP option is selected for the output file.

Type filename
File Mode output
Internal Default None
Filter *.net *.txt
Close Window
X

ControlNetOptions: FLATFILE


Description

This file will contain the data collected from the coreg application. The data will be comma separated and contain the sample, line position in the first input cube, the sample, line position found in the search cube, and the sample difference and line difference between to two.

Type filename
File Mode output
Internal Default None
Filter *.txt *.lis *.lst
Close Window
X

ControlNetOptions: ROWS


Description

The number of rows of points to use in the coreg process. If not entered, it will default to ROWS = (image lines - 1) / search chip lines + 1.

Type integer
Internal Default Automatic
Minimum 1 (inclusive)
Close Window
X

ControlNetOptions: COLUMNS


Description

The number of columns of points to use in the coreg process. If not entered, it will default to COLUMNS = (image samples - 1) / search chip samples + 1.

Type integer
Internal Default Automatic
Minimum 1 (inclusive)
Close Window

Example 1

Coregistration of 2 Images

Description

This example shows the coreg application. The rows and columns parameters are left as default.
Sample,Line,TranslatedSample,TranslatedLine,SampleDifference,LineDifference,GoodnessOfFit
211.875,164.283,200,133,-11.8751,-31.2829,0.991597
211.766,429.437,200,398,-11.7661,-31.4369,0.995987
        
The above text file is the ffile.txt file created when coreg is ran. The flat file is comma seperated and can easily be imported into excel.

Command Line

coreg from=./lunar1.cub match=./lunar2.cub t=out.cub flatfile=ffile.txt
Just run coreg on 2 images.

Input Images

First Input image

First Input image for coreg

Parameter Name: FROM

This is the 800 by 800 input image to be translated for the coreg example.

Second Input image

Second Input image for coreg

Parameter Name: MATCH

This is the 800 by 800 input image to be held for the coreg example.

Output Image

Output image showing results of the coreg application.

Output image for coreg

Parameter Name: TO

This is the 800 by 800 output image that results.