Gaussian image filter is a low-pass discrete Gaussian filter that smooths out the image by doing a Gaussian-weighted averaging of neighbor pixels of a given input pixel. It produces images with less artifacts than Box Image Filter, but could potentially be more costly to compute.
It supports two modes of operation:
Input | Gaussian kernel | Output |
---|---|---|
![]() | 7x7 support, \[ \sigma=1.7 \] | ![]() |
Gaussian filter is implemented as a convolution operation on the input image where the kernel has the following weights:
\[ w_g[x,y] = \frac{1}{2\pi\sigma^2} \cdot e^{-\frac{x^2+y^2}{2\sigma^2}} \]
When the input kernel support size is 0 for a given dimension (or both), it is calculated from the given standard deviation by assuming that the weights outside \(\pm3\sigma\) window are zero.
In this case, the following formula is used:
\[ w = \max\{3,2 \times \lceil 3\sigma\rceil-1\} \]
Gaussian filter is currently implemented using separable image convolver if it satisfies \(max(m,n) \geq 7\), and the input characteristics (size and/or type) satisfies its constraints.
If \(max(m,n) < 7\), it'll use image convolver if input characteristics satisfies its constraints, or else the operation will fail.