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\} \]
For more details, consult the API reference.
Constraints for specific backends supersede the ones specified for all backends.
For further information on how performance was benchmarked, see Performance Measurement.
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 0.27 ms | 0.0652 ms | 1.017 ms |
1920x1080 | u8 | 5x5 | 0.564 ms | 0.0689 ms | 1.318 ms |
1920x1080 | u8 | 7x7 | 0.65 ms | 0.0882 ms | 1.958 ms |
1920x1080 | u8 | 11x11 | 0.89 ms | 0.0992 ms | 3.45 ms |
1920x1080 | u16 | 3x3 | 0.43 ms | 0.1070 ms | 1.117 ms |
1920x1080 | u16 | 5x5 | 0.59 ms | 0.1159 ms | 1.595 ms |
1920x1080 | u16 | 7x7 | 1.12 ms | 0.1346 ms | 2.521 ms |
1920x1080 | u16 | 11x11 | 1.29 ms | 0.1579 ms | 4.83 ms |
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 0.831 ms | 0.259 ms | n/a |
1920x1080 | u8 | 5x5 | 1.02 ms | 0.292 ms | n/a |
1920x1080 | u8 | 7x7 | 1.14 ms | 0.397 ms | n/a |
1920x1080 | u8 | 11x11 | 1.58 ms | 0.472 ms | n/a |
1920x1080 | u16 | 3x3 | 1.97 ms | 0.390 ms | n/a |
1920x1080 | u16 | 5x5 | 2.1 ms | 0.422 ms | n/a |
1920x1080 | u16 | 7x7 | 2.72 ms | 0.584 ms | n/a |
1920x1080 | u16 | 11x11 | 3.39 ms | 0.679 ms | n/a |
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 1.559 ms | 0.669 ms | n/a |
1920x1080 | u8 | 5x5 | 2.269 ms | 0.746 ms | n/a |
1920x1080 | u8 | 7x7 | 2.72 ms | 1.024 ms | n/a |
1920x1080 | u8 | 11x11 | 3.029 ms | 1.236 ms | n/a |
1920x1080 | u16 | 3x3 | 3.58 ms | 0.976 ms | n/a |
1920x1080 | u16 | 5x5 | 4.21 ms | 1.021 ms | n/a |
1920x1080 | u16 | 7x7 | 5.269 ms | 1.392 ms | n/a |
1920x1080 | u16 | 11x11 | 7.31 ms | 1.663 ms | n/a |