Image Processing Reference
In-Depth Information
The positive median will retain the center value should it be 1. This may be
written as
ψ
+ med =
X 2 +
ψ
med ,
ψ
+ med =
X 2 + X 0 X 1 X 3 + X 0 X 1 X 4 + X 0 X 3 X 4 + X 1 X 3 X 4 .
(6.4)
For the output pixel to be black, either the center pixel must be black or at least three
of the four other pixels must be black.
Alternatively, the negative median will preserve the value of the center pixel
should it be 0, otherwise it follows the median and can be written as:
ψ
med =
ψ
med . X 2 .
ψ
med = X 0 X 1 X 2 + X 0 X 2 X 3 + X 0 X 2 X 4 + X 1 X 2 X 3 + X 1 X 2 X 4 + X 2 X 3 X 4 .
(6.5)
ψ
med = X 2 ( X 0 X 1 + X 0 X 3 + X 0 X 4 + X 1 X 3 + X 1 X 4 + X 3 X 4 ).
For the negative median filter, the center pixel will only be black if it is black prior
to filtering and supported by at least two other black pixels.
6.4 Weighted Median Filters
Median filters give equal weighting to all of the pixels within the window. As men-
tioned earlier, this can cause streaking effects especially for larger window sizes.
This effect can be reduced by giving more importance to the pixels close to the cen-
ter of the filter window.
It is often claimed that the median filter is good at preserving edges. This is
only half true. In grayscale images that would otherwise be blurred by Gaussian or
other linear smoothing filters, the abrupt height of the step of the edge is preserved.
However, the position of the edge can be shifted to a different location.
Figure 6.1 shows two examples of image detail that may be damaged by me-
dian filtering. The first shows a corner pixel removed from a 90 degree angle. This
may be preserved using a weighted median. The second effect is known as edge
“pulling”. Isolated noise pixels close to an edge can cause it to be pulled out at this
point.
Search WWH ::




Custom Search