DriveWorks SDK Reference

| 0.6.67 Release

Tracker

Detailed Description

Defines the tracker module.

Data Structures

struct  dwFeatureTrackerConfig
 Holds configuration parameters for a feature tracker. More...
 

Functions

DW_API_PUBLIC dwStatus dwFeatureTracker_detectNewFeatures (dwFeatureListHandle_t list, dwConstPyramidHandle_t pyramid, dwFeatureTrackerHandle_t obj)
 Detects new features and adds them to the feature list. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_getCUDAStream (cudaStream_t *stream, dwFeatureTrackerHandle_t obj)
 Gets the CUDA stream used by the feature tracker. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_initialize (dwFeatureTrackerHandle_t *obj, dwContextHandle_t context, cudaStream_t stream, const dwFeatureTrackerConfig config)
 Creates and initializes a feature tracker. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_release (dwFeatureTrackerHandle_t *obj)
 Releases the feature tracker. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_reset (dwFeatureTrackerHandle_t obj)
 Resets a feature tracker. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_setCUDAStream (cudaStream_t stream, dwFeatureTrackerHandle_t obj)
 Sets the CUDA stream for CUDA related operations. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_setMask (const uint8_t *d_mask, const uint32_t maskStrideBytes, const uint32_t maskWidth, const uint32_t maskHeight, dwFeatureTrackerHandle_t obj)
 Sets a mask to ignore areas of the image. More...
 
DW_API_PUBLIC dwStatus dwFeatureTracker_trackFeatures (dwFeatureListHandle_t list, dwConstPyramidHandle_t previousPyramid, dwConstPyramidHandle_t currentPyramid, const float32_t *d_predictedPositions, dwFeatureTrackerHandle_t obj)
 Tracks features from the internal list between the previous and current images. More...
 

Data Structure Documentation

◆ dwFeatureTrackerConfig

struct dwFeatureTrackerConfig
Data Fields
float32_t detectorScoreThreshold Higher thresholds detect less features.
uint32_t imageHeight
uint32_t imageWidth
uint32_t interationsLK Upper bound on number of Lucas-Kanade iterations per level.
uint32_t maxFeatureCount Upper bound on number of features handled.
uint32_t windowSizeLK Window size used in the Lucas-Kanade tracker.

Supported sizes are 6,8,10,12,14.

Function Documentation

◆ dwFeatureTracker_detectNewFeatures()

DW_API_PUBLIC dwStatus dwFeatureTracker_detectNewFeatures ( dwFeatureListHandle_t  list,
dwConstPyramidHandle_t  pyramid,
dwFeatureTrackerHandle_t  obj 
)

Detects new features and adds them to the feature list.

Features are added only in areas where the mask!=0xff and where features are not currently being tracked.

Parameters
[in]listSpecifies the feature list where new features are stored.
[in]pyramidSpecifies the pryamid on which feature detection takes place.
[in]objSpecifies the object handle.
Returns
DW_INVALID_ARGUMENT if feature tracker handle or feature list handle or pyramid handle are NULL.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_getCUDAStream()

DW_API_PUBLIC dwStatus dwFeatureTracker_getCUDAStream ( cudaStream_t *  stream,
dwFeatureTrackerHandle_t  obj 
)

Gets the CUDA stream used by the feature tracker.

Parameters
[out]streamThe CUDA stream currently used.
[in]objA handle to the feature tracker module.
Returns
DW_INVALID_ARGUMENT if feature tracker handle or stream are NULL.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_initialize()

DW_API_PUBLIC dwStatus dwFeatureTracker_initialize ( dwFeatureTrackerHandle_t obj,
dwContextHandle_t  context,
cudaStream_t  stream,
const dwFeatureTrackerConfig  config 
)

Creates and initializes a feature tracker.

Parameters
[out]objA pointer to the feature tracker handle is returned here.
[in]contextSpecifies the handle to the context under which it is created.
[in]streamSpecifies the CUDA stream to use for pyramid operations.
[in]configSpecifies the configuration parameters.
Returns
DW_INVALID_ARGUMENT if feature tracker handle or context are NULL or config is invalid.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_release()

DW_API_PUBLIC dwStatus dwFeatureTracker_release ( dwFeatureTrackerHandle_t obj)

Releases the feature tracker.

This method releases all resources associated with a feature tracker.

Note
This method renders the handle unusable.
Parameters
[in]objA pointer to the object handle to be released.
Returns
DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_reset()

DW_API_PUBLIC dwStatus dwFeatureTracker_reset ( dwFeatureTrackerHandle_t  obj)

Resets a feature tracker.

Parameters
[in]objSpecifies the feature tracker handle to be reset.
Returns
DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_setCUDAStream()

DW_API_PUBLIC dwStatus dwFeatureTracker_setCUDAStream ( cudaStream_t  stream,
dwFeatureTrackerHandle_t  obj 
)

Sets the CUDA stream for CUDA related operations.

Note
The ownership of the stream remains by the callee.
Parameters
[in]streamThe CUDA stream to be used. Default is the one passed during dwFeatureTracker_initialize.
[in]objA handle to the feature tracker module to set CUDA stream for.
Returns
DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_setMask()

DW_API_PUBLIC dwStatus dwFeatureTracker_setMask ( const uint8_t *  d_mask,
const uint32_t  maskStrideBytes,
const uint32_t  maskWidth,
const uint32_t  maskHeight,
dwFeatureTrackerHandle_t  obj 
)

Sets a mask to ignore areas of the image.

Areas where mask==0xff will not produce new features when detectNewFeatures() is called. The size of the mask must be the same as the image.

Parameters
[in]d_maskA GPU pointer to the mask data.
[in]maskStrideBytesSpecifies the stride, in bytes, for each row of the mask.
[in]maskWidthSpecifies the width of the mask.
[in]maskHeightSpecifies the height of the mask.
[in]objSpecifies the object handle.
Returns
DW_INVALID_ARGUMENT if feature tracker handle or d_mask are NULL or maskWidth or maskHeight are invalid.
DW_SUCCESS otherwise.

◆ dwFeatureTracker_trackFeatures()

DW_API_PUBLIC dwStatus dwFeatureTracker_trackFeatures ( dwFeatureListHandle_t  list,
dwConstPyramidHandle_t  previousPyramid,
dwConstPyramidHandle_t  currentPyramid,
const float32_t d_predictedPositions,
dwFeatureTrackerHandle_t  obj 
)

Tracks features from the internal list between the previous and current images.

Parameters
[in]listSpecifies the list of features to be tracked and updated.
[in]previousPyramidSpecifies the pyramid constructed from the last image.
[in]currentPyramidSpecifies the pyramid constructed from the current image.
[in]d_predictedPositionsA GPU pointer to a list of expected positions of the features to be tracked. The indexes of this list must match the indexes of the internal feature list. if this is NULL(== 0), then use previous locations of the list as predicted positions.
[in]objSpecifies the feature tracker handle.
Returns
DW_INVALID_ARGUMENT if any parameter is NULL or previous and current pyramids have a different number of levels.
A specific CUDA error in case of an underlying cuda failure.
DW_SUCCESS otherwise.