VPI - Vision Programming Interface

3.0 Release

FAST Corners

Detect FAST corners in an image, usually used in keypoint tracking. More...

Data Structures

struct  VPIFASTCornerDetectorParams
 Structure that defines the parameters for vpiSubmitFASTCornerDetector. More...
 

Functions

VPIStatus vpiInitFASTCornerDetectorParams (VPIFASTCornerDetectorParams *params)
 Initializes VPIFASTCornerDetectorParams with default values. More...
 
VPIStatus vpiSubmitFASTCornerDetector (VPIStream stream, uint64_t backend, VPIImage input, VPIArray outCorners, const VPIFASTCornerDetectorParams *params, VPIBorderExtension border)
 Submits a FAST Corner Detector operation to the stream. More...
 

Detailed Description

Detect FAST corners in an image, usually used in keypoint tracking.

Refer to FAST Corners Detector for more details and usage examples.


Data Structure Documentation

◆ VPIFASTCornerDetectorParams

struct VPIFASTCornerDetectorParams

Structure that defines the parameters for vpiSubmitFASTCornerDetector.

Definition at line 81 of file FASTCorners.h.

+ Collaboration diagram for VPIFASTCornerDetectorParams:
Data Fields
int32_t circleRadius Circle radius around a pixel to check if it is a corner.

The following circle radii are supported, correlating each radius with the number of pixels in the circle:

Circle radius Number of pixels in the circle
1 8
2 12
3 16
  • Must be 1, 2 or 3.
int32_t arcLength Arc length in pixels over the circle to check central pixel is a corner.

Arc length is the minimum number of contiguous pixels in the circle that are either brighter (have higher intensity values) or darker (have lower intensity values) than the central pixel, plus or minus a threshold, respectively, to mark it as a corner.

  • For VPI_BACKEND_CPU, it must be in the valid range from 1 to the number of pixels in the circle.
  • For VPI_BACKEND_CUDA, it must be either 5, 7 or 9 according to the circle radius as:
    Circle radius Arc length
    1 5
    2 7
    3 9
float intensityThreshold Threshold to select a pixel as being part of the arc in circle around a keypoint candidate.

Intensity threshold is used to check if a pixel in the circle is either brighter (has higher intensity value) or darker (has lower intensity value) than the central pixel. This check is used in the arc calculation to determine if a pixel is in the arc or not.

int8_t nonMaxSuppression Whether to apply non-maximum suppression to remove corners too close together.

If not '0', it activates non-maximum suppression (NMS) for the FAST corner detector algorithm. The NMS for FAST suppresses pixels in a 1-ring neighborhood by increasing the intensity threshold value and removing corner pixels that fail the arc length calculation, keeping the single pixel in the neighborhood that survives. If '0', it deactivates the non-maximum suppression.

Function Documentation

◆ vpiInitFASTCornerDetectorParams()

VPIStatus vpiInitFASTCornerDetectorParams ( VPIFASTCornerDetectorParams params)

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

Initializes VPIFASTCornerDetectorParams with default values.

Default values are:

  • circleRadius: 3
  • arcLength: 9
  • intensityThreshold: 10
  • nonMaxSuppression: 1
Return values
VPI_ERROR_INVALID_ARGUMENTparams is NULL.
VPI_SUCCESSOperation executed successfully.

◆ vpiSubmitFASTCornerDetector()

VPIStatus vpiSubmitFASTCornerDetector ( VPIStream  stream,
uint64_t  backend,
VPIImage  input,
VPIArray  outCorners,
const VPIFASTCornerDetectorParams params,
VPIBorderExtension  border 
)

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

Submits a FAST Corner Detector operation to the stream.

Parameters
[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.
[in]inputInput image from where the FAST corners will be extracted.
[out]outCornersArray 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.
[in]paramsPointer to a VPIFASTCornerDetectorParams. It defines the parameters for this algorithm invocation. These parameters can vary in every call and will be copied internally. Thus there is no need to keep the parameters object around.
[in]borderHow to handle pixels outside image boundaries.
Return values
VPI_ERROR_INVALID_ARGUMENTstream is NULL.
VPI_ERROR_INVALID_ARGUMENTinput or outCorners are NULL.
VPI_ERROR_INVALID_ARGUMENTCircle radius in params outside valid range.
VPI_ERROR_INVALID_ARGUMENTArc length in params outside valid range.
VPI_ERROR_INVALID_ARGUMENTIntensity threshold in params outside valid range.
VPI_ERROR_INVALID_ARRAY_TYPEInvalid outCorners array type.
VPI_ERROR_INVALID_IMAGE_FORMATUnsupported input format.
VPI_ERROR_INVALID_OPERATIONThe needed backends aren't enabled in stream, input or outCorners.
VPI_SUCCESSOperation executed successfully.