Additive effects of a 2D Gaussian filter
古いコメントを表示
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.
回答 (1 件)
David Young
2011 年 9 月 1 日
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 件のコメント
Scott Holmes
2011 年 9 月 6 日
David Young
2011 年 9 月 10 日
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.
カテゴリ
ヘルプ センター および File Exchange で Image Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!