Image Processing Reference
In-Depth Information
Figure 3.14
Applying direct averaging
ave(pic,winsize) :=
new
zero(pic)
half floor winsize
2
for x half..cols(pic)-half-1
for y half..rows(pic)-half-1
winsize-1
winsize-1
pic
(winsize winsize)
y+iwin-half,x+jwin-half
iwin=0
jwin=0
new
floor
y,x
new
Code 3.6
Direct averaging
sum winsize·winsize
for y 0..winsize-1
for x 0..winsize-1
template y,x
averaging - template(winsize):=
1
template
sum
smoothed := tm - conv(p, averaging - template(3))
Code 3.7
Direct averaging by template convolution
The effect of averaging is to reduce noise, this is its advantage. An associated disadvantage
is that averaging causes blurring which reduces detail in an image. It is also a low-pass
filter since its effect is to allow low spatial frequencies to be retained, and to suppress high
frequency components. A larger template, say 5 × 5, will remove more noise (high frequencies)
but reduce the level of detail. The size of an averaging operator is then equivalent to the
reciprocal of the bandwidth of a low-pass filter it implements.
Search WWH ::




Custom Search