VPI - Vision Programming Interface

1.0 Release

KLT Feature Tracker

Runs KLT Feature tracking on a sequence of frames. More...

Data Structures

struct  VPIKLTFeatureTrackerCreationParams
 Creation parameters of KLT Feature Tracker. More...
 
struct  VPIKLTFeatureTrackerParams
 Structure that defines the parameters for vpiCreateKLTFeatureTracker. More...
 
struct  VPIKLTTrackedBoundingBox
 Stores a bounding box that is being tracked by KLT Tracker. More...
 

Enumerations

enum  VPIKLTFeatureTrackerType
 KLT Feature Tracker algorithm type. More...
 

Functions

VPIStatus vpiInitKLTFeatureTrackerCreationParams (VPIKLTFeatureTrackerCreationParams *params)
 Initialize VPIKLTFeatureTrackerCreationParams with default values. More...
 
VPIStatus vpiCreateKLTFeatureTracker (uint32_t backends, int32_t imageWidth, int32_t imageHeight, VPIImageFormat imageFormat, const VPIKLTFeatureTrackerCreationParams *params, VPIPayload *payload)
 Creates payload for vpiSubmitKLTFeatureTracker. More...
 
VPIStatus vpiSubmitKLTFeatureTracker (VPIStream stream, uint32_t backend, VPIPayload payload, VPIImage templateImage, VPIArray inputBoxList, VPIArray inputPredictionList, VPIImage referenceImage, VPIArray outputBoxList, VPIArray outputEstimationList, const VPIKLTFeatureTrackerParams *params)
 Runs KLT Feature Tracker on two frames. More...
 

Detailed Description

Runs KLT Feature tracking on a sequence of frames.


Data Structure Documentation

◆ VPIKLTFeatureTrackerCreationParams

struct VPIKLTFeatureTrackerCreationParams

Creation parameters of KLT Feature Tracker.

Definition at line 79 of file KLTFeatureTracker.h.

+ Collaboration diagram for VPIKLTFeatureTrackerCreationParams:
Data Fields
int32_t maxTemplateCount Maximum number of templates to be tracked.
int32_t maxTemplateHeight Maximum height of each tracked templates.
int32_t maxTemplateWidth Maximum width of each tracked template.

◆ VPIKLTFeatureTrackerParams

struct VPIKLTFeatureTrackerParams

Structure that defines the parameters for vpiCreateKLTFeatureTracker.

Definition at line 134 of file KLTFeatureTracker.h.

+ Collaboration diagram for VPIKLTFeatureTrackerParams:
Data Fields
float maxScaleChange Maximum relative scale change.

Scale changes larger than this will make KLT consider that tracking was lost.

float maxTranslationChange Maximum relative translation change.

Translation changes larger than this will make KLT consider that tracking was lost.

float nccThresholdKill Threshold to consider template tracking was lost.

Must be a value between 0 and 1.

float nccThresholdStop Threshold to stop estimating.
float nccThresholdUpdate Threshold for requiring template update.

Must be a value between 0 and 1.

int32_t numberOfIterationsScaling Number of Inverse compositional iterations of scale estimations.
VPIKLTFeatureTrackerType trackingType Type of KLT tracking that will be performed.

◆ VPIKLTTrackedBoundingBox

struct VPIKLTTrackedBoundingBox

Stores a bounding box that is being tracked by KLT Tracker.

Definition at line 315 of file Types.h.

+ Collaboration diagram for VPIKLTTrackedBoundingBox:
Data Fields
VPIBoundingBox bbox Bounding box being tracked.
uint8_t reserved1 Reserved for future use.
uint8_t reserved2 Reserved for future use.
int8_t templateStatus Status of the template related to this bounding box.

Accepted values:

  • 1 template needs updating.
  • 0 existing template still can be used for tracking, it doesn't need to be updated.
int8_t trackingStatus Tracking status of this bounding box.

Accepted values:

  • 1 tracking information is invalid and shouldn't be relied upon.
  • 0 tracking information is valid.

Enumeration Type Documentation

◆ VPIKLTFeatureTrackerType

#include <vpi/algo/KLTFeatureTracker.h>

KLT Feature Tracker algorithm type.

Enumerator
VPI_KLT_INVERSE_COMPOSITIONAL 

Inverse compositional algorithm for KLT tracker.

The inverse compositional algorithm is a reformulation of the classic Lucas-Kanade algorithm to make the steepest-descent images and Hessian constant.

Ref:Simon Baker, Iain Matthew, "Lucas-Kanade 20 Years On: A Unified Framework".
International Journal of Computer Vision, February 2004, Volume 56, issue 3, pp. 228-231.

Definition at line 117 of file KLTFeatureTracker.h.

Function Documentation

◆ vpiCreateKLTFeatureTracker()

VPIStatus vpiCreateKLTFeatureTracker ( uint32_t  backends,
int32_t  imageWidth,
int32_t  imageHeight,
VPIImageFormat  imageFormat,
const VPIKLTFeatureTrackerCreationParams params,
VPIPayload payload 
)

#include <vpi/algo/KLTFeatureTracker.h>

Creates payload for vpiSubmitKLTFeatureTracker.

Parameters
[in]backendsVPI backends that are eligible to execute the algorithm. Currently only one backend is accepted.
[in]imageWidth,imageHeightInput image dimensions.
[in]imageFormatInput image format.
[in]params
[out]payloadPointer to memory where the created payload handle will be written to.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiInitKLTFeatureTrackerCreationParams()

VPIStatus vpiInitKLTFeatureTrackerCreationParams ( VPIKLTFeatureTrackerCreationParams params)

#include <vpi/algo/KLTFeatureTracker.h>

Initialize VPIKLTFeatureTrackerCreationParams with default values.

Default values:

  • maxTemplateCount: 64
  • maxTemplateWidth: 64
  • maxTemplateHeight: 64
Parameters
[out]paramsStructure to be filled with default values.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiSubmitKLTFeatureTracker()

VPIStatus vpiSubmitKLTFeatureTracker ( VPIStream  stream,
uint32_t  backend,
VPIPayload  payload,
VPIImage  templateImage,
VPIArray  inputBoxList,
VPIArray  inputPredictionList,
VPIImage  referenceImage,
VPIArray  outputBoxList,
VPIArray  outputEstimationList,
const VPIKLTFeatureTrackerParams params 
)

#include <vpi/algo/KLTFeatureTracker.h>

Runs KLT Feature Tracker on two frames.

Outputs tracked bounding boxes and estimated transform array.

Parameters
[in]streamThe stream where the operation will be queued in.
[in]backendBackend that will execute the algorithm. Must be one of the backends specified during payload creation. If 0, VPI will select one of the eligible backends from the payload that accepts the given parameters, usually the fastest one.
[in]payloadpayload created with vpiCreateKLTFeatureTracker
[in]referenceImagereference image
[in]inputBoxListInput bounding box array, must have type VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
[in]inputPredictionListInput predicted transform array, must have type VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
[in]templateImagetemplate image
[out]outputBoxListoutput Bounding box array, must have type VPI_ARRAY_TYPE_KLT_TRACKED_BOUNDING_BOX
[out]outputEstimationListSstimated transform array, must have type VPI_ARRAY_TYPE_HOMOGRAPHY_TRANSFORM_2D
[in]paramsControl parameters of the KLT feature tracker algorithm.
Returns
an error code on failure else VPI_SUCCESS