Median filter

From Wikipedia, the free encyclopedia

In image processing it is usually necessary to perform high degree of noise reduction in an image before performing higher-level processing steps, such as edge detection. The median filter is a non-linear digital filtering technique, often used to remove noise from images or other signals. The idea is to examine a sample of the input and decide if it is representative of the signal. This is performed using a window consisting of an odd number of samples. The values in the window are sorted into numerical order; the median value, the sample in the center of the window, is selected as the output. The oldest sample is discarded, a new sample acquired, and the calculation repeats.

Median filtering is a common step in image processing. It is particularly useful to reduce speckle noise and salt and pepper noise. Its edge-preserving nature makes it useful in cases where edge blurring is undesirable.

[edit] Example

to demonstrate the median filter will be applied to the following array with a window size of 3, repeating edge values:

x = [2 80 6 3]

y[1] = Median[2 2 80] = 2
y[2] = Median[2 80 6] = Median[2 6 80] = 6
y[3] = Median[80 6 3] = Median[3 6 80] = 6
y[4] = Median[6 3 3] = Median[3 3 6] = 3

so
y = [2 6 6 3]

where y is the median filtered output of x

[edit] See also

[edit] External links

Image:Mathapplied-stub_ico.png This applied mathematics-related article is a stub. You can help Wikipedia by expanding it.
In other languages