dw_imageprocessing_features
The test specification can be found at featurearrayapi_features_testgroup
Data Structures | |
struct | dwFeatureHistoryArray |
Holds pointers to the data exposed by a feature2d list. More... | |
struct | dwFeatureArray |
Typedefs | |
typedef enum dwFeature2DStatus | dwFeature2DStatus |
Defines the feature array used by detector and tracker. More... | |
typedef struct dwFeatureHistoryArray | dwFeatureHistoryArray |
Holds pointers to the data exposed by a feature2d list. More... | |
typedef struct dwFeatureArray | dwFeatureArray |
Enumerations | |
enum | dwFeature2DStatus { DW_FEATURE2D_STATUS_INVALID = 0, DW_FEATURE2D_STATUS_DETECTED, DW_FEATURE2D_STATUS_TRACKED, DW_FEATURE2D_STATUS_TYPE_COUNT } |
Defines the feature array used by detector and tracker. More... | |
Functions | |
DW_API_PUBLIC dwStatus | dwFeatureArray_create (dwFeatureArray *featureArray, const uint32_t maxFeatureCount, const dwMemoryType memoryType, dwContextHandle_t context) |
Creates and initializes a feature array. More... | |
DW_API_PUBLIC dwStatus | dwFeatureArray_createNew (dwFeatureArray *featureArray, const uint32_t maxFeatureCount, const dwMemoryType memoryType, cudaStream_t stream, dwContextHandle_t context) |
Creates and initializes a feature array. More... | |
DW_API_PUBLIC dwStatus | dwFeatureArray_destroy (dwFeatureArray featureArray) |
Destroys the featureArray and frees any memory created by dwFeatureArray_createNew(). More... | |
DW_API_PUBLIC dwStatus | dwFeatureArray_reset (dwFeatureArray *featureArray, cudaStream_t stream) |
Resets the feature array. More... | |
DW_API_PUBLIC dwStatus | dwFeatureArray_copyAsync (dwFeatureArray *dstFeatures, const dwFeatureArray *srcFeatures, cudaStream_t stream) |
Deep copy all contents from srcFeatures to dstFeatures. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_create (dwFeatureHistoryArray *featureHistoryArray, const uint32_t maxFeatureCount, const uint32_t maxHistoryCapacity, const dwMemoryType memoryType, dwContextHandle_t context) |
Creates and initializes a feature history array. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_createNew (dwFeatureHistoryArray *featureHistoryArray, const uint32_t maxFeatureCount, const uint32_t maxHistoryCapacity, const dwMemoryType memoryType, cudaStream_t stream, dwContextHandle_t context) |
Creates and initializes a feature history array. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_destroy (dwFeatureHistoryArray featureHistoryArray) |
Destroys the featureHistoryArray and frees any memory created by dwFeatureHistoryArray_createNew(). More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_reset (dwFeatureHistoryArray *featureHistoryArray, cudaStream_t stream) |
Resets the feature history array. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_getCurrent (dwFeatureArray *featureArray, dwFeatureHistoryArray const *featureHistoryArray) |
Get the latest feature snapshot(arraySize = maxFeatureCount) from history. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_getPrevious (dwFeatureArray *featureArray, dwFeatureHistoryArray const *featureHistoryArray) |
Get the feature snapshot(arraySize = maxFeatureCount) 1 frame previous to current time. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_get (dwFeatureArray *featureArray, const uint32_t historyIdx, dwFeatureHistoryArray const *featureHistoryArray) |
Get the feature snapshot(arraySize = maxFeatureCount) historyIdx-th frame earlier. More... | |
DW_API_PUBLIC dwStatus | dwFeatureHistoryArray_copyAsync (dwFeatureHistoryArray *dstFeatureHistory, const dwFeatureHistoryArray *srcFeatureHistory, cudaStream_t stream) |
Deep copy all contents from srcFeatureHistory to dstFeatureHistory. More... | |
DW_API_PUBLIC dwStatus | dwFeature_mergeNewToOldMap (uint32_t *d_newToOldMapC2A, const uint32_t *d_newToOldMapC2B, const uint32_t *d_newToOldMapB2A, const uint32_t *d_newToOldMapCount, const uint32_t maxFeatureCount, cudaStream_t stream) |
Merge newToOldMap from 2 inputs. More... | |
typedef enum dwFeature2DStatus dwFeature2DStatus |
Defines the feature array used by detector and tracker.
Defines the possible status of a feature.
typedef struct dwFeatureArray dwFeatureArray |
typedef struct dwFeatureHistoryArray dwFeatureHistoryArray |
Holds pointers to the data exposed by a feature2d list.
The pointers can point to GPU or CPU memory.
The locationHistory field is a 2D structure that stores the pixel positions for each feature at each time instant. It is a column-major matrix, where the column is the time-index and the row is the feature-index, for example: [x_00,y_00],[x_10,y_10],...,[x_N0,y_N0],[x_01,y_01],...,[x_N1,y_N1],...,[x_NH,y_NH], Where N = max feature count and H = location history size.
To avoid unnecessary memory copies, the time-index is treated as a ringbuffer. The feature2d list has a global "currentTimeIdx" that wraps around the location history size. The ages array holds how many frames each feature has been tracked. This value can be larger than historyCapacity, in this case, the accessing will be wrapped in ringbuffer.
@par Example to access the locations for the current and previous frames.
@verbatim embed:rst:leading-asterisk
.. code-block:: cpp
dwVector2f currentLocation = locationHistory[currentTimeIdx * maxFeatureCount + featureIdx];
uint32_t previousTimeIdx = (currentTimeIdx + 1) % historyCapacity;
dwVector2f currentLocation = locationHistory[previousTimeIdx * maxFeatureCount + featureIdx];
@endverbatim
enum dwFeature2DStatus |
Defines the feature array used by detector and tracker.
Defines the possible status of a feature.
Definition at line 52 of file FeatureList.h.
DW_API_PUBLIC dwStatus dwFeature_mergeNewToOldMap | ( | uint32_t * | d_newToOldMapC2A, |
const uint32_t * | d_newToOldMapC2B, | ||
const uint32_t * | d_newToOldMapB2A, | ||
const uint32_t * | d_newToOldMapCount, | ||
const uint32_t | maxFeatureCount, | ||
cudaStream_t | stream | ||
) |
Merge newToOldMap from 2 inputs.
i.e. There're 3 working stages: A->B->C, newToOldMapC2B gives the mapping of C->B, while newToOldMapB2A gives the mapping of B->A. The final C->A mapping will be computed and output to newToOldMapC2A
[out] | d_newToOldMapC2A | A GPU pointer to the output merged newToOldMap |
[in] | d_newToOldMapC2B | A GPU pointer to newToOldMap from stage C->B |
[in] | d_newToOldMapB2A | A GPU pointer to newToOldMap from stage B->A |
[in] | d_newToOldMapCount | A GPU pointer to valid number of entries in newToOldMapC2B |
[in] | maxFeatureCount | max number of features for newToOldMapC2A, newToOldMapC2B and newToOldMapB2A |
[in] | stream | Working cuda stream |
DW_API_PUBLIC dwStatus dwFeatureArray_copyAsync | ( | dwFeatureArray * | dstFeatures, |
const dwFeatureArray * | srcFeatures, | ||
cudaStream_t | stream | ||
) |
Deep copy all contents from srcFeatures to dstFeatures.
[out] | dstFeatures | dwFeatureArray to copy to |
[in] | srcFeatures | dwFeatureArray to copy from |
[in] | stream | Working cuda stream |
DW_API_PUBLIC dwStatus dwFeatureArray_create | ( | dwFeatureArray * | featureArray, |
const uint32_t | maxFeatureCount, | ||
const dwMemoryType | memoryType, | ||
dwContextHandle_t | context | ||
) |
Creates and initializes a feature array.
[out] | featureArray | pointer to the dwFeatureArray is returned here. |
[in] | maxFeatureCount | maximum number of features that the feature array can have. |
[in] | memoryType | DW_FEATURE2D_MEMORY_TYPE_CUDA for CUDA array, DW_FEATURE2D_MEMORY_TYPE_CPU for CPU array, DW_FEATURE2D_MEMORY_TYPE_PINNED for pinned memory |
[in] | context | handle to the context under which it is created. |
DW_API_PUBLIC dwStatus dwFeatureArray_createNew | ( | dwFeatureArray * | featureArray, |
const uint32_t | maxFeatureCount, | ||
const dwMemoryType | memoryType, | ||
cudaStream_t | stream, | ||
dwContextHandle_t | context | ||
) |
Creates and initializes a feature array.
[out] | featureArray | pointer to the dwFeatureArray is returned here. |
[in] | maxFeatureCount | maximum number of features that the feature array can have. |
[in] | memoryType | DW_FEATURE2D_MEMORY_TYPE_CUDA for CUDA array, DW_FEATURE2D_MEMORY_TYPE_CPU for CPU array, DW_FEATURE2D_MEMORY_TYPE_PINNED for pinned memory |
[in] | stream | Working CUDA stream |
[in] | context | handle to the context under which it is created. |
DW_API_PUBLIC dwStatus dwFeatureArray_destroy | ( | dwFeatureArray | featureArray | ) |
Destroys the featureArray and frees any memory created by dwFeatureArray_createNew().
[in] | featureArray | feature array to be destroyed. |
DW_API_PUBLIC dwStatus dwFeatureArray_reset | ( | dwFeatureArray * | featureArray, |
cudaStream_t | stream | ||
) |
Resets the feature array.
Sets the feature count back to zero.
[in] | featureArray | feature array to be reset. |
[in] | stream | CUDA stream used to reset the feature array |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_copyAsync | ( | dwFeatureHistoryArray * | dstFeatureHistory, |
const dwFeatureHistoryArray * | srcFeatureHistory, | ||
cudaStream_t | stream | ||
) |
Deep copy all contents from srcFeatureHistory to dstFeatureHistory.
[out] | dstFeatureHistory | dwFeatureHistoryArray to copy to |
[in] | srcFeatureHistory | dwFeatureHistoryArray to copy from |
[in] | stream | Working cuda stream |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_create | ( | dwFeatureHistoryArray * | featureHistoryArray, |
const uint32_t | maxFeatureCount, | ||
const uint32_t | maxHistoryCapacity, | ||
const dwMemoryType | memoryType, | ||
dwContextHandle_t | context | ||
) |
Creates and initializes a feature history array.
[out] | featureHistoryArray | pointer to the dwFeatureHistoryArray is returned here. |
[in] | maxFeatureCount | maximum number of features that each time slice can have. |
[in] | maxHistoryCapacity | maximum length of history in feature history array. There'll be maxFeatureCount*maxHistoryCapacity features totally. |
[in] | memoryType | DW_FEATURE2D_MEMORY_TYPE_CUDA for CUDA array, DW_FEATURE2D_MEMORY_TYPE_CPU for CPU array, DW_FEATURE2D_MEMORY_TYPE_PINNED for pinned memory |
[in] | context | handle to the context under which it is created. |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_createNew | ( | dwFeatureHistoryArray * | featureHistoryArray, |
const uint32_t | maxFeatureCount, | ||
const uint32_t | maxHistoryCapacity, | ||
const dwMemoryType | memoryType, | ||
cudaStream_t | stream, | ||
dwContextHandle_t | context | ||
) |
Creates and initializes a feature history array.
[out] | featureHistoryArray | pointer to the dwFeatureHistoryArray is returned here. |
[in] | maxFeatureCount | maximum number of features that each time slice can have. |
[in] | maxHistoryCapacity | maximum length of history in feature history array. There'll be maxFeatureCount*maxHistoryCapacity features totally. |
[in] | memoryType | DW_FEATURE2D_MEMORY_TYPE_CUDA for CUDA array, DW_FEATURE2D_MEMORY_TYPE_CPU for CPU array, DW_FEATURE2D_MEMORY_TYPE_PINNED for pinned memory |
[in] | stream | Working CUDA stream |
[in] | context | handle to the context under which it is created. |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_destroy | ( | dwFeatureHistoryArray | featureHistoryArray | ) |
Destroys the featureHistoryArray and frees any memory created by dwFeatureHistoryArray_createNew().
[in] | featureHistoryArray | feature history array to be destroyed. |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_get | ( | dwFeatureArray * | featureArray, |
const uint32_t | historyIdx, | ||
dwFeatureHistoryArray const * | featureHistoryArray | ||
) |
Get the feature snapshot(arraySize = maxFeatureCount) historyIdx-th frame earlier.
Assuming dwFeatureHistoryArray has N valid features in current Time(t), this API returns a dwFeatureArray that contains the snapshot of those N features in Time(t-historyIdx)
[out] | featureArray | Snapshot of the timeIdx that is historyIdx frame previous to current in feature history. |
[in] | historyIdx | Time index that need to be backtraced. |
[in] | featureHistoryArray | Complete feature history. |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_getCurrent | ( | dwFeatureArray * | featureArray, |
dwFeatureHistoryArray const * | featureHistoryArray | ||
) |
Get the latest feature snapshot(arraySize = maxFeatureCount) from history.
[out] | featureArray | Snapshot of latest time in feature history. |
[in] | featureHistoryArray | Complete feature history. |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_getPrevious | ( | dwFeatureArray * | featureArray, |
dwFeatureHistoryArray const * | featureHistoryArray | ||
) |
Get the feature snapshot(arraySize = maxFeatureCount) 1 frame previous to current time.
Assuming dwFeatureHistoryArray has N valid features in current Time(t), this API returns a dwFeatureArray that contains the snapshot of those N features in Time(t-1).
[out] | featureArray | Snapshot of the timeIdx that is 1 frame previous to current in feature history. |
[in] | featureHistoryArray | Complete feature history. |
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_reset | ( | dwFeatureHistoryArray * | featureHistoryArray, |
cudaStream_t | stream | ||
) |
Resets the feature history array.
Sets the feature count back to zero.
[in] | featureHistoryArray | feature history array to be reset. |
[in] | stream | CUDA stream used to reset the feature history array |