Additive effects of a 2D Gaussian filter
3 views (last 30 days)
Show older comments
Hello, I am curious as to if anyone knows if reapplying the Gaussian filter to an image will cause an linear increase or logarithmic....so forth change in effects. Any help would be greatly appreciated.
0 Comments
Answers (1)
David Young
on 1 Sep 2011
Suppose you apply a Gaussian filter with width parameter SIGMA1 to an image, and then you apply a second Gaussian filter with parameter SIGMA2 to the output of the first operation.
The final result is the same as applying a single Gaussian filter with parameter SIGMA3 to the original image, where the widths are related by the Pythagorean formula:
2 2 2
SIGMA3 = SIGMA1 + SIGMA2
(The SIGMA parameter is sometimes, rather misleadingly, called the 'standard deviation' of the filter.)
This assumes that the filters are represented in sufficiently large arrays that truncation at the boundaries is negligible. In practice, because there is always some truncation, this result is approximate.
Repeated application of Gaussian filtering can be a useful technique to achieve high levels of smoothing, particularly in multi-scale "pyramid" representations.
2 Comments
David Young
on 10 Sep 2011
You need to make the kernel size big enough to avoid truncating the filter too much. It's convenient to keep the size odd, so I usually use something like this:
sz = 2*(ceil(2.6 * sigma)) + 1;
filter = fspecial('gauss', sz, sigma);
That's a compromise - it loses something like 1% of the total weight of the filter to truncation.
Then you just set sigma and let sz take care of itself. If you do that you'll find you get a very big difference for different values of sigma.
See Also
Categories
Find more on Digital Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!