VPI - Vision Programming Interface

3.0 Release

MinMaxLoc

Find in an image the minimum and maximum value locations. More...

Functions

VPIStatus vpiCreateMinMaxLoc (uint64_t backends, int32_t imageWidth, int32_t imageHeight, VPIImageFormat imageFormat, VPIPayload *payload)
 Creates payload for vpiSubmitMinMaxLoc. More...
 
VPIStatus vpiSubmitMinMaxLoc (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage input, VPIArray minCoords, VPIArray maxCoords)
 Finds minimum and maximum value locations in an image. More...
 

Detailed Description

Find in an image the minimum and maximum value locations.

The function vpiCreateMinMaxLoc is used to create the payload for the algorithm. The function vpiSubmitMinMaxLoc is used to find minimum and maximum locations in an image.

Function Documentation

◆ vpiCreateMinMaxLoc()

VPIStatus vpiCreateMinMaxLoc ( uint64_t  backends,
int32_t  imageWidth,
int32_t  imageHeight,
VPIImageFormat  imageFormat,
VPIPayload payload 
)

#include </opt/nvidia/vpi3/include/vpi/algo/MinMaxLoc.h>

Creates payload for vpiSubmitMinMaxLoc.

Parameters
[in]backendsVPI backend that will execute the algorithm.
[in]imageWidth,imageHeightInput image dimensions.
  • Must be >= 1x1.
[in]imageFormatInput image format.
[out]payloadPointer to the payload variable that receives the created handle.
Return values
VPI_ERROR_INVALID_ARGUMENTpayload is NULL.
VPI_ERROR_INVALID_ARGUMENTimageWidth or imageHeight outside valid range.
VPI_ERROR_INVALID_ARGUMENTbackend refers to an invalid backend.
VPI_ERROR_NOT_IMPLEMENTEDMinMaxLoc algorithm is not supported by given backend.
VPI_ERROR_INVALID_CONTEXTCurrent context is destroyed.
VPI_IMAGE_FORMAT_INVALIDimageFormat is not supported.
VPI_ERROR_OUT_OF_MEMORYCannot allocate required resources.
VPI_ERROR_INVALID_OPERATIONBackend isn't enabled in current context.
VPI_SUCCESSOperation executed successfully.

◆ vpiSubmitMinMaxLoc()

VPIStatus vpiSubmitMinMaxLoc ( VPIStream  stream,
uint64_t  backend,
VPIPayload  payload,
VPIImage  input,
VPIArray  minCoords,
VPIArray  maxCoords 
)

#include </opt/nvidia/vpi3/include/vpi/algo/MinMaxLoc.h>

Finds minimum and maximum value locations in an image.

Note
The MinMaxLoc algorithm does not guarantee deterministic output. Each array capacity (minCoords and maxCoords in vpiSubmitMinMaxLoc) limit the number of locations found by the algorithm, that is the total number may be greater than this limitation and the set of locations returned might differ from one backend to another and in different runs on the same backend. Additionally, there is no strict ordering imposed to each array of locations and might also differ on different backends and runs.
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.
  • Must be the backend specified during payload creation or 0 as a shorthand to use this backend.
[in]payloadPayload as created by vpiCreateMinMaxLoc.
[in]inputInput image where minimum and/or maximum are to be found.
  • Must not be NULL.
  • Input image size and format must match the ones defined in vpiCreateMinMaxLoc.
  • Input image pitch must be a multiple of its pixels if using VPI_BACKEND_CUDA.
  • Image must have enabled the backends that will execute the algorithm.
[out]minCoordsOutput array that stores pixel coordinates with minimum value. If not needed, pass NULL. Number of coordinates returned is limited by array capacity.
[out]maxCoordsOutput array that stores pixel coordinates with maximum value. If not needed, pass NULL. Number of coordinates returned is limited by array capacity.
Return values
VPI_ERROR_INVALID_ARGUMENTstream is NULL.
VPI_ERROR_INVALID_ARGUMENTinput is NULL.
VPI_ERROR_INVALID_ARGUMENTpayload is not created using vpiCreateMinMaxLoc.
VPI_ERROR_INVALID_ARGUMENTinput image dimension and format does not match the ones associated with payload.
VPI_ERROR_INVALID_ARRAY_TYPEminCoords or maxCoords array type not accepted.
VPI_ERROR_INVALID_PAYLOAD_TYPEpayload is invalid.
VPI_ERROR_INVALID_OPERATIONThe given backend isn't enabled in stream.
VPI_ERROR_INVALID_OPERATIONThe needed backends aren't enabled in stream, input, minCoords or maxCoords.
VPI_SUCCESSOperation executed successfully.