vpi.Image.convolution

Image.convolution(kernel: 2D array of float, *, out: vpi.Image = None, border: vpi.Border = vpi.Border.CLAMP, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image
Image.convolution(kernel_x: array of float, kernel_y: array of float, *, out: vpi.Image = None, border: vpi.Border = vpi.Border.CLAMP, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image

Runs a generic 2D convolution over the image.

Hint

This function is used for generic 2D kernels, separable or not. For separable kernels, it’s usually more efficient to use it with kernel_x and kernel_y parameters.

See also

Refer to the convolution algorithm explanation and the separable convolution algorithm explanation for more details and usage examples.

Parameters
  • kernel (2D array of float) – Convolution kernel coefficients.

  • kernel_x (array of float) – Convolution kernel coefficients in X direction (horizontal). It can be a 1D array or a 2D array with height==1.

  • kernel_y (array of float) – Convolution kernel coefficients in Y direction (vertical). It can be a 1D array or a 2D array with width==1.

  • out (vpi.Image, optional) – The output for the algorithm.

  • border (vpi.Border, optional) – The border extension used by the algorithm.

  • backend (vpi.Backend, optional) – The backend to be used by the algorithm.

  • stream (vpi.Stream, optional) – The stream to be used by the algorithm.

Returns

The output for the algorithm.

Return type

vpi.Image

Caution

Restrictions to several arguments may apply. Check the C API references of the submit convolution function and the submit separable convolution function and also their group concepts for more details.