NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release

Detailed Description

Defines the 2D box tracker API.

Data Structures

struct  dwTrackedBox2D
 Holds a tracked 2D bounding box. More...
 
struct  dwBoxTracker2DParams
 Holds 2D object-tracker parameters. More...
 

Typedefs

typedef struct dwBoxTracker2DObject * dwBoxTracker2DHandle_t
 Handle to a 2D object tracker. More...
 

Functions

DW_API_PUBLIC dwStatus dwBoxTracker2D_initParams (dwBoxTracker2DParams *parameters)
 Initializes 2D tracker parameters with default values. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_initialize (dwBoxTracker2DHandle_t *obj, const dwBoxTracker2DParams *parameters, int32_t imageWidth, int32_t imageHeight, dwContextHandle_t context)
 Initializes 2D bounding box tracker. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_reset (dwBoxTracker2DHandle_t obj)
 Resets the 2D bounding box tracker. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_shallowReset (dwBoxTracker2DHandle_t obj)
 Performs a shallow reset on the 2D bounding box tracker. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_release (dwBoxTracker2DHandle_t obj)
 Releases the 2D bounding box tracker. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_add (const dwBox2D *boxes, size_t num, dwBoxTracker2DHandle_t obj)
 Adds bounding boxes to the tracker. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_addPreClustered (const dwTrackedBox2D *boxes, size_t num, dwBoxTracker2DHandle_t obj)
 Adds pre-clustered bounding boxes to the tracker. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_track (const float32_t *curFeatureLocations, const dwFeature2DStatus *curFeatureStatuses, const float32_t *preFeatureLocations, dwBoxTracker2DHandle_t obj)
 Tracks the bounding boxes. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_updateFeatures (const float32_t *featureLocations, const dwFeature2DStatus *statuses, size_t nFeatures, dwBoxTracker2DHandle_t obj)
 Updates the feature locations of the 2D bounding boxes. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_get (const dwTrackedBox2D **boxList, size_t *num, dwBoxTracker2DHandle_t obj)
 Gets tracked bounding boxes and IDs. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_enablePriorityTracking (bool enable, dwBoxTracker2DHandle_t obj)
 Enables priority tracking of a boundary box. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_setTrackingPriority (uint32_t idx, float32_t priority, dwBoxTracker2DHandle_t obj)
 Sets the priority of a bounding box. More...
 
DW_API_PUBLIC dwStatus dwBoxTracker2D_getTrackingPriority (float32_t *priority, uint32_t idx, dwBoxTracker2DHandle_t obj)
 Returns the priority of a bounding box. More...
 

Typedef Documentation

◆ dwBoxTracker2DHandle_t

typedef struct dwBoxTracker2DObject* dwBoxTracker2DHandle_t

Handle to a 2D object tracker.

Definition at line 47 of file BoxTracker2D.h.

Function Documentation

◆ dwBoxTracker2D_add()

DW_API_PUBLIC dwStatus dwBoxTracker2D_add ( const dwBox2D boxes,
size_t  num,
dwBoxTracker2DHandle_t  obj 
)

Adds bounding boxes to the tracker.

The tracker first performs clustering to the group close-by redundant bounding boxes. In each cluster, the average box is computed and added to the tracker.

Parameters
[in]boxesThe list of 2D bounding boxes to added.
[in]numNumber of boxes passed in the given list.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle is NULL or num is greater than 0 and boxes is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_addPreClustered()

DW_API_PUBLIC dwStatus dwBoxTracker2D_addPreClustered ( const dwTrackedBox2D boxes,
size_t  num,
dwBoxTracker2DHandle_t  obj 
)

Adds pre-clustered bounding boxes to the tracker.

The tracker assumes input boxes are pre-clustered and all boxes are added to the tracker. If the input box matches an internal tracked box, the ID of the internal tracked box is preferred.

Parameters
[in]boxesThe list of pre-clustered boxes.
[in]numNumber of boxes passed in the given list.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle is NULL or num is greater than 0 and boxes is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_enablePriorityTracking()

DW_API_PUBLIC dwStatus dwBoxTracker2D_enablePriorityTracking ( bool  enable,
dwBoxTracker2DHandle_t  obj 
)

Enables priority tracking of a boundary box.

The priority of the bounding boxes can be used to control the association between 2D features and bounding boxes in case of overlap. With priority tracking enabled, the box with the higher priority gets the feature.

Parameters
[in]enableEnables (true)/disable(false) priority tracking.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_get()

DW_API_PUBLIC dwStatus dwBoxTracker2D_get ( const dwTrackedBox2D **  boxList,
size_t *  num,
dwBoxTracker2DHandle_t  obj 
)

Gets tracked bounding boxes and IDs.

Parameters
[out]boxListThe list of tracked bounding boxes.
[out]numNumber of bounding box returned in boxList.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if any parameter is NULL.
DW_SUCCESS otherwise.
Note
boxList is pointing to an internally allocated memory.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_getTrackingPriority()

DW_API_PUBLIC dwStatus dwBoxTracker2D_getTrackingPriority ( float32_t priority,
uint32_t  idx,
dwBoxTracker2DHandle_t  obj 
)

Returns the priority of a bounding box.

Parameters
[out]priorityTracking priority (smaller value == higher priority).
[in]idxIndex of the object.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle or priority is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_initialize()

DW_API_PUBLIC dwStatus dwBoxTracker2D_initialize ( dwBoxTracker2DHandle_t obj,
const dwBoxTracker2DParams parameters,
int32_t  imageWidth,
int32_t  imageHeight,
dwContextHandle_t  context 
)

Initializes 2D bounding box tracker.

Parameters
[out]objHandle to 2D bounding box tracker.
[in]parametersThe 2D tracker parameters.
[in]imageWidthThe width of the image.
[in]imageHeightThe height of the image.
[in]contextHandle to the context under which it is created.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle or parameters are NULL or imageWidht or imageHeight are equal or less than zero.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwBoxTracker2D_initParams()

DW_API_PUBLIC dwStatus dwBoxTracker2D_initParams ( dwBoxTracker2DParams parameters)

Initializes 2D tracker parameters with default values.

Parameters
[out]parameters2D tracker parameters.
Returns
DW_INVALID_ARGUMENT if parameters are NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: No

◆ dwBoxTracker2D_release()

DW_API_PUBLIC dwStatus dwBoxTracker2D_release ( dwBoxTracker2DHandle_t  obj)

Releases the 2D bounding box tracker.

Parameters
[in]objHandle to release.
Returns
DW_INVALID_HANDLE if box tracker2D handle is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: No
  • De-Init: Yes

◆ dwBoxTracker2D_reset()

DW_API_PUBLIC dwStatus dwBoxTracker2D_reset ( dwBoxTracker2DHandle_t  obj)

Resets the 2D bounding box tracker.

Parameters
[in]objHandle to reset.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_setTrackingPriority()

DW_API_PUBLIC dwStatus dwBoxTracker2D_setTrackingPriority ( uint32_t  idx,
float32_t  priority,
dwBoxTracker2DHandle_t  obj 
)

Sets the priority of a bounding box.

Parameters
[in]idxIndex of the object.
[in]priorityTracking priority (smaller value == higher priority).
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_shallowReset()

DW_API_PUBLIC dwStatus dwBoxTracker2D_shallowReset ( dwBoxTracker2DHandle_t  obj)

Performs a shallow reset on the 2D bounding box tracker.

This function does not initialize all variables. It just sets the count to zero.

Parameters
[in]objHandle to reset.
Returns
DW_INVALID_ARGUMENT if box tracker2D handle is NULL.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_track()

DW_API_PUBLIC dwStatus dwBoxTracker2D_track ( const float32_t curFeatureLocations,
const dwFeature2DStatus curFeatureStatuses,
const float32_t preFeatureLocations,
dwBoxTracker2DHandle_t  obj 
)

Tracks the bounding boxes.

Parameters
[in]curFeatureLocationsThe feature locations computed in the current image frame. It has 2*featureCount number of items.
[in]curFeatureStatusesThe feature statues of the current image frame. It has featureCount number of items.
[in]preFeatureLocationsThe feature locations computed in the previous image frame. It has 2*featureCount number of items.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if any parameter is NULL.
DW_SUCCESS otherwise.
Note
Ensure the curFeatureLocations argument has the same size as preFeatureLocations.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwBoxTracker2D_updateFeatures()

DW_API_PUBLIC dwStatus dwBoxTracker2D_updateFeatures ( const float32_t featureLocations,
const dwFeature2DStatus statuses,
size_t  nFeatures,
dwBoxTracker2DHandle_t  obj 
)

Updates the feature locations of the 2D bounding boxes.

This function call must occur between dwBoxTracker2D_track() and dwBoxTracker2D_get().

Parameters
[in]featureLocationsThe feature locations with 2*nFeatures items.
[in]statusesThe feature statuses with nFeatures items.
[in]nFeaturesThe number of 2D features, 0 < nFeatures < 8000.
[in]objHandle to the 2D bounding box tracker.
Returns
DW_INVALID_ARGUMENT if box the tracker2D handle, featureLocations, or statuses are NULL; or if nFeatures is greater than 8000.
DW_SUCCESS otherwise.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes