Defines 2D-based feature detection and tracking.
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_initDefaultParams (dwFeature2DTrackerConfig *params) |
| Initializes dwFeature2DTracker parameters with default values. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_initDefaultParamsForCamera (dwFeature2DTrackerConfig *params, const dwTransformation3f *cameraToRig, dwConstCameraModelHandle_t cameraHandle) |
| Initializes dwFeature2DTracker parameters with values best suited for the given camera using camera extrinsic (dwTransformation3f* cameraToRig) and camera intrinsic (dwConstCameraModelHandle_t cameraHandle) More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_initialize (dwFeature2DTrackerHandle_t *obj, const dwFeature2DTrackerConfig *config, cudaStream_t cudaStream, dwContextHandle_t context) |
| Creates and initializes a feature tracker. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_reset (dwFeature2DTrackerHandle_t obj) |
| Resets a feature tracker. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_release (dwFeature2DTrackerHandle_t obj) |
| Releases the feature tracker. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_trackFeatures (dwFeatureHistoryArray *featureHistoryArray, dwFeatureArray *predictedFeatures, float32_t *d_normalizedCrossCorrelation, const dwFeatureArray *featuresToTrack, const dwVector2f *d_predictedPositions, const dwPyramidImage *previousPyramid, const dwPyramidImage *currentPyramid, dwFeature2DTrackerHandle_t obj) |
| Tracks features and store the tracked results to predictedFeatures between the previous and current images. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_compact (dwFeatureHistoryArray *featureHistoryArray, dwFeature2DTrackerHandle_t obj) |
| Remove invalid features. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_setCUDAStream (cudaStream_t stream, dwFeature2DTrackerHandle_t obj) |
| Sets the CUDA stream for CUDA related operations. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_getCUDAStream (cudaStream_t *stream, dwFeature2DTrackerHandle_t obj) |
| Gets the CUDA stream used by the feature tracker. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_setPVAStream (cupvaStream_t stream, dwFeature2DTrackerHandle_t obj) |
| Sets the cuPVA stream for PVA related operations. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_getPVAStream (cupvaStream_t *stream, dwFeature2DTrackerHandle_t obj) |
| Gets the cuPVA stream used by the feature tracker. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_registerOutputNccScore (float32_t *nccScore, uint32_t nccScoreArraySize, dwFeature2DTrackerHandle_t obj) |
| Binds output ncc Score. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_registerHistoryArray (dwFeatureHistoryArray *historyArray, dwFeature2DTrackerHandle_t obj) |
| Binds feature HistoryArray. More...
|
|
DW_API_PUBLIC dwStatus | dwFeature2DTracker_registerFeatureArray (dwFeatureArray *inFeatures, dwFeature2DTrackerHandle_t obj) |
| Binds feature Array. More...
|
|
◆ DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE
#define DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE 16 |
◆ dwConstFeature2DTrackerHandle_t
Handle representing a const feature tracker.
Definition at line 55 of file FeatureTracker.h.
◆ dwFeature2DTrackerAlgorithm
Defines different KLT tracking algorithms.
◆ dwFeature2DTrackerConfig
Holds configuration parameters for a feature tracker.
◆ dwFeature2DTrackerHandle_t
◆ dwFeature2DTrackerAlgorithm
Defines different KLT tracking algorithms.
Enumerator |
---|
DW_FEATURE2D_TRACKER_ALGORITHM_STD | 3-DOF (dx, dy, dscale) standard KLT tracking.
|
DW_FEATURE2D_TRACKER_ALGORITHM_EX | 3-DOF (dx, dy, dscale) extended KLT tracking.
|
DW_FEATURE2D_TRACKER_ALGORITHM_EX_FAST | 3-DOF (dx, dy, dscale) fast extended KLT tracking.
|
DW_FEATURE2D_TRACKER_ALGORITHM_COUNT | |
Definition at line 69 of file FeatureTracker.h.
◆ dwFeature2DTracker_compact()
Remove invalid features.
- Parameters
-
[in,out] | featureHistoryArray | Sparse feature history array, the features whose status = DW_FEATURE2D_STATUS_INVALID will be removed after calling |
[in] | obj | Specifies the feature tracker handle. |
- Returns
- DW_INVALID_ARGUMENT if featureHistoryArray or obj is NULL.
A specific CUDA error in case of an underlying cuda failure.
DW_SUCCESS otherwise.
- Note
- this API does real work only when
dwFeature2DTrackerConfig::enableSparseOutput = 1
, It will also update the dwFeatureHistoryArray::newToOldMap
.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_getCUDAStream()
Gets the CUDA stream used by the feature tracker.
- Parameters
-
[out] | stream | The CUDA stream currently used. |
[in] | obj | A handle to the feature tracker module. |
- Returns
- DW_INVALID_ARGUMENT if feature tracker handle or stream are NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_getPVAStream()
Gets the cuPVA stream used by the feature tracker.
- Parameters
-
[out] | stream | The cuPVA stream currently used. |
[in] | obj | A handle to the feature tracker module. |
- Returns
- DW_NOT_AVAILABLE if PVA is not available on the platform.
DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_initDefaultParams()
Initializes dwFeature2DTracker parameters with default values.
- Parameters
-
[in,out] | params | dwFeature2DTracker parameters; user can optionally set imageWidth/imageHeight before the API call to obtain the default parameters for the resolution |
- Returns
- DW_INVALID_ARGUMENT if params is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: No
- De-Init: No
◆ dwFeature2DTracker_initDefaultParamsForCamera()
Initializes dwFeature2DTracker parameters with values best suited for the given camera using camera extrinsic (dwTransformation3f* cameraToRig) and camera intrinsic (dwConstCameraModelHandle_t cameraHandle)
- Parameters
-
[out] | params | dwFeature2DTracker parameters |
[in] | cameraToRig | transformed camera extrinsic parameters with respect to rig |
[in] | cameraHandle | holds camera intrinsic information |
- Returns
- DW_INVALID_ARGUMENT if any parameter is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: No
- De-Init: No
◆ dwFeature2DTracker_initialize()
Creates and initializes a feature tracker.
- Parameters
-
[out] | obj | A pointer to the feature tracker handle is returned here. |
[in] | config | the configuration parameters for tracker. |
[in] | cudaStream | the CUDA stream to use for tracker operations. |
[in] | context | the handle to the context under which it is created. |
- Returns
- DW_INVALID_ARGUMENT if feature tracker handle, featureHistoryArray or context are NULL.
if config is invalid.
if featureHistoryArray is not allocated on GPU if featureHistoryArray contains invalid pointers DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: No
- De-Init: No
◆ dwFeature2DTracker_registerFeatureArray()
Binds feature Array.
Internally the cuda pointer to featureArray is mapped to pva address space using the cupva cuda interop api
- Parameters
-
[in] | inFeatures | cuda pointer to Feature Array |
[in] | obj | A handle to the feature tracker module. |
- Returns
- DW_NOT_SUPPORTED if the api is called for non pva platform. DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_registerHistoryArray()
Binds feature HistoryArray.
Internally the cuda pointer to feature History Array is mapped to pva address space using the cupva cuda interop api
- Parameters
-
[in] | historyArray | cuda pointer to Complete feature History Array |
[in] | obj | A handle to the feature tracker module. |
- Returns
- DW_NOT_SUPPORTED if the api is called for non pva platform. DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_registerOutputNccScore()
Binds output ncc Score.
Internally the cuda pointer to nccScore is mapped to pva address space using the cupva cuda interop api
- Parameters
-
[in] | nccScore | cuda pointer to Input NccScore |
[in] | obj | A handle to the feature tracker module. |
[in] | nccScoreArraySize | Number of elements in the ncc Score Array |
- Returns
- DW_NOT_SUPPORTED if the api is called for non pva platform. DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_release()
Releases the feature tracker.
This method releases all resources associated with a feature tracker.
- Note
- This method renders the handle unusable.
- Parameters
-
[in] | obj | The object handle to be released. |
- Returns
- DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: No
- De-Init: Yes
◆ dwFeature2DTracker_reset()
Resets a feature tracker.
- Parameters
-
[in] | obj | Specifies the feature tracker handle to be reset. |
- Returns
- DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_setCUDAStream()
Sets the CUDA stream for CUDA related operations.
- Note
- The ownership of the stream remains by the callee.
- Parameters
-
[in] | stream | The CUDA stream to be used. Default is the one passed during dwFeature2DTracker_initialize. |
[in] | obj | A handle to the feature tracker module to set CUDA stream for. |
- Returns
- DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_setPVAStream()
Sets the cuPVA stream for PVA related operations.
- Note
- The ownership of the stream remains by the callee.
- Parameters
-
[in] | stream | The cuPVA stream to be used. |
[in] | obj | A handle to the feature tracker module to set cuPVA stream for. |
- Returns
- DW_NOT_AVAILABLE if PVA is not available on the platform.
DW_INVALID_ARGUMENT if feature tracker handle is NULL.
DW_SUCCESS otherwise.
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes
◆ dwFeature2DTracker_trackFeatures()
Tracks features and store the tracked results to predictedFeatures
between the previous and current images.
Features to track are defined by dwFeatureHistoryArray
bound to the tracker during initialization
- Parameters
-
[out] | featureHistoryArray | output feature history array, must be on GPU memory. |
[out] | predictedFeatures | list of predicted features, it's also the top slice of dwFeatureHistoryArray |
[out] | d_normalizedCrossCorrelation | Device pointer to nccScore of tracked features, will be ignored if it's NULL. |
[in] | featuresToTrack | list of features to be tracked, usually the output of feature detector. |
[in] | d_predictedPositions | A 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 the locations in featuresToTrack |
[in] | previousPyramid | pyramid constructed from the last image. |
[in] | currentPyramid | pyramid constructed from the current image. |
[in] | obj | Specifies the feature tracker handle. |
- Returns
- DW_INVALID_ARGUMENT if any parameter except d_normalizedCrossCorrelation and d_predictedPositions is NULL, or previous and current pyramids have a different number of levels.
if previousFeatures or detectedFeatures are not on GPU.
A specific CUDA error in case of an underlying cuda failure.
DW_SUCCESS otherwise.
- Note
- Output
predictedFeatures
array contains a list of compacted features, invalid trackings are removed automatically, the orders between input featuresToTrack
and output predictedFeatures
can be queried by dwFeatureHistoryArray::newToOldMap
which maps new->old index: newToOldMap[newIdx] == oldIdx. newToOldMap[i] = j means the i-th feature in output predictedFeatures
is the j-th item in input featuresToTrack
array. i.e. predictedFeatures[i] = featuresToTrack[newToOldMap[i]], below is an example: data: [1 2 3 4 5 6 7 8 9] tracked/untracked: [O O X X O X O X O] compacted output (overwrite 3 and 4 by 9 and 7): data: [1 2 9 7 5] newToOldMap: [0 1 8 6 4]
- API Group
- Init: Yes
- Runtime: Yes
- De-Init: Yes