Median Filtering
Median filtering is a nonlinear process useful in reducing impulsive, or salt-and-pepper noise. It is also useful in preserving edges in an image while reducing random noise. Impulsive or salt-and pepper noise can occur due to a random bit error in a communication channel. In a median filter, a window slides along the image, and the median intensity value of the pixels within the window becomes the output intensity of the pixel being processed.For example, suppose the pixel values within a window are 5,6, 55, 10 and 15, and the pixel being processed has a value of 55. The output of the median filter an the current pixel location is 10, which is the median of the five values.
|
|
|
Like lowpass filtering, median filtering smoothes the image and is thus useful in reducing noise.
Unlike lowpass filtering, median filtering can preserve discontinuities in a step function and can smooth a few pixels whose values differ significantly from their surroundings without affecting the other pixels.Figure (5.21) shows a 1-D step sequence degraded by a small amount of random noise. Figure (5.21) shows the result after filtering with a lowpass filter whose impulse response is a 5-point rectangular window. Figure (5.21) shows the result after filtering with 5-point median filter. It is clear from the figure that the step discontinuity is better preserved by the median filter. Figure (5.21a) shows a 1-D sequence with two values that are significantly different from the surrounding points. Figures (b) and (c) show the result of a lowpass filter and a median filter, respectively. The filters used in figure (5.22) are the same as those used in figure(5.21). If the two impulsive values are due to noise, the result of using a median filter will be the reduce the noise. If the two values are part of the signal, however, using the median filter will distort the signal.
|
|
|
(continued in the next slide)
|