DriveWorks SDK Reference

| 0.6.67 Release

ScalingFeatureTracker.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) 2017 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 
37 #ifndef DW_FEATURES_SCALING_FEATURE_TRACKER_H__
38 #define DW_FEATURES_SCALING_FEATURE_TRACKER_H__
39 
40 // C api
41 #include <dw/core/Config.h>
42 #include <dw/core/Context.h>
43 #include <dw/core/Types.h>
44 #include <dw/image/Image.h>
45 #include <dw/features/Features.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
52 #define DW_MAX_TEMPLATE_SIZE 128
53 
55 typedef struct dwScalingFeatureTrackerObject *dwScalingFeatureTrackerHandle_t;
56 
58 typedef struct dwScalingFeatureTrackerObject const *dwConstScalingFeatureTrackerHandle_t;
59 
61 typedef struct dwScalingFeatureListObject *dwScalingFeatureListHandle_t;
62 
64 typedef struct dwScalingFeatureListObject const *dwConstScalingFeatureListHandle_t;
65 
70 
72  uint32_t numIterScaling;
73 
81 
87 
93 
97 
102 
104 
109 
112 
115 
118 
121 
125 
127  uint32_t *ids;
128 
130  uint32_t *ages;
131 
134 
137 
139  uint32_t *featureCount;
141 
149 // dwScalingFeatureList
164 dwStatus dwScalingFeatureList_initialize(dwScalingFeatureListHandle_t *obj, dwContextHandle_t context, cudaStream_t stream,
165  const uint32_t maxFeatureCount, const dwTrivialDataType pxlType);
166 
178 dwStatus dwScalingFeatureList_reset(dwScalingFeatureListHandle_t obj);
179 
193 dwStatus dwScalingFeatureList_release(dwScalingFeatureListHandle_t *obj);
194 
208 dwStatus dwScalingFeatureList_getDataBasePointer(void **d_basePointer, size_t *size, dwScalingFeatureListHandle_t obj);
209 
224  dwScalingFeatureListHandle_t obj);
225 
234 dwStatus dwScalingFeatureList_addEmptyFeature(uint32_t nFeatures, dwScalingFeatureListHandle_t obj);
235 
246  dwScalingFeatureListHandle_t obj);
247 
264 dwStatus dwScalingFeatureList_selectValid(uint32_t *d_validIndexCount, uint32_t *d_validIndexes,
265  uint32_t *d_invalidIndexCount, uint32_t *d_invalidIndexes,
266  dwConstScalingFeatureListHandle_t obj);
267 
284 dwStatus dwScalingFeatureList_compact(dwScalingFeatureListHandle_t list,
285  const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes,
286  const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes);
287 
300 dwStatus dwScalingFeatureList_setCUDAStream(cudaStream_t stream, dwScalingFeatureListHandle_t obj);
301 
312 dwStatus dwScalingFeatureList_getCUDAStream(cudaStream_t *stream, dwScalingFeatureListHandle_t obj);
313 
382 
383 
395 dwStatus dwScalingFeatureTracker_initialize(dwScalingFeatureTrackerHandle_t *obj,
396  const dwScalingFeatureTrackerParameters* params,
397  cudaStream_t stream, dwContextHandle_t context);
398 
406 dwStatus dwScalingFeatureTracker_reset(dwScalingFeatureTrackerHandle_t obj);
407 
417 dwStatus dwScalingFeatureTracker_release(dwScalingFeatureTrackerHandle_t* obj);
418 
427 dwStatus dwScalingFeatureTracker_setCUDAStream(cudaStream_t cudaStream,
428  dwScalingFeatureTrackerHandle_t obj);
429 
438 dwStatus dwScalingFeatureTracker_getCUDAStream(cudaStream_t* cudaStream,
439  dwScalingFeatureTrackerHandle_t obj);
440 
441 
454 dwStatus dwScalingFeatureTracker_updateTemplateAsync(dwScalingFeatureListHandle_t list,
455  const dwImageCUDA* templateImage,
456  dwScalingFeatureTrackerHandle_t obj);
457 
470 dwStatus dwScalingFeatureTracker_trackAsync(dwScalingFeatureListHandle_t list,
471  const dwImageCUDA* currentImage,
472  dwScalingFeatureTrackerHandle_t obj);
473 
474 
475 #ifdef __cplusplus
476 }
477 #endif
478 
479 #endif // DW_FEATURES_SCALING_FEATURE_TRACKER_H__
DW_API_PUBLIC dwStatus dwScalingFeatureList_getCUDAStream(cudaStream_t *stream, dwScalingFeatureListHandle_t obj)
Gets the CUDA stream used by the scaling feature list.
uint32_t numIterTranslation
Iteration number to apply the translation-only KLT for robustness.
Pointer list to the CUDA table with type = DW_CUDA_TABLE_SIMPLE.
struct dwScalingFeatureListObject const * dwConstScalingFeatureListHandle_t
Handle representing a const list of 2D scaling features.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:77
dwVector2f * sizes
size of the feature to be tracked
dwFeatureStatus
Defines the possible status of a feature.
Definition: Features.h:88
dwTrivialDataType
Specifies a type indicator of the underlying trivial data type.
Definition: Types.h:104
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_initDefaultParams(dwScalingFeatureTrackerParameters *params)
Initializes ScalingFeatureTracker parameters with default values.
float32_t maxScaleChange
If scalingFactor between frame N to N-1 is outside range [1/maxScaleChange, maxScaleChange] tracking ...
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_initialize(dwScalingFeatureTrackerHandle_t *obj, const dwScalingFeatureTrackerParameters *params, cudaStream_t stream, dwContextHandle_t context)
Initialize the ScalingFeatureTracker module.
uint32_t * featureCount
Total number of feature points. Single value.
float32_t thresholdKill
Killing threshold in [0, 1].
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_getCUDAStream(cudaStream_t *cudaStream, dwScalingFeatureTrackerHandle_t obj)
Gets the CUDA stream used.
Defines a two-element floating-point vector.
Definition: Types.h:207
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_updateTemplateAsync(dwScalingFeatureListHandle_t list, const dwImageCUDA *templateImage, dwScalingFeatureTrackerHandle_t obj)
Update the tracking template for each valid feature in the tracker The computation takes place asynch...
Defines a CUDA image.
Definition: Image.h:263
dwBool * bNewTemplate
true when the overall data is updated, false when only location info is updated
DW_API_PUBLIC dwStatus dwScalingFeatureList_compact(dwScalingFeatureListHandle_t list, const uint32_t *d_validIndexCount, const uint32_t *d_validIndexes, const uint32_t *d_invalidIndexCount, const uint32_t *d_invalidIndexes)
Removes scaling features from the list.
uint32_t * ages
age of the feature
NVIDIA DriveWorks API: Core Methods
DW_API_PUBLIC dwStatus dwScalingFeatureList_reset(dwScalingFeatureListHandle_t obj)
Resets the scaling feature list.
float32_t * scaleToTemplate
scaleFactor of frame N to the template
struct dwScalingFeatureListObject * dwScalingFeatureListHandle_t
Handle representing a list of 2D scaling features.
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_release(dwScalingFeatureTrackerHandle_t *obj)
Releases the ScalingFeatureTracker module.
uint32_t * ids
id of the feature
dwStatus
Status definition.
Definition: Status.h:167
DW_API_PUBLIC dwStatus dwScalingFeatureList_applySizeFilter(float32_t maxWidth, float32_t maxHeight, dwScalingFeatureListHandle_t obj)
Mark the features in the list as DW_FEATURE_STATUS_INVALID with size larger than (maxWidth, maxHeight)
DW_API_PUBLIC dwStatus dwScalingFeatureList_release(dwScalingFeatureListHandle_t *obj)
Releases the scaling feature list.
float32_t maxSizeDifference
If templateSize/newDetectedSize is not within [1/maxSizeDifference, maxSizeDifference] region...
struct dwScalingFeatureTrackerObject * dwScalingFeatureTrackerHandle_t
Handle representing a ScalingFeatureTracker tracker.
float32_t maxPixelTolerance
When template image data is kept and only updates its location, if the pixel offset between the cente...
DW_API_PUBLIC dwStatus dwScalingFeatureList_addEmptyFeature(uint32_t nFeatures, dwScalingFeatureListHandle_t obj)
Insert nFeatures empty feature into the feature list.
DW_API_PUBLIC dwStatus dwScalingFeatureList_getDataBasePointer(void **d_basePointer, size_t *size, dwScalingFeatureListHandle_t obj)
Returns the start position of the data buffer that stores all of the scaling feature list information...
DW_API_PUBLIC dwStatus dwScalingFeatureList_getDataPointers(dwScalingFeatureListPointers *pointers, void *basePointer, dwScalingFeatureListHandle_t obj)
Returns the pointers to the actual data of a scaling feature list given the base pointer.
uint32_t numIterScaling
Iteration number to apply the translation-and-scaling KLT.
uint8_t dwBool
Definition: Types.h:79
DW_API_PUBLIC dwStatus dwScalingFeatureList_selectValid(uint32_t *d_validIndexCount, uint32_t *d_validIndexes, uint32_t *d_invalidIndexCount, uint32_t *d_invalidIndexes, dwConstScalingFeatureListHandle_t obj)
Creates a list of indexes of those scaling features with a status of detected or tracked, and list of indexes of those scaling features with a status of invalid.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:78
DW_API_PUBLIC dwStatus dwScalingFeatureList_initialize(dwScalingFeatureListHandle_t *obj, dwContextHandle_t context, cudaStream_t stream, const uint32_t maxFeatureCount, const dwTrivialDataType pxlType)
Creates and initializes a scaling feature list.
DW_API_PUBLIC dwStatus dwScalingFeatureList_setCUDAStream(cudaStream_t stream, dwScalingFeatureListHandle_t obj)
Sets the CUDA stream for CUDA related operations.
NVIDIA DriveWorks API: 2D Tracker
struct dwScalingFeatureTrackerObject const * dwConstScalingFeatureTrackerHandle_t
Handle representing a const ScalingFeatureTracker tracker.
Configuration parameters for a dwScalingFeatureTracker.
dwVector2f * locations
center location of the feature to be tracked
dwVector2f * templateLocations
location of the feature template
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_trackAsync(dwScalingFeatureListHandle_t list, const dwImageCUDA *currentImage, dwScalingFeatureTrackerHandle_t obj)
Track the features in currentImage .
dwFeatureStatus * statuses
status of the tracking
float32_t thresholdUpdate
Updating threshold in [0, 1].
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_setCUDAStream(cudaStream_t cudaStream, dwScalingFeatureTrackerHandle_t obj)
Sets the CUDA stream used.
#define DW_API_PUBLIC
Definition: Exports.h:76
dwVector2f * templateSizes
size of the feature template
float32_t * scaleFactors
scaleFactor of frame N to N-1
DW_API_PUBLIC dwStatus dwScalingFeatureTracker_reset(dwScalingFeatureTrackerHandle_t obj)
Resets the ScalingFeatureTracker.