VPI - Vision Programming Interface

0.4.4 Release

Convolution

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

Functions

VPIStatus vpiSubmitConvolution (VPIStream stream, VPIBackend backend, VPIImage input, VPIImage output, const float *kernelData, uint32_t kernelWidth, uint32_t kernelHeight, VPIBoundaryCond boundary)
 Runs a generic 2D convolution over an image. More...
 
VPIStatus vpiSubmitSeparableConvolution (VPIStream stream, VPIBackend backend, VPIImage input, VPIImage output, const float *kernelXData, uint32_t kernelXSize, const float *kernelYData, uint32_t kernelYSize, VPIBoundaryCond boundary)
 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,
VPIBackend  backend,
VPIImage  input,
VPIImage  output,
const float *  kernelData,
uint32_t  kernelWidth,
uint32_t  kernelHeight,
VPIBoundaryCond  boundary 
)

#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]backendThe backend 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]boundaryBoundary condition.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiSubmitSeparableConvolution()

VPIStatus vpiSubmitSeparableConvolution ( VPIStream  stream,
VPIBackend  backend,
VPIImage  input,
VPIImage  output,
const float *  kernelXData,
uint32_t  kernelXSize,
const float *  kernelYData,
uint32_t  kernelYSize,
VPIBoundaryCond  boundary 
)

#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]backendThe backend 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]boundaryBoundary condition.
Returns
an error code on failure else VPI_SUCCESS.