VPI - Vision Programming Interface

1.0 Release

Convolution

Convolves an image with a 2D kernel. More...

Functions

VPIStatus vpiSubmitConvolution (VPIStream stream, uint32_t backend, VPIImage input, VPIImage output, const float *kernelData, int32_t kernelWidth, int32_t kernelHeight, VPIBorderExtension border)
 Runs a generic 2D convolution over an image. More...
 
VPIStatus vpiSubmitSeparableConvolution (VPIStream stream, uint32_t backend, VPIImage input, VPIImage output, const float *kernelXData, int32_t kernelXSize, const float *kernelYData, int32_t kernelYSize, VPIBorderExtension border)
 Runs a generic 2D convolution operation over an image, optimized for separable kernels. More...
 

Detailed Description

Convolves an image with a 2D kernel.

vpiSubmitConvolution is used for generic 2D kernels, separable or not. For separable kernels, it's usually more efficient to use vpiSubmitSeparableConvolution.

Function Documentation

◆ vpiSubmitConvolution()

VPIStatus vpiSubmitConvolution ( VPIStream  stream,
uint32_t  backend,
VPIImage  input,
VPIImage  output,
const float *  kernelData,
int32_t  kernelWidth,
int32_t  kernelHeight,
VPIBorderExtension  border 
)

#include <vpi/algo/Convolution.h>

Runs a generic 2D convolution over an image.

Parameters
[in]streamThe stream handle where the operation will be queued in.
[in]backendBackend that will execute the algorithm.
[in]inputInput image to be convolved with the kernel.
[out]outputOutput image where the result is written to. Its image format and dimensions must be the same as input.
[in]kernelWidth,kernelHeightKernel dimensions.
[in]kernelDataConvolution kernel coefficients, in row-major layout.
[in]borderBorder extension.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiSubmitSeparableConvolution()

VPIStatus vpiSubmitSeparableConvolution ( VPIStream  stream,
uint32_t  backend,
VPIImage  input,
VPIImage  output,
const float *  kernelXData,
int32_t  kernelXSize,
const float *  kernelYData,
int32_t  kernelYSize,
VPIBorderExtension  border 
)

#include <vpi/algo/Convolution.h>

Runs a generic 2D convolution operation over an image, optimized for separable kernels.

Parameters
[in]streamThe stream handle where the operation will be queued in.
[in]backendBackend that will execute the algorithm.
[in]inputInput image to be convolved with the kernel.
[out]outputOutput image where the result is written to. Its image format and dimensions must be the same as input's.
[in]kernelXSize,kernelYSizeKernel dimensions in X and Y directions.
[in]kernelXData,kernelYDataConvolution kernel coefficients, in both X and Y directions respectively.
[in]borderBorder extension.
Returns
an error code on failure else VPI_SUCCESS.