A Spatial Median Filter For Noise Removal in Digital Images
A Spatial Median Filter For Noise Removal in Digital Images
2 7 1 8+5+3+2+7+1+4+6+9
9
4 6 9
Mean=5
Median Filter
Drawback in the Mean Filter is poor at maintaining edges
within the image.
The Median Filter is performed by taking the magnitude of all
of the vectors within a mask and sorting the magnitudes.
The pixel with the median magnitude is then used to replace
the pixel studied.
The Simple Median Filter has an advantage over the Mean
filter in that it relies on median of the data instead of the mean.
The median of a set is more robust with respect to the
presence of noise.
How does Median Filter Work
First of all you have to sort the values of
vectors and then you have to find out center
value that is median value.
If it will be matrix data means you have to sort
the column values first and row values.
A=[4 2 3;7 9 6;2 5 6]; 2 6 2
Median=5 A= 3 7 5 = 3 5 7
4 9 6
Component Median Filter
In the Simple Median Filter, each point in the signal
is converted to a single magnitude.
In the Component Median Filter each scalar
component is treated independently.
A filter mask is placed over a point in the signal. For
each component of each point under the mask, a
single median component is determined.
These components are then combined to form a new
point, which is then used to represent the point in the
signal studied.
When working with color images, however, this filter
regularly outperforms the Simple Median Filter.
When noise affects a point in a grayscale image, the
result is called “salt and pepper” noise.
In color images, this property of “salt and pepper”
noise is typical of noise models where only one scalar
value of a point is affected.
For this noise model, the Component Median
Filter is more accurate than the Simple Median
Filter.
The disadvantage of this filter is that it will
create a new signal point that did not exist in
the original signal, which may be undesirable
in some applications.