User's Guide

DESWATH

Performs one-dimensional filtering of an image.

Function:

Reduces or eliminates the swathing or banding found in Landsat TM images. A three-pass filter technique is applied to the input image. Each filter is one line by a user-specified number of samples. DESWATH may also be useful in filtering other types of image noise.

Parameters:

IN
Input image. IN may be a single- or multi-band image and may contain BYTE, INTEGER*2, INTEGER*4, or REAL*4 pixel data. Window and/or band options may be specified. The window size of all input images are required to be the same. If the data type of the output image is to be the same as the input images, i.e., ODTYPE = SAME, and the input images do not have the same data type, then the output image is the same data type as the first image specified.

OUT
Output image. The output image is the same size as the input image specification. Output data type is determined by ODTYPE.

KERNDIM(51,41,31)
Filter kernel size. It is the kernel value to be applied for each pass--the number of pixels in the sample direction that is used to determine the lowpass, the highpass and then again the lowpass filter. The filter is one line by the user-specified number of samples. The first value is the kernel used for pass one, the second for pass two, and the third for pass three.

SMTHRVAL(20)
Smoothing threshold value. This dictates which values are to be included within the deswathing algorithm.

OFFSET(100.0)
Offset to be applied during processing to ensure values will remain within range for byte data.

ODTYPE(SAME)
Output data type. The data type of the output image.


  = SAME:  Same as input. 
  = BYTE:  BYTE      (8-bit unsigned integer)
                     (0 through 255)
  = I*2:   INTEGER*2 (16-bit signed integer)
                     (-32768 through 32767)
  = I*4:   INTEGER*4 (32-bit signed integer)
                     (-2147483648 through 2147483647)
  = R*4:   REAL*4    (32-bit signed real)
                     (System dependent)

Examples:

  1. LAS> deswath in=ny.dat out=out.dat kerndim=(51,41,31) smthrval=25 odtype=same

    The user has requested to filter image NY.DAT into image OUT.DAT. Image NY.DAT will be of the same size and data type as NY.DAT because the window and band options were not specified on the input image and the parameter ODTYPE is set to SAME indicating no data conversion is to take place. The filter size is 1 x 51 for the first pass, 1 x 41 for the second pass, and 1 x 31 for the third pass.

  2. LAS> deswath in="image1(:1,3)+image2(100,200,500,512:4)" out=out.dat kerndim=(51,41,31) smthrval=15 odtype=i*4

    The user has requested to filter bands 1 and 3 of image IMAGE1 and band 4 of image IMAGE2 into image OUT.DAT. It is assumed that IMAGE1 is a 500 line by 512 sample image; otherwise, an error results because window sizes are not the same. Image OUT.DAT is a three-band 500 line by 512 sample image with data type of 32-bit signed integer. DESWATH uses 1 x 51, 1 x 41, and 1 x 31 filter sizes.

Description/Algorithm:

The program starts by retrieving the input parameters. Error checking is done on the input image(s) to ensure that they all have equal window sizes. After parameter verification, the input image is filtered to cosmetically remove scan-line noise from geometrically corrected LANDSAT thematic mapper (TM) data (i.e., P-tape imagery).

Due to the amount of time taken to process data in two-dimensional windows, it has been decided to process each step separately with other LAS modules used for rotation and subtraction where necessary. The modules used in this procedure and the order used is as follows:

  DESWATH  - Applies low-pass filter
  FLIP-90  - Rotates 90 degrees
  DESWATH  - Applies a high-pass filter
  MATH-SUB - Subtracts filtered image from original
  FLIP-270 - Rotates 270 degrees
  DESWATH  - Applies a low-pass filter
  COPY     - Converts the original data to the desired data type
  MATH-SUB - Subtracts from previously subtracted data

This procedure PDF performs the following steps:


  1.  Applies a low-pass filter (default 51 sample) to the input 
      image.

  2.  Rotates the image by 90 degrees in order to apply the filter
      in the line direction.

  3.  Applies a high-pass filter (default 41 sample), which is a 
      central pixel value minus filter-window mean, to the output 
      from step two.

  4.  Subtracts the image created in step three from the original 
      image.

  5.  Rotates the image by 270 degrees in order to apply the final
      filter.
  
  6.  Applies a low-pass filter (default 31 sample) to the output
      from step five.

  7.  Runs COPY to convert the original image to the datatype of
      the output image for the subtraction process.
  
  8.  Subtracts the image produced in step seven from the image
      created in step four.  This is the final filtered image.

Reference:  Crippen, R.E., 1989, "A Simple Spatial Filtering 
            Routine for the Cosmetic Removal of Scan-Line Noise 
            from LANDSAT TM P-Tape Imagery," Photogrammetric 
            Engineering and Remote Sensing, Vol 55, No.3, 
            March 1989, p327-331.

Nonfatal Error Message:

  1. [deswath2-warn] Nonfatal error encountered -- Image data saved

    A nonfatal error was encountered during processing. The image data is probably valid and therefore saved. The error message that is displayed immediately preceding this message is the specific error that was encountered. Processing continues.

Fatal Error Messages:

  1. [deswath-fatal] Fatal error encountered -- Image data saved

    A fatal error was encountered during processing. The output image file is not deleted, and processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  2. [deswath-window] Input images do not have same window sizes

    Error occurs if multiple input images are specified with different window sizes.

User Notes:

  1. Timing for four-band 256 x 256 BYTE image is 01:10. It should be noted that the time will increase as the kernel size is increased or the data type is increased.

  2. The related modules which are performed within the PDF are FLIP-90, MATH-SUB, FLIP-270, and COPY.