
184 A Computational Introduction to Digital Image Processing, Second Edition
The reason is that
fspecial adjusts its output to keep the volume under the Gaussian
function always 1. This means that a wider function, with a large standard deviation, will
have a low maximum. So we need to scale the result so that the central value will be 1; and
mat2gray does that automatically.
The transforms are shown in Figure 7.24(a) and (c). In each case, the final parameter of
the
fspecial
function is the standard deviation; it controls the width of the filter. Clearly,
the larger the standard deviation, the wider the function, and so the greater amount of the
transform ...