DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

FeatureDetector.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-2020 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 
48 #ifndef DW_IMAGEPROCESSING_FEATURE_DETECTOR_H_
49 #define DW_IMAGEPROCESSING_FEATURE_DETECTOR_H_
50 
51 #include <dw/core/Config.h>
52 #include <dw/core/Exports.h>
53 #include <dw/core/Context.h>
54 #include <dw/core/Types.h>
55 #include <dw/image/Image.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
65 typedef struct dwFeature2DDetectorObject* dwFeature2DDetectorHandle_t;
66 
68 typedef struct dwFeature2DDetectorObject const* dwConstFeature2DDetectorHandle_t;
69 
76 
80 
84 
87 
89 typedef enum {
92 
96 
99 
104 {
106  dwFeature2DDetectorType type;
107 
110  uint32_t imageWidth;
111 
114  uint32_t imageHeight;
115 
119  uint32_t maxFeatureCount;
120 
126 
128  uint32_t cellSize;
129 
132  uint32_t gradientSize;
133 
137  uint32_t blockSize;
138 
145 
152 
165 
171  uint32_t detectionLevel;
172 
179  uint32_t harrisRadius;
180 
188  uint32_t NMSRadius;
189 
194  dwFeature2DSelectionMaskType maskType;
195 
199 
206 
212 
218  DW_DEPRECATED("WARNING: dwFeature2DDetectorConfig will be removed in the next major release, "
219  "use dwFeature2DDetectorConfigNew instead");
220 
225 {
227  dwFeature2DDetectorType type;
228 
231  uint32_t imageWidth;
232 
235  uint32_t imageHeight;
236 
240  uint32_t maxFeatureCount;
241 
247 
249  uint32_t cellSize;
250 
253  uint32_t gradientSize;
254 
258  uint32_t blockSize;
259 
266 
273 
286 
292  uint32_t detectionLevel;
293 
300  uint32_t harrisRadius;
301 
309  uint32_t NMSRadius;
310 
315  dwFeature2DSelectionMaskType maskType;
316 
322 
328 
335 
342 
345  bool useHalf;
346 
350 
357 
363 
369 
371 
378 #pragma GCC diagnostic push
379 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
381 DW_DEPRECATED("WARNING: dwFeature2DDetector_initDefaultParams will be removed in the next major "
382  "release, use dwFeature2DDetector_initDefaultParamsNew instead")
384 #pragma GCC diagnostic pop
385 
394 
406 #pragma GCC diagnostic push
407 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
409 DW_DEPRECATED("WARNING: dwFeature2DDetector_initDefaultParamsForCamera will be removed in the next "
410  "major release, use dwFeature2DDetector_initDefaultParamsForCameraNew instead")
412  const dwTransformation3f* cameraToRig,
413  dwConstCameraModelHandle_t cameraHandle);
414 #pragma GCC diagnostic pop
415 
429  const dwTransformation3f* cameraToRig,
430  dwConstCameraModelHandle_t cameraHandle);
431 
443 #pragma GCC diagnostic push
444 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
446 DW_DEPRECATED("WARNING: dwFeature2DDetector_initialize will be removed in the next major release, "
447  "use dwFeature2DDetector_initializeNew instead")
448 dwStatus dwFeature2DDetector_initialize(dwFeature2DDetectorHandle_t* obj,
449  const dwFeature2DDetectorConfig* config,
450  cudaStream_t cudaStream,
451  dwContextHandle_t context);
452 #pragma GCC diagnostic pop
453 
466 dwStatus dwFeature2DDetector_initializeNew(dwFeature2DDetectorHandle_t* obj,
467  const dwFeature2DDetectorConfigNew* config,
468  cudaStream_t cudaStream,
469  dwContextHandle_t context);
470 
480 dwStatus dwFeature2DDetector_reset(dwFeature2DDetectorHandle_t obj);
481 
495 dwStatus dwFeature2DDetector_release(dwFeature2DDetectorHandle_t obj);
496 
515 dwStatus dwFeature2DDetector_setMask(const uint8_t* d_mask,
516  const uint32_t maskStrideBytes,
517  const uint32_t maskWidth,
518  const uint32_t maskHeight,
519  dwFeature2DDetectorHandle_t obj);
520 
552  dwImageHandle_t image,
553  dwFeatureArray* preTrackedFeatures,
554  const float32_t* d_normalizedCrossCorrelation,
555  dwFeature2DDetectorHandle_t obj);
556 
587  const dwPyramidImage* pyramid,
588  dwFeatureArray* preTrackedFeatures,
589  const float32_t* d_normalizedCrossCorrelation,
590  dwFeature2DDetectorHandle_t obj);
591 
599 dwStatus dwFeature2DDetector_getValidTrackedCount(const uint32_t** d_validTrackedCount,
600  dwFeature2DDetectorHandle_t obj);
601 
614 dwStatus dwFeature2DDetector_setCUDAStream(cudaStream_t stream, dwFeature2DDetectorHandle_t obj);
615 
626 dwStatus dwFeature2DDetector_getCUDAStream(cudaStream_t* stream, dwFeature2DDetectorHandle_t obj);
627 
628 #ifdef __cplusplus
629 }
630 #endif
631 
632 #endif // DW_IMAGEPROCESSING_FEATURE_DETECTOR_H_
NVIDIA DriveWorks API: Camera Methods
Extended Harris Corner detector with more configurable parameters, more flexible, better quality but ...
uint32_t detectionLevel
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always detects on level 0 pyramid image...
Fast corner detector, quicker.
float32_t detailThreshold
for DW_FEATURE2D_DETECTOR_TYPE_STD only features in the cell that have scores higher than this value ...
uint32_t NMSRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX and DW_FEATURE2D_DETECTOR_TYPE_FAST9 STD detector use fixed NMSRadi...
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 ...
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:70
struct dwImageObject * dwImageHandle_t
Definition: Image.h:99
dwFeature2DSelectionMaskType
Feature distribution mask for extended detector.
bool isMaskAdjustmentEnabled
for DW_FEATURE2D_DETECTOR_TYPE_EX only Switch to use mask adjusment
dwFeature2DDetectorType
Defines different KLT tracking algorithms.
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.
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParamsNew(dwFeature2DDetectorConfigNew *params)
Initializes dwFeature2DDetector parameters with default values.
uint32_t harrisRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector use fixed harrisRadius = 1.
float32_t detailThreshold
for DW_FEATURE2D_DETECTOR_TYPE_STD only features in the cell that have scores higher than this value ...
bool useHalf
for DW_FEATURE2D_DETECTOR_TYPE_EX only use half-precision floating point to calculate harris corner s...
float32_t gaussianMaskStDevX
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
dwProcessorType processorType
for DW_FEATURE2D_DETECTOR_TYPE_STD only set to DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 to ...
uint32_t detectionLevel
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always detects on level 0 pyramid image...
NVIDIA DriveWorks API: Core Methods
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_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParams(dwFeature2DDetectorConfig *params)
Initializes dwFeature2DDetector parameters with default values.
DW_API_PUBLIC dwStatus dwFeature2DDetector_initializeNew(dwFeature2DDetectorHandle_t *obj, const dwFeature2DDetectorConfigNew *config, cudaStream_t cudaStream, dwContextHandle_t context)
Creates and initializes a feature Detector.
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
uint32_t imageHeight
Height of the images that the Detector runs on.
output feature in uniform distribution
uint32_t blockSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Block window size used to compute the Har...
DW_API_PUBLIC dwStatus dwFeature2DDetector_release(dwFeature2DDetectorHandle_t obj)
Releases the feature Detector.
uint32_t imageWidth
Width of the images that the Detector runs on.
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.
dwFeature2DSelectionMaskType maskType
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always output UNIFORM distribution.
output feature in 2D gaussian distribution which has more features in center area and less ones in bo...
Specifies a 3D rigid transformation.
Definition: Types.h:462
uint32_t imageWidth
Width of the images that the Detector runs on.
float32_t scoreThreshold
Threshold to filter out low latency points.
dwStatus
Status definition.
Definition: Status.h:178
uint32_t maxFeatureCount
Upper bound on number of features handled.
dwProcessorType
Processor type definitions.
Definition: Types.h:159
uint32_t numEvenDistributionPerCell
for DW_FEATURE2D_DETECTOR_TYPE_STD only Number of features to be appended after high frequency points...
uint32_t NMSRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX and DW_FEATURE2D_DETECTOR_TYPE_FAST9 STD detector use fixed NMSRadi...
uint32_t cellSize
Cell size in pixel to split the image into cells.
#define DW_DEPRECATED(msg)
Definition: Exports.h:68
uint32_t harrisRadius
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector use fixed harrisRadius = 1.
NVIDIA DriveWorks API: Pyramid
Holds configuration parameters for a feature detector.
uint32_t cellSize
Cell size in pixel to split the image into cells.
dwProcessorType processorType
for DW_FEATURE2D_DETECTOR_TYPE_STD only set to DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 to ...
DW_API_PUBLIC dwStatus dwFeature2DDetector_getValidTrackedCount(const uint32_t **d_validTrackedCount, dwFeature2DDetectorHandle_t obj)
dwFeature2DDetector_getValidTrackedCount
const uint32_t DW_FEATURES2D_DETECTOR_MAX_CELL_SIZE
DW_API_PUBLIC dwStatus dwFeature2DDetector_reset(dwFeature2DDetectorHandle_t obj)
Resets a feature Detector.
dwFeature2DDetectorType type
Detecting algorithm defined by dwFeature2DDetectorType
struct dwCameraModelObject const * dwConstCameraModelHandle_t
A pointer to the handle representing a const calibrated camera.
Definition: CameraModel.h:72
uint32_t gradientSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Gradient window size. ...
Pyramid image structure.
Definition: Pyramid.h:66
bool isMaskAdjustmentEnabled
for DW_FEATURE2D_DETECTOR_TYPE_EX only Switch to use mask adjusment
uint32_t gradientSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Gradient window size. ...
DW_API_PUBLIC dwStatus dwFeature2DDetector_getCUDAStream(cudaStream_t *stream, dwFeature2DDetectorHandle_t obj)
Gets the CUDA stream used by the feature Detector.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
bool useNewToOldMapFromPreTracked
Determines whether the detector uses dwFeatureArray::newToOldMap directly from input preTrackedFeatur...
struct dwFeature2DDetectorObject const * dwConstFeature2DDetectorHandle_t
Handle representing a const feature detector.
float32_t harrisK
Weigting K of the harris corner score defined as det(M) - K * trace(M) * trace(M), where M is the structural matrix 0.04 - 0.06 is used typically If set to zero the default value (5e-2) will be used.
bool autoGenerateFeatureID
Determines whether the detector generates unique feature ids for new detections automatically.
bool useNewToOldMapFromPreTracked
Determines whether the detector uses dwFeatureArray::newToOldMap directly from input preTrackedFeatur...
float32_t harrisK
Weigting K of the harris corner score defined as det(M) - K * trace(M) * trace(M), where M is the structural matrix 0.04 - 0.06 is used typically If set to zero the default value (5e-2) will be used.
dwFeature2DSelectionMaskType maskType
for DW_FEATURE2D_DETECTOR_TYPE_EX only STD detector always output UNIFORM distribution.
struct dwFeature2DDetectorObject * dwFeature2DDetectorHandle_t
Handle representing a feature detector.
Standard Harris Corner detector with fixed parameters, quicker.
float32_t gaussianMaskStDevY
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
NVIDIA DriveWorks API: Core Exports
float32_t gaussianMaskCenterY
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...
bool autoGenerateFeatureID
Determines whether the detector generates unique feature ids for new detections automatically.
Holds configuration parameters for a feature detector.
NVIDIA DriveWorks API: Feature Array and Feature History Array
uint32_t imageHeight
Height of the images that the Detector runs on.
dwFeature2DDetectorType type
Detecting algorithm defined by dwFeature2DDetectorType
DW_API_PUBLIC dwStatus dwFeature2DDetector_initDefaultParamsForCameraNew(dwFeature2DDetectorConfigNew *params, const dwTransformation3f *cameraToRig, dwConstCameraModelHandle_t cameraHandle)
Initializes dwFeature2DDetector parameters with values best suited for the given camera using camera ...
#define DW_API_PUBLIC
Definition: Exports.h:56
uint32_t blockSize
for DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 only Block window size used to compute the Har...
uint32_t numEvenDistributionPerCell
for DW_FEATURE2D_DETECTOR_TYPE_STD only Number of features to be appended after high frequency points...
uint32_t maxFeatureCount
Upper bound on number of features handled.
float32_t scoreThreshold
Threshold to filter out low latency points.
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.
DW_API_PUBLIC dwStatus dwFeature2DDetector_setCUDAStream(cudaStream_t stream, dwFeature2DDetectorHandle_t obj)
Sets the CUDA stream for CUDA related operations.
float32_t gaussianMaskCenterX
for DW_FEATURE2D_DETECTOR_TYPE_EX only Ignored when not using DW_FEATURE2D_SELECTION_MASK_TYPE_GAUSSI...