Go to the USGS Home Page

USGS MIPS Median Documentation






This program applies a convolution  filter to an image . The filter operator is the median of a NxN window, that is, the DN  halfway through the sorted list of all the DNs in the window. The size of the window can be 3x3, 5x5, or 7x7. In addition, the program can filter all pixels in the image, only valid pixels , or only invalid pixels.

  

Files

This program requires as input an unsigned 8-bit  image file and will produce an unsigned 8-bit image file. The following information is transferred from the input file to the output file(if appropriate):

Image labels 
Mosaic labels
Projection labels
Sonar labels
Navigation  file
History  file
         

Parameters

THREE, FIVE or SEVEN

These options are used to select the size of window. The window will be square and of size 3x3, 5x5, or 7x7 depending on the option selected. The default window size is 3x3.

ALL, VALID and INVALID

These parameters are used to select which pixels in the image are to be filtered. The ALL option will filter all the pixels in the image. The VALID option will filter pixels whose DN values fall within a user specified minimum/maximum range. The INVALID option will filter pixels whose DN values fall outside a user specified minimum/maximum range. The default is to filter all pixels.

MIN and MAX

These parameters are used to define valid pixels when using the VALID or INVALID filter option. Pixels with DNs inside the range, inclusive, are valid and those outside the range are invalid. Also, for all three options, ALL, VALID, and INVALID, pixels whose DNs fall outside the range of MIN/MAX will not be used when computing the mode of the window. The defaults are 0 and 255.

Uses

Low pass filter operators such as mode, median, and averaging all defocus or blur the image. They can be used to suppress speckle in radar and sonar images, and outliers in classification images.

The main advantage of a median filter over an averaging filter (FILTER program) is it can not produce new DNs in an image. For example, given the following window from a classification image:

2   2   2
3  10  10
3   3  10
An averaging filter would generate an output of 5, while a median filter would produce a 3.

Examples

From left to right, original Landsat MSS Band 6, 3x3 median filter using all pixels, and 7x7 median filter using all pixels.

[Example Image] [Example Image] [Example Image]

See Also

Filter 
Mode 

U.S. Department of the Interior | U.S. Geological Survey | Jobs
Home | Search | Disclaimers & Privacy Web Rings
Send comments to webman@TerraWeb.wr.usgs.gov
URL:
Last Modified: Thu Oct 31 15:08:22 MST 2002
FirstGov: Your First Click to the U.S. Gov ernment