DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

FeatureList.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-2021 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 
46 #ifndef DW_IMAGEPROCESSING_FEATURE_LIST_H_
47 #define DW_IMAGEPROCESSING_FEATURE_LIST_H_
48 
49 #include <dw/core/Config.h>
50 #include <dw/core/base/Exports.h>
52 #include <dw/core/base/Types.h>
53 #include <dw/image/Image.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
62 typedef enum dwFeature2DStatus {
67 
72 
77 
80 
118 typedef struct dwFeatureHistoryArray
119 {
120  dwFeature2DStatus* statuses;
121  uint32_t* ages;
123  uint32_t* ids;
124  uint32_t* newToOldMap;
126  uint32_t* featureCount;
128  uint32_t currentTimeIdx;
129  uint32_t maxHistory;
130  uint32_t maxFeatures;
132  uint8_t* data;
133  size_t bytes;
137 
138 typedef struct dwFeatureArray
139 {
140  dwFeature2DStatus* statuses;
141  uint32_t* ages;
143  uint32_t* ids;
144  uint32_t* newToOldMap;
146  uint32_t* featureCount;
148  uint32_t timeIdx;
149  uint32_t maxFeatures;
153 
155 // dwFeature2DList
172  const uint32_t maxFeatureCount,
173  const dwMemoryType memoryType,
174  dwContextHandle_t context);
175 
189 
201 
217  const dwFeatureArray* srcFeatures,
218  cudaStream_t stream);
219 
236  const uint32_t maxFeatureCount,
237  const uint32_t maxHistoryCapacity,
238  const dwMemoryType memoryType,
239  dwContextHandle_t context);
240 
251 
263 
277  dwFeatureHistoryArray* featureHistoryArray);
278 
294  dwFeatureHistoryArray* featureHistoryArray);
295 
313  const uint32_t historyIdx,
314  dwFeatureHistoryArray* featureHistoryArray);
315 
332  const dwFeatureHistoryArray* srcFeatureHistory,
333  cudaStream_t stream);
351 dwStatus dwFeature_mergeNewToOldMap(uint32_t* d_newToOldMapC2A,
352  const uint32_t* d_newToOldMapC2B,
353  const uint32_t* d_newToOldMapB2A,
354  const uint32_t* d_newToOldMapCount,
355  const uint32_t maxFeatureCount,
356  cudaStream_t stream);
357 
358 #ifdef __cplusplus
359 }
360 #endif
361 
362 #endif // DW_IMAGEPROCESSING_FEATURE2D_LIST_H_
NVIDIA DriveWorks API: Core Types
uint32_t timeIdx
Time index, 0 means latest, N means N frames earlier to latest.
Definition: FeatureList.h:148
dwMemoryType memoryType
Where feature array is located, GPU, CPU or pinned memory.
Definition: FeatureList.h:135
Holds pointers to the data exposed by a feature2d list.
Definition: FeatureList.h:118
dwFeature2DStatus * statuses
Status of each feature.
Definition: FeatureList.h:120
float float32_t
Specifies POD types.
Definition: Types.h:70
A feature with this entry is garbage.
Definition: FeatureList.h:66
uint32_t maxFeatures
Max number of features in one timeIdx.
Definition: FeatureList.h:130
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
dwVector2f * locationHistory
Location history of feature points.
Definition: FeatureList.h:125
dwMemoryType memoryType
Where feature array is located, GPU, CPU or pinned memory.
Definition: FeatureList.h:151
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_get(dwFeatureArray *featureArray, const uint32_t historyIdx, dwFeatureHistoryArray *featureHistoryArray)
Get the feature snapshot(arraySize = maxFeatureCount) historyIdx-th frame earlier.
uint32_t * featureCount
Total number of feature points.
Definition: FeatureList.h:146
uint8_t * data
Pointer to the raw data address.
Definition: FeatureList.h:132
uint32_t * ages
Age of each feature.
Definition: FeatureList.h:121
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_getCurrent(dwFeatureArray *featureArray, dwFeatureHistoryArray *featureHistoryArray)
Get the latest feature snapshot(arraySize = maxFeatureCount) from history.
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_destroy(dwFeatureHistoryArray featureHistoryArray)
Destroys the featureHistoryArray and frees any memory created by dwFeatureHistoryArray_create().
DW_API_PUBLIC dwStatus dwFeatureArray_destroy(dwFeatureArray featureArray)
Destroys the featureArray and frees any memory created by dwFeatureArray_create().
uint32_t * newToOldMap
New to old index map, 1D array of size maxFeatures.
Definition: FeatureList.h:144
dwMemoryType
Memory type definitions.
Definition: Types.h:177
size_t bytes
Bytes of raw data.
Definition: FeatureList.h:133
uint32_t maxHistory
Max feature history size.
Definition: FeatureList.h:129
dwStatus
Status definition.
Definition: Status.h:180
DW_API_PUBLIC dwStatus dwFeatureArray_copyAsync(dwFeatureArray *dstFeatures, const dwFeatureArray *srcFeatures, cudaStream_t stream)
Deep copy all contents from srcFeatures to dstFeatures
uint32_t * ages
Age of each feature.
Definition: FeatureList.h:141
uint32_t currentTimeIdx
Index that points to the latest feature records.
Definition: FeatureList.h:128
The feature was just detected in the current frame.
Definition: FeatureList.h:71
DW_API_PUBLIC dwStatus dwFeature_mergeNewToOldMap(uint32_t *d_newToOldMapC2A, const uint32_t *d_newToOldMapC2B, const uint32_t *d_newToOldMapB2A, const uint32_t *d_newToOldMapCount, const uint32_t maxFeatureCount, cudaStream_t stream)
Merge newToOldMap from 2 inputs.
The feature was successfully tracked in the current frame.
Definition: FeatureList.h:76
uint32_t * ids
Id of each feature.
Definition: FeatureList.h:123
dwFeature2DStatus
Defines the possible status of a feature.
Definition: FeatureList.h:62
DW_API_PUBLIC dwStatus dwFeatureArray_create(dwFeatureArray *featureArray, const uint32_t maxFeatureCount, const dwMemoryType memoryType, dwContextHandle_t context)
Creates and initializes a feature array.
uint32_t * featureCount
Total number of feature points.
Definition: FeatureList.h:126
float32_t * scales
Scale change for each feature.
Definition: FeatureList.h:122
dwFeature2DStatus * statuses
Status of each feature.
Definition: FeatureList.h:140
uint32_t * ids
Id of each feature.
Definition: FeatureList.h:143
DW_API_PUBLIC dwStatus dwFeatureArray_reset(dwFeatureArray *featureArray)
Resets the feature array.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:79
NVIDIA DriveWorks API: Core Methods
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_reset(dwFeatureHistoryArray *featureHistoryArray)
Resets the feature history array.
uint32_t * newToOldMap
New to old index map, 1D array of size maxFeatures.
Definition: FeatureList.h:124
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_copyAsync(dwFeatureHistoryArray *dstFeatureHistory, const dwFeatureHistoryArray *srcFeatureHistory, cudaStream_t stream)
Deep copy all contents from srcFeatureHistory to dstFeatureHistory
float32_t * scales
Scale change for each feature.
Definition: FeatureList.h:142
dwVector2f * locations
Location of feature points.
Definition: FeatureList.h:145
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_create(dwFeatureHistoryArray *featureHistoryArray, const uint32_t maxFeatureCount, const uint32_t maxHistoryCapacity, const dwMemoryType memoryType, dwContextHandle_t context)
Creates and initializes a feature history array.
uint32_t maxFeatures
Max number of features.
Definition: FeatureList.h:149
#define DW_API_PUBLIC
Definition: Exports.h:54
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_getPrevious(dwFeatureArray *featureArray, dwFeatureHistoryArray *featureHistoryArray)
Get the feature snapshot(arraySize = maxFeatureCount) 1 frame previous to current time...
NVIDIA DriveWorks API: Core Exports