VPI - Vision Programming Interface

3.2 Release

Filter an image with a 2D binary kernel composed with the erode morphological operation. More...

Functions

VPIStatus vpiSubmitErode (VPIStream stream, uint64_t backend, VPIImage input, VPIImage output, const int8_t *kernelData, int32_t kernelWidth, int32_t kernelHeight, VPIBorderExtension border)
 Runs a 2D erode over an image. More...
 

Detailed Description

Filter an image with a 2D binary kernel composed with the erode morphological operation.

Refer to Erode for more details and usage examples regarding Erode.

Function Documentation

◆ vpiSubmitErode()

VPIStatus vpiSubmitErode ( VPIStream  stream,
uint64_t  backend,
VPIImage  input,
VPIImage  output,
const int8_t *  kernelData,
int32_t  kernelWidth,
int32_t  kernelHeight,
VPIBorderExtension  border 
)

#include <vpi/algo/MorphologicalFilter.h>

Runs a 2D erode over an image.

Parameters
[in]streamThe stream handle where the operation will be queued in.
  • Must not be NULL.
  • Stream must have enabled the backends that will execute the algorithm.
[in]backendBackend that will execute the algorithm.
[in]inputInput image to be eroded with the kernel.
[out]outputOutput image where the result is written to.
  • Must not be NULL.
  • Must have same format and dimensions as input image.
  • Image must have enabled the backends that will execute the algorithm.
[in]kernelWidth,kernelHeightKernel dimensions.
  • Must be between 1x1 and 11x11, and can be non-square. (PVA only supports 3x3 and 5x5 square sizes)
[in]kernelDataErode kernel binary mask, i.e. structuring element or neighborhood definition, in row-major layout. The kernel elements are copied to an internal buffer. The buffers passed can be deallocated after the call. Use NULL for full neighborhood, all elements considered to be 1.
  • If not NULL, it must point to a buffer with kernelWidth * kernelHeight elements. (PVA only supports 3x3, 5x5 square and 3x3 cross kernels)
[in]borderHow to handle pixels outside image boundaries.
Return values
VPI_ERROR_INVALID_ARGUMENTstream is NULL.
VPI_ERROR_INVALID_ARGUMENTinput or output are NULL.
VPI_ERROR_INVALID_ARGUMENTkernelWidth or kernelHeight outside valid range.
VPI_ERROR_INVALID_ARGUMENTinput and output images must have same dimensions and format.
VPI_ERROR_INVALID_ARGUMENTborder not supported.
VPI_ERROR_INVALID_IMAGE_FORMATinput format not supported.
VPI_ERROR_NOT_IMPLEMENTEDErode algorithm is not supported by given backend.
VPI_ERROR_INVALID_OPERATIONThe needed backends aren't enabled in stream, input or output.
VPI_SUCCESSOperation executed successfully.