DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

FeatureTracker.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2018-2020 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
48 #ifndef DW_IMAGEPROCESSING_FEATURE2D_TRACKER_H_
49 #define DW_IMAGEPROCESSING_FEATURE2D_TRACKER_H_
50 
51 #include <dw/core/Config.h>
52 #include <dw/core/Exports.h>
53 #include <dw/core/Context.h>
54 #include <dw/core/Types.h>
55 #include <dw/image/Image.h>
57 
58 #include <stdint.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
65 #define DW_FEATURE2D_TRACKER_MAX_WINDOW_SIZE 16
66 
68 typedef struct dwFeature2DTrackerObject* dwFeature2DTrackerHandle_t;
69 
71 typedef struct dwFeature2DTrackerObject const* dwConstFeature2DTrackerHandle_t;
72 
79 
82 
85 
87  DW_FEATURE2D_TRACKER_ALGORITHM_SFM DW_DEPRECATED_ENUM("deprecated, please use dwFeature2DTrackerConfigNew::enableSparseOutput=1"),
88 
91 
96 {
98  dwFeature2DTrackerAlgorithm algorithm;
99 
103 
105  uint32_t maxFeatureCount;
106 
108  uint32_t historyCapacity;
109 
114 
116  uint32_t imageWidth;
117 
119  uint32_t imageHeight;
120 
128  uint32_t windowSizeLK;
129 
135 
139  uint32_t numIterScaling;
140 
149 
154 
160 
167 
173 
180 
182  DW_DEPRECATED("WARNING: dwFeature2DTrackerConfig will be removed in the next major release, "
183  "use dwFeature2DTrackerConfigNew instead");
184 
189 {
191  dwFeature2DTrackerAlgorithm algorithm;
192 
196 
198  uint32_t maxFeatureCount;
199 
201  uint32_t historyCapacity;
202 
207 
209  uint32_t imageWidth;
210 
212  uint32_t imageHeight;
213 
221  uint32_t windowSizeLK;
222 
230 
236 
240  uint32_t numIterScaling;
241 
250 
258  bool useHalf;
259 
266 
271 
277 
284 
290 
297 
304 
306 
313 #pragma GCC diagnostic push
314 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
316 DW_DEPRECATED("WARNING: dwFeature2DTracker_initDefaultParams will be removed in the next major release, "
317  "use dwFeature2DTracker_initDefaultParamsNew instead")
319 #pragma GCC diagnostic pop
320 
329 
341 #pragma GCC diagnostic push
342 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
344 DW_DEPRECATED("WARNING: dwFeature2DTracker_initDefaultParamsForCamera will be removed in the next major release, "
345  "use dwFeature2DTracker_initDefaultParamsForCameraNew instead")
347  const dwTransformation3f* cameraToRig,
348  dwConstCameraModelHandle_t cameraHandle);
349 #pragma GCC diagnostic pop
350 
364  const dwTransformation3f* cameraToRig,
365  dwConstCameraModelHandle_t cameraHandle);
366 
381 #pragma GCC diagnostic push
382 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
384 DW_DEPRECATED("WARNING: dwFeature2DTracker_initialize will be removed in the next major release, "
385  "use dwFeature2DTracker_initializeNew instead")
386 dwStatus dwFeature2DTracker_initialize(dwFeature2DTrackerHandle_t* obj,
387  const dwFeature2DTrackerConfig* config,
388  cudaStream_t cudaStream, dwContextHandle_t context);
389 #pragma GCC diagnostic pop
390 
405 dwStatus dwFeature2DTracker_initializeNew(dwFeature2DTrackerHandle_t* obj,
406  const dwFeature2DTrackerConfigNew* config,
407  cudaStream_t cudaStream, dwContextHandle_t context);
408 
418 dwStatus dwFeature2DTracker_reset(dwFeature2DTrackerHandle_t obj);
419 
433 dwStatus dwFeature2DTracker_release(dwFeature2DTrackerHandle_t obj);
434 
469  dwFeatureArray* predictedFeatures,
470  float32_t* d_normalizedCrossCorrelation,
471  const dwFeatureArray* featuresToTrack,
472  const dwVector2f* d_predictedPositions,
473  const dwPyramidImage* previousPyramid,
474  const dwPyramidImage* currentPyramid,
475  dwFeature2DTrackerHandle_t obj);
476 
492  dwFeature2DTrackerHandle_t obj);
493 
506 dwStatus dwFeature2DTracker_setCUDAStream(cudaStream_t stream, dwFeature2DTrackerHandle_t obj);
507 
518 dwStatus dwFeature2DTracker_getCUDAStream(cudaStream_t* stream, dwFeature2DTrackerHandle_t obj);
519 
520 #ifdef __cplusplus
521 }
522 #endif
523 
524 #endif // DW_IMAGEPROCESSING_FEATURE2D_TRACKER_H_
Holds pointers to the data exposed by a feature2d list.
Definition: FeatureList.h:120
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:70
dwFeature2DDetectorType
Defines different KLT tracking algorithms.
float32_t largeMotionKillRatio
Features will be killed if the motion is larger than the template size times the large motion killing...
uint32_t numIterScaling
Upper bound on number of 3-DOF translation+scaling KLT iterations per level.
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
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...
uint32_t numIterScaling
Upper bound on number of 3-DOF translation+scaling KLT iterations per level.
3-DOF (dx, dy, dscale) fast extended KLT tracking.
uint32_t maxFeatureCount
Upper bound on number of features handled.
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...
float32_t displacementThreshold
If difference of translation prediction between 2 adjacent KLT iteration is less than this value...
DW_API_PUBLIC dwStatus dwFeature2DTracker_initDefaultParamsNew(dwFeature2DTrackerConfigNew *params)
Initializes dwFeature2DTracker parameters with default values.
Tracker for SFM.
bool enableAdaptiveWindowSizeLK
Enable adaptive window size If enabled, the tracker will use windowSizeLK to track only at the first ...
float32_t maxScaleChange
The maximum allowed scale change for the tracked points across consecutive frames.
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
uint32_t imageHeight
Height of the images that the tracker runs on.
dwFeature2DDetectorType detectorType
Type of detector that connects to the tracker, should the be the same value as dwFeature2DDetectorCon...
DW_API_PUBLIC dwStatus dwFeature2DTracker_initialize(dwFeature2DTrackerHandle_t *obj, const dwFeature2DTrackerConfig *config, cudaStream_t cudaStream, dwContextHandle_t context)
Creates and initializes a feature tracker.
struct dwFeature2DTrackerObject const * dwConstFeature2DTrackerHandle_t
Handle representing a const feature tracker.
uint32_t numIterTranslationOnly
Upper bound on number of 2-DOF translation-only KLT iterations per level.
bool useHalf
Set it to true to use half float as intermediate results during tracking It saves register usage and ...
Specifies a 3D rigid transformation.
Definition: Types.h:462
float32_t largeMotionKillRatio
Features will be killed if the motion is larger than the template size times the large motion killing...
dwFeature2DTrackerAlgorithm
Defines different KLT tracking algorithms.
dwProcessorType processorType
Processor type which determines on which processor the algorithm should be executed on...
DW_API_PUBLIC dwStatus dwFeature2DTracker_reset(dwFeature2DTrackerHandle_t obj)
Resets a feature tracker.
dwStatus
Status definition.
Definition: Status.h:178
uint32_t windowSizeLK
Window size used in the KLT tracker.
Holds configuration parameters for a feature tracker.
dwProcessorType
Processor type definitions.
Definition: Types.h:159
float32_t nccKillThreshold
Features will be killed if the Cross Correlation Score is less than this threshold during tracking...
float32_t maxScaleChange
The maximum allowed scale change for the tracked points across consecutive frames.
dwFeature2DTrackerAlgorithm algorithm
Tracking Algorithm defined by dwFeature2DTrackerAlgorithm.
float32_t nccKillThreshold
Features will be killed if the Cross Correlation Score is less than this threshold during tracking...
uint32_t historyCapacity
Upper bound of history in feature history array.
dwFeature2DDetectorType detectorType
Type of detector that connects to the tracker, should the be the same value as dwFeature2DDetectorCon...
#define DW_DEPRECATED(msg)
Definition: Exports.h:68
uint32_t pyramidLevelCount
Levels of pyramid to track Valid only when algorithm = DW_FEATURE2D_TRACKER_ALGORITHM_EX.
uint32_t imageHeight
Height of the images that the tracker runs on.
uint32_t numLevelTranslationOnly
Number of levels in pyramid that will use translation-only KLT tracking, level [maxPyramidLevel - 1...
3-DOF (dx, dy, dscale) standard KLT tracking.
uint32_t imageWidth
Width of the images that the tracker runs on.
dwProcessorType processorType
Processor type which determines on which processor the algorithm should be executed on...
DW_API_PUBLIC dwStatus dwFeature2DTracker_initDefaultParams(dwFeature2DTrackerConfig *params)
Initializes dwFeature2DTracker parameters with default values.
uint32_t numLevelTranslationOnly
Number of levels in pyramid that will use translation-only KLT tracking, level [maxPyramidLevel - 1...
uint32_t numIterTranslationOnly
Upper bound on number of 2-DOF translation-only KLT iterations per level.
struct dwCameraModelObject const * dwConstCameraModelHandle_t
A pointer to the handle representing a const calibrated camera.
Definition: CameraModel.h:72
Pyramid image structure.
Definition: Pyramid.h:66
Holds configuration parameters for a feature tracker.
3-DOF (dx, dy, dscale) extended KLT tracking.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
uint32_t enableSparseOutput
Enable sparse output if set to 1.
float32_t nccUpdateThreshold
Feature template will be updated if the Cross Correlation Score is less than this threshold during tr...
uint32_t windowSizeLK
Window size used in the KLT tracker.
struct dwFeature2DTrackerObject * dwFeature2DTrackerHandle_t
Handle representing a feature tracker.
DW_API_PUBLIC dwStatus dwFeature2DTracker_release(dwFeature2DTrackerHandle_t obj)
Releases the feature tracker.
NVIDIA DriveWorks API: Core Exports
dwFeature2DTrackerAlgorithm algorithm
Tracking Algorithm defined by dwFeature2DTrackerAlgorithm.
DW_API_PUBLIC dwStatus dwFeature2DTracker_initializeNew(dwFeature2DTrackerHandle_t *obj, const dwFeature2DTrackerConfigNew *config, cudaStream_t cudaStream, dwContextHandle_t context)
Creates and initializes a feature tracker.
uint32_t pyramidLevelCount
Levels of pyramid to track Valid only when algorithm = DW_FEATURE2D_TRACKER_ALGORITHM_EX.
uint32_t maxFeatureCount
Upper bound on number of features handled.
DW_API_PUBLIC dwStatus dwFeature2DTracker_initDefaultParamsForCameraNew(dwFeature2DTrackerConfigNew *params, const dwTransformation3f *cameraToRig, dwConstCameraModelHandle_t cameraHandle)
Initializes dwFeature2DTracker parameters with values best suited for the given camera using camera e...
uint32_t imageWidth
Width of the images that the tracker runs on.
DW_API_PUBLIC dwStatus dwFeature2DTracker_compact(dwFeatureHistoryArray *featureHistoryArray, dwFeature2DTrackerHandle_t obj)
Remove invalid features.
DW_API_PUBLIC dwStatus dwFeature2DTracker_setCUDAStream(cudaStream_t stream, dwFeature2DTrackerHandle_t obj)
Sets the CUDA stream for CUDA related operations.
#define DW_API_PUBLIC
Definition: Exports.h:56
float32_t nccUpdateThreshold
Feature template will be updated if the Cross Correlation Score is less than this threshold during tr...
NVIDIA DriveWorks API: 2D Detector
DW_API_PUBLIC dwStatus dwFeature2DTracker_getCUDAStream(cudaStream_t *stream, dwFeature2DTrackerHandle_t obj)
Gets the CUDA stream used by the feature tracker.
uint32_t historyCapacity
Upper bound of history in feature history array.