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\} \]
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.48 ms | 0.0649 ms | 0.9617 ms |
1920x1080 | u8 | 5x5 | 0.611 ms | 0.0689 ms | 1.2313 ms |
1920x1080 | u8 | 7x7 | 0.63 ms | 0.0881 ms | 1.7580 ms |
1920x1080 | u8 | 11x11 | 0.860 ms | 0.0995 ms | 3.2604 ms |
1920x1080 | u16 | 3x3 | 0.43 ms | 0.1077 ms | 1.0608 ms |
1920x1080 | u16 | 5x5 | 0.59 ms | 0.1163 ms | 1.5124 ms |
1920x1080 | u16 | 7x7 | 1.12 ms | 0.1340 ms | 2.3514 ms |
1920x1080 | u16 | 11x11 | 1.31 ms | 0.1586 ms | 4.6484 ms |
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 0.89 ms | 0.254 ms | n/a |
1920x1080 | u8 | 5x5 | 1.013 ms | 0.288 ms | n/a |
1920x1080 | u8 | 7x7 | 1.21 ms | 0.396 ms | n/a |
1920x1080 | u8 | 11x11 | 1.57 ms | 0.471 ms | n/a |
1920x1080 | u16 | 3x3 | 1.81 ms | 0.375 ms | n/a |
1920x1080 | u16 | 5x5 | 2.15 ms | 0.418 ms | n/a |
1920x1080 | u16 | 7x7 | 2.57 ms | 0.577 ms | n/a |
1920x1080 | u16 | 11x11 | 3.41 ms | 0.668 ms | n/a |
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 1.523 ms | 0.6650 ms | n/a |
1920x1080 | u8 | 5x5 | 2.253 ms | 0.742 ms | n/a |
1920x1080 | u8 | 7x7 | 2.71 ms | 1.024 ms | n/a |
1920x1080 | u8 | 11x11 | 3.004 ms | 1.235 ms | n/a |
1920x1080 | u16 | 3x3 | 3.662 ms | 0.965 ms | n/a |
1920x1080 | u16 | 5x5 | 4.227 ms | 1.015 ms | n/a |
1920x1080 | u16 | 7x7 | 5.29 ms | 1.389 ms | n/a |
1920x1080 | u16 | 11x11 | 7.435 ms | 1.657 ms | n/a |