DriveWorks SDK Reference
3.0.4260 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>
56 #include <dw/image/Image.h>
57 #include <dw/core/Context.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
64 #define DW_OBJECT_DETECTOR_MAX_IMAGES 4
65 
67 
70 typedef struct dwObjectDetectorObject* dwObjectDetectorHandle_t;
71 
75 typedef struct
76 {
78  uint32_t sensorId;
79 
81  uint32_t maxNumImages;
82 
87 
91 
96 
101 
105 typedef enum {
109 
111 // dwObjectDetector
112 
122 
134 dwStatus dwObjectDetector_initializeFromDriveNet(dwObjectDetectorHandle_t* obj,
135  const dwObjectDetectorParams* detectorParams,
136  dwDriveNetHandle_t drivenet,
137  dwContextHandle_t ctx);
138 
147 dwStatus dwObjectDetector_reset(dwObjectDetectorHandle_t obj);
148 
159 dwStatus dwObjectDetector_release(dwObjectDetectorHandle_t obj);
160 
173 dwStatus dwObjectDetector_setROI(uint32_t imageIdx, const dwRect* ROI,
174  const dwTransformation2f* outputToObject, dwObjectDetectorHandle_t obj);
175 
188 dwStatus dwObjectDetector_getROI(dwRect* ROI, dwTransformation2f* outputToObject, uint32_t imageIdx,
189  dwObjectDetectorHandle_t obj);
190 
200 dwStatus dwObjectDetector_setCUDAStream(cudaStream_t stream, dwObjectDetectorHandle_t obj);
201 
211 dwStatus dwObjectDetector_getCUDAStream(cudaStream_t* stream, dwObjectDetectorHandle_t obj);
212 
220 dwStatus dwObjectDetector_isFuseObjectsEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
221 
229 dwStatus dwObjectDetector_setEnableFuseObjects(bool enable, dwObjectDetectorHandle_t obj);
230 
240  dwObjectDetectorHandle_t obj);
241 
251  dwObjectDetectorHandle_t obj);
252 
260 DW_DEPRECATED("Replaced with dwObjectDetector_isObjectDepthEnabled")
261 dwStatus dwObjectDetector_isDistanceEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
262 
270 dwStatus dwObjectDetector_isObjectDepthEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
271 
279 dwStatus dwObjectDetector_isObjectUrgencyEnabled(bool* enabled, dwObjectDetectorHandle_t obj);
280 
297 dwStatus dwObjectDetector_setOutputMask(const uint8_t* mask, uint32_t maskWidth, uint32_t maskHeight,
298  dwObjectClass objectClass, dwObjectDetectorHandle_t obj);
299 
308 dwStatus dwObjectDetector_clearOutputMask(dwObjectClass objectClass, dwObjectDetectorHandle_t obj);
309 
320 dwStatus dwObjectDetector_getOutputMaskDimensions(uint32_t* width, uint32_t* height,
321  dwObjectDetectorHandle_t obj);
336  dwObjectDetectorHandle_t obj);
337 #ifdef __cplusplus
338 }
339 #endif
340 
341 #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_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: 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:166
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
#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.
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