NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
FeatureTracker.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
31 #ifndef DW_IMAGEPROCESSING_TRACKING_FEATURETRACKER_FEATURETRACKER_H_
32 #define DW_IMAGEPROCESSING_TRACKING_FEATURETRACKER_FEATURETRACKER_H_
33 
34 #include <dw/core/base/Config.h>
35 #include <dw/core/base/Exports.h>
36 #include <dw/core/context/Context.h>
37 #include <dw/core/base/Types.h>
38 #include <dw/image/Image.h>
39 #include <dw/imageprocessing/featuredetector/FeatureDetector.h>
40 #include <dw/core/system/PVA.h>
41 
42 #include <stdint.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
49 #define DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE 16
50 
52 typedef struct dwFeature2DTrackerObject* dwFeature2DTrackerHandle_t;
53 
55 typedef struct dwFeature2DTrackerObject const* dwConstFeature2DTrackerHandle_t;
56 
72 
75 
78 
81 
95 {
98 
102 
104  uint32_t maxFeatureCount;
105 
107  uint32_t historyCapacity;
108 
114 
116  uint32_t imageWidth;
117 
119  uint32_t imageHeight;
120 
129  uint32_t windowSizeLK;
130 
139 
145 
150  uint32_t numIterScaling;
151 
161 
170  bool useHalf;
171 
178 
184 
191 
198 
205 
212 
219 
221 
245 
272  const dwTransformation3f* cameraToRig,
273  dwConstCameraModelHandle_t cameraHandle);
274 
304  const dwFeature2DTrackerConfig* config,
305  cudaStream_t cudaStream, dwContextHandle_t context);
306 
330 
358 
406  dwFeatureArray* predictedFeatures,
407  float32_t* d_normalizedCrossCorrelation,
408  const dwFeatureArray* featuresToTrack,
409  const dwVector2f* d_predictedPositions,
410  const dwPyramidImage* previousPyramid,
411  const dwPyramidImage* currentPyramid,
413 
444 
471 
496 
524 
550 
577 
603 
620 
621 #ifdef __cplusplus
622 }
623 #endif
624 
625 #endif // DW_IMAGEPROCESSING_TRACKING_FEATURETRACKER_FEATURETRACKER_H_
dwFeature2DTrackerConfig::enableAdaptiveWindowSizeLK
bool enableAdaptiveWindowSizeLK
Enable adaptive window size If enabled, the tracker will use windowSizeLK to track only at the first ...
Definition: FeatureTracker.h:138
dwFeature2DTracker_initialize
DW_API_PUBLIC dwStatus dwFeature2DTracker_initialize(dwFeature2DTrackerHandle_t *obj, const dwFeature2DTrackerConfig *config, cudaStream_t cudaStream, dwContextHandle_t context)
Creates and initializes a feature tracker.
cupvaStream_t
void * cupvaStream_t
Dummy definition for non PVA supported platforms.
Definition: PVA.h:29
dwFeature2DTrackerConfig
Holds configuration parameters for a feature tracker.
Definition: FeatureTracker.h:94
dwFeature2DTrackerConfig::nccUpdateThreshold
float32_t nccUpdateThreshold
Feature template will be updated if the Cross Correlation Score is less than this threshold during tr...
Definition: FeatureTracker.h:197
DW_FEATURE2D_TRACKER_ALGORITHM_EX
@ DW_FEATURE2D_TRACKER_ALGORITHM_EX
3-DOF (dx, dy, dscale) extended KLT tracking.
Definition: FeatureTracker.h:74
dwFeature2DTrackerConfig::imageHeight
uint32_t imageHeight
Height of the images that the tracker runs on.
Definition: FeatureTracker.h:119
dwPyramidImage
Pyramid image structure.
Definition: Pyramid_1.h:47
dwFeature2DTracker_setCUDAStream
DW_API_PUBLIC dwStatus dwFeature2DTracker_setCUDAStream(cudaStream_t stream, dwFeature2DTrackerHandle_t obj)
Sets the CUDA stream for CUDA related operations.
dwFeature2DTrackerConfig::enableSparseOutput
uint32_t enableSparseOutput
Enable sparse output if set to 1.
Definition: FeatureTracker.h:177
dwFeature2DTrackerConfig::numIterTranslationOnly
uint32_t numIterTranslationOnly
Upper bound on number of 2-DOF translation-only KLT iterations per level.
Definition: FeatureTracker.h:144
dwFeatureArray
Definition: FeatureList.h:133
dwFeature2DTrackerConfig::displacementThreshold
float32_t displacementThreshold
If difference of translation prediction between 2 adjacent KLT iteration is less than this value,...
Definition: FeatureTracker.h:211
dwFeature2DTrackerConfig::algorithm
dwFeature2DTrackerAlgorithm algorithm
Tracking Algorithm defined by dwFeature2DTrackerAlgorithm.
Definition: FeatureTracker.h:97
dwFeature2DTrackerAlgorithm
dwFeature2DTrackerAlgorithm
Defines different KLT tracking algorithms.
Definition: FeatureTracker.h:69
dwConstCameraModelHandle_t
struct dwCameraModelObject const * dwConstCameraModelHandle_t
A pointer to the handle representing a const calibrated camera.
Definition: CameraModel.h:55
dwFeature2DTrackerConfig::nccKillThreshold
float32_t nccKillThreshold
Features will be killed if the Cross Correlation Score is less than this threshold during tracking.
Definition: FeatureTracker.h:190
dwFeature2DTracker_trackFeatures
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 i...
dwFeature2DTrackerHandle_t
struct dwFeature2DTrackerObject * dwFeature2DTrackerHandle_t
Handle representing a feature tracker.
Definition: FeatureTracker.h:52
dwFeature2DTrackerConfig::processorType
dwProcessorType processorType
Processor type which determines on which processor the algorithm should be executed on.
Definition: FeatureTracker.h:218
dwFeature2DTracker_setPVAStream
DW_API_PUBLIC dwStatus dwFeature2DTracker_setPVAStream(cupvaStream_t stream, dwFeature2DTrackerHandle_t obj)
Sets the cuPVA stream for PVA related operations.
dwProcessorType
dwProcessorType
Processor type definitions.
Definition: TypesExtra.h:116
dwFeature2DTracker_reset
DW_API_PUBLIC dwStatus dwFeature2DTracker_reset(dwFeature2DTrackerHandle_t obj)
Resets a feature tracker.
dwFeature2DTracker_compact
DW_API_PUBLIC dwStatus dwFeature2DTracker_compact(dwFeatureHistoryArray *featureHistoryArray, dwFeature2DTrackerHandle_t obj)
Remove invalid features.
float32_t
float float32_t
Specifies POD types.
Definition: BasicTypes.h:41
dwFeature2DTrackerConfig::pyramidLevelCount
uint32_t pyramidLevelCount
Levels of pyramid to track Valid only when algorithm = DW_FEATURE2D_TRACKER_ALGORITHM_EX or DW_FEATUR...
Definition: FeatureTracker.h:113
dwFeature2DTracker_release
DW_API_PUBLIC dwStatus dwFeature2DTracker_release(dwFeature2DTrackerHandle_t obj)
Releases the feature tracker.
dwFeature2DDetectorType
dwFeature2DDetectorType
Defines different KLT tracking algorithms.
Definition: FeatureDetector.h:54
dwFeature2DTracker_initDefaultParamsForCamera
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 e...
dwFeature2DTracker_registerOutputNccScore
DW_API_PUBLIC dwStatus dwFeature2DTracker_registerOutputNccScore(float32_t *nccScore, uint32_t nccScoreArraySize, dwFeature2DTrackerHandle_t obj)
Binds output ncc Score.
dwFeature2DTracker_registerHistoryArray
DW_API_PUBLIC dwStatus dwFeature2DTracker_registerHistoryArray(dwFeatureHistoryArray *historyArray, dwFeature2DTrackerHandle_t obj)
Binds feature HistoryArray.
dwFeature2DTracker_getCUDAStream
DW_API_PUBLIC dwStatus dwFeature2DTracker_getCUDAStream(cudaStream_t *stream, dwFeature2DTrackerHandle_t obj)
Gets the CUDA stream used by the feature tracker.
dwFeature2DTrackerConfig::imageWidth
uint32_t imageWidth
Width of the images that the tracker runs on.
Definition: FeatureTracker.h:116
dwFeature2DTrackerConfig::detectorType
dwFeature2DDetectorType detectorType
Type of detector that connects to the tracker, should be the same value as dwFeature2DDetectorConfig:...
Definition: FeatureTracker.h:101
DW_FEATURE2D_TRACKER_ALGORITHM_COUNT
@ DW_FEATURE2D_TRACKER_ALGORITHM_COUNT
Definition: FeatureTracker.h:79
dwFeature2DTrackerConfig::largeMotionKillRatio
float32_t largeMotionKillRatio
Features will be killed if the motion is larger than the template size times the large motion killing...
Definition: FeatureTracker.h:204
dwFeature2DTrackerConfig::numIterScaling
uint32_t numIterScaling
Upper bound on number of 3-DOF translation+scaling KLT iterations per level.
Definition: FeatureTracker.h:150
dwFeature2DTrackerConfig::useHalf
bool useHalf
Set it to true to use half float as intermediate results during tracking It saves register usage and ...
Definition: FeatureTracker.h:170
dwFeature2DTrackerConfig
struct dwFeature2DTrackerConfig dwFeature2DTrackerConfig
Holds configuration parameters for a feature tracker.
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:74
dwFeature2DTrackerConfig::maxScaleChange
float32_t maxScaleChange
The maximum allowed scale change for the tracked points across consecutive frames.
Definition: FeatureTracker.h:183
dwFeature2DTracker_registerFeatureArray
DW_API_PUBLIC dwStatus dwFeature2DTracker_registerFeatureArray(dwFeatureArray *inFeatures, dwFeature2DTrackerHandle_t obj)
Binds feature Array.
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:27
dwFeatureHistoryArray
Holds pointers to the data exposed by a feature2d list.
Definition: FeatureList.h:105
dwTransformation3f
Specifies a 3D rigid transformation.
Definition: MatrixTypes.h:226
dwConstFeature2DTrackerHandle_t
struct dwFeature2DTrackerObject const * dwConstFeature2DTrackerHandle_t
Handle representing a const feature tracker.
Definition: FeatureTracker.h:55
params
DW_API_PUBLIC dwPointCloudRangeImageCreatorParams const *const params
Definition: PointCloudRangeImageCreator.h:292
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: Exports.h:38
obj
const NvSciSyncObj *const obj
Definition: wfdext.h:120
dwFeature2DTracker_initDefaultParams
DW_API_PUBLIC dwStatus dwFeature2DTracker_initDefaultParams(dwFeature2DTrackerConfig *params)
Initializes dwFeature2DTracker parameters with default values.
dwFeature2DTrackerConfig::maxFeatureCount
uint32_t maxFeatureCount
Upper bound on number of features handled.
Definition: FeatureTracker.h:104
dwFeature2DTracker_getPVAStream
DW_API_PUBLIC dwStatus dwFeature2DTracker_getPVAStream(cupvaStream_t *stream, dwFeature2DTrackerHandle_t obj)
Gets the cuPVA stream used by the feature tracker.
dwFeature2DTrackerConfig::historyCapacity
uint32_t historyCapacity
Upper bound of history in feature history array.
Definition: FeatureTracker.h:107
DW_FEATURE2D_TRACKER_ALGORITHM_STD
@ DW_FEATURE2D_TRACKER_ALGORITHM_STD
3-DOF (dx, dy, dscale) standard KLT tracking.
Definition: FeatureTracker.h:71
DW_FEATURE2D_TRACKER_ALGORITHM_EX_FAST
@ DW_FEATURE2D_TRACKER_ALGORITHM_EX_FAST
3-DOF (dx, dy, dscale) fast extended KLT tracking.
Definition: FeatureTracker.h:77
dwFeature2DTrackerConfig::windowSizeLK
uint32_t windowSizeLK
Window size used in the KLT tracker.
Definition: FeatureTracker.h:129
dwFeature2DTrackerConfig::numLevelTranslationOnly
uint32_t numLevelTranslationOnly
Number of levels in pyramid that will use translation-only KLT tracking, level [maxPyramidLevel - 1,...
Definition: FeatureTracker.h:160
dwVector2f
Defines a two-element single-precision floating-point vector.
Definition: MatrixTypes.h:30