Image Processing Reference
In-Depth Information
Gaussian_template (19, 4)
Figure 3.17
Gaussian function
0.02
0.08
0.14
0.08
0.02
0.08
0.37
0.61
0.37
0.08
0.14
0.61
1.0
0.61
0.14
0.08
0.37
0.61
0.37
0.08
0.02
0.08
0.14
0.08
0.02
Figure 3.18
Template for the 5 ×
5 Gaussian averaging operator σ
= 1.0)
By reference to Figure 3.16 it is clear that the Gaussian filter can offer improved
performance compared with direct averaging: more features are retained whilst the noise
is removed. This can be understood by Fourier transform theory. In Section 2.4.2 (Chapter
2) we found that the Fourier transform of a square is a two-dimensional sinc function. This
has a non-even frequency response (the magnitude of the transform does not reduce in a
smooth manner) and has regions where the transform becomes negative, called sidelobes.
These can have undesirable effects since there are high frequencies that contribute more
than some lower ones, a bit paradoxical in low-pass filtering to remove noise. In contrast,
the Fourier transform of a Gaussian function is another Gaussian function, which decreases
smoothly without these sidelobes. This can lead to better performance since the contributions
of the frequency components reduce in a controlled manner.
In a software implementation of the Gaussian operator, we need a function implementing
Equation 3.22, the Gaussian_template function in Code 3.9 . This is used to calculate
the coefficients of a template to be centred on an image point. The two arguments are
winsize , the (square) operator's size, and the standard deviation σ that controls its
width, as discussed earlier. The operator coefficients are normalised by the sum of template
values, as before. This summation is stored in sum , which is initialised to zero. The centre
of the square template is then evaluated as half the size of the operator. Then, all template
coefficients are calculated by a version of Equation 3.22 which specifies a weight relative
to the centre co-ordinates. Finally, the normalised template coefficients are returned as the
Gaussian template. The operator is used in template convolution, via convolve , as in
direct averaging (Code 3.5 ).
Search WWH ::




Custom Search