User's Guide

GRIDGEN

Generates a Geometric Mapping Grid from transformation coefficients

Function:

Reads transformation coefficients from a geometric mapping grid file and generates a grid file containing the corresponding mapping grid. The mapping grid generated by this transformation may be reduced in density as defined by the TOLVAL parameter, or the user may specify a grid spacing (which will not be reduced). The output geometric mapping grid information is readable by RESAMPLE for use in the geometric rectification of an image.

Parameters:

INGRID
Input grid file. Input geometric mapping grid file containing polynomial transformation coefficients.

OUTGRID
Output grid file. Output geometric mapping grid file containing both mapping grid and transformation coefficients.

WINDOW
Window specification. Area of output image over which the geometric mapping grid is to be evaluated.

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. A default value of 0.015625 is used to check grids to 1/64th of a pixel.

NLGRID(--)
Number of lines per grid. 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. 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.

Examples:

  1. LAS> gridgen ingrid=grid.coeff outgrid=grid.dat window=(1,1,512,512) tolval=0.1

    The input geometric mapping grid file GRID.COEFF is read and the transformation coefficients are extracted. The grid density is automatically selected to meet the tolerance of 0.1 pixels. The grid is created and verified to be a one-to-one mapping..

  2. LAS> gridgen ingrid=grid.coeff outgrid=grid.dat window=(1,1,512,512) nlgrid=20 nsgrid=20

    The input geometric mapping grid file GRID.COEFF is read and the transformation coefficients are extracted. The 27x27 grid is created over the user-specified windows according to the transformation. If the mapping is not one-to-one, an error is returned. Each grid cell in the 27 x 27 grid contains 20 output space lines and 20 output space samples.

Description/Algorithm:

GRIDGEN uses polynomial transformation coefficients stored in a geometric mapping grid file to generate a geometric mapping grid for use with RESAMPLE, the geometric rectification function. GRIDGEN can be used to regenerate existing mapping grids with different grid densities and output sizes. GRIDGEN is also used for initial grid generation after the use of the EDITGRID routine. (The EDITGRID routine provides for entering/editing of the polynomial transformation coefficients, as well as other things).

The one-to-one mapping property of the transformation is tested by inspecting the Jacobian of the transformation over the user-specified window. If the mapping is not one to one, the grid is not created and processing is terminated. Otherwise, the gridding process continues.

The user can control the density of the geometric 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 total 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 that the user is aware of potential 
    gridding errors due to grid density, and, therefore, grid 
    reduction techniques are not applied.

The output grid file contains the geometric mapping grid point values, transformation coefficients, as well as other information copied from the input geometric mapping grid file. Additional information on the Jacobian test and gridding techniques is contained in the Geometric Manipulation Package Overview Document, GEOMPOD.

Nonfatal Error Messages:

  1. [gridgen-warn] Nonfatal error encountered

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

  2. [gridgen-nrows] Number of grid rows exceeded maximum, Number of grid rows set to maximum

    The number of geometric mapping grid rows exceeded the maximum allowed. This error occurs when the user enters too small a grid spacing (NLGRID) for the window given. The number of rows is set to the maximum (4095).

  3. [gridgen-ncols] Number of grid columns exceeded maximum, Number of grid columns set to maximum

    The number of geometric mapping grid columns exceeded the maximum allowed. This error occurs when the user enters too small a grid spacing (NSGRID) for the window given. The number of columns is set to the maximum (4095).

Fatal Error Messages:

  1. [gridgen-fatal] Fatal error encountered

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

  2. [gridgen-degree] Polynomial degree not supported

    The polynomial degree contained in the input geometric mapping grid file is not supported by this function. Polynomials having degrees 1 through 4 are supported by this routine.

  3. [gridgen-no_poly] Model is not a polynomial model

    The model contained in the input geometric mapping grid file is not a polynomial model. This function can calculate mapping grids from polynomial coefficients only.

  4. [gridgen-alloc] Unable to allocate dynamic memory

    An error occurred allocating memory for the output geometric mapping grid file. Rerun the function; and if the error reoccurs, contact the system manager.

  5. [gridgen-degenerate] Transformation not one-to-one

    The one-to-one Jacobian test failed. Check the polynomial transformation coefficients for validity.

  6. [gridgen-invalid] WINDOW/NLGRID/NSGRID must be greater than zero

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

User Notes:

  1. 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.
  2. The output grid file may be displayed by the program DSPGRID.

  3. For more details on grid reduction techniques, refer to the Geometric Manipulation Package Overview Document, GEOMPOD.