Image Processing Reference
In-Depth Information
Figure 2.7
(a) Window content for
x
= (1, 0, 1) and (b) count of observations for input
x
= (1,
0, 1).
The content of the filter window is as shown in Fig. 2.7(a). The count of observa-
tion values for this window is repeated in Fig. 2.7(b). As the filter window is passed
over the image, the pixel pattern shown in Fig. 2.7(a) was observed a total of five
times. It can be seen that on four occasions the corresponding ideal value was 1, and
in the remaining case it was 0. For this type of filter, a single value of output must be
assigned to each input combination. If the filter output for this particular input is set
to 1, it will be correct for four pixels and cause an error at just one. Alternatively,
setting the filter output to 0 would cause four pixels to be in error and only one to be
correct.
Hence, the allocation of the output value for each input combination (i.e. the
design strategy) is as follows:
ψ
opt ( x ) = 1 f N 1 ( x ) N 0 ( x )
and
ψ
opt ( x ) = 0 otherwise,
(2.5)
where N 1 ( x ) and N 0 ( x ) correspond to the number of observations in the ideal image
I o for which the corresponding pixel was 1 or 0, respectively.
In other words, the output is set to the value that is correct most often. This pro-
cess is repeated for every input combination, and hence the optimum filter may be
determined. Figure 2.8 shows the table for all inputs. The output of the optimum fil-
ter corresponds to the most commonly occurring ideal value.
Using only the most basic knowledge of Boolean algebra, the filtering function
can be easily shown to be
ψ
opt ( x ) =X 0 X 1 +X 0 X 2 +X 1 X 2 .
(2.6)
 
Search WWH ::




Custom Search