VPI - Vision Programming Interface

2.3 Release

Harris Corners

Detect Harris keypoints in an image, usually used in keypoint tracking. More...

Data Structures

struct  VPIHarrisCornerDetectorParams
 Structure that defines the parameters for vpiSubmitHarrisCornerDetector. More...


VPIStatus vpiInitHarrisCornerDetectorParams (VPIHarrisCornerDetectorParams *params)
 Initializes VPIHarrisCornerDetectorParams with default values. More...
VPIStatus vpiCreateHarrisCornerDetector (uint64_t backends, int32_t inputWidth, int32_t inputHeight, VPIPayload *payload)
 Creates a Harris Corner Detector payload. More...
VPIStatus vpiSubmitHarrisCornerDetector (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage input, VPIArray outFeatures, VPIArray outScores, const VPIHarrisCornerDetectorParams *params)
 Submits a Harris Corner Detector operation to the stream. More...

Detailed Description

Detect Harris keypoints in an image, usually used in keypoint tracking.

Refer to Harris Corner Detector for more details and usage examples.

Data Structure Documentation

◆ VPIHarrisCornerDetectorParams

struct VPIHarrisCornerDetectorParams

Structure that defines the parameters for vpiSubmitHarrisCornerDetector.

Definition at line 81 of file HarrisCorners.h.

+ Collaboration diagram for VPIHarrisCornerDetectorParams:
Data Fields
int32_t gradientSize Gradient window size.
  • Must be 3, 5 or 7.
int32_t blockSize Block window size used to compute the Harris Corner score.
  • Must be 3, 5 or 7.
float strengthThresh Specifies the minimum threshold with which to eliminate Harris Corner scores.
  • Must be >= 0.
float sensitivity Specifies sensitivity threshold from the Harris-Stephens equation.
float minNMSDistance Non-maximum suppression radius, set to 0 to disable it.
  • On PVA backend, this must be set to 8.

Function Documentation

◆ vpiInitHarrisCornerDetectorParams()

VPIStatus vpiInitHarrisCornerDetectorParams ( VPIHarrisCornerDetectorParams params)

#include </opt/nvidia/vpi2/include/vpi/algo/HarrisCorners.h>

Initializes VPIHarrisCornerDetectorParams with default values.

Default values are:

  • gradientSize: 3
  • blockSize: 3
  • strengthThresh: 20
  • sensitivity: 0.0625
  • minNMSDistance: 8
Return values
VPI_SUCCESSOperation executed successfully.

◆ vpiCreateHarrisCornerDetector()

VPIStatus vpiCreateHarrisCornerDetector ( uint64_t  backends,
int32_t  inputWidth,
int32_t  inputHeight,
VPIPayload payload 

#include </opt/nvidia/vpi2/include/vpi/algo/HarrisCorners.h>

Creates a Harris Corner Detector payload.

This function allocates all temporary memory needed by the algorithm.

[in]backendsVPI backends that are eligible to execute the algorithm.
[in]inputWidth,inputHeightDimensions of the input image that will be used with this payload.
  • On PVA dimensions limited to minimum of 160x120, maximum of 3264x2448.
  • Must be >= 0 (other backends).
[out]payloadPointer to the payload variable that receives the created handle.
Return values
VPI_ERROR_INVALID_ARGUMENTinputWidth or inputHeight outside valid range.
VPI_ERROR_INVALID_ARGUMENTbackends refers to an invalid backend.
VPI_ERROR_INVALID_OPERATIONBackend hardware not available.
VPI_ERROR_NOT_IMPLEMENTEDHarris Corner Detector algorithm is not supported by given backend.
VPI_ERROR_INVALID_CONTEXTCurrent context is destroyed.
VPI_ERROR_OUT_OF_MEMORYCannot allocate required resources.
VPI_ERROR_INVALID_OPERATIONBackend isn't enabled in current context.
VPI_SUCCESSOperation executed successfully.

◆ vpiSubmitHarrisCornerDetector()

VPIStatus vpiSubmitHarrisCornerDetector ( VPIStream  stream,
uint64_t  backend,
VPIPayload  payload,
VPIImage  input,
VPIArray  outFeatures,
VPIArray  outScores,
const VPIHarrisCornerDetectorParams params 

#include </opt/nvidia/vpi2/include/vpi/algo/HarrisCorners.h>

Submits a Harris Corner Detector operation to the stream.

[in]streamThe stream 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 to be submitted along the other parameters.
[in]inputInput image from where the Harris corners will be extracted.
[out]outFeaturesArray that will receive the detected corners. Array size is updated with the number of corners found.
  • Must not be NULL.
  • It must have type VPI_ARRAY_TYPE_KEYPOINT_F32.
  • Array must have enabled the backends that will execute the algorithm.
  • On PVA, the array capacity must be 8192.
[out]outScoresArray that will receive the corners' scores. Array size matches outFeatures array' size.
  • Must not be NULL.
  • It must have type VPI_ARRAY_TYPE_U32.
  • Array must have enabled the backends that will execute the algorithm.
  • Must have same capacity as outFeatures.
[in]paramsPointer to a VPIHarrisCornerDetectorParams with parameters for this algorithm invocation. These parameters can vary in every call and will be copied internally, no need to keep the object around.
Return values
VPI_ERROR_INVALID_ARGUMENTinput, outFeatures or outScores are NULL.
VPI_ERROR_INVALID_ARGUMENTpayload is not created by vpiCreateHarrisCornerDetector.
VPI_ERROR_INVALID_ARGUMENTStrength threshold in params outside valid range.
VPI_ERROR_INVALID_ARGUMENTOutput arrays must have same capacity.
VPI_ERROR_INVALID_ARGUMENTUnsupported outFeatures or outScores type.
VPI_ERROR_INVALID_ARGUMENTInvalid input dimensions.
VPI_ERROR_INVALID_IMAGE_FORMATUnsupported input format.
VPI_ERROR_INVALID_OPERATIONThe needed backends aren't enabled in stream, outFeatures or outScores.
VPI_SUCCESSOperation executed successfully.