Defines 2D-based feature detection and tracking.
@design{dw_imageprocessing_tracking_featuretracker}
Data Structures | |
| struct | dwFeature2DTrackerConfig |
| Holds configuration parameters for a feature tracker. More... | |
Macros | |
| #define | DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE 16 |
| tracking window size More... | |
Typedefs | |
| typedef void * | cupvaStream_t |
| Dummy definition for non PVA supported platforms. More... | |
| typedef struct dwFeature2DTrackerObject * | dwFeature2DTrackerHandle_t |
| Handle representing a feature tracker. More... | |
| typedef struct dwFeature2DTrackerObject const * | dwConstFeature2DTrackerHandle_t |
| Handle representing a const feature tracker. More... | |
| typedef enum dwFeature2DTrackerAlgorithm | dwFeature2DTrackerAlgorithm |
| Defines different KLT tracking algorithms. More... | |
| typedef struct dwFeature2DTrackerConfig | dwFeature2DTrackerConfig |
| Holds configuration parameters for a feature tracker. More... | |
Enumerations | |
| enum | dwFeature2DTrackerAlgorithm { DW_FEATURE2D_TRACKER_ALGORITHM_STD = 0, DW_FEATURE2D_TRACKER_ALGORITHM_EX, DW_FEATURE2D_TRACKER_ALGORITHM_EX_FAST, DW_FEATURE2D_TRACKER_ALGORITHM_COUNT } |
| Defines different KLT tracking algorithms. More... | |
| #define DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE 16 |
tracking window size
Definition at line 54 of file FeatureTracker.h.
| typedef void* cupvaStream_t |
Dummy definition for non PVA supported platforms.
Definition at line 44 of file FeatureTracker.h.
| typedef struct dwFeature2DTrackerObject const* dwConstFeature2DTrackerHandle_t |
Handle representing a const feature tracker.
Definition at line 60 of file FeatureTracker.h.
| typedef enum dwFeature2DTrackerAlgorithm dwFeature2DTrackerAlgorithm |
Defines different KLT tracking algorithms.
| typedef struct dwFeature2DTrackerConfig dwFeature2DTrackerConfig |
Holds configuration parameters for a feature tracker.
| typedef struct dwFeature2DTrackerObject* dwFeature2DTrackerHandle_t |
Handle representing a feature tracker.
Definition at line 57 of file FeatureTracker.h.
Defines different KLT tracking algorithms.
Definition at line 65 of file FeatureTracker.h.
| DW_API_PUBLIC dwStatus dwFeature2DTracker_compact | ( | dwFeatureHistoryArray * | featureHistoryArray, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Remove invalid features.
| [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. |
dwFeature2DTrackerConfig::enableSparseOutput = 1, It will also update the dwFeatureHistoryArray::newToOldMap. | DW_API_PUBLIC dwStatus dwFeature2DTracker_getCUDAStream | ( | cudaStream_t * | stream, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Gets the CUDA stream used by the feature tracker.
| [out] | stream | The CUDA stream currently used. |
| [in] | obj | A handle to the feature tracker module. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_getPVAStream | ( | cupvaStream_t * | stream, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Gets the cuPVA stream used by the feature tracker.
| [out] | stream | The cuPVA stream currently used. |
| [in] | obj | A handle to the feature tracker module. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_initDefaultParams | ( | dwFeature2DTrackerConfig * | params | ) |
Initializes dwFeature2DTracker parameters with default values.
| [in,out] | params | dwFeature2DTracker parameters; user can optionally set imageWidth/imageHeight before the API call to obtain the default parameters for the resolution |
| 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)
| [out] | params | dwFeature2DTracker parameters |
| [in] | cameraToRig | transformed camera extrinsic parameters with respect to rig |
| [in] | cameraHandle | holds camera intrinsic information |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_initialize | ( | dwFeature2DTrackerHandle_t * | obj, |
| const dwFeature2DTrackerConfig * | config, | ||
| cudaStream_t | cudaStream, | ||
| dwContextHandle_t | context | ||
| ) |
Creates and initializes a feature tracker.
| [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. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_registerFeatureArray | ( | dwFeatureArray const * | inFeatures, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Binds feature Array.
Internally the cuda pointer to featureArray is mapped to pva address space using the cupva cuda interop api
| [in] | inFeatures | cuda pointer to Feature Array |
| [in] | obj | A handle to the feature tracker module. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_registerHistoryArray | ( | dwFeatureHistoryArray * | historyArray, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Binds feature HistoryArray.
Internally the cuda pointer to feature History Array is mapped to pva address space using the cupva cuda interop api
| [in] | historyArray | cuda pointer to Complete feature History Array |
| [in] | obj | A handle to the feature tracker module. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_registerOutputNccScore | ( | float32_t * | nccScore, |
| uint32_t | nccScoreArraySize, | ||
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Binds output ncc Score.
Internally the cuda pointer to nccScore is mapped to pva address space using the cupva cuda interop api
| [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 |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_release | ( | dwFeature2DTrackerHandle_t | obj | ) |
Releases the feature tracker.
This method releases all resources associated with a feature tracker.
| [in] | obj | The object handle to be released. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_reset | ( | dwFeature2DTrackerHandle_t | obj | ) |
Resets a feature tracker.
| [in] | obj | Specifies the feature tracker handle to be reset. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_setCUDAStream | ( | cudaStream_t | stream, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Sets the CUDA stream for CUDA related operations.
| [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. |
| DW_API_PUBLIC dwStatus dwFeature2DTracker_setPVAStream | ( | cupvaStream_t | stream, |
| dwFeature2DTrackerHandle_t | obj | ||
| ) |
Sets the cuPVA stream for PVA related operations.
| [in] | stream | The cuPVA stream to be used. |
| [in] | obj | A handle to the feature tracker module to set cuPVA stream for. |
| 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.
Features to track are defined by dwFeatureHistoryArray bound to the tracker during initialization
| [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. |
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]