DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

ObjectDetector.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) 2016-2019 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_OBJECTPERCEPTION_DETECTOR_H_
49 #define DW_OBJECTPERCEPTION_DETECTOR_H_
50 
51 #include <dw/world/Object.h>
52 #include <dw/world/ObjectArray.h>
54 #include <dw/dnn/DNN.h>
55 #include <dw/dnn/DataConditioner.h>
57 #include <dw/image/Image.h>
58 #include <dw/core/Context.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
65 #define DW_OBJECT_DETECTOR_MAX_IMAGES 2
66 
68 
71 typedef struct dwObjectDetectorObject* dwObjectDetectorHandle_t;
72 
76 typedef struct
77 {
79  uint32_t sensorId;
80 
82  uint32_t maxNumImages;
83 
88 
92 
97 
102 
106 typedef enum {
110 
112 // dwObjectDetector
113 
123 
135 dwStatus dwObjectDetector_initializeFromDriveNet(dwObjectDetectorHandle_t* obj,
136  const dwObjectDetectorParams* detectorParams,
137  dwDriveNetHandle_t drivenet,
138  dwContextHandle_t ctx);
139 
153 dwStatus dwObjectDetector_initializeFromAutoNet(dwObjectDetectorHandle_t* obj,
154  uint32_t imageWidth,
155  uint32_t imageHeight,
156  dwAutoNetHandle_t autonet,
157  const dwObjectDetectorParams* detectorParams,
158  dwContextHandle_t ctx);
159 
168 dwStatus dwObjectDetector_reset(dwObjectDetectorHandle_t obj);
169 
180 dwStatus dwObjectDetector_release(dwObjectDetectorHandle_t obj);
181 
194 dwStatus dwObjectDetector_setROI(uint32_t imageIdx, const dwRect* ROI,
195  const dwTransformation2f* outputToObject, dwObjectDetectorHandle_t obj);
196 
209 dwStatus dwObjectDetector_getROI(dwRect* ROI, dwTransformation2f* outputToObject, uint32_t imageIdx,
210  dwObjectDetectorHandle_t obj);
211 
221 dwStatus dwObjectDetector_setCUDAStream(cudaStream_t stream, dwObjectDetectorHandle_t obj);
222 
232 dwStatus dwObjectDetector_getCUDAStream(cudaStream_t* stream, dwObjectDetectorHandle_t obj);
233 
241 dwStatus dwObjectDetector_isFuseObjectsEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
242 
250 dwStatus dwObjectDetector_setEnableFuseObjects(bool enable, dwObjectDetectorHandle_t obj);
251 
261  dwObjectDetectorHandle_t obj);
262 
272  dwObjectDetectorHandle_t obj);
273 
281 DW_DEPRECATED("Replaced with dwObjectDetector_isObjectDepthEnabled")
282 dwStatus dwObjectDetector_isDistanceEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
283 
291 dwStatus dwObjectDetector_isObjectDepthEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
292 
300 dwStatus dwObjectDetector_isObjectUrgencyEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
301 
318 dwStatus dwObjectDetector_setOutputMask(const uint8_t* mask, uint32_t maskWidth, uint32_t maskHeight,
319  dwObjectClass objectClass, dwObjectDetectorHandle_t obj);
320 
329 dwStatus dwObjectDetector_clearOutputMask(dwObjectClass objectClass, dwObjectDetectorHandle_t obj);
330 
341 dwStatus dwObjectDetector_getOutputMaskDimensions(uint32_t* width, uint32_t* height,
342  dwObjectDetectorHandle_t obj);
357  dwObjectDetectorHandle_t obj);
358 
374  dwObjectDetectorHandle_t obj);
375 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif // DW_OBJECTPERCEPTION_DETECTOR_H_
float float32_t
Specifies POD types.
Definition: Types.h:70
dwObjectDetectorOutputType
The type of the detector output.
Defines a rectangle.
Definition: Types.h:189
NVIDIA DriveWorks API: World Module
DW_API_PUBLIC dwStatus dwObjectDetector_initializeFromAutoNet(dwObjectDetectorHandle_t *obj, uint32_t imageWidth, uint32_t imageHeight, dwAutoNetHandle_t autonet, const dwObjectDetectorParams *detectorParams, dwContextHandle_t ctx)
Initializes ObjectDetector module.
DW_API_PUBLIC dwStatus dwObjectDetector_setCUDAStream(cudaStream_t stream, dwObjectDetectorHandle_t obj)
Sets the CUDA stream used.
DW_API_PUBLIC dwStatus dwObjectDetector_setCoverageThreshold(float32_t covThreshold, dwObjectClass objectClass, dwObjectDetectorHandle_t obj)
Set coverage threshold for a given class.
DW_API_PUBLIC dwStatus dwObjectDetector_isObjectDepthEnabled(bool *enabled, dwObjectDetectorHandle_t obj)
Returns a boolean indicating whether object depth output is enabled.
DW_API_PUBLIC dwStatus dwObjectDetector_setEnableFuseObjects(bool enable, dwObjectDetectorHandle_t obj)
Enables or disables objectFusing.
uint32_t maxNumImages
Maximum number of images (cannot be larger than DW_DETECTOR_MAX_IMAGES). Default is 1...
DW_API_PUBLIC dwStatus dwObjectDetector_isFuseObjectsEnabled(bool *enabled, dwObjectDetectorHandle_t obj)
Returns a boolean indicating whether object fusing is enabled.
Defines a CUDA image.
Definition: Image.h:266
struct dwObjectDetectorObject * dwObjectDetectorHandle_t
Handle to an object detector.
NVIDIA DriveWorks API: AutoNet Module
NVIDIA DriveWorks API: Core Methods
struct dwDriveNetObject * dwDriveNetHandle_t
Handle to a DriveNet object.
Definition: DriveNet.h:63
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
bool enableBoundingBoxClipping
If enableBoundingBoxClipping is set to true, the bounding boxes are clipped to the image edges...
#define DW_OBJECT_DETECTOR_MAX_IMAGES
Maximum number of images the detector can process at a time.
Specifies a 2D transformation as a 3 x 3 matrix in column-major order.
Definition: Types.h:446
DW_API_PUBLIC dwStatus dwObjectDetector_setROI(uint32_t imageIdx, const dwRect *ROI, const dwTransformation2f *outputToObject, dwObjectDetectorHandle_t obj)
Sets the region of interest for an image at given index, and the 2D transformation from the image coo...
NVIDIA DriveWorks API: DNN Methods
dwStatus
Status definition.
Definition: Status.h:178
DW_API_PUBLIC dwStatus dwObjectDetector_release(dwObjectDetectorHandle_t obj)
Releases the ObjectDetector module.
DW_API_PUBLIC dwStatus dwObjectDetector_detectObjects(dwObjectArray *detections, const dwImageCUDA *image, dwObjectDetectorHandle_t obj)
Detects objects from the given input image.
DW_API_PUBLIC dwStatus dwObjectDetector_getCoverageThreshold(float32_t *covThreshold, dwObjectClass objectClass, dwObjectDetectorHandle_t obj)
Get coverage threshold for a given class.
NVIDIA DriveWorks API: Data Conditioner Methods
DW_API_PUBLIC dwStatus dwObjectDetector_detectObjectsAutoNet(dwObjectArray *detections, dwAutoNetOutputHandle_t input, dwObjectDetectorHandle_t obj)
Detects objects from the given DNN inference output.
#define DW_DEPRECATED(msg)
Definition: Exports.h:68
DW_API_PUBLIC dwStatus dwObjectDetector_setOutputMask(const uint8_t *mask, uint32_t maskWidth, uint32_t maskHeight, dwObjectClass objectClass, dwObjectDetectorHandle_t obj)
Set output mask.
DW_API_PUBLIC dwStatus dwObjectDetector_initializeFromDriveNet(dwObjectDetectorHandle_t *obj, const dwObjectDetectorParams *detectorParams, dwDriveNetHandle_t drivenet, dwContextHandle_t ctx)
Initializes ObjectDetector module with a DriveNet module.
Homogeneous array of structs.
Definition: ObjectArray.h:68
NVIDIA DriveWorks API: DriveNet Module
DW_API_PUBLIC dwStatus dwObjectDetector_clearOutputMask(dwObjectClass objectClass, dwObjectDetectorHandle_t obj)
Clears output mask.
DW_API_PUBLIC dwStatus dwObjectDetector_isDistanceEnabled(bool *enabled, dwObjectDetectorHandle_t obj)
Returns a boolean indicating whether DNN distance output is enabled.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
DW_API_PUBLIC dwStatus dwObjectDetector_isObjectUrgencyEnabled(bool *enabled, dwObjectDetectorHandle_t obj)
Returns a boolean indicating whether DNN urgency output is enabled.
DW_API_PUBLIC dwStatus dwObjectDetector_reset(dwObjectDetectorHandle_t obj)
Resets ObjectDetector.
NVIDIA DriveWorks API: World Module
DW_API_PUBLIC dwStatus dwObjectDetector_getOutputMaskDimensions(uint32_t *width, uint32_t *height, dwObjectDetectorHandle_t obj)
Returns output mask dimensions.
DW_API_PUBLIC dwStatus dwObjectDetector_initDefaultParams(dwObjectDetectorParams *detectorParams)
Initializes ObjectDetector parameters with default values.
struct dwAutoNetObject * dwAutoNetHandle_t
Handle to a AutoNet object.
Definition: AutoNet.h:65
struct dwAutoNetOutputObject * dwAutoNetOutputHandle_t
Handle to a AutoNet output object.
Definition: AutoNet.h:71
uint32_t sensorId
camera sensor id of the camera the detector runs on
Object detector configuration parameters.
bool enableFuseObjects
If enableFuseObjects is set to true, all the objects proposals coming from all the images are treated...
DW_API_PUBLIC dwStatus dwObjectDetector_getROI(dwRect *ROI, dwTransformation2f *outputToObject, uint32_t imageIdx, dwObjectDetectorHandle_t obj)
Returns the region of interest and the 2D transformation from the image coordinate system to object c...
dwObjectClass
Object classes known to DriveWorks.
Definition: Obstacle.h:110
DW_API_PUBLIC dwStatus dwObjectDetector_getCUDAStream(cudaStream_t *stream, dwObjectDetectorHandle_t obj)
Gets the CUDA stream used.
#define DW_API_PUBLIC
Definition: Exports.h:56