User's Guide

LNFILL

Corrects blocks of lines of data by averaging neighboring lines.

Function:

Corrects blocks of lines by averaging the lines immediately above and below each block of lines. The file specified in INFILE lists blocks of lines requiring fixing. A block of lines is identified by the line number of the first line of the block and the number of consecutive lines making up the block. The number of lines in a block must range between one and the value in MAXLFIX. MAXLFIX specifies the maximum number of lines in a block that will be corrected. All blocks containing more lines than MAXLFIX will be replaced with zeros. The blocks of lines must be listed in ascending order.

Each pixel of a line in a block is corrected using the pixels immediately above and below the sample position for the block. The correction is a graduated average from the lower pixel to the upper pixel for a sample position within the block. When the block has only one line in it, then the correction is the average of the two points. If the block contains a border which is also the border of the image, then the lines in the block will be replaced with the only line adjacent to the block.

Parameters:

IN
Input image. Specifies the name of the image to be corrected. All data types are supported, and window and band options may be specified.

INFILE
Input file. The input file containing the blocks of lines (in ascending order) to be fixed. The maximum number of blocks is limited to 1000. The format of the file is:


   first record  = number of blocks to fix, total lines 
                   to fix 
   second record = starting line to fix, number of 
                   consecutive lines
		.
		.
		.
   last record
   An example follows:
	5 9
	3 1
	5 2
	8 1
	15 1
	25 4

In this example there are five blocks requiring corrections totaling nine lines. The first line to correct is line three. It will be corrected using lines two and four. Lines five and six will both be corrected using lines four and seven. Line eight will be corrected using lines seven and nine. Line fifteen will be corrected using lines fourteen and sixteen. A block of four lines starting at line twenty-five will be corrected using lines twenty-four and twenty-nine. All other lines in the image will be copied directly.

OUT
Output image. Specifies the name of the output image to contain the corrected output. If no image is specified, the the input image will be updated.

MAXLFIX(7)
Maximum number of lines to fix. If the number of lines in a block exceeds this number then the lines of the corrected image will be set to zero.

Example:

  1. LAS> lnfill in=inimage infile=fixfile out=outimage

    The image file INIMAGE has the lines specified in the file FIXFILE corrected. The image file OUTIMAGE is produced.

  2. LAS> lnfill in=inoutimage infile=fixfile out=-- maxlfix=3

    The image file INOUTIMAGE has the lines specified in the file FIXFILE corrected. The corrections are made to the input image INOUTIMAGE. Any blocks of four lines or greater identified in the file FIXFILE will be replaced with zeros within INOUTIMAGE.

Description/Algorithm:

LNFILL copies the input images to the output image, if NULL (--) is specified then the input image is updated. It then reads the file INFILE, which specifies the blocks of lines to correct. For each block, the lines above and below the block are read. Each sample within every line of the block is corrected using an equation performing a graduated average.


    pixel_value = top - (((top - bottom) / (n + 1)) * i)

    	pixel_value = Corrected value for the pixel.

	top	    = Pixel value of the pixel in the line 
                      above the block for that sample.     

        bottom      = Pixel value of the pixel in the line
		      below the block for that sample.

        n	    = Number of lines in the block.

        i           = The line number relative to the
	              block where the first number is 1 and the
	              last number is n.

When the number of lines in the block exceeds the value in MAXLFIX, then all the pixels in the block are set to zero. If one of the lines either above or below the line is missing, then the existing line is duplicated for all lines in the block.

Nonfatal Error Message:

  1. [lnfill-maxline] Warning, input values set to zero

    A block in the associated file containing the line information has more lines to fix than the value in MAXLFIX. All lines in this block are set to zero. Increasing the value of MAXLFIX may correct this problem.

Fatal Error Messages:

  1. [lnfill-alloc] Error allocating dynamic memory

    The routine was unable to allocate sufficient dynamic memory to its buffers. The function was unable to create a buffer large enough to contain a line of the image. This may be a system problem. Notify a system manager.

  2. [lnfill-comb] Combination of images is not allowed in update mode

    When updating the input image only one image can be specified. Run LNFILL once for each of the images supplied.

  3. [lnfill-line] Too many LINE correction values

    The number of blocks to correct, specified in the associated file, exceeds the maximum number allowed. The current limit is 1000. Decrease the number of blocks specified in INFILE.

  4. [lnfill-nbrln] LINES must have a corresponding number of bad lines

    The format of the associated file requires the line number for the first bad line in a block and the number of lines in the block. Correct the problem in the file specified for INFILE.

  5. [lnfill-open] Error opening line file

    Unable to open the file specified in INFILE. Re-enter the value of INFILE with a valid file specification.

  6. [lnfill-size] Input images do not have same window size

    The input images have different window sizes. Re-enter the value of IN with images having identical window sizes.

  7. [lnfill-window] Error specifying window

    Window specifications are not correct. Check the value of IN and the block specifications in the associated file containing the line information.

User notes:

    None.