DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

TemplateTracker.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) 2019 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 
47 #ifndef DW_IMAGEPROCESSING_TEMPLATE_TRACKER_H_
48 #define DW_IMAGEPROCESSING_TEMPLATE_TRACKER_H_
49 
50 // C api
51 #include <dw/core/Config.h>
52 #include <dw/core/Context.h>
53 #include <dw/core/Types.h>
54 #include <dw/image/Image.h>
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
113 #define DW_MAX_TEMPLATE2D_SIZE 128
114 
116 typedef struct dwTemplateTrackerObject* dwTemplateTrackerHandle_t;
117 
119 typedef struct dwTemplateTrackerObject const* dwConstTemplateTrackerHandle_t;
120 
128 
131 {
133  dwTemplateTrackerAlgorithm algorithm;
134 
137 
139  uint32_t maxPyramidLevel;
140 
142  uint32_t imageWidth;
143 
145  uint32_t imageHeight;
146 
149 
156 
164 
170 
178 
182 
187 
192 
200 
202 typedef struct dwTemplateArray
203 {
206  uint32_t* ids;
207  uint32_t* ages;
209  uint32_t* newToOldMap;
211  uint32_t* templateCount;
212  uint32_t maxTemplates;
214  uint8_t* data;
215  size_t bytes;
220 
222 
239  const uint32_t maxTemplateCount,
240  const dwMemoryType memoryType,
241  dwContextHandle_t context);
242 
254 
267 
283  const dwTemplateArray* srcTemplateArray,
284  cudaStream_t stream);
293 
305 dwStatus dwTemplateTracker_initialize(dwTemplateTrackerHandle_t* obj,
306  const dwTemplateTrackerParameters* params,
307  cudaStream_t stream, dwContextHandle_t context);
308 
316 dwStatus dwTemplateTracker_reset(dwTemplateTrackerHandle_t obj);
317 
327 dwStatus dwTemplateTracker_release(dwTemplateTrackerHandle_t obj);
328 
337 dwStatus dwTemplateTracker_setCUDAStream(cudaStream_t cudaStream,
338  dwTemplateTrackerHandle_t obj);
339 
348 dwStatus dwTemplateTracker_getCUDAStream(cudaStream_t* cudaStream,
349  dwTemplateTrackerHandle_t obj);
350 
373  const dwImageCUDA* currentImage,
374  const dwImageCUDA* previousImage,
375  dwTemplateTrackerHandle_t obj);
376 
399  const dwPyramidImage* currentPyramid,
400  const dwPyramidImage* previousPyramid,
401  dwTemplateTrackerHandle_t obj);
402 
403 #ifdef __cplusplus
404 }
405 #endif
406 
407 #endif // DW_IMAGEPROCESSING_TEMPLATE_TRACKER_H_
DW_API_PUBLIC dwStatus dwTemplateTracker_release(dwTemplateTrackerHandle_t obj)
Releases the TemplateTracker module.
float32_t validHeight
Maximum valid template height, any templates with bbox.height > validHeight will be killed after trac...
NVIDIA DriveWorks API: Core Types
uint8_t * data
Pointer to the raw data address.
float32_t * scaleFactors
scaleFactor from frame N to N-1 of each template.
uint32_t * templateCount
Total number of templates.
float float32_t
Specifies POD types.
Definition: Types.h:70
uint32_t maxTemplates
Max number of templates in template array.
dwTemplateTrackerAlgorithm algorithm
Tracking Algorithm defined by dwTemplateTrackerAlgorithm.
DW_API_PUBLIC dwStatus dwTemplateArray_destroy(dwTemplateArray templateArray)
Destroys the template array and frees any memory created by dwTemplateArray_create().
struct dwTemplateTrackerObject const * dwConstTemplateTrackerHandle_t
Handle representing a const TemplateTracker tracker.
uint32_t imageHeight
Height of the images that the tracker runs on.
DW_API_PUBLIC dwStatus dwTemplateTracker_trackPyramid(dwTemplateArray *templateArray, const dwPyramidImage *currentPyramid, const dwPyramidImage *previousPyramid, dwTemplateTrackerHandle_t obj)
Track the templates in currentPyramid .
DW_API_PUBLIC dwStatus dwTemplateTracker_initialize(dwTemplateTrackerHandle_t *obj, const dwTemplateTrackerParameters *params, cudaStream_t stream, dwContextHandle_t context)
Initialize the TemplateTracker module.
Defines a CUDA image.
Definition: Image.h:266
float32_t validWidth
Maximum valid template width, any templates with bbox.width > validWidth will be killed after trackin...
DW_API_PUBLIC dwStatus dwTemplateArray_reset(dwTemplateArray *templateArray)
Resets the template array.
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
Pointer list to the CUDA table with type = DW_CUDA_TABLE_SIMPLE.
Definition: Types.h:204
uint32_t * newToOldMap
New to old index map, 1D array of size maxTemplates.
float32_t maxScaleChange
If scalingFactor between frame N to N-1 is outside range [1/maxScaleChange, maxScaleChange] tracking ...
uint32_t maxPyramidLevel
Max pyramid level to track.
uint32_t maxTemplateCount
Upper bound on number of templates handled.
dwMemoryType
Memory type definitions.
Definition: Types.h:177
dwStatus
Status definition.
Definition: Status.h:178
uint32_t numIterationsCoarse
for DW_TEMPLATE_TRACKER_ALGO_IA only Iteration number to apply the coarse KLT for robustness...
DW_API_PUBLIC dwStatus dwTemplateTracker_initDefaultParams(dwTemplateTrackerParameters *params)
Initializes TemplateTracker parameters with default values.
dwProcessorType
Processor type definitions.
Definition: Types.h:159
dwTemplateTrackerAlgorithm
Different versions of the template tracker Both can be found in paper: "Lucas-Kanade 20 Years On: A U...
uint32_t numIterationsFine
Iteration number to apply the KLT tracker.
struct dwTemplateTrackerObject * dwTemplateTrackerHandle_t
Handle representing a TemplateTracker tracker.
uint32_t imageWidth
Width of the images that the tracker runs on.
NVIDIA DriveWorks API: Pyramid
float32_t thresholdUpdate
Updating threshold in [0, 1].
dwFeature2DStatus
Defines the possible status of a feature.
Definition: FeatureList.h:64
uint32_t * ages
Age of each template.
DW_API_PUBLIC dwStatus dwTemplateArray_copyAsync(dwTemplateArray *dstTemplateArray, const dwTemplateArray *srcTemplateArray, cudaStream_t stream)
Deep copy all contents from srcTemplateArray to dstTemplateArray
Pyramid image structure.
Definition: Pyramid.h:66
DW_API_PUBLIC dwStatus dwTemplateTracker_trackImage(dwTemplateArray *templateArray, const dwImageCUDA *currentImage, const dwImageCUDA *previousImage, dwTemplateTrackerHandle_t obj)
Track the templates in currentImage .
dwRectf * bboxes
bounding box of each template.
DW_API_PUBLIC dwStatus dwTemplateTracker_getCUDAStream(cudaStream_t *cudaStream, dwTemplateTrackerHandle_t obj)
Gets the CUDA stream used.
DW_API_PUBLIC dwStatus dwTemplateTracker_reset(dwTemplateTrackerHandle_t obj)
Resets the TemplateTracker.
Configuration parameters for a dwTemplateTrackerIA.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
DW_API_PUBLIC dwStatus dwTemplateTracker_setCUDAStream(cudaStream_t cudaStream, dwTemplateTrackerHandle_t obj)
Sets the CUDA stream used.
float32_t thresholdKill
Killing threshold in [0, 1].
dwFeature2DStatus * statuses
Status of each template.
inverse compositional KLT.
uint32_t * ids
Id of each template.
DW_API_PUBLIC dwStatus dwTemplateArray_create(dwTemplateArray *templateArray, const uint32_t maxTemplateCount, const dwMemoryType memoryType, dwContextHandle_t context)
Creates and initializes a template array.
NVIDIA DriveWorks API: Feature Array and Feature History Array
dwMemoryType memoryType
Whether the template array is located on CPU or GPU.
#define DW_API_PUBLIC
Definition: Exports.h:56
float32_t thresholdStop
for DW_TEMPLATE_TRACKER_ALGO_IC only Stop threshold in [-1, 1].
size_t bytes
Bytes of raw data.
dwProcessorType processorType
Processor type which determines on which processor the algorithm should be executed on...