User's Guide

POLYFIT

Generates a geometric mapping grid file from tie point pairs

Function:

Generates a geometric mapping grid file for use in the rectification process. A tie point location file containing tie point pairs is used to derive two bivariate polynomials which define the transformation from one coordinate system to another. The polynomial is used to create a geometric mapping grid of linear segments that approximates this transformation. The mapping grid, transformation coefficients, and projection-related information are written to the geometric mapping grid file.

Parameters:

INTL
Input tie point location file. The tie point location file containing the tie point coordinate pairs to be used in calculating polynomials which define the coordinate transformation.

OUTTL
Output tie point location file. The tie point location file containing the tie point coordinate pairs used in calculating polynomials defining the coordinate transformation. All tie point records contained in the input file are included; however, the active-flag portion of the tie point records has been updated to indicate each tie point's contribution to the modeling process.

OUTGRID
Output grid file. Output geometric mapping grid file containing the geometric mapping grid, statistical information related to the fitting of the tie points and gridding process, as well as projection and framing information of the output space.

OUTPLOT(--)
Output plot file. Name of the plot file containing the tie point id, the X and Y coordinates in the search image, and the tie point residuals.

WINDOW(--)
Window specification. Area of output image over which the geometric mapping grid is to be evaluated. If WINDOW is NULL, the output area is determined from the framing parameters contained in INTL.

NLGRID(--)
Number of lines per grid cell. The number of lines contained in each output grid cell. If NLGRID is NULL, the geometric mapping grid size is set to the maximum and then reduced according to the TOLVAL parameter.

NSGRID(--)
Number of samples per grid cell. The number of samples contained in each output grid cell. If NSGRID is NULL, the geometric mapping grid size is set to the maximum and then reduced according to the TOLVAL parameter.

TRANOPT(INV)
Transformation option. Allows the swapping of independent and dependent variables in the calculation of transformation coefficients and the geometric mapping grid file. The inverse transformation is normally used to register an image to a reference space (image or map).

  = FWD:  Forward transformation.  Maps input space
          to output space.
  = INV:  Inverse transformation.  Maps output space
          to input space.

PDEGREE(1)
Polynomial degree. The maximum polynomial degree to be used in calculating the coordinate transformations. The maximum degree is 4. The actual degree allowable for a given set of tie point pairs may be less, depending on the number of tie point pairs being used in the modeling process.

STATSIG(0.05,0.05)
Statistical significance levels. The statistical significance levels for entering and removing variables in the stepwise regression analysis. Refer to User Note 4 for more information.

TOLVAL(0.015625)
Tolerance value. Tolerance (in pixels) for reducing the density of geometric mapping grid points. If NLGRID and NSGRID are not NULL, the TOLVAL parameter is ignored.

MAXRES(--)
Maximum residual value. The maximum residual value (in pixels) allowed in both line and sample directions. In normal, interactive operation, this parameter is NULL. If not NULL, MAXRES is used as a tolerance value for deleting tie points from the modeling process; prompting does not occur. Be cautious when using this method of editing--the tie point with the maximum residual is not always the "best" tie point to delete.

PRTOPT(ALL)
Print option. Indicates whether the transformation coefficients, tie point residuals, and other transformation information is printed for each iteration, or only the last iteration.

  = ALL:   Print the transformation information for 
           all iterations.
  = LAST:  Print the transformation information for 
           the last iteration only.

PRINT(TERM)
Output destination. Specifies the output destination for a listing of the transformation coefficients, tie point residuals, and other transformation information. Note that the information will always go to the terminal if interactive editing is to be performed. The following options are available:


  = --:        No Report
  = TERM:      Terminal.  Output is sent to the 
               user's terminal.
  = LP:        Line printer.  Output is sent to the 
               printer defined by $PRINTER.
  = Filename:  User-supplied filename.  Output is 
               sent to the user-supplied file with
               the extension ".prt".

Examples:

  1. LAS> polyfit intl=tiept.loc window=(1,1,512,512) outtl=tiept.out outgrid=grid.dat pdegree=1

    Point pairs from the tie point location file TIEPT.LOC are used to derive a pair of first-degree least squares regression equations that predict input coordinates from output coordinates. Results of the predictions are displayed, including point identifiers, coordinates, residuals of the transformation, and RMS residual values.

    The user is then asked if the results are satisfactory. If they are not, the program displays the current degree, the number of tie point pairs, and the maximum permissible degree.

    The user is given the chance to change parameters, (including deleting or reinstating tie points) and to rerun the modeling process until satisfactory. The resulting geometric mapping grid is written to GRID.DAT and the edited tie points are written to TIEPT.OUT.

  2. LAS> polyfit intl=tiept.loc window=(1,1,512,512) outtl=tiept.out outgrid=grid.dat pdegree=1 maxres=0.5 prtopt=last

    Point pairs from the tie point location file TIEPT.LOC are used to derive a pair of first-degree least squares regression equations that predict input coordinates from output coordinates. The final results of the predictions are displayed, including point identifiers, coordinates, residuals of the transformation, and RMS residual values.

    The resulting residuals are scanned for the largest value in line or sample. If that value is larger than the maximum residual value (MAXRES), the tie point is deleted and the points are modeled again. This process continues until the maximum residual is less than or equal to MAXRES or until there are too few tie point pairs for the modeling process.

Description/Algorithm:

POLYFIT uses a tie point location file containing tie point pairs which define a mapping from the output (REFERENCE) coordinates to the input (SEARCH) coordinates (an INVERSE transformation) to derive a pair of bivariate polynomials. A FORWARD transformation may also be applied. The polynomials are calculated using least squares regression analysis in a forward stepping procedure. The PDEGREE and STATSIG parameters, as well as the number of tie points used in the modeling process, control the regression fitting.

During the process, the user is given the option to reinstate or remove tie points and refit the model. If the user specifies a value in the MAXRES parameter, this editing will be automatic. For each iteration of the fit, the largest residual is removed if it is greater than MAXRES. This continues until all line and sample residual values are less than MAXRES or the number of tie points is too few to produce a fit. Tie points should always be edited with caution; the tie point with the largest residual is not always the point that should be removed.

When a satisfactory transformation equation has been found, the transformation is applied to create the geometric mapping grid. The user can control the density of the mapping grid in two ways:

1.  The default technique is to perform a sampling of the error
    at regular intervals over the image (both rows and columns).
    At these intervals, a slice of a grid is created and reduced 
    to the minimum density that allows the grid to meet the 
    allowed error tolerance (TOLVAL) in all sampled areas.
    For any linear transformation, the grid is reduced to a 
    2 x 2 grid regardless of TOLVAL values.

2.  The user has the option to specify the number of lines and 
    samples in each grid cell.  From these, the number of rows 
    and columns in the geometric mapping grid are calculated.  
    If the number of rows and columns exceed the maximum size 
    of 4095 x 4095, the number of lines and samples in each grid 
    cell are adjusted to fit the maximum grid size.  The user 
    is then informed of the adjustment.  Using this option, it 
    is assumed the user is aware of potential gridding errors
    due to grid density; grid reduction techniques are not applied.

The output geometric mapping grid file contains the mapping grid point values, transformation coefficients, projection information, framing information needed by RESAMPLE to fill the output image's DDR, as well as statistical information regarding the polynomial modeling process and the errors resulting from the gridding process.

Additional information on the stepwise regression analysis and gridding techniques is contained in the Geometric Manipulation Package Overview Document, GEOMPOD.

Nonfatal Error Message:

  1. [polyfit-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The error message that is displayed preceding this message is the specific error that was encountered. Processing continues.

Fatal Error Messages:

  1. [polyfit-fatal] Fatal error encountered

    The error message displayed immediately preceding this message is the specific error encountered. Processing is terminated.

  2. [polyfit-alloc] Unable to allocate dynamic memory

    An error occurred allocating memory during processing. Rerun the function, and if the error reoccurs, contact the system manager.

  3. [polyfit-nofit] Cannot fit tie points in <xx>

    The stepwise regression analysis routine could not arrive at a fit in the X or Y direction. Check the tie point location file for tie point validity and the distribution of tie points.

  4. [polyfit-no_wind] Cannot determine window from framing parameters

    The user entered a NULL window and expected the program to calculate it from the output space framing parameters contained in the input tie point location file. However, the framing parameters in the tie point location file were not complete enough to calculate this window. Either correct the framing parameters in the tie point location file or enter a window.

  5. [polyfit-invalid] NLGRID/NSGRID must be greater than zero

    The NLGRID (also NSGRID) parameter was specified to be an invalid value. If specified, it must be greater than zero.

User Notes:

  1. The degree of the approximation polynomial is restricted to a maximum of 4. The actual degree may be less than that specified, depending on the number and distribution of the tie point pairs. The following table gives the minimum number of tie point pairs required for valid PDEGREE specifications:

    
                                  Number of
                          PDEGREE   Points
    
    			1	 3
    			2	 6
    			3	10
    			4	15
    

    It is recommended that the user make several tests with different permissible degrees in the same run to ensure the lowest order satisfactory approximation.

  2. The number of input tie point pairs must be less than or equal to 1024.

  3. The maximum grid size is 4095 x 4095. It is suggested that the user not actually make grids this dense since it would consume greater than 250 MB of memory.
  4. The output grid file may be displayed by DSPGRID.

  5. The values of the STATSIG parameter are used to enter and remove variables (polynomial terms, not tie points) during the stepwise regression procedure. The default values of 0.05 indicate that to enter the model, the significance level of the variable's (polynomial term's) contribution to the model must be in the upper 5 percent of the F-distribution; and to stay in the model, the significance level of the variable's contribution to the model must also be in the upper 5 percent of the F-distribution. STATSIG values near 1.0 allow variables to enter and remain in the model that do not significantly help define the relations between the tie point pairs. Also, STATSIG values near 0.0 may prevent any variables from entering the model and/or will cause variables to be quickly removed after other variables are entered.