Image Processing Reference
In-Depth Information
and thresholding operation. The MAE of a WOS or median filter will therefore be
either greater than or the same as an unconstrained filter implemented within the
same-sized window.
The unconstrained filter implemented in a window of
n
pixels has 2
n
independ-
ent input combinations. The WOS and median filters have a much smaller set of
possible inputs. Taking the special case of a simple rank-order filter
(
x
), all inputs
with the same Hamming weight are in effect the same input. The Hamming weight
6
is the sum of the pixel values in the filter window, i.e.,
|
x
|=
ψ
i
X
i
. Therefore, for a
5-input window, the inputs
x
= (0,0,0,0,1),
x
= (0,0,0,1,0),
x
= (0,0,1,0,0),
x
=
(0,1,0,0,0),
x
= (1,0,0,0,0) all result in the same output. This means that many in-
puts for the unconstrained filter map to a single input in the rank-order filter. The
filter may therefore be written as a function of the Hamming weight of the input
vector, (
|
x
|). There are in effect just
n+
1 inputs rather than 2
n
. The observation
table may therefore be written with just
n+
1 lines.
Consider the images of Fig. 6.3. A 3
Σ
3 WOS filter results in an observation ta-
ble with just 10 (|
x
| = 0……..9) lines compared to 512(= 2
9
) lines for the uncon-
strained function. In the binary case, the simple rank-order filter is equivalent to
placing a threshold value
r
on the Hamming weight of the input
|
x
| such that the fil-
ter output
×
r
, and (
|
x
|)
=
0
if
|
x
|<
r
. The design of the optimum
rank filter therefore reduces to the selection of the value
r
.
Following the same procedure as in previous chapters, the value of
r
should be
set to make the output correspond to the correct value as often as possible. For sim-
plicity, the filter output value will be written as
y
. It can be seen from the table of
observations in Fig. 6.3(a) and the corresponding probabilities shown in Fig. 6.3(b)
that the probability of the filter output being
1
,
p
(
y=
1
||
x
|
) is seen to increase
monotonically with |
x
|. The value of
r
opt
that results in the optimum rank filter
(|
x
|)
opt
therefore corresponds to the minimum value of |
x
| for which
p
(
y=
1
||
x
|
)
(
|
x
|)
=
1if
|
x
|
≥
≥
0.5. In this case
r
opt
= 6. Selecting any other rank, including the median (
r=
5) will
result in a filter with an increased error compared to (
|
x
|)
opt
(
r=
6). The number of
pixels in error in the image filtered by the optimum rank filter may be found by
summing the minimum value of
N
0
and
N
1
from each line of the table of observa-
tions. These are shown in Fig. 6.3(a) and the appropriate value is shaded in gray. A
comparison of the noisy image filtered by the optimum filter and by the median fil-
ter is shown in Fig. 6.3(c) and 6.3(d). The median has an additional 24 pixels in er-
ror corresponding to the difference between
N
0
and
N
1
(308 and 284) in line |
x
|=5
in the observation table.
6.6 Weight-Monotonic Property
It was seen in Fig. 6.3(b) that the probability of the filter output being
1
,
p
(
y=
1
||
x
|
)
increased monotonically with |
x
|, i.e.,