Sie sind auf Seite 1von 4

MEDIAN

FILTER
Theory
MATLAB Implementation
Median Filter
The neighborhood of a pixel in the image consists of the pixels surrounding it.
( 8 x 8 ) neighborhood of a pixel at the location ( i , j ):

(i-1, j-1) (i , j-1) (i +1, j-1)

(i-1 , j) (i , j) (i +1, j)

(i+1 , j+1) (i+1, j+1) (i+1 , j+1)


Median Filter
Median filter replaces the intensity value of that pixel by the median of the neighborhood of that
pixel.
For example, consider the pixel at the center with intensity value 255
The median of 9 numbers in the matrix below is 96.

101 69 0 101 69 0
Median Filter
123 255 87 123 96 87

56 96 155 56 96 155
Median Filter
Neighborhood matrix of any pixel will have 9 pixels
Its a matter of choice really. You can have bigger neighborhoods.
We have to be careful while choosing the neighborhood of a pixel. It should not exceed beyond
dimension of the original image.
For example, consider the pixel in red. Its neighborhood matrix will not have 9 pixels, therell be
only 6 pixels (itself and 5 others shown in green).

Das könnte Ihnen auch gefallen