User's Guide

HISMTCH

Matches the histograms created by PIXCOUNT of the overlap area of two images and then uses MAP to stretch the pixel values of FROMFRAM to match TOFRAM.

Function:

Calculates the intersection of two cutline polygons and creates a histogram of this overlap area for each of the two input images. The histograms are matched at certain percentages in order to transform the FROMFRAM image to match the TOFRAM image.

Parameters:

FROMFRAM
From frame number. The frame number of the image that is mapped to match the TOFRAM image.

TOFRAM
To frame number. The frame number of the image that FROMFRAM image is mapped to.

BAND(1)
Band number. The band number of the two input images that are to be matched.

FTYPE(TRAN)
File type. The type of images that are used as the input images.


  = ORIG:  Original image.  
  = TRAN:  Transformed image.
  = RAD:   Radiometrically corrected image.

MASKVAL(0)
Mask value. The pixel value that is used to designate masked area. Pixels of this value are not used in the calculations.

MAPPERC(0,.5,5,25,50,75,95,99.5,100)
Map percentages. These are the cumulative percentages of the histograms which are used to calculate the TOFRAM and FROMFRAM values needed by MAP. The values of the histogram of TOFRAM image closest to the percentages entered are the TOFRAM values used in MAP, and the values of the histogram of FROMFRAM image closest to the percentages entered are the FROMFRAM values used in MAP.

DELFLG(YES)
Delete flag.


  = YES:  Delete temporary files.  
  = NO:   Do not delete temporary files.

PRINT(TERM)
Output destination. The destination of the output.


  = 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".

Example:

  1. LAS> hismtch tofram=1 fromfram=2 band=1 ftype="xfr" maskval=(0) mapperc=(0,.5,5,25,50,75,95,99.5,100) delflg=no print = term

    The global variable $IMAGE equals (F2038,F2039). The input and output image names and the input cutline file names are calculated. The cut files F2038.XCT and F2039.XCT are read in, and the intersection of these two cutfiles is calculated and written to the temporary files F2038.OCUT;TEM and F2039.OCUT;TEM. F20381.XFR and F20391.XFR are masked according to the files F2038.OCUT;TEM and F2039.OCUT;TEM. A histogram is then calculated for each of these masked images. Using the histogram of image F20391.MASKVAL, the values nearest the cumulative percentages of (0,.5,5,25,50,75,95, 99.5,100) are stored in the TOFRAM column of the temporary file F20381.MAP;TEM. Using the histogram of image F20381.MASKVAL, the values nearest the cumulative percentages of (0,.5,5,25,50,75,95,99.5,100) are stored in the FROMFRAM column of the temporary file F20381.MAP;TEM. This file--F20381.MAP;TEM--is then used by MAP to transform F20381.XFR and write it to F20381.MTCH. The temporary files are not deleted. The outputs from INTCUT, PIXCOUNT, and MAPFILE are printed to the terminal.

Description/Algorithm:

After reading the parameters, the input and output image names and the input cutline file names are calculated. FROMFRAM and TOFRAM cutline files are opened, and the cutline vertices are read in. The intersection of the two cutlines is then calculated, and a temporary cutline file for each input image is created. FROMFRAM and TOFRAM are then masked by the module PMASK using these cutline files. The two images created by PMASK are only the size of the minimum and maximum line/sample coordinates of the intersection cutline files. A histogram is created for the masked area of each of the two images using PIXCOUNT. The values of these histograms are then matched at the cumulative percentages that were given in MAPPERC. The values that are matched between the two histograms are then used in MAP to transform FROMFRAM by a piecewise linear fit. All the temporary files are deleted if desired and the completion message is displayed.

Nonfatal Error Messages:

    Displayed from the routine that is called.

Fatal Error Messages:

    Displayed from the routine that is called.

User Notes:

  1. If INTEGER*4 data with values outside the -32768 to 32767 range or REAL*4 data is input, processing time may be considerably slower then BYTE or INTEGER*2 data. This is due to the larger number of comparisons that may be made while searching the histogram array.

  2. Any changes made to the routines CMDEL, MAPFILE, INTCUT, PIXCOUNT, PMASK, or MAP may affect the operation of this routine.