DriveWorks SDK Reference

| 0.6.67 Release

ObjectTracker

Detailed Description

Defines ObjectTracker module for object tracking.

Data Structures

struct  dwObjectFeatureTrackerParams
 
struct  dwObjectTrackerParams
 

Typedefs

typedef struct dwObjectTrackerObject * dwObjectTrackerHandle_t
 Handle to an object tracker. More...
 

Functions

DW_API_PUBLIC dwStatus dwObjectTracker_boxTrackHost (dwObject *trackedDetections, size_t *numTrackedDetections, const dwObject *previousDetections, size_t numPreviousDetections, uint32_t classIdx, dwObjectTrackerHandle_t obj)
 Tracks objects in previousDetections based on the tracked features by previously called dwObjectTracker_featureTrackDeviceAsync. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_boxTrackHostExternalFeatures (dwObject *trackedDetections, size_t *numTrackedDetections, const dwObject *previousDetections, size_t numPreviousDetections, const dwFeatureListPointers *featureList, uint32_t maxFeatureCount, uint32_t historyCapacity, uint32_t currentTimeIdx, uint32_t classIdx, dwObjectTrackerHandle_t obj)
 This function enables tracking of objects using already extracted features from the previous and current frame. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_featureTrackDeviceAsync (const dwImageCUDA *image, dwObjectTrackerHandle_t obj)
 Tracks the features from a previously given image to the current image. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_getCUDAStream (cudaStream_t *stream, dwObjectTrackerHandle_t obj)
 Gets the CUDA stream used. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_initDefaultParams (dwObjectFeatureTrackerParams *featureTrackerParams, dwObjectTrackerParams *objectTrackerParamsArray, uint32_t numClasses)
 Initializes ObjectTracker parameters with default values. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_initialize (dwObjectTrackerHandle_t *obj, dwContextHandle_t ctx, const dwImageProperties *imageProperties, const dwObjectFeatureTrackerParams *featureTrackerParams, const dwObjectTrackerParams *objectTrackerParamsArray, uint32_t numClasses)
 Initializes the ObjectTracker module. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_release (dwObjectTrackerHandle_t *obj)
 Releases the ObjectTracker module. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_reset (dwObjectTrackerHandle_t obj)
 Resets the ObjectTracker. More...
 
DW_API_PUBLIC dwStatus dwObjectTracker_setCUDAStream (cudaStream_t stream, dwObjectTrackerHandle_t obj)
 Sets the CUDA stream used. More...
 

Data Structure Documentation

◆ dwObjectFeatureTrackerParams

struct dwObjectFeatureTrackerParams
Data Fields
float32_t detectorScoreThreshold Higher thresholds detect less features. Default is 0.3.
uint32_t historyCapacity Capacity of feature history circular buffer.
uint32_t iterationsLK Upper bound on number of Lucas-Kanade iterations per level. Default is 10.
dwRect maskROI Region of interest where the objects are tracked. Default is full image.
uint32_t maxFeatureCount Upper bound on number of features handled.
uint32_t pyramidLevelCount Number of levels in the pyramid. Default is 3.
uint32_t windowSizeLK Window size used in the Lucas-Kanade tracker. Supported sizes are 6,8,10,12,14. Default is 8.

◆ dwObjectTrackerParams

struct dwObjectTrackerParams
Data Fields
float32_t confRateDetect Rate at which to combine confidence values of new boxes to existing tracked boxes when a new box is found to match an existing box, i.e., conf = conf + conf_new * rate.

This also applies to the initial confidence value for a new box, i.e., conf = conf_new * rate. Default is 1.

float32_t confRateTrackMax Max rate at which confidence values of tracked boxes changes from frame to frame.

When there is no corresponding detection, conf = conf - actualConfRate. Actual decaying rate is determined between 'confRateTrackMin' and 'confRateTrackMax' according to the number of feature points used to track the object. i.e., actualConfRate = confRateTrackMin + (confRateTrackMax - confRateTrackMin) * (1.f - sqrt(featureCount / maxFeatureCount))

float32_t confRateTrackMin Min rate at which confidence values of tracked boxes changes from frame to frame.
float32_t confThreshConfirm Threshold on confidence below which tracker will not confirmed to be used yet.
float32_t confThreshDiscard Threshold on confidence below which tracker no longer tracks the box location. Default is 0.
dwBool enablePriorityTracking Priority of the objects can be used to control association between 2D features and bounding boxes in case of overlap.

With priority tracking enabled, the object with the lower index gets the feature.

float32_t maxBoxImageScale Maximum box scale in the image to track.

It multiplies with image width and height to get the maximum box size. Default is 0.5.

uint32_t maxFeatureCountPerBox Maximum features to track for each 2D bounding box. Default is 500.
uint32_t maxNumObjects Maximum number of objects to track.

This information is used to allocate resources at initialization time. Default is 100.

float32_t minBoxImageScale Minimum box scale in the image to track.

It multiplies with image width and height to get the minimum box size. Default is 0.005.

Typedef Documentation

◆ dwObjectTrackerHandle_t

typedef struct dwObjectTrackerObject* dwObjectTrackerHandle_t

Handle to an object tracker.

Definition at line 62 of file Tracker.h.

Function Documentation

◆ dwObjectTracker_boxTrackHost()

DW_API_PUBLIC dwStatus dwObjectTracker_boxTrackHost ( dwObject trackedDetections,
size_t *  numTrackedDetections,
const dwObject previousDetections,
size_t  numPreviousDetections,
uint32_t  classIdx,
dwObjectTrackerHandle_t  obj 
)

Tracks objects in previousDetections based on the tracked features by previously called dwObjectTracker_featureTrackDeviceAsync.

This function synchronizes host with the CUDA stream.

Parameters
[out]trackedDetectionsList of tracked objects.
[out]numTrackedDetectionsNumber of tracked objects.
[in]previousDetectionsList of input objects to be tracked.
[in]numPreviousDetectionsNumber of input objects.
[in]classIdxClass index from which to use the object tracker parameters.
[in]objSpecifies the ObjectTracker handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT
Note
trackedDetections must be allocated with maxNumObjects given at initialization.

◆ dwObjectTracker_boxTrackHostExternalFeatures()

DW_API_PUBLIC dwStatus dwObjectTracker_boxTrackHostExternalFeatures ( dwObject trackedDetections,
size_t *  numTrackedDetections,
const dwObject previousDetections,
size_t  numPreviousDetections,
const dwFeatureListPointers featureList,
uint32_t  maxFeatureCount,
uint32_t  historyCapacity,
uint32_t  currentTimeIdx,
uint32_t  classIdx,
dwObjectTrackerHandle_t  obj 
)

This function enables tracking of objects using already extracted features from the previous and current frame.

This function synchronizes host with the CUDA stream.

Parameters
[out]trackedDetectionsList of tracked objects.
[out]numTrackedDetectionsNumber of tracked objects.
[in]previousDetectionsList of input objects to be tracked.
[in]numPreviousDetectionsNumber of input objects.
[in]featureListFeature list in host.
[in]maxFeatureCountMaximum number of features that featureList can store.
[in]historyCapacityCapacity of featureList circular buffer.
[in]currentTimeIdxRow index of the current frame in featureList circular buffer.
[in]classIdxClass index from which to use the object tracker parameters.
[in]objSpecifies the ObjectTracker handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT
Note
trackedDetections must be allocated with maxNumObjects given at initialization.
previousFeatures and currentFeatures are expected to be in host memory.

◆ dwObjectTracker_featureTrackDeviceAsync()

DW_API_PUBLIC dwStatus dwObjectTracker_featureTrackDeviceAsync ( const dwImageCUDA image,
dwObjectTrackerHandle_t  obj 
)

Tracks the features from a previously given image to the current image.

This function must be called before dwObjectTracker_boxTrackHost. The computation takes place asynchronously on the device (GPU).

Parameters
[in]imageCUDA image where the objects are tracked.
[in]objSpecifies the ObjectTracker handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwObjectTracker_getCUDAStream()

DW_API_PUBLIC dwStatus dwObjectTracker_getCUDAStream ( cudaStream_t *  stream,
dwObjectTrackerHandle_t  obj 
)

Gets the CUDA stream used.

Parameters
[out]streamThe CUDA stream used.
[in]objA pointer to the ObjectTracker handle that is updated.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwObjectTracker_initDefaultParams()

DW_API_PUBLIC dwStatus dwObjectTracker_initDefaultParams ( dwObjectFeatureTrackerParams featureTrackerParams,
dwObjectTrackerParams objectTrackerParamsArray,
uint32_t  numClasses 
)

Initializes ObjectTracker parameters with default values.

Parameters
[out]featureTrackerParamsFeature tracking parameters.
[out]objectTrackerParamsArrayObject tracking parameters for each class.
[in]numClassesNumber of classes. Maximum allowed is DW_OBJECT_MAX_CLASSES.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

◆ dwObjectTracker_initialize()

DW_API_PUBLIC dwStatus dwObjectTracker_initialize ( dwObjectTrackerHandle_t obj,
dwContextHandle_t  ctx,
const dwImageProperties imageProperties,
const dwObjectFeatureTrackerParams featureTrackerParams,
const dwObjectTrackerParams objectTrackerParamsArray,
uint32_t  numClasses 
)

Initializes the ObjectTracker module.

Parameters
[out]objA pointer to ObjectTracker handle that is initialized from parameters.
[in]ctxSpecifies the handle to the context.
[in]imagePropertiesImage properties to set up the tracker for.
[in]featureTrackerParamsFeature tracker parameters.
[in]objectTrackerParamsArrayObject tracker parameters for each object class.
[in]numClassesNumber of object classes.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT
Note
Expected pxlType for the image are: DW_TYPE_UINT8, DW_TYPE_UINT16, DW_TYPE_FP16

◆ dwObjectTracker_release()

DW_API_PUBLIC dwStatus dwObjectTracker_release ( dwObjectTrackerHandle_t obj)

Releases the ObjectTracker module.

Parameters
[in]objA pointer to the object handle to release.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
Note
This method renders the handle unusable.

◆ dwObjectTracker_reset()

DW_API_PUBLIC dwStatus dwObjectTracker_reset ( dwObjectTrackerHandle_t  obj)

Resets the ObjectTracker.

Parameters
[in]objHandle to reset.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwObjectTracker_setCUDAStream()

DW_API_PUBLIC dwStatus dwObjectTracker_setCUDAStream ( cudaStream_t  stream,
dwObjectTrackerHandle_t  obj 
)

Sets the CUDA stream used.

Parameters
[in]streamThe CUDA stream used.
[in]objA pointer to the ObjectTracker handle that is updated.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS