DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

TemplateTracker.h
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
45#ifndef DW_IMAGEPROCESSING_TEMPLATE_TRACKER_H_
46#define DW_IMAGEPROCESSING_TEMPLATE_TRACKER_H_
47
48// C api
49#include <dw/core/base/Config.h>
51#include <dw/core/base/Types.h>
52#include <dw/image/Image.h>
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
111#define DW_MAX_TEMPLATE2D_SIZE 128
112
114typedef struct dwTemplateTrackerObject* dwTemplateTrackerHandle_t;
115
117typedef struct dwTemplateTrackerObject const* dwConstTemplateTrackerHandle_t;
118
126
129{
132
135
138
140 uint32_t imageWidth;
141
143 uint32_t imageHeight;
144
147
154
162
168
176
180
185
190
198
199typedef struct dwTemplateArray
200{
203 uint32_t* ids;
204 uint32_t* ages;
206 uint32_t* newToOldMap;
208 uint32_t* templateCount;
209 uint32_t maxTemplates;
211 uint8_t* data;
212 size_t bytes;
217
219
236 const uint32_t maxTemplateCount,
237 const dwMemoryType memoryType,
238 dwContextHandle_t context);
239
251
264dwStatus dwTemplateArray_reset(dwTemplateArray* templateArray, cudaStream_t stream);
265
281 const dwTemplateArray* srcTemplateArray,
282 cudaStream_t stream);
291
304 const dwTemplateTrackerParameters* params,
305 cudaStream_t stream, dwContextHandle_t context);
306
315
326
337
348
371 const dwImageCUDA* currentImage,
372 const dwImageCUDA* previousImage,
374
397 const dwPyramidImage* currentPyramid,
398 const dwPyramidImage* previousPyramid,
400
401#ifdef __cplusplus
402}
403#endif
405#endif // DW_IMAGEPROCESSING_TEMPLATE_TRACKER_H_
NVIDIA DriveWorks API: Feature Array and Feature History Array
NVIDIA DriveWorks API: Pyramid
NVIDIA DriveWorks API: Core Types
NVIDIA DriveWorks API: Core Methods
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:82
#define DW_API_PUBLIC
Definition: Exports.h:54
dwStatus
Status definition.
Definition: Status.h:171
dwProcessorType
Processor type definitions.
Definition: Types.h:168
float float32_t
Specifies POD types.
Definition: Types.h:70
dwMemoryType
Memory type definitions.
Definition: Types.h:189
Defines a rectangle with floating point numbers.
Definition: Types.h:224
dwFeature2DStatus
Defines the possible status of a feature.
Definition: FeatureList.h:62
Defines a CUDA image.
Definition: Image.h:427
Pyramid image structure.
Definition: Pyramid.h:65
float32_t thresholdUpdate
Updating threshold in [0, 1].
uint32_t maxTemplateCount
Upper bound on number of templates handled.
uint32_t imageHeight
Height of the images that the tracker runs on.
float32_t maxScaleChange
If scalingFactor between frame N to N-1 is outside range [1/maxScaleChange, maxScaleChange] tracking ...
dwMemoryType memoryType
Whether the template array is located on CPU or GPU.
uint8_t * data
Pointer to the raw data address.
uint32_t * ids
Id of each template.
dwRectf * bboxes
bounding box of each template.
uint32_t maxTemplates
Max number of templates in template array.
float32_t thresholdKill
Killing threshold in [0, 1].
float32_t * scaleFactors
scaleFactor from frame N to N-1 of each template.
size_t bytes
Bytes of raw data.
float32_t thresholdStop
for DW_TEMPLATE_TRACKER_ALGO_IC only Stop threshold in [-1, 1].
uint32_t numIterationsCoarse
for DW_TEMPLATE_TRACKER_ALGO_IA only Iteration number to apply the coarse KLT for robustness.
uint32_t * ages
Age of each template.
uint32_t imageWidth
Width of the images that the tracker runs on.
float32_t validWidth
Maximum valid template width, any templates with bbox.width > validWidth will be killed after trackin...
uint32_t numIterationsFine
Iteration number to apply the KLT tracker.
dwProcessorType processorType
Processor type which determines on which processor the algorithm should be executed on.
uint32_t * templateCount
Total number of templates.
dwFeature2DStatus * statuses
Status of each template.
dwTemplateTrackerAlgorithm algorithm
Tracking Algorithm defined by dwTemplateTrackerAlgorithm.
float32_t validHeight
Maximum valid template height, any templates with bbox.height > validHeight will be killed after trac...
uint32_t * newToOldMap
New to old index map, 1D array of size maxTemplates.
uint32_t maxPyramidLevel
Max pyramid level to track.
DW_API_PUBLIC dwStatus dwTemplateTracker_reset(dwTemplateTrackerHandle_t obj)
Resets the TemplateTracker.
DW_API_PUBLIC dwStatus dwTemplateArray_create(dwTemplateArray *templateArray, const uint32_t maxTemplateCount, const dwMemoryType memoryType, dwContextHandle_t context)
Creates and initializes a template array.
DW_API_PUBLIC dwStatus dwTemplateTracker_setCUDAStream(cudaStream_t cudaStream, dwTemplateTrackerHandle_t obj)
Sets the CUDA stream used.
DW_API_PUBLIC dwStatus dwTemplateArray_reset(dwTemplateArray *templateArray, cudaStream_t stream)
Resets the template array.
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_initDefaultParams(dwTemplateTrackerParameters *params)
Initializes TemplateTracker parameters with default values.
DW_API_PUBLIC dwStatus dwTemplateArray_destroy(dwTemplateArray templateArray)
Destroys the template array and frees any memory created by dwTemplateArray_create().
DW_API_PUBLIC dwStatus dwTemplateTracker_initialize(dwTemplateTrackerHandle_t *obj, const dwTemplateTrackerParameters *params, cudaStream_t stream, dwContextHandle_t context)
Initialize the TemplateTracker module.
DW_API_PUBLIC dwStatus dwTemplateArray_copyAsync(dwTemplateArray *dstTemplateArray, const dwTemplateArray *srcTemplateArray, cudaStream_t stream)
Deep copy all contents from srcTemplateArray to dstTemplateArray
DW_API_PUBLIC dwStatus dwTemplateTracker_release(dwTemplateTrackerHandle_t obj)
Releases the TemplateTracker module.
dwTemplateTrackerAlgorithm
Different versions of the template tracker Both can be found in paper: "Lucas-Kanade 20 Years On: A U...
DW_API_PUBLIC dwStatus dwTemplateTracker_trackImage(dwTemplateArray *templateArray, const dwImageCUDA *currentImage, const dwImageCUDA *previousImage, dwTemplateTrackerHandle_t obj)
Track the templates in currentImage .
struct dwTemplateTrackerObject * dwTemplateTrackerHandle_t
Handle representing a TemplateTracker tracker.
struct dwTemplateTrackerObject const * dwConstTemplateTrackerHandle_t
Handle representing a const TemplateTracker tracker.
DW_API_PUBLIC dwStatus dwTemplateTracker_getCUDAStream(cudaStream_t *cudaStream, dwTemplateTrackerHandle_t obj)
Gets the CUDA stream used.
@ DW_TEMPLATE_TRACKER_ALGORITHM_IC
inverse compositional KLT.
@ DW_TEMPLATE_TRACKER_ALGORITHM_IA
inverse additive KLT
Configuration parameters for a dwTemplateTrackerIA.
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality