NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access 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>
37 #include <dw/core/base/Types.h>
38 #include <dw/image/Image.h>
40 #ifdef DW_SDK_BUILD_PVA
41 #include <cupva_host_scheduling.h>
42 #else
43 typedef void* cupvaStream_t;
45 #endif
46 
47 #include <stdint.h>
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
54 #define DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE 16
55 
57 typedef struct dwFeature2DTrackerObject* dwFeature2DTrackerHandle_t;
58 
60 typedef struct dwFeature2DTrackerObject const* dwConstFeature2DTrackerHandle_t;
61 
68 
71 
74 
77 
82 {
85 
89 
91  uint32_t maxFeatureCount;
92 
94  uint32_t historyCapacity;
95 
101 
103  uint32_t imageWidth;
104 
106  uint32_t imageHeight;
107 
116  uint32_t windowSizeLK;
117 
126 
132 
137  uint32_t numIterScaling;
138 
148 
157  bool useHalf;
158 
165 
171 
178 
185 
192 
199 
206 
208 
223 
241  const dwTransformation3f* cameraToRig,
242  dwConstCameraModelHandle_t cameraHandle);
243 
264  const dwFeature2DTrackerConfig* config,
265  cudaStream_t cudaStream, dwContextHandle_t context);
266 
281 
300 
340  dwFeatureArray* predictedFeatures,
341  float32_t* d_normalizedCrossCorrelation,
342  const dwFeatureArray* featuresToTrack,
343  const dwVector2f* d_predictedPositions,
344  const dwPyramidImage* previousPyramid,
345  const dwPyramidImage* currentPyramid,
347 
369 
387 
403 
422 
439 
457 
474 
491 
492 #ifdef __cplusplus
493 }
494 #endif
495 
496 #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:125
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.
dwFeature2DTrackerConfig
Holds configuration parameters for a feature tracker.
Definition: FeatureTracker.h:81
FeatureDetector.h
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:184
DW_FEATURE2D_TRACKER_ALGORITHM_EX
@ DW_FEATURE2D_TRACKER_ALGORITHM_EX
3-DOF (dx, dy, dscale) extended KLT tracking.
Definition: FeatureTracker.h:70
Types.h
dwFeature2DTrackerConfig::imageHeight
uint32_t imageHeight
Height of the images that the tracker runs on.
Definition: FeatureTracker.h:106
dwPyramidImage
Pyramid image structure.
Definition: pyramid/Pyramid.h:47
dwFeature2DTracker_setCUDAStream
DW_API_PUBLIC dwStatus dwFeature2DTracker_setCUDAStream(cudaStream_t stream, dwFeature2DTrackerHandle_t obj)
Sets the CUDA stream for CUDA related operations.
Image.h
dwFeature2DTrackerConfig::enableSparseOutput
uint32_t enableSparseOutput
Enable sparse output if set to 1.
Definition: FeatureTracker.h:164
cupvaStream_t
void * cupvaStream_t
Dummy definition for non PVA supported platforms.
Definition: featuredetector/FeatureDetector.h:44
dwFeature2DTrackerConfig::numIterTranslationOnly
uint32_t numIterTranslationOnly
Upper bound on number of 2-DOF translation-only KLT iterations per level.
Definition: FeatureTracker.h:131
dwFeatureArray
Definition: FeatureList.h:134
dwFeature2DTrackerConfig::displacementThreshold
float32_t displacementThreshold
If difference of translation prediction between 2 adjacent KLT iteration is less than this value,...
Definition: FeatureTracker.h:198
dwFeature2DTrackerConfig::algorithm
dwFeature2DTrackerAlgorithm algorithm
Tracking Algorithm defined by dwFeature2DTrackerAlgorithm.
Definition: FeatureTracker.h:84
dwFeature2DTrackerAlgorithm
dwFeature2DTrackerAlgorithm
Defines different KLT tracking algorithms.
Definition: FeatureTracker.h:65
dwConstCameraModelHandle_t
struct dwCameraModelObject const * dwConstCameraModelHandle_t
A pointer to the handle representing a const calibrated camera.
Definition: CameraModel.h:54
Exports.h
dwFeature2DTrackerConfig::nccKillThreshold
float32_t nccKillThreshold
Features will be killed if the Cross Correlation Score is less than this threshold during tracking.
Definition: FeatureTracker.h:177
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:57
dwFeature2DTrackerConfig::processorType
dwProcessorType processorType
Processor type which determines on which processor the algorithm should be executed on.
Definition: FeatureTracker.h:205
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:119
dwFeature2DTracker_reset
DW_API_PUBLIC dwStatus dwFeature2DTracker_reset(dwFeature2DTrackerHandle_t obj)
Resets a feature tracker.
dwFeature2DTracker_registerFeatureArray
DW_API_PUBLIC dwStatus dwFeature2DTracker_registerFeatureArray(dwFeatureArray const *inFeatures, dwFeature2DTrackerHandle_t obj)
Binds feature Array.
dwFeature2DTracker_compact
DW_API_PUBLIC dwStatus dwFeature2DTracker_compact(dwFeatureHistoryArray *featureHistoryArray, dwFeature2DTrackerHandle_t obj)
Remove invalid features.
float32_t
float float32_t
Definition: core/base/BasicTypes.h:43
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:100
dwFeature2DTracker_release
DW_API_PUBLIC dwStatus dwFeature2DTracker_release(dwFeature2DTrackerHandle_t obj)
Releases the feature tracker.
dwFeature2DDetectorType
dwFeature2DDetectorType
Defines different KLT tracking algorithms.
Definition: featuredetector/FeatureDetector.h:60
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:103
obj
const NvSciSyncObj *const obj
Definition: wfdext.h:528
dwFeature2DTrackerConfig::detectorType
dwFeature2DDetectorType detectorType
Type of detector that connects to the tracker, should be the same value as dwFeature2DDetectorConfig:...
Definition: FeatureTracker.h:88
DW_FEATURE2D_TRACKER_ALGORITHM_COUNT
@ DW_FEATURE2D_TRACKER_ALGORITHM_COUNT
Definition: FeatureTracker.h:75
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:32
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:191
dwFeature2DTrackerConfig::numIterScaling
uint32_t numIterScaling
Upper bound on number of 3-DOF translation+scaling KLT iterations per level.
Definition: FeatureTracker.h:137
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:157
dwFeature2DTrackerConfig
struct dwFeature2DTrackerConfig dwFeature2DTrackerConfig
Holds configuration parameters for a feature tracker.
Config.h
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:81
dwFeature2DTrackerConfig::maxScaleChange
float32_t maxScaleChange
The maximum allowed scale change for the tracked points across consecutive frames.
Definition: FeatureTracker.h:170
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:60
cupvaStream_t
void * cupvaStream_t
Dummy definition for non PVA supported platforms.
Definition: FeatureTracker.h:44
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: core/base/Exports.h:57
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:91
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:94
DW_FEATURE2D_TRACKER_ALGORITHM_STD
@ DW_FEATURE2D_TRACKER_ALGORITHM_STD
3-DOF (dx, dy, dscale) standard KLT tracking.
Definition: FeatureTracker.h:67
DW_FEATURE2D_TRACKER_ALGORITHM_EX_FAST
@ DW_FEATURE2D_TRACKER_ALGORITHM_EX_FAST
3-DOF (dx, dy, dscale) fast extended KLT tracking.
Definition: FeatureTracker.h:73
dwFeature2DTrackerConfig::windowSizeLK
uint32_t windowSizeLK
Window size used in the KLT tracker.
Definition: FeatureTracker.h:116
dwFeature2DTrackerConfig::numLevelTranslationOnly
uint32_t numLevelTranslationOnly
Number of levels in pyramid that will use translation-only KLT tracking, level [maxPyramidLevel - 1,...
Definition: FeatureTracker.h:147
Context.h
dwVector2f
Defines a two-element single-precision floating-point vector.
Definition: MatrixTypes.h:30