Digital Signal Processing Reference
In-Depth Information
EXAMPLE 14.7
Perform digital filtering on the noisy image using a 2 2 convolutional average kernel, and compare the enhanced
image with the original one given the following 8-bit grayscale original and corrupted (noisy) images:
2
4
3
5
100 100 100 100
100 100 100 100
100 100 100 100
100 100 100 100
4 4 original image :
2
4
3
5
99
107 113
96
92
116
84
107
4 4 corrupted image :
103
93
86
108
87
109 106 107
" 11
11
#
2 2 average kernel : 1
4
Solution:
In the following diagram, we pad edges with zeros in the last row and column before processing at the point where
the first kernel and the last kernel are shown in the dotted-line boxes, respectively:
99
107
113
96
0
0
0
92
116
84
107
103
93
86
108
1 07
87
109
106
0
000 00
99 107
92 116
To process the first element, we know that the first kernel covers the image elements as
. Summing
each product of the kernel element and the corresponding image pixel value, multiplying by a scale factor of ¼,
and rounding the result, it follows that
1
4 ð99 1 þ 107 1 þ 92 1 þ 116 1Þ¼103:5
roundð103:5Þ¼104
107 113
116
In the processing of the second element, the kernel covers
. Similarly, we have
84
1
4 ð107 1 þ 113 1 þ 116 1 þ 84 1Þ ¼ 105
roundð105Þ¼105
The process continues for the rest of image pixels. To process the last element of the first row, 96, since the kernel
96 0
107 0
covers only
, we assume that the last two elements are zeros. Then
1
4 ð96 1 þ 107 1 þ 0 1 þ 0 1Þ¼50:75
roundð50:75Þ¼51
Search WWH ::




Custom Search