Image convolver algorithm performs a 2D convolution operation on the input image with the provided 2D kernel. This is useful when the kernel isn't separable and its dimensions are smaller than 5x5. In other cases, it's usually preferable to use the separable image convolver algorithm due to its speed.
Input | Kernel | Output |
---|---|---|
![]() | \[ \begin{bmatrix} 1 & 0 & -1 \\ 0 & 0 & 0 \\ -1 & 0 & 1 \end{bmatrix} \] | ![]() |
Discrete 2D convolution is implemented using the following discrete function:
\[ I'[x,y] = \sum_{m=0}^{k_h} \sum_{n=0}^{k_w} K[m,n] \times I[x-(n-\lfloor k_w/2 \rfloor), y-(m-\lfloor k_h/2 \rfloor) ] \]
Where:
Consult the Image Convolution for a complete example.
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.65 ms | 0.0649 ms | 0.9631 ms |
1920x1080 | u8 | 5x5 | 1.02 ms | 0.0756 ms | 1.2312 ms |
1920x1080 | u8 | 7x7 | 1.434 ms | 0.1192 ms | 1.7560 ms |
1920x1080 | u8 | 11x11 | 3.622 ms | 0.2506 ms | 3.2589 ms |
1920x1080 | u16 | 3x3 | 0.82 ms | 0.1077 ms | 1.0607 ms |
1920x1080 | u16 | 5x5 | 1.12 ms | 0.1281 ms | 1.5125 ms |
1920x1080 | u16 | 7x7 | 1.54 ms | 0.1923 ms | 2.3490 ms |
1920x1080 | u16 | 11x11 | 3.3 ms | 0.4171 ms | 4.6461 ms |
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 1.5 ms | 0.256 ms | n/a |
1920x1080 | u8 | 5x5 | 2.54 ms | 0.305 ms | n/a |
1920x1080 | u8 | 7x7 | 4.07 ms | 0.482 ms | n/a |
1920x1080 | u8 | 11x11 | 11.3 ms | 0.7997 ms | n/a |
1920x1080 | u16 | 3x3 | 1.74 ms | 0.381 ms | n/a |
1920x1080 | u16 | 5x5 | 2.83 ms | 0.389 ms | n/a |
1920x1080 | u16 | 7x7 | 4.14 ms | 0.574 ms | n/a |
1920x1080 | u16 | 11x11 | 11.19 ms | 0.9969 ms | n/a |
size | type | kernel | CPU | CUDA | PVA |
---|---|---|---|---|---|
1920x1080 | u8 | 3x3 | 3.14 ms | 0.670 ms | n/a |
1920x1080 | u8 | 5x5 | 5.73 ms | 0.8814 ms | n/a |
1920x1080 | u8 | 7x7 | 8.78 ms | 1.3284 ms | n/a |
1920x1080 | u8 | 11x11 | 25.55 ms | 2.2300 ms | n/a |
1920x1080 | u16 | 3x3 | 3.698 ms | 0.964 ms | n/a |
1920x1080 | u16 | 5x5 | 5.93 ms | 1.0299 ms | n/a |
1920x1080 | u16 | 7x7 | 9.06 ms | 1.564 ms | n/a |
1920x1080 | u16 | 11x11 | 25.92 ms | 2.8124 ms | n/a |