Some image processing methods inherently smooth the images with an ideal filter, that is, a rectangular pulse. Comparing those methods with others that use a more typical Gaussian kernel can thus be challenging, as even if the full-width at half-maximum (FWHM) of the Gaussian filter is made equal to the width of the rectangular pulse, the resulting smoothnesses are not similar.
What would be the FWHM of a Gaussian filter that produces smoothness as similar as possible as that of a rectangular pulse of width ? This must depend only on the choice of the standard deviation of the Gaussian filter, which is the only parameter we can choose, versus the width of the ideal filter, which is also the only parameter that can be controlled (when it even can). If you ever wondered about this important question, here you will find the answer.
Note: This is the first time I use AI for an article (Claude 4.6, specifically). It certainly saved some time. I believe I am in good company in that.
Definitions: Consider the following two real-valued functions each normalized to have unit area:
1) A rectangular pulse of width :
2. A Gaussian centered at the origin with standard deviation :
We want to find the value of as a function of that minimizes the integral of squared difference between the two functions:
Solution: We start by expanding the integrand into 3 separate terms:
For , we substitute so
For , since on an interval of length and zero elsewhere, we have:
which does not depend on .
For , given that only on the interval , we have:
Substituting so that , and defining , thus mapping the integration limits to :
Noting that , we obtain:
Hence:
We need now to differentiate with respect to and set it to zero. The derivative of the first term is:
For the second term, using the chain rule with and , we have:
Setting :
and solving for :
Recalling we defined and solving for :
From a previous article, we know that the FWHM of a Gaussian filter can be expressed as .
Final result: Hence, we have:
Which means that the FWHM of the Gaussian filter is approximately 0.8164965809277 times the width of the rectangular filter.
Example: Suppose you did some image processing that involved averaging over a sphere with radius 30 mm. The width of the rectangular function is 60 mm. The FWHM of the closest Gaussian filter that yields similar degree of smoothing is approximately 48.99 mm.