NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
FeatureList.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
36 #ifndef DW_IMAGEPROCESSING_FEATURES_FEATURELIST_H_
37 #define DW_IMAGEPROCESSING_FEATURES_FEATURELIST_H_
38 
39 #include <dw/core/base/Config.h>
40 #include <dw/core/base/Exports.h>
42 #include <dw/core/base/Types.h>
43 #include <dw/image/Image.h>
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
52 typedef enum dwFeature2DStatus {
57 
62 
67 
73 
105 typedef struct dwFeatureHistoryArray
106 {
108  uint32_t* ages;
110  uint32_t* ids;
111  uint32_t* newToOldMap;
113  uint32_t* featureCount;
114  uint32_t* validTrackedCount;
116  uint32_t currentTimeIdx;
117  uint32_t maxHistory;
118  uint32_t maxFeatures;
119  uint32_t sensorId;
122  // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
123  DW_DEPRECATED("use hostPointer or cudaDevicePointer instead")
124  uint8_t* data;
126  void* hostPointer;
129  size_t bytes;
133 
134 typedef struct dwFeatureArray
135 {
137  uint32_t* ages;
139  uint32_t* ids;
140  uint32_t* newToOldMap;
142  uint32_t* featureCount;
143  uint32_t* validTrackedCount;
145  void* hostPointer;
148  uint32_t timeIdx;
149  uint32_t maxFeatures;
150  uint32_t sensorId;
154 
156 // dwFeature2DList
175 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
176 DW_DEPRECATED("WARNING: will be removed in the next major release, use dwFeatureArray_createNew instead")
179  const uint32_t maxFeatureCount,
180  const dwMemoryType memoryType,
181  dwContextHandle_t context);
182 
204  const uint32_t maxFeatureCount,
205  const dwMemoryType memoryType,
206  cudaStream_t stream,
207  dwContextHandle_t context);
208 
226 
243  cudaStream_t stream);
244 
261  const dwFeatureArray* srcFeatures,
262  cudaStream_t stream);
263 
282 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
283 DW_DEPRECATED("WARNING: will be removed in the next major release, use dwFeatureHistoryArray_createNew instead")
286  const uint32_t maxFeatureCount,
287  const uint32_t maxHistoryCapacity,
288  const dwMemoryType memoryType,
289  dwContextHandle_t context);
290 
312  const uint32_t maxFeatureCount,
313  const uint32_t maxHistoryCapacity,
314  const dwMemoryType memoryType,
315  cudaStream_t stream,
316  dwContextHandle_t context);
317 
332 
349  cudaStream_t stream);
350 
368  dwFeatureHistoryArray const* featureHistoryArray);
369 
390  dwFeatureHistoryArray const* featureHistoryArray);
391 
413  const uint32_t historyIdx,
414  dwFeatureHistoryArray const* featureHistoryArray);
415 
433  const dwFeatureHistoryArray* srcFeatureHistory,
434  cudaStream_t stream);
456 dwStatus dwFeature_mergeNewToOldMap(uint32_t* d_newToOldMapC2A,
457  const uint32_t* d_newToOldMapC2B,
458  const uint32_t* d_newToOldMapB2A,
459  const uint32_t* d_newToOldMapCount,
460  const uint32_t maxFeatureCount,
461  cudaStream_t stream);
462 
463 #ifdef __cplusplus
464 }
465 #endif
466 
467 #endif // DW_IMAGEPROCESSING_FEATURES_FEATURELIST_H_
dwFeatureHistoryArray_createNew
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_createNew(dwFeatureHistoryArray *featureHistoryArray, const uint32_t maxFeatureCount, const uint32_t maxHistoryCapacity, const dwMemoryType memoryType, cudaStream_t stream, dwContextHandle_t context)
Creates and initializes a feature history array.
dwFeatureHistoryArray::currentTimeIdx
uint32_t currentTimeIdx
Index that points to the latest feature records.
Definition: FeatureList.h:116
dwFeatureArray::locations
dwVector2f * locations
Location of feature points.
Definition: FeatureList.h:141
dwFeatureHistoryArray::validTrackedCount
uint32_t * validTrackedCount
Valid tracked features from last frame.
Definition: FeatureList.h:114
dwFeatureHistoryArray::devicePointer
void * devicePointer
Base address for the data in device address space.
Definition: FeatureList.h:127
dwFeatureHistoryArray::sensorId
uint32_t sensorId
ID of the camera sensor for which the array was generated.
Definition: FeatureList.h:119
Types.h
dwFeatureHistoryArray::bytes
size_t bytes
Bytes of raw data.
Definition: FeatureList.h:129
dwFeatureArray::scales
float32_t * scales
Scale change for each feature.
Definition: FeatureList.h:138
DW_FEATURE2D_STATUS_TRACKED
@ DW_FEATURE2D_STATUS_TRACKED
The feature was successfully tracked in the current frame.
Definition: FeatureList.h:66
Image.h
dwFeatureArray::devicePointer
void * devicePointer
Base address for the data in device address space.
Definition: FeatureList.h:146
dwFeatureArray_create
DW_API_PUBLIC dwStatus dwFeatureArray_create(dwFeatureArray *featureArray, const uint32_t maxFeatureCount, const dwMemoryType memoryType, dwContextHandle_t context)
Creates and initializes a feature array.
dwFeatureArray
Definition: FeatureList.h:134
dwFeatureArray::ages
uint32_t * ages
Age of each feature.
Definition: FeatureList.h:137
DW_FEATURE2D_STATUS_TYPE_COUNT
@ DW_FEATURE2D_STATUS_TYPE_COUNT
Number of different dwFeature2DStatus enum type, mark as enum end.
Definition: FeatureList.h:71
dwFeatureHistoryArray::maxFeatures
uint32_t maxFeatures
Max number of features in one timeIdx.
Definition: FeatureList.h:118
Exports.h
dwFeatureHistoryArray_copyAsync
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_copyAsync(dwFeatureHistoryArray *dstFeatureHistory, const dwFeatureHistoryArray *srcFeatureHistory, cudaStream_t stream)
Deep copy all contents from srcFeatureHistory to dstFeatureHistory.
dwFeatureHistoryArray::memoryType
dwMemoryType memoryType
Where feature array is located, GPU, CPU or pinned memory.
Definition: FeatureList.h:131
dwFeatureArray::timeIdx
uint32_t timeIdx
Time index, 0 means latest, N means N frames earlier to latest.
Definition: FeatureList.h:148
dwFeatureArray::newToOldMap
uint32_t * newToOldMap
New to old index map, 1D array of size maxFeatures.
Definition: FeatureList.h:140
dwFeatureHistoryArray_create
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.
dwFeatureHistoryArray_reset
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_reset(dwFeatureHistoryArray *featureHistoryArray, cudaStream_t stream)
Resets the feature history array.
dwTime_t
int64_t dwTime_t
Definition: core/base/BasicTypes.h:65
dwFeatureArray_copyAsync
DW_API_PUBLIC dwStatus dwFeatureArray_copyAsync(dwFeatureArray *dstFeatures, const dwFeatureArray *srcFeatures, cudaStream_t stream)
Deep copy all contents from srcFeatures to dstFeatures.
dwFeatureHistoryArray::hostPointer
void * hostPointer
Base address for the data in host address space.
Definition: FeatureList.h:126
float32_t
float float32_t
Definition: core/base/BasicTypes.h:43
dwFeatureHistoryArray::statuses
dwFeature2DStatus * statuses
Status of each feature.
Definition: FeatureList.h:107
dwFeatureArray::ids
uint32_t * ids
Id of each feature.
Definition: FeatureList.h:139
dwFeatureHistoryArray::ages
uint32_t * ages
Age of each feature.
Definition: FeatureList.h:108
dwFeatureHistoryArray_destroy
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_destroy(dwFeatureHistoryArray featureHistoryArray)
Destroys the featureHistoryArray and frees any memory created by dwFeatureHistoryArray_createNew().
dwFeatureArray_createNew
DW_API_PUBLIC dwStatus dwFeatureArray_createNew(dwFeatureArray *featureArray, const uint32_t maxFeatureCount, const dwMemoryType memoryType, cudaStream_t stream, dwContextHandle_t context)
Creates and initializes a feature array.
dwFeatureArray
struct dwFeatureArray dwFeatureArray
dwFeatureHistoryArray_get
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_get(dwFeatureArray *featureArray, const uint32_t historyIdx, dwFeatureHistoryArray const *featureHistoryArray)
Get the feature snapshot(arraySize = maxFeatureCount) historyIdx-th frame earlier.
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:32
DW_DEPRECATED
#define DW_DEPRECATED(msg)
Definition: core/base/Exports.h:80
dwFeatureHistoryArray::scales
float32_t * scales
Scale change for each feature.
Definition: FeatureList.h:109
dwFeatureHistoryArray_getCurrent
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_getCurrent(dwFeatureArray *featureArray, dwFeatureHistoryArray const *featureHistoryArray)
Get the latest feature snapshot(arraySize = maxFeatureCount) from history.
Config.h
dwMemoryType
dwMemoryType
Memory type definitions.
Definition: TypesExtra.h:147
dwFeatureArray::featureCount
uint32_t * featureCount
Total number of feature points.
Definition: FeatureList.h:142
dwFeatureArray::maxFeatures
uint32_t maxFeatures
Max number of features.
Definition: FeatureList.h:149
dwFeature2DStatus
dwFeature2DStatus
Defines the feature array used by detector and tracker.
Definition: FeatureList.h:52
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:81
dwFeatureArray_destroy
DW_API_PUBLIC dwStatus dwFeatureArray_destroy(dwFeatureArray featureArray)
Destroys the featureArray and frees any memory created by dwFeatureArray_createNew().
dwFeatureArray::hostPointer
void * hostPointer
Base address for the data in host address space.
Definition: FeatureList.h:145
dwFeatureHistoryArray::data
uint8_t * data
Pointer to the raw data address.
Definition: FeatureList.h:124
dwFeatureHistoryArray::locationHistory
dwVector2f * locationHistory
Location history of feature points.
Definition: FeatureList.h:112
dwFeatureHistoryArray
Holds pointers to the data exposed by a feature2d list.
Definition: FeatureList.h:105
dwFeatureArray::validTrackedCount
uint32_t * validTrackedCount
Valid tracked features from last frame.
Definition: FeatureList.h:143
dwFeatureHistoryArray::timestamp
dwTime_t timestamp
Timestamp of the dwFeatureHistoryArray struct, which is the timestamp of the latest image frame being...
Definition: FeatureList.h:120
dwFeatureArray::statuses
dwFeature2DStatus * statuses
Status of each feature.
Definition: FeatureList.h:136
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: core/base/Exports.h:57
DW_FEATURE2D_STATUS_DETECTED
@ DW_FEATURE2D_STATUS_DETECTED
The feature was just detected in the current frame.
Definition: FeatureList.h:61
dwFeatureHistoryArray::ids
uint32_t * ids
Id of each feature.
Definition: FeatureList.h:110
dwFeatureArray_reset
DW_API_PUBLIC dwStatus dwFeatureArray_reset(dwFeatureArray *featureArray, cudaStream_t stream)
Resets the feature array.
dwFeatureHistoryArray::maxHistory
uint32_t maxHistory
Max feature history size.
Definition: FeatureList.h:117
dwFeatureArray::sensorId
uint32_t sensorId
ID of the camera sensor for which the array was generated.
Definition: FeatureList.h:150
dwFeatureHistoryArray_getPrevious
DW_API_PUBLIC dwStatus dwFeatureHistoryArray_getPrevious(dwFeatureArray *featureArray, dwFeatureHistoryArray const *featureHistoryArray)
Get the feature snapshot(arraySize = maxFeatureCount) 1 frame previous to current time.
dwFeatureHistoryArray::newToOldMap
uint32_t * newToOldMap
New to old index map, 1D array of size maxFeatures.
Definition: FeatureList.h:111
dwFeature_mergeNewToOldMap
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.
DW_FEATURE2D_STATUS_INVALID
@ DW_FEATURE2D_STATUS_INVALID
A feature with this entry is garbage.
Definition: FeatureList.h:56
dwFeatureHistoryArray::featureCount
uint32_t * featureCount
Total number of feature points.
Definition: FeatureList.h:113
Context.h
dwFeatureArray::memoryType
dwMemoryType memoryType
Where feature array is located, GPU, CPU or pinned memory.
Definition: FeatureList.h:152
dwVector2f
Defines a two-element single-precision floating-point vector.
Definition: MatrixTypes.h:30