![]() |
DriveWorks SDK Reference| 0.6.67 Release |
Defines the feature list used by the tracker.
Data Structures | |
struct | dwFeatureListPointers |
Holds pointers to the data exposed by a feature list. More... | |
Enumerations | |
enum | dwFeatureStatus { DW_FEATURE_STATUS_INVALID = 0, DW_FEATURE_STATUS_DETECTED, DW_FEATURE_STATUS_TRACKED, DW_FEATURE_STATUS_TYPE_COUNT } |
Defines the possible status of a feature. More... | |
Functions | |
DW_API_PUBLIC dwStatus | dwFeatureList_compact (dwFeatureListHandle_t featureList, const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes, const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes) |
Removes features from the list. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_getCUDAStream (cudaStream_t *stream, dwFeatureListHandle_t obj) |
Gets the CUDA stream used by the feature list. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_getCurrentTimeIdx (uint32_t *currentTimeIdx, dwFeatureListHandle_t obj) |
Returns the current time index of feature-history circular buffer. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_getDataBasePointer (void **d_basePointer, size_t *size, dwFeatureListHandle_t obj) |
Returns the start position of the data buffer that stores all of the feature list information (in GPU memory). More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_getDataPointers (dwFeatureListPointers *pointers, void *basePointer, dwFeatureListHandle_t obj) |
Returns the pointers to the actual data of a feature list given the base pointer. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_getFeatureListSize (uint32_t *maxFeatureCount, uint32_t *historyCapacity, dwFeatureListHandle_t obj) |
Returns the maximum feature count and history capacity of the feature list. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_initialize (dwFeatureListHandle_t *obj, dwContextHandle_t context, cudaStream_t stream, const uint32_t maxFeatureCount, const uint32_t historyCapacity, const uint32_t imageWidth, uint32_t imageHeight) |
Creates and initializes a feature list. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_proximityFilter (dwFeatureListHandle_t list) |
Invalidates features that are too close to each other. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_release (dwFeatureListHandle_t *obj) |
Releases the feature list. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_reset (dwFeatureListHandle_t obj) |
Resets the feature list. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_selectValid (uint32_t *d_validIndexCount, uint32_t *d_validIndexes, uint32_t *d_invalidIndexCount, uint32_t *d_invalidIndexes, dwConstFeatureListHandle_t obj) |
Creates a list of indexes of those features with a status of detected or tracked, and list of indexes of those features with a status of invalid. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_setCUDAStream (cudaStream_t stream, dwFeatureListHandle_t obj) |
Sets the CUDA stream for CUDA related operations. More... | |
DW_API_PUBLIC dwStatus | dwFeatureList_setCurrentTimeIdx (uint32_t currentTimeIdx, dwFeatureListHandle_t obj) |
Sets the current time index of the feature-history circular buffer. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_addEmptyFeature (uint32_t nFeatures, dwScalingFeatureListHandle_t obj) |
Insert nFeatures empty feature into the feature list. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_applySizeFilter (float32_t maxWidth, float32_t maxHeight, dwScalingFeatureListHandle_t obj) |
Mark the features in the list as DW_FEATURE_STATUS_INVALID with size larger than (maxWidth, maxHeight) More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_compact (dwScalingFeatureListHandle_t list, const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes, const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes) |
Removes scaling features from the list. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_getCUDAStream (cudaStream_t *stream, dwScalingFeatureListHandle_t obj) |
Gets the CUDA stream used by the scaling feature list. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_getDataBasePointer (void **d_basePointer, size_t *size, dwScalingFeatureListHandle_t obj) |
Returns the start position of the data buffer that stores all of the scaling feature list information (in GPU memory). More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_getDataPointers (dwScalingFeatureListPointers *pointers, void *basePointer, dwScalingFeatureListHandle_t obj) |
Returns the pointers to the actual data of a scaling feature list given the base pointer. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_initialize (dwScalingFeatureListHandle_t *obj, dwContextHandle_t context, cudaStream_t stream, const uint32_t maxFeatureCount, const dwTrivialDataType pxlType) |
Creates and initializes a scaling feature list. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_release (dwScalingFeatureListHandle_t *obj) |
Releases the scaling feature list. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_reset (dwScalingFeatureListHandle_t obj) |
Resets the scaling feature list. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_selectValid (uint32_t *d_validIndexCount, uint32_t *d_validIndexes, uint32_t *d_invalidIndexCount, uint32_t *d_invalidIndexes, dwConstScalingFeatureListHandle_t obj) |
Creates a list of indexes of those scaling features with a status of detected or tracked, and list of indexes of those scaling features with a status of invalid. More... | |
DW_API_PUBLIC dwStatus | dwScalingFeatureList_setCUDAStream (cudaStream_t stream, dwScalingFeatureListHandle_t obj) |
Sets the CUDA stream for CUDA related operations. More... | |
struct dwFeatureListPointers |
Data Fields | ||
---|---|---|
uint32_t * | ages |
Age of each feature. 1D array of size N. |
uint32_t * | featureCount |
Total number of feature points. Single value. |
dwVector2f * | locationHistory |
Location history of feature points. 2D array of size N*H. |
dwFeatureStatus * | statuses |
Status of each feature. 1D array of size N. |
enum dwFeatureStatus |
Defines the possible status of a feature.
Definition at line 88 of file Features.h.
DW_API_PUBLIC dwStatus dwFeatureList_compact | ( | dwFeatureListHandle_t | featureList, |
const uint32_t * | d_validIndexCount, | ||
const uint32_t * | d_validIndexes, | ||
const uint32_t * | d_invalidIndexCount, | ||
const uint32_t * | d_invalidIndexes | ||
) |
Removes features from the list.
It doesn't work in place; instead, it copies the valid features onto a new list.
[in,out] | featureList | Specifies the list where the compact operation will be performed. |
[in] | d_validIndexCount | A GPU pointer to the number of entries in the d_validIndexes array. |
[in] | d_validIndexes | A GPU array that holds the indexes of the features that will be copied to the new list. |
[in] | d_invalidIndexCount | A GPU pointer to the number of entries in the d_invalidIndexes array. |
[in] | d_invalidIndexes | A GPU array that holds the indexes of the features that shouldn't be copied to the new list. |
DW_API_PUBLIC dwStatus dwFeatureList_getCUDAStream | ( | cudaStream_t * | stream, |
dwFeatureListHandle_t | obj | ||
) |
Gets the CUDA stream used by the feature list.
[out] | stream | The CUDA stream currently used. |
[in] | obj | A handle to the feature list module. |
DW_API_PUBLIC dwStatus dwFeatureList_getCurrentTimeIdx | ( | uint32_t * | currentTimeIdx, |
dwFeatureListHandle_t | obj | ||
) |
Returns the current time index of feature-history circular buffer.
Using this function one can find where the most recent measured position is:
[out] | currentTimeIdx | Current time index. |
[in] | obj | Feature list handle. |
DW_API_PUBLIC dwStatus dwFeatureList_getDataBasePointer | ( | void ** | d_basePointer, |
size_t * | size, | ||
dwFeatureListHandle_t | obj | ||
) |
Returns the start position of the data buffer that stores all of the feature list information (in GPU memory).
Use this base pointer to allocate a CPU buffer and copy the feature list into it.
[out] | size | The size of the feature list data structure. |
[out] | d_basePointer | A pointer to a GPU pointer to the feature data. |
[in] | obj | Specifies the feature list handle. |
DW_API_PUBLIC dwStatus dwFeatureList_getDataPointers | ( | dwFeatureListPointers * | pointers, |
void * | basePointer, | ||
dwFeatureListHandle_t | obj | ||
) |
Returns the pointers to the actual data of a feature list given the base pointer.
basePointer can be either CPU or GPU, and the resulting pointers will be in the same memory space.
[out] | pointers | List of pointers into the data. |
[in] | basePointer | Start of the data structure. Can be GPU or CPU pointer. |
[in] | obj | Specifies the feature list handle. |
DW_API_PUBLIC dwStatus dwFeatureList_getFeatureListSize | ( | uint32_t * | maxFeatureCount, |
uint32_t * | historyCapacity, | ||
dwFeatureListHandle_t | obj | ||
) |
Returns the maximum feature count and history capacity of the feature list.
[out] | maxFeatureCount | Maximum number of features can be stored in the list. |
[out] | historyCapacity | Capacity of location history circular buffer. |
[in] | obj | Feature list handle. |
DW_API_PUBLIC dwStatus dwFeatureList_initialize | ( | dwFeatureListHandle_t * | obj, |
dwContextHandle_t | context, | ||
cudaStream_t | stream, | ||
const uint32_t | maxFeatureCount, | ||
const uint32_t | historyCapacity, | ||
const uint32_t | imageWidth, | ||
uint32_t | imageHeight | ||
) |
Creates and initializes a feature list.
The list allocates space for maxFeatureCount
features and is initialized to zero features.
[out] | obj | A pointer to the feature list handle is returned here. |
[in] | context | Specifies the handle to the context under which it is created. |
[in] | stream | Specifies the CUDA stream to use for list operations. |
[in] | maxFeatureCount | Specifies the maximum number of features that the list can have. |
[in] | historyCapacity | Specifies capacity of feature history circular buffer. |
[in] | imageWidth | Specifies the width of the source images. |
[in] | imageHeight | Specifies the height of the source images. |
DW_API_PUBLIC dwStatus dwFeatureList_proximityFilter | ( | dwFeatureListHandle_t | list | ) |
Invalidates features that are too close to each other.
[in] | list | Specifies the list handle. |
DW_API_PUBLIC dwStatus dwFeatureList_release | ( | dwFeatureListHandle_t * | obj | ) |
Releases the feature list.
This method releases all resources associated with a feature list.
[in] | obj | A pointer to the object handle to be released. |
DW_API_PUBLIC dwStatus dwFeatureList_reset | ( | dwFeatureListHandle_t | obj | ) |
Resets the feature list.
Sets the feature count back to zero.
[in] | obj | Specifies the feature list handle to reset. |
DW_API_PUBLIC dwStatus dwFeatureList_selectValid | ( | uint32_t * | d_validIndexCount, |
uint32_t * | d_validIndexes, | ||
uint32_t * | d_invalidIndexCount, | ||
uint32_t * | d_invalidIndexes, | ||
dwConstFeatureListHandle_t | obj | ||
) |
Creates a list of indexes of those features with a status of detected or tracked, and list of indexes of those features with a status of invalid.
[out] | d_validIndexCount | A GPU pointer to the number of entries in the d_validIndexes array. |
[out] | d_validIndexes | A GPU array to hold the indexes of the features with a valid status. Must be at least of size featureCount. |
[out] | d_invalidIndexCount | A GPU pointer to the number of entries in the d_invalidIndexes array. |
[out] | d_invalidIndexes | A GPU array to hold the indexes of the features with a invalid status. Must be at least of size featureCount. |
[in] | obj | Specifies the feature list handle. |
DW_API_PUBLIC dwStatus dwFeatureList_setCUDAStream | ( | cudaStream_t | stream, |
dwFeatureListHandle_t | obj | ||
) |
Sets the CUDA stream for CUDA related operations.
[in] | stream | The CUDA stream to be used. Default is the one passed during dwFeatureList_initialize. |
[in] | obj | A handle to the feature list module to set CUDA stream for. |
DW_API_PUBLIC dwStatus dwFeatureList_setCurrentTimeIdx | ( | uint32_t | currentTimeIdx, |
dwFeatureListHandle_t | obj | ||
) |
Sets the current time index of the feature-history circular buffer.
When you call dwFeatureTracker_trackFeatures(), the current time index is decremented automatically. Use this function only when you want to manually change the current time index to provide your own feature list.
[in] | currentTimeIdx | Current time index. |
[in] | obj | Feature list handle. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_addEmptyFeature | ( | uint32_t | nFeatures, |
dwScalingFeatureListHandle_t | obj | ||
) |
Insert nFeatures empty feature into the feature list.
[in] | nFeatures | Number of features to be added |
[in,out] | obj | Specifies the scaling feature list handle. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_applySizeFilter | ( | float32_t | maxWidth, |
float32_t | maxHeight, | ||
dwScalingFeatureListHandle_t | obj | ||
) |
Mark the features in the list as DW_FEATURE_STATUS_INVALID with size larger than (maxWidth, maxHeight)
[in] | maxWidth | If width of the feature > maxWidth, it will be marked as DW_FEATURE_STATUS_INVALID |
[in] | maxHeight | If height of the feature > maxHeight, it will be marked as DW_FEATURE_STATUS_INVALID |
[in,out] | obj | Specifies the scaling eature list handle. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_compact | ( | dwScalingFeatureListHandle_t | list, |
const uint32_t * | d_validIndexCount, | ||
const uint32_t * | d_validIndexes, | ||
const uint32_t * | d_invalidIndexCount, | ||
const uint32_t * | d_invalidIndexes | ||
) |
Removes scaling features from the list.
It doesn't work in place; instead, it copies the valid features onto a new list.
[in,out] | list | Specifies the list where the compact operation will be performed. |
[in] | d_validIndexCount | A GPU pointer to the number of entries in the d_validIndexes array. |
[in] | d_validIndexes | A GPU array that holds the indexes of the features that will be copied to the new list. |
[in] | d_invalidIndexCount | A GPU pointer to the number of entries in the d_invalidIndexes array. |
[in] | d_invalidIndexes | A GPU array that holds the indexes of the features that shouldn't be copied to the new list. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_getCUDAStream | ( | cudaStream_t * | stream, |
dwScalingFeatureListHandle_t | obj | ||
) |
Gets the CUDA stream used by the scaling feature list.
[out] | stream | The CUDA stream currently used. |
[in] | obj | A handle to the scaling feature list module. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_getDataBasePointer | ( | void ** | d_basePointer, |
size_t * | size, | ||
dwScalingFeatureListHandle_t | obj | ||
) |
Returns the start position of the data buffer that stores all of the scaling feature list information (in GPU memory).
Use this base pointer to allocate a CPU buffer and copy the scaling feature list into it.
[out] | size | The size of the scaling feature list data structure. |
[out] | d_basePointer | A pointer to a GPU pointer to the scaling feature data. |
[in] | obj | Specifies the scaling feature list handle. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_getDataPointers | ( | dwScalingFeatureListPointers * | pointers, |
void * | basePointer, | ||
dwScalingFeatureListHandle_t | obj | ||
) |
Returns the pointers to the actual data of a scaling feature list given the base pointer.
basePointer can be either CPU or GPU, and the resulting pointers will be in the same memory space.
[out] | pointers | List of pointers into the data. |
[in] | basePointer | Start of the data structure. Can be GPU or CPU pointer. |
[in] | obj | Specifies the scaling feature list handle. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_initialize | ( | dwScalingFeatureListHandle_t * | obj, |
dwContextHandle_t | context, | ||
cudaStream_t | stream, | ||
const uint32_t | maxFeatureCount, | ||
const dwTrivialDataType | pxlType | ||
) |
Creates and initializes a scaling feature list.
The list allocates space for maxFeatureCount
features and is initialized to zero features.
[out] | obj | A pointer to the feature list handle is returned here. |
[in] | context | Specifies the handle to the context under which it is created. |
[in] | stream | Specifies the CUDA stream to use for list operations. |
[in] | maxFeatureCount | Specifies the maximum number of features that the list can have. |
[in] | pxlType |
DW_API_PUBLIC dwStatus dwScalingFeatureList_release | ( | dwScalingFeatureListHandle_t * | obj | ) |
Releases the scaling feature list.
This method releases all resources associated with a scaling feature list.
[in] | obj | A pointer to the object handle to be released. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_reset | ( | dwScalingFeatureListHandle_t | obj | ) |
Resets the scaling feature list.
Sets the feature count back to zero.
[in] | obj | Specifies the scaling feature list handle to reset. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_selectValid | ( | uint32_t * | d_validIndexCount, |
uint32_t * | d_validIndexes, | ||
uint32_t * | d_invalidIndexCount, | ||
uint32_t * | d_invalidIndexes, | ||
dwConstScalingFeatureListHandle_t | obj | ||
) |
Creates a list of indexes of those scaling features with a status of detected or tracked, and list of indexes of those scaling features with a status of invalid.
[out] | d_validIndexCount | A GPU pointer to the number of entries in the d_validIndexes array. |
[out] | d_validIndexes | A GPU array to hold the indexes of the features with a valid status. Must be at least of size featureCount. |
[out] | d_invalidIndexCount | A GPU pointer to the number of entries in the d_invalidIndexes array. |
[out] | d_invalidIndexes | A GPU array to hold the indexes of the features with a invalid status. Must be at least of size featureCount. |
[in] | obj | Specifies the scaling feature list handle. |
DW_API_PUBLIC dwStatus dwScalingFeatureList_setCUDAStream | ( | cudaStream_t | stream, |
dwScalingFeatureListHandle_t | obj | ||
) |
Sets the CUDA stream for CUDA related operations.
[in] | stream | The CUDA stream to be used. Default is the one passed during dwScalingFeatureList_initialize. |
[in] | obj | A handle to the scaling feature list module to set CUDA stream for. |