User's Guide

DEBAND

Filter to remove the banding pattern from Landsat TM images.

Function:

Filter to remove the banding pattern from Landsat TM images. A debanding filter with user-specified swath height and tolerance factor is applied to the input image to reduce and/or eliminate the effects of the TM banding pattern.

Parameters:

IN
Input image. The image to apply the debanding filter to. The input image must be BYTE data.

OUT
Output image. The output image produced by the debanding filter.

TOLVAL(5.0)
Tolerance value. The value used to determine upper and lower data points in the first pass of the filter algorithm.

HEIGHT(17)
Height of filter. The height of the filter window, specifying the number of lines above and below the current line to use in the first pass of the filter algorithm.

Example:

  1. LAS> deband in=image_in out=image_out tolval=4.5

    The TM debanding filter is applied to the input image IMAGE_IN using the user-specified tolerance value of 4.5 to create the output image IMAGE_OUT. The filter swath height defaults to 17.

Description/Algorithm:

The filtering algorithm works with each line of each band of the input image individually.

The premise behind the debanding filter is to implement a two-dimensional FIR (Finite Impulse Response) filter which removes the banding pattern in TM data with a minimal effect on image content. The filter window is shown below, using the default swath height of 17 lines.

           <------------ 35 pixels ---------->
         + ooooooooooooooooooooooooooooooooooo
         |
         |
	 |
       -17 lines (the value of HEIGHT)
	 |
         |                 Pixel being filtered
         |                  |
         + oooooooooooooooooXooooooooooooooooo
         |
         |
	 |
       +17 lines
	 |
         |
         |
         + ooooooooooooooooooooooooooooooooooo

The filter is implemented in two passes: a vertical pass followed by a horizontal pass. The first pass incorporates the specified tolerance to insure good performance and produces an initial correction factor. The second pass performs horizontal smoothing on the calculated initial correction factors to obtain a final correction value.

First Pass:  

   Step 1.  Find the upper data point (UDP).  
            UDP = image(x, y-HEIGHT)
		if |image(x, y) - image(x, y-HEIGHT)| <= TOLVAL
            where TOLVAL is 4 <= TOLVAL <= 8, normally TOLVAL = 5.

   Step 2.  If step 1 fails to find an UDP, then 
            UDP = average{image(x+10n, y-HEIGHT)}, 
	    n = -2,-1,0,1,2 for all values satisfying
	    |image(x,y) - image(x+10n, y-HEIGHT)| <= TOLVAL.

   Step 3.  If steps 1 & 2 fail to find the UDP, then the UDP is not used
            to calculate the inital correction factor (ICF).

   Step 4.  Find the lower data point (LDP) in an analogous manner using
            the scan line 17 pixels below the current line.

   Step 5.  Calculate the ICF:
              If UDP and LDP are found,
                ICF(x,y) = 0.5[image(x, y) - 0.5(UDP+LDP)]
              If only UDP is found,
                ICF(x,y) = 0.5[image(x, y) - UDP]
              If only LDP is found,
                ICF(x,y) = 0.5[image(x, y) - LDP]
              If neither UDP or LDP is found,
                declare no ICF at this point (not ICF = 0.0)

Second Pass:

   Step 1.  Use 35-sample-wide averaging window (all weights equal and sum
            to 1.0) to smooth ICF values along one line.  The width of the
	    smoothing window is constant and is not related to the swath
	    height as given in the HEIGHT parameter.  When performing
            the smoothing operation, only those values in the window
            which indicate that a valid ICF is available are used.  This
            gives a more desireable performance near edges.  The results
            are the final correction factors.

The final operation is to subtract the final correction values from the original image line to obtain the filtered image line. This line of data is written to disk and the process repeats for the next line until the entire input image has been filtered.

Nonfatal Error Messages:

  1. [deband-warn] Nonfatal error encountered

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

Fatal Error Messages:

  1. [deband-alloc] Error allocating dynamic memory

    An error occurred allocating memory. Rerun the function, and if the error reoccurs, notify the system manager.

  2. [deband-dtype] Data type not supported

    The DEBAND filter only works on BYTE data. Contact the LAS system administrator.

  3. [deband-fatal] Fatal error encountered

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

  4. [deband-window] Input images do not have the same window size

    The images as given by IN do not have the same window size. Correct the input image specification and rerun.

User Notes:

    None.