NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
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>
33 #include <dw/core/context/Context.h>
34 #include <dw/core/base/Types.h>
35 #include <dw/image/Image.h>
36 #include <dw/imageprocessing/features/FeatureList.h>
37 #include <dw/imageprocessing/pyramid/Pyramid.h>
38 #include <dw/calibration/cameramodel/CameraModel.h>
39 #include <dw/core/system/PVA.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
46 typedef struct dwFeature2DDetectorObject* dwFeature2DDetectorHandle_t;
47 
49 typedef struct dwFeature2DDetectorObject const* dwConstFeature2DDetectorHandle_t;
50 
57 
61 
65 
68 
70 typedef enum {
73 
77 
80 
85 {
88 
91  uint32_t imageWidth;
92 
95  uint32_t imageHeight;
96 
100  uint32_t maxFeatureCount;
101 
107 
109  uint32_t cellSize;
110 
113  uint32_t gradientSize;
114 
118  uint32_t blockSize;
119 
125 
132 
145 
151  uint32_t detectionLevel;
152 
159  uint32_t harrisRadius;
160 
168  uint32_t NMSRadius;
169 
175 
181 
187 
194 
201 
204  bool useHalf;
205 
209 
215  DW_DEPRECATED("WARNING: will be removed in the next major release")
217 
222  DW_DEPRECATED("WARNING: will be removed in the next major release")
224 
230 
232 
246 
264  const dwTransformation3f* cameraToRig,
265  dwConstCameraModelHandle_t cameraHandle);
266 
284  const dwFeature2DDetectorConfig* config,
285  cudaStream_t cudaStream,
286  dwContextHandle_t context);
287 
302 
321 
344 dwStatus dwFeature2DDetector_setMask(const uint8_t* d_mask,
345  const uint32_t maskStrideBytes,
346  const uint32_t maskWidth,
347  const uint32_t maskHeight,
349 
388  dwImageHandle_t image,
389  dwFeatureArray* preTrackedFeatures,
390  const float32_t* d_normalizedCrossCorrelation,
392 
431  const dwPyramidImage* pyramid,
432  dwFeatureArray* preTrackedFeatures,
433  const float32_t* d_normalizedCrossCorrelation,
435 
467  dwFeatureArray* preTrackedFeatures,
468  const float32_t* d_normalizedCrossCorrelation,
470 
501  dwFeatureArray* preTrackedFeatures,
502  const float32_t* d_normalizedCrossCorrelation,
504 
515 DW_DEPRECATED("WARNING: will be removed in the next major release, validTrackedCount pointer can be read directly from dwFeatureArray")
517 dwStatus dwFeature2DDetector_getValidTrackedCount(const uint32_t** d_validTrackedCount,
519 
537 
553 
569 
588 
606 
622 
640 
658 
675 
676 #ifdef __cplusplus
677 }
678 #endif
679 
680 #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.h:180
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.h:118
dwFeature2DDetector_initialize
DW_API_PUBLIC dwStatus dwFeature2DDetector_initialize(dwFeature2DDetectorHandle_t *obj, const dwFeature2DDetectorConfig *config, cudaStream_t cudaStream, dwContextHandle_t context)
Creates and initializes a feature Detector.
DW_FEATURE2D_DETECTOR_TYPE_STD
@ DW_FEATURE2D_DETECTOR_TYPE_STD
Standard Harris Corner detector with fixed parameters, quicker.
Definition: FeatureDetector.h:56
cupvaStream_t
void * cupvaStream_t
Dummy definition for non PVA supported platforms.
Definition: PVA.h:29
dwFeature2DDetectorConfig::gaussianMaskStDevX
float32_t gaussianMaskStDevX
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: FeatureDetector.h:193
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_1.h:47
dwFeature2DDetectorConfig::scoreThreshold
float32_t scoreThreshold
Threshold to filter out low frequency points.
Definition: FeatureDetector.h:124
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.
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.h:131
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.
dwFeatureArray
Definition: FeatureList.h:133
DW_FEATURE2D_DETECTOR_TYPE_FAST9
@ DW_FEATURE2D_DETECTOR_TYPE_FAST9
Fast corner detector, quicker.
Definition: FeatureDetector.h:64
dwFeature2DDetector_registerInputNccScore
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerInputNccScore(float32_t *nccScore, uint32_t nccScoreArraySize, dwFeature2DDetectorHandle_t obj)
Binds input ncc Score.
dwConstFeature2DDetectorHandle_t
struct dwFeature2DDetectorObject const * dwConstFeature2DDetectorHandle_t
Handle representing a const feature detector.
Definition: FeatureDetector.h:49
dwConstCameraModelHandle_t
struct dwCameraModelObject const * dwConstCameraModelHandle_t
A pointer to the handle representing a const calibrated camera.
Definition: CameraModel.h:55
dwFeature2DDetector_getValidTrackedCount
DW_API_PUBLIC dwStatus dwFeature2DDetector_getValidTrackedCount(const uint32_t **d_validTrackedCount, dwFeature2DDetectorHandle_t obj)
dwFeature2DDetector_getValidTrackedCount
dwFeature2DDetector_registerFeatureArray
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerFeatureArray(dwFeatureArray *inFeatures, dwFeature2DDetectorHandle_t obj)
Binds feature Array.
dwFeature2DDetectorConfig::useNewToOldMapFromPreTracked
bool useNewToOldMapFromPreTracked
Determines whether the detector uses dwFeatureArray::newToOldMap directly from input preTrackedFeatur...
Definition: FeatureDetector.h:216
dwFeature2DDetectorConfig::imageHeight
uint32_t imageHeight
Height of the images that the Detector runs on.
Definition: FeatureDetector.h:95
dwFeature2DDetector_setPVAStream
DW_API_PUBLIC dwStatus dwFeature2DDetector_setPVAStream(cupvaStream_t stream, dwFeature2DDetectorHandle_t obj)
Sets the CUPVA stream for PVA related operations.
dwFeature2DDetectorConfig::gaussianMaskStDevY
float32_t gaussianMaskStDevY
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: FeatureDetector.h:200
dwFeature2DDetectorConfig::NMSRadius
uint32_t NMSRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX and DW_FEATURE2D_DETECTOR_TYPE_FAST9 STD detector use fixed NMSRadi...
Definition: FeatureDetector.h:168
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.h:228
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:116
dwFeature2DDetectorConfig::maxFeatureCount
uint32_t maxFeatureCount
Upper bound on number of features handled.
Definition: FeatureDetector.h:100
dwFeature2DDetectorConfig
Holds configuration parameters for a feature detector.
Definition: FeatureDetector.h:84
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.h:66
DW_FEATURE2D_SELECTION_MASK_TYPE_UNIFORM
@ DW_FEATURE2D_SELECTION_MASK_TYPE_UNIFORM
output feature in uniform distribution
Definition: FeatureDetector.h:72
DW_FEATURES2D_DETECTOR_MAX_CELL_SIZE
const uint32_t DW_FEATURES2D_DETECTOR_MAX_CELL_SIZE
Definition: FeatureDetector.h:231
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.h:76
float32_t
float float32_t
Specifies POD types.
Definition: BasicTypes.h:41
dwFeature2DDetectorType
dwFeature2DDetectorType
Defines different KLT tracking algorithms.
Definition: FeatureDetector.h:54
dwFeature2DDetectorConfig::detectionLevel
uint32_t detectionLevel
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always detects on level 0 pyramid image.
Definition: FeatureDetector.h:151
DW_FEATURE2D_SELECTION_MASK_TYPE_COUNT
@ DW_FEATURE2D_SELECTION_MASK_TYPE_COUNT
Definition: FeatureDetector.h:78
dwFeature2DDetectorConfig::isMaskAdjustmentEnabled
bool isMaskAdjustmentEnabled
for DW_FEATURE2D_DETECTOR_TYPE_EX only Switch to use mask adjusment
Definition: FeatureDetector.h:208
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.h:70
dwFeature2DDetectorConfig::maskType
dwFeature2DSelectionMaskType maskType
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always output UNIFORM distribution.
Definition: FeatureDetector.h:174
dwFeature2DDetector_initDefaultParams
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParams(dwFeature2DDetectorConfig *params)
Initializes dwFeature2DDetector parameters with default values.
dwFeature2DDetector_setCUDAStream
DW_API_PUBLIC dwStatus dwFeature2DDetector_setCUDAStream(cudaStream_t stream, dwFeature2DDetectorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
dwFeature2DDetector_reset
DW_API_PUBLIC dwStatus dwFeature2DDetector_reset(dwFeature2DDetectorHandle_t obj)
Resets a feature Detector.
DW_DEPRECATED
#define DW_DEPRECATED(msg)
Definition: Exports.h:50
dwFeature2DDetectorConfig::harrisK
float32_t harrisK
Weigting K of the harris corner score defined as det(M) - K * trace(M) * trace(M),...
Definition: FeatureDetector.h:106
dwFeature2DDetectorConfig::cellSize
uint32_t cellSize
Cell size in pixel to split the image into cells.
Definition: FeatureDetector.h:109
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:74
dwFeature2DDetectorConfig::numEvenDistributionPerCell
uint32_t numEvenDistributionPerCell
for DW_FEATURE2D_DETECTOR_TYPE_STD only Number of features to be appended after high frequency points...
Definition: FeatureDetector.h:144
dwFeature2DDetectorConfig::gaussianMaskCenterY
float32_t gaussianMaskCenterY
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
Definition: FeatureDetector.h:186
dwFeature2DDetectorConfig::gradientSize
uint32_t gradientSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Gradient window size.
Definition: FeatureDetector.h:113
dwFeature2DDetectorHandle_t
struct dwFeature2DDetectorObject * dwFeature2DDetectorHandle_t
Handle representing a feature detector.
Definition: FeatureDetector.h:46
dwFeature2DDetectorConfig::imageWidth
uint32_t imageWidth
Width of the images that the Detector runs on.
Definition: FeatureDetector.h:91
dwFeature2DDetectorConfig::harrisRadius
uint32_t harrisRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector use fixed harrisRadius = 1.
Definition: FeatureDetector.h:159
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.
dwImageHandle_t
struct dwImageObject * dwImageHandle_t
Definition: Image.h:88
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:27
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.h:204
params
DW_API_PUBLIC dwPointCloudRangeImageCreatorParams const *const params
Definition: PointCloudRangeImageCreator.h:292
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: Exports.h:38
dwFeature2DDetectorConfig::autoGenerateFeatureID
bool autoGenerateFeatureID
Determines whether the detector generates unique feature ids for new detections automatically.
Definition: FeatureDetector.h:223
dwFeature2DDetectorConfig::type
dwFeature2DDetectorType type
Detecting algorithm defined by dwFeature2DDetectorType
Definition: FeatureDetector.h:87
obj
const NvSciSyncObj *const obj
Definition: wfdext.h:120
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.h:60
dwFeature2DDetector_registerHistoryArray
DW_API_PUBLIC dwStatus dwFeature2DDetector_registerHistoryArray(dwFeatureHistoryArray *historyArray, dwFeature2DDetectorHandle_t obj)
Binds feature HistoryArray.