NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
featuredetector/FeatureDetector.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 
29 #ifndef DW_IMAGEPROCESSING_FEATUREDETECTOR_FEATUREDETECTOR_H_
30 #define DW_IMAGEPROCESSING_FEATUREDETECTOR_FEATUREDETECTOR_H_
31 
32 #include <dw/core/base/Exports.h>
34 #include <dw/core/base/Types.h>
35 #include <dw/image/Image.h>
39 #include <dw/core/base/Config.h>
40 #ifdef DW_SDK_BUILD_PVA
41 #include <cupva_host_scheduling.h>
42 #else
43 typedef void* cupvaStream_t;
45 #endif
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
52 typedef struct dwFeature2DDetectorObject* dwFeature2DDetectorHandle_t;
53 
55 typedef struct dwFeature2DDetectorObject const* dwConstFeature2DDetectorHandle_t;
56 
63 
67 
71 
74 
76 typedef enum {
79 
83 
86 
91 {
94 
97  uint32_t imageWidth;
98 
101  uint32_t imageHeight;
102 
106  uint32_t maxFeatureCount;
107 
113 
115  uint32_t cellSize;
116 
119  uint32_t gradientSize;
120 
124  uint32_t blockSize;
125 
131 
138 
151 
157  uint32_t detectionLevel;
158 
165  uint32_t harrisRadius;
166 
174  uint32_t NMSRadius;
175 
181 
187 
193 
200 
207 
210  bool useHalf;
211 
215 
221  // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
222  DW_DEPRECATED("WARNING: will be removed in the next major release")
224 
229  // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
230  DW_DEPRECATED("WARNING: will be removed in the next major release")
232 
238 
240 
254 
272  const dwTransformation3f* cameraToRig,
273  dwConstCameraModelHandle_t cameraHandle);
274 
292  const dwFeature2DDetectorConfig* config,
293  cudaStream_t const cudaStream,
294  dwContextHandle_t const context);
295 
310 
329 
352 dwStatus dwFeature2DDetector_setMask(const uint8_t* d_mask,
353  const uint32_t maskStrideBytes,
354  const uint32_t maskWidth,
355  const uint32_t maskHeight,
357 
396  dwImageHandle_t image,
397  dwFeatureArray* preTrackedFeatures,
398  const float32_t* d_normalizedCrossCorrelation,
400 
439  const dwPyramidImage* pyramid,
440  dwFeatureArray* preTrackedFeatures,
441  const float32_t* d_normalizedCrossCorrelation,
443 
475  dwFeatureArray* preTrackedFeatures,
476  const float32_t* d_normalizedCrossCorrelation,
478 
509  dwFeatureArray* preTrackedFeatures,
510  const float32_t* d_normalizedCrossCorrelation,
512 
523 // coverity[misra_c_2012_directive_4_9_violation] Deviation Record: AV-NDAS-SWSADR-008
524 DW_DEPRECATED("WARNING: will be removed in the next major release, validTrackedCount pointer can be read directly from dwFeatureArray")
526 dwStatus dwFeature2DDetector_getValidTrackedCount(const uint32_t** d_validTrackedCount,
528 
546 
562 
578 
597 
615 
631 
649 
667 
684 
685 #ifdef __cplusplus
686 }
687 #endif
688 
689 #endif // DW_IMAGEPROCESSING_FEATUREDETECTOR_FEATUREDETECTOR_H_
dwFeature2DDetectorConfig::gaussianMaskCenterX
float32_t gaussianMaskCenterX
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: featuredetector/FeatureDetector.h:186
dwFeature2DDetectorConfig::blockSize
uint32_t blockSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Block window size used to compute the Har...
Definition: featuredetector/FeatureDetector.h:124
DW_FEATURE2D_DETECTOR_TYPE_STD
@ DW_FEATURE2D_DETECTOR_TYPE_STD
Standard Harris Corner detector with fixed parameters, quicker.
Definition: featuredetector/FeatureDetector.h:62
dwFeature2DDetectorConfig::gaussianMaskStDevX
float32_t gaussianMaskStDevX
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: featuredetector/FeatureDetector.h:199
Types.h
dwFeature2DDetector_getPVAStream
DW_API_PUBLIC dwStatus dwFeature2DDetector_getPVAStream(cupvaStream_t *stream, dwFeature2DDetectorHandle_t obj)
Gets the CUPVA stream used by the feature Detector.
dwPyramidImage
Pyramid image structure.
Definition: pyramid/Pyramid.h:47
dwFeature2DDetectorConfig::scoreThreshold
float32_t scoreThreshold
Threshold to filter out low frequency points.
Definition: featuredetector/FeatureDetector.h:130
dwFeature2DDetector_detectFromImage
DW_API_PUBLIC dwStatus dwFeature2DDetector_detectFromImage(dwFeatureArray *outputDetections, dwImageHandle_t image, dwFeatureArray *preTrackedFeatures, const float32_t *d_normalizedCrossCorrelation, dwFeature2DDetectorHandle_t obj)
Detects new features and append them after old tracked features.
Image.h
dwFeature2DDetectorConfig::detailThreshold
float32_t detailThreshold
for DW_FEATURE2D_DETECTOR_TYPE_STD only features in the cell that have scores higher than this value ...
Definition: featuredetector/FeatureDetector.h:137
dwFeature2DDetector_detectFromPyramid
DW_API_PUBLIC dwStatus dwFeature2DDetector_detectFromPyramid(dwFeatureArray *outputDetections, const dwPyramidImage *pyramid, dwFeatureArray *preTrackedFeatures, const float32_t *d_normalizedCrossCorrelation, dwFeature2DDetectorHandle_t obj)
Detects new features and append them after old tracked features.
cupvaStream_t
void * cupvaStream_t
Dummy definition for non PVA supported platforms.
Definition: featuredetector/FeatureDetector.h:44
dwFeatureArray
Definition: FeatureList.h:134
DW_FEATURE2D_DETECTOR_TYPE_FAST9
@ DW_FEATURE2D_DETECTOR_TYPE_FAST9
Fast corner detector, quicker.
Definition: featuredetector/FeatureDetector.h:70
dwFeature2DDetector_registerInputNccScore
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerInputNccScore(float32_t *nccScore, uint32_t nccScoreArraySize, dwFeature2DDetectorHandle_t obj)
Binds input ncc Score.
dwFeature2DDetector_initialize
DW_API_PUBLIC dwStatus dwFeature2DDetector_initialize(dwFeature2DDetectorHandle_t *obj, const dwFeature2DDetectorConfig *config, cudaStream_t const cudaStream, dwContextHandle_t const context)
Creates and initializes a feature Detector.
dwConstFeature2DDetectorHandle_t
struct dwFeature2DDetectorObject const * dwConstFeature2DDetectorHandle_t
Handle representing a const feature detector.
Definition: featuredetector/FeatureDetector.h:55
dwConstCameraModelHandle_t
struct dwCameraModelObject const * dwConstCameraModelHandle_t
A pointer to the handle representing a const calibrated camera.
Definition: CameraModel.h:54
dwFeature2DDetector_getValidTrackedCount
DW_API_PUBLIC dwStatus dwFeature2DDetector_getValidTrackedCount(const uint32_t **d_validTrackedCount, dwFeature2DDetectorHandle_t obj)
dwFeature2DDetector_getValidTrackedCount
Exports.h
dwFeature2DDetectorConfig::useNewToOldMapFromPreTracked
bool useNewToOldMapFromPreTracked
Determines whether the detector uses dwFeatureArray::newToOldMap directly from input preTrackedFeatur...
Definition: featuredetector/FeatureDetector.h:223
dwFeature2DDetectorConfig::imageHeight
uint32_t imageHeight
Height of the images that the Detector runs on.
Definition: featuredetector/FeatureDetector.h:101
dwFeature2DDetectorConfig::gaussianMaskStDevY
float32_t gaussianMaskStDevY
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: featuredetector/FeatureDetector.h:206
dwFeature2DDetectorConfig::NMSRadius
uint32_t NMSRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX and DW_FEATURE2D_DETECTOR_TYPE_FAST9 STD detector use fixed NMSRadi...
Definition: featuredetector/FeatureDetector.h:174
dwFeature2DDetectorConfig::processorType
dwProcessorType processorType
for DW_FEATURE2D_DETECTOR_TYPE_STD only set to DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 to ...
Definition: featuredetector/FeatureDetector.h:236
dwFeature2DDetector_dryrunDetectionPyramid
DW_API_PUBLIC dwStatus dwFeature2DDetector_dryrunDetectionPyramid(dwFeatureArray *outputDetections, dwFeatureArray *preTrackedFeatures, const float32_t *d_normalizedCrossCorrelation, dwFeature2DDetectorHandle_t obj)
Dryrun the detection to record a CUDA graph.
dwProcessorType
dwProcessorType
Processor type definitions.
Definition: TypesExtra.h:119
dwFeature2DDetectorConfig::maxFeatureCount
uint32_t maxFeatureCount
Upper bound on number of features handled.
Definition: featuredetector/FeatureDetector.h:106
dwFeature2DDetectorConfig
Holds configuration parameters for a feature detector.
Definition: featuredetector/FeatureDetector.h:90
dwFeature2DDetector_getCUDAStream
DW_API_PUBLIC dwStatus dwFeature2DDetector_getCUDAStream(cudaStream_t *stream, dwFeature2DDetectorHandle_t obj)
Gets the CUDA stream used by the feature Detector.
DW_FEATURE2D_DETECTOR_TYPE_COUNT
@ DW_FEATURE2D_DETECTOR_TYPE_COUNT
Definition: featuredetector/FeatureDetector.h:72
DW_FEATURE2D_SELECTION_MASK_TYPE_UNIFORM
@ DW_FEATURE2D_SELECTION_MASK_TYPE_UNIFORM
output feature in uniform distribution
Definition: featuredetector/FeatureDetector.h:78
DW_FEATURES2D_DETECTOR_MAX_CELL_SIZE
const uint32_t DW_FEATURES2D_DETECTOR_MAX_CELL_SIZE
Definition: featuredetector/FeatureDetector.h:239
dwFeature2DDetector_setScoreThreshold
DW_API_PUBLIC dwStatus dwFeature2DDetector_setScoreThreshold(float32_t scoreThreshold, dwFeature2DDetectorHandle_t obj)
Set Harris detector's score threshold.
DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSIAN
@ DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSIAN
output feature in 2D gaussian distribution which has more features in center area and less ones in bo...
Definition: featuredetector/FeatureDetector.h:82
float32_t
float float32_t
Definition: core/base/BasicTypes.h:43
dwFeature2DDetectorType
dwFeature2DDetectorType
Defines different KLT tracking algorithms.
Definition: featuredetector/FeatureDetector.h:60
dwFeature2DDetectorConfig::detectionLevel
uint32_t detectionLevel
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always detects on level 0 pyramid image.
Definition: featuredetector/FeatureDetector.h:157
DW_FEATURE2D_SELECTION_MASK_TYPE_COUNT
@ DW_FEATURE2D_SELECTION_MASK_TYPE_COUNT
Definition: featuredetector/FeatureDetector.h:84
dwFeature2DDetectorConfig::isMaskAdjustmentEnabled
bool isMaskAdjustmentEnabled
for DW_FEATURE2D_DETECTOR_TYPE_EX only Switch to use mask adjusment
Definition: featuredetector/FeatureDetector.h:214
dwFeature2DDetector_release
DW_API_PUBLIC dwStatus dwFeature2DDetector_release(dwFeature2DDetectorHandle_t obj)
Releases the feature Detector.
dwFeature2DDetector_initDefaultParamsForCamera
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParamsForCamera(dwFeature2DDetectorConfig *params, const dwTransformation3f *cameraToRig, dwConstCameraModelHandle_t cameraHandle)
Initializes dwFeature2DDetector parameters with values best suited for the given camera using camera ...
dwFeature2DSelectionMaskType
dwFeature2DSelectionMaskType
Feature distribution mask for extended detector.
Definition: featuredetector/FeatureDetector.h:76
obj
const NvSciSyncObj *const obj
Definition: wfdext.h:528
dwFeature2DDetectorConfig::maskType
dwFeature2DSelectionMaskType maskType
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always output UNIFORM distribution.
Definition: featuredetector/FeatureDetector.h:180
dwFeature2DDetector_initDefaultParams
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParams(dwFeature2DDetectorConfig *params)
Initializes dwFeature2DDetector parameters with default values.
dwFeature2DDetector_reset
DW_API_PUBLIC dwStatus dwFeature2DDetector_reset(dwFeature2DDetectorHandle_t obj)
Resets a feature Detector.
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:32
DW_DEPRECATED
#define DW_DEPRECATED(msg)
Definition: core/base/Exports.h:80
dwFeature2DDetectorConfig::harrisK
float32_t harrisK
Weigting K of the harris corner score defined as det(M) - K * trace(M) * trace(M),...
Definition: featuredetector/FeatureDetector.h:112
dwFeature2DDetectorConfig::cellSize
uint32_t cellSize
Cell size in pixel to split the image into cells.
Definition: featuredetector/FeatureDetector.h:115
dwFeature2DDetector_setPVAStream
DW_API_PUBLIC dwStatus dwFeature2DDetector_setPVAStream(cupvaStream_t const stream, dwFeature2DDetectorHandle_t obj)
Sets the CUPVA stream for PVA related operations.
dwImageHandle_t
struct dwImageObject * dwImageHandle_t
Handle to an image object.
Definition: image/Image.h:99
Config.h
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:81
dwFeature2DDetectorConfig::numEvenDistributionPerCell
uint32_t numEvenDistributionPerCell
for DW_FEATURE2D_DETECTOR_TYPE_STD only Number of features to be appended after high frequency points...
Definition: featuredetector/FeatureDetector.h:150
dwFeature2DDetectorConfig::gaussianMaskCenterY
float32_t gaussianMaskCenterY
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: featuredetector/FeatureDetector.h:192
dwFeature2DDetectorConfig::gradientSize
uint32_t gradientSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Gradient window size.
Definition: featuredetector/FeatureDetector.h:119
dwFeature2DDetectorHandle_t
struct dwFeature2DDetectorObject * dwFeature2DDetectorHandle_t
Handle representing a feature detector.
Definition: featuredetector/FeatureDetector.h:52
dwFeature2DDetectorConfig::imageWidth
uint32_t imageWidth
Width of the images that the Detector runs on.
Definition: featuredetector/FeatureDetector.h:97
dwFeature2DDetectorConfig::harrisRadius
uint32_t harrisRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector use fixed harrisRadius = 1.
Definition: featuredetector/FeatureDetector.h:165
Pyramid.h
dwFeature2DDetector_getScoreThreshold
DW_API_PUBLIC dwStatus dwFeature2DDetector_getScoreThreshold(float32_t *scoreThreshold, dwFeature2DDetectorHandle_t obj)
Get the current score threshold used in Harris detector.
dwFeature2DDetector_setMask
DW_API_PUBLIC dwStatus dwFeature2DDetector_setMask(const uint8_t *d_mask, const uint32_t maskStrideBytes, const uint32_t maskWidth, const uint32_t maskHeight, dwFeature2DDetectorHandle_t obj)
Sets a mask to ignore areas of the image.
dwFeature2DDetector_registerFeatureArray
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerFeatureArray(dwFeatureArray const *inFeatures, dwFeature2DDetectorHandle_t obj)
Binds feature Array.
dwFeature2DDetector_dryrunDetectionImage
DW_API_PUBLIC dwStatus dwFeature2DDetector_dryrunDetectionImage(dwFeatureArray *outputDetections, dwFeatureArray *preTrackedFeatures, const float32_t *d_normalizedCrossCorrelation, dwFeature2DDetectorHandle_t obj)
Dryrun the detection to record a CUDA graph.
dwFeatureHistoryArray
Holds pointers to the data exposed by a feature2d list.
Definition: FeatureList.h:105
dwTransformation3f
Specifies a 3D rigid transformation.
Definition: MatrixTypes.h:226
dwFeature2DDetectorConfig::useHalf
bool useHalf
for DW_FEATURE2D_DETECTOR_TYPE_EX only use half-precision floating point to calculate harris corner s...
Definition: featuredetector/FeatureDetector.h:210
dwFeature2DDetector_setCUDAStream
DW_API_PUBLIC dwStatus dwFeature2DDetector_setCUDAStream(cudaStream_t const stream, dwFeature2DDetectorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
CameraModel.h
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: core/base/Exports.h:57
dwFeature2DDetectorConfig::autoGenerateFeatureID
bool autoGenerateFeatureID
Determines whether the detector generates unique feature ids for new detections automatically.
Definition: featuredetector/FeatureDetector.h:231
dwFeature2DDetectorConfig::type
dwFeature2DDetectorType type
Detecting algorithm defined by dwFeature2DDetectorType
Definition: featuredetector/FeatureDetector.h:93
DW_FEATURE2D_DETECTOR_TYPE_EX
@ DW_FEATURE2D_DETECTOR_TYPE_EX
Extended Harris Corner detector with more configurable parameters, more flexible, better quality but ...
Definition: featuredetector/FeatureDetector.h:66
FeatureList.h
dwFeature2DDetector_registerHistoryArray
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerHistoryArray(dwFeatureHistoryArray *historyArray, dwFeature2DDetectorHandle_t obj)
Binds feature HistoryArray.
Context.h