NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 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>
41 #include <dw/core/context/Context.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  DW_DEPRECATED("use hostPointer or cudaDevicePointer instead")
123  uint8_t* data;
125  void* hostPointer;
128  size_t bytes;
132 
133 typedef struct dwFeatureArray
134 {
136  uint32_t* ages;
138  uint32_t* ids;
139  uint32_t* newToOldMap;
141  uint32_t* featureCount;
142  uint32_t* validTrackedCount;
144  void* hostPointer;
147  uint32_t timeIdx;
148  uint32_t maxFeatures;
149  uint32_t sensorId;
153 
155 // dwFeature2DList
175 DW_DEPRECATED("WARNING: will be removed in the next major release, use dwFeatureArray_createNew instead")
177  const uint32_t maxFeatureCount,
178  const dwMemoryType memoryType,
179  dwContextHandle_t context);
180 
202  const uint32_t maxFeatureCount,
203  const dwMemoryType memoryType,
204  cudaStream_t stream,
205  dwContextHandle_t context);
206 
224 
241  cudaStream_t stream);
242 
259  const dwFeatureArray* srcFeatures,
260  cudaStream_t stream);
261 
281 DW_DEPRECATED("WARNING: will be removed in the next major release, use dwFeatureHistoryArray_createNew instead")
283  const uint32_t maxFeatureCount,
284  const uint32_t maxHistoryCapacity,
285  const dwMemoryType memoryType,
286  dwContextHandle_t context);
287 
309  const uint32_t maxFeatureCount,
310  const uint32_t maxHistoryCapacity,
311  const dwMemoryType memoryType,
312  cudaStream_t stream,
313  dwContextHandle_t context);
314 
329 
346  cudaStream_t stream);
347 
365  dwFeatureHistoryArray const* featureHistoryArray);
366 
387  dwFeatureHistoryArray const* featureHistoryArray);
388 
410  const uint32_t historyIdx,
411  dwFeatureHistoryArray const* featureHistoryArray);
412 
430  const dwFeatureHistoryArray* srcFeatureHistory,
431  cudaStream_t stream);
453 dwStatus dwFeature_mergeNewToOldMap(uint32_t* d_newToOldMapC2A,
454  const uint32_t* d_newToOldMapC2B,
455  const uint32_t* d_newToOldMapB2A,
456  const uint32_t* d_newToOldMapCount,
457  const uint32_t maxFeatureCount,
458  cudaStream_t stream);
459 
460 #ifdef __cplusplus
461 }
462 #endif
463 
464 #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:140
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:126
dwFeatureHistoryArray::sensorId
uint32_t sensorId
ID of the camera sensor for which the array was generated.
Definition: FeatureList.h:119
dwFeatureHistoryArray::bytes
size_t bytes
Bytes of raw data.
Definition: FeatureList.h:128
dwFeatureArray::scales
float32_t * scales
Scale change for each feature.
Definition: FeatureList.h:137
DW_FEATURE2D_STATUS_TRACKED
@ DW_FEATURE2D_STATUS_TRACKED
The feature was successfully tracked in the current frame.
Definition: FeatureList.h:66
dwFeatureArray::devicePointer
void * devicePointer
Base address for the data in device address space.
Definition: FeatureList.h:145
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:133
dwFeatureArray::ages
uint32_t * ages
Age of each feature.
Definition: FeatureList.h:136
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
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:130
dwFeatureArray::timeIdx
uint32_t timeIdx
Time index, 0 means latest, N means N frames earlier to latest.
Definition: FeatureList.h:147
dwFeatureArray::newToOldMap
uint32_t * newToOldMap
New to old index map, 1D array of size maxFeatures.
Definition: FeatureList.h:139
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
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:54
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:125
float32_t
float float32_t
Specifies POD types.
Definition: BasicTypes.h:41
dwFeatureHistoryArray::statuses
dwFeature2DStatus * statuses
Status of each feature.
Definition: FeatureList.h:107
dwFeatureArray::ids
uint32_t * ids
Id of each feature.
Definition: FeatureList.h:138
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.
DW_DEPRECATED
#define DW_DEPRECATED(msg)
Definition: Exports.h:50
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.
dwMemoryType
dwMemoryType
Memory type definitions.
Definition: TypesExtra.h:142
dwFeatureArray::featureCount
uint32_t * featureCount
Total number of feature points.
Definition: FeatureList.h:141
dwFeatureArray::maxFeatures
uint32_t maxFeatures
Max number of features.
Definition: FeatureList.h:148
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:74
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:144
dwFeatureHistoryArray::data
uint8_t * data
Pointer to the raw data address.
Definition: FeatureList.h:123
dwFeatureHistoryArray::locationHistory
dwVector2f * locationHistory
Location history of feature points.
Definition: FeatureList.h:112
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:27
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:142
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:135
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: Exports.h:38
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:149
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
dwFeatureArray::memoryType
dwMemoryType memoryType
Where feature array is located, GPU, CPU or pinned memory.
Definition: FeatureList.h:151
dwVector2f
Defines a two-element single-precision floating-point vector.
Definition: MatrixTypes.h:30