Convolves an image with a 2D kernel. More...
Functions | |
VPIStatus | vpiSubmitConvolution (VPIStream stream, uint64_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, uint64_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... | |
Convolves an image with a 2D kernel.
Refer to Convolution for more details and usage examples regarding Convolution. Refer to Separable Convolution for more details and usage examples regarding Separable Convolution.
vpiSubmitConvolution is used for generic 2D kernels, separable or not. For separable kernels, it's usually more efficient to use vpiSubmitSeparableConvolution.
VPIStatus vpiSubmitConvolution | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIImage | input, | ||
VPIImage | output, | ||
const float * | kernelData, | ||
int32_t | kernelWidth, | ||
int32_t | kernelHeight, | ||
VPIBorderExtension | border | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/Convolution.h>
Runs a generic 2D convolution over an image.
[in] | stream | The stream handle where the operation will be queued in.
| ||||||||||||||||||||||||||||||||||||||||
[in] | backend | Backend that will execute the algorithm.
| ||||||||||||||||||||||||||||||||||||||||
[in] | input | Input image to be convolved with the kernel.
| ||||||||||||||||||||||||||||||||||||||||
[out] | output | Output image where the result is written to.
| ||||||||||||||||||||||||||||||||||||||||
[in] | kernelWidth,kernelHeight | Kernel dimensions.
| ||||||||||||||||||||||||||||||||||||||||
[in] | kernelData | Convolution kernel coefficients, in row-major layout. The kernel elements are copied to an internal buffer. The buffers passed can be deallocated after the call.
| ||||||||||||||||||||||||||||||||||||||||
[in] | border | How to handle pixels outside image boundaries.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | input or output are NULL. |
VPI_ERROR_INVALID_ARGUMENT | kernelWidth or kernelHeight are outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | kernelData is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Some weight in kernelData is outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | input or output dimensions outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | input and output image must have same dimensions. |
VPI_ERROR_INVALID_ARGUMENT | border not supported. |
VPI_ERROR_INVALID_ARGUMENT | backend is invalid or unknown. |
VPI_ERROR_INVALID_IMAGE_FORMAT | input or output format not supported. |
VPI_ERROR_INVALID_IMAGE_FORMAT | input and output formats are not compatible. |
VPI_ERROR_NOT_IMPLEMENTED | Convolution algorithm is not supported by given backend. |
VPI_ERROR_INVALID_OPERATION | Backend hardware not available. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , input or output . |
VPI_SUCCESS | Operation executed successfully. |
VPIStatus vpiSubmitSeparableConvolution | ( | VPIStream | stream, |
uint64_t | backend, | ||
VPIImage | input, | ||
VPIImage | output, | ||
const float * | kernelXData, | ||
int32_t | kernelXSize, | ||
const float * | kernelYData, | ||
int32_t | kernelYSize, | ||
VPIBorderExtension | border | ||
) |
#include </opt/nvidia/vpi2/include/vpi/algo/Convolution.h>
Runs a generic 2D convolution operation over an image, optimized for separable kernels.
[in] | stream | The stream handle where the operation will be queued in.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | backend | Backend that will execute the algorithm.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | input | Input image to be convolved with the kernel.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[out] | output | Output image where the result is written to.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | kernelXSize,kernelYSize | Kernel dimensions in X and Y directions.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | kernelXData,kernelYData | Convolution kernel coefficients, in both X and Y directions respectively. The kernel elements are copied to an internal buffer. The buffers passed can be deallocated after the call.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[in] | border | How to handle pixels outside image boundaries.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | input or output are NULL. |
VPI_ERROR_INVALID_ARGUMENT | kernelXData or kernelYData are NULL. |
VPI_ERROR_INVALID_ARGUMENT | kernelXSize or kernelYSize outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | Some weight in kernelData is outside valid range. |
VPI_ERROR_INVALID_ARGUMENT | input or output image dimensions outside valid range.. |
VPI_ERROR_INVALID_ARGUMENT | border not supported. |
VPI_ERROR_INVALID_ARGUMENT | input and output image dimensions and format do not match. |
VPI_ERROR_INVALID_ARGUMENT | backend is invalid or unknown. |
VPI_ERROR_INVALID_IMAGE_FORMAT | input and output formats aren't supported |
VPI_ERROR_NOT_IMPLEMENTED | Separable Convolution algorithm is not supported by given backend. |
VPI_ERROR_INVALID_OPERATION | Backend hardware not available. |
VPI_ERROR_INVALID_OPERATION | The needed backends aren't enabled in stream , input or output . |
VPI_SUCCESS | Operation executed successfully. |