DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

LspDetector.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) 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_LIGHTSOURCENET_DETECTOR_H_
49 #define DW_LIGHTSOURCENET_DETECTOR_H_
50 
52 #include <dw/dnn/DNN.h>
53 #include <dw/dnn/DataConditioner.h>
54 #include <dw/image/Image.h>
55 #include <dw/core/Context.h>
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
63 
66 typedef struct dwLightSourceDetectorObject* dwLightSourceDetectorHandle_t;
67 
68 typedef enum {
78 
79 typedef struct
80 {
85 
88 
90  uint32_t glareThreshold;
91 
93 
94 typedef struct
95 {
97  bool flag;
98 
100 
105 {
107 
109 
111 
112  uint32_t size; // assume this is equal to DW_LIGHTSOURCENET_DNN_OUTPUT_WIDTH * DW_LIGHTSOURCENET_DNN_OUTPUT_HEIGHT
113  uint32_t width; // assume this is equal to DW_LIGHTSOURCENET_DNN_OUTPUT_WIDTH
114  uint32_t height; // assume this is equal to DW_LIGHTSOURCENET_DNN_OUTPUT_HEIGHT
116 
118 // dwLightSourceDetector
119 
130 
143 dwStatus dwLightSourceDetector_initialize(dwLightSourceDetectorHandle_t* obj,
145  const dwLightSourceDetectorParams* detectorParams,
146  dwContextHandle_t ctx);
147 
160 dwStatus dwLightSourceDetector_initializeFromAutoNet(dwLightSourceDetectorHandle_t* obj,
161  dwAutoNetHandle_t autonet,
162  const dwLightSourceDetectorParams* detectorParams,
163  dwContextHandle_t ctx);
164 
186  const dwImageCUDA* imgRGB,
187  const dwImageCUDA* imgBayer,
188  dwLightSourceDetectorHandle_t obj);
189 
204  dwAutoNetOutputHandle_t netOutput,
205  dwLightSourceDetectorHandle_t obj);
206 
217 dwStatus dwLightSourceDetector_setCUDAStream(cudaStream_t stream, dwLightSourceDetectorHandle_t obj);
218 
229 dwStatus dwLightSourceDetector_getCUDAStream(cudaStream_t* stream, dwLightSourceDetectorHandle_t obj);
230 
240 dwStatus dwLightSourceDetector_reset(dwLightSourceDetectorHandle_t obj);
241 
253 dwStatus dwLightSourceDetector_release(dwLightSourceDetectorHandle_t obj);
254 
255 #ifdef __cplusplus
256 }
257 #endif
258 
259 #endif // DW_LIGHTSOURCENET_DETECTOR_H_
float float32_t
Specifies POD types.
Definition: Types.h:70
NVIDIA DriveWorks API: LightSourceNet Module
Defines a rectangle.
Definition: Types.h:189
uint8_t otherLightMask[DW_LIGHTSOURCENET_DNN_OUTPUT_HEIGHT][DW_LIGHTSOURCENET_DNN_OUTPUT_WIDTH]
Definition: LspDetector.h:110
#define DW_LIGHTSOURCENET_DNN_OUTPUT_HEIGHT
DW_API_PUBLIC dwStatus dwLightSourceDetector_initDefaultParams(dwLightSourceDetectorParams *detectorParams)
Initializes LightSourceDetector parameters with default values.
struct dwLightSourceNetObject * dwLightSourceNetHandle_t
Handle to a LightSourceNet object.
Car (or other road user with active light)
Definition: LspDetector.h:70
#define DW_LIGHTSOURCENET_DNN_OUTPUT_WIDTH
DNN raw output 2D size.
Defines a CUDA image.
Definition: Image.h:266
NVIDIA DriveWorks API: AutoNet Module
Total class count.
Definition: LspDetector.h:76
uint32_t glareThreshold
Glare detection threshold (in bayer pixel value)
Definition: LspDetector.h:90
NVIDIA DriveWorks API: Core Methods
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
DW_API_PUBLIC dwStatus dwLightSourceDetector_processLightSourcePipeline(dwLightSourceDetectorAutoBeamStatus *output, const dwImageCUDA *imgRGB, const dwImageCUDA *imgBayer, dwLightSourceDetectorHandle_t obj)
Provided input images, execute Light Source Perception pipeline, returning output immediately...
DW_API_PUBLIC dwStatus dwLightSourceDetector_setCUDAStream(cudaStream_t stream, dwLightSourceDetectorHandle_t obj)
Sets the CUDA stream used.
DW_API_PUBLIC dwStatus dwLightSourceDetector_getCUDAStream(cudaStream_t *stream, dwLightSourceDetectorHandle_t obj)
Gets the CUDA stream used.
NVIDIA DriveWorks API: DNN Methods
dwStatus
Status definition.
Definition: Status.h:178
NVIDIA DriveWorks API: Data Conditioner Methods
uint8_t carMask[DW_LIGHTSOURCENET_DNN_OUTPUT_HEIGHT][DW_LIGHTSOURCENET_DNN_OUTPUT_WIDTH]
Definition: LspDetector.h:106
dwRect ROI
Region of interest for each image at the corresponding index.
Definition: LspDetector.h:84
DW_API_PUBLIC dwStatus dwLightSourceDetector_initialize(dwLightSourceDetectorHandle_t *obj, dwLightSourceNetHandle_t lspnet, const dwLightSourceDetectorParams *detectorParams, dwContextHandle_t ctx)
Initializes LightSourceDetector module with a LightSourceNet module.
DW_API_PUBLIC dwStatus dwLightSourceDetector_release(dwLightSourceDetectorHandle_t obj)
Releases the LightSourceDetector module.
DW_API_PUBLIC dwStatus dwLightSourceDetector_reset(dwLightSourceDetectorHandle_t obj)
Resets the LightSourceDetector module.
DW_API_PUBLIC dwStatus dwLightSourceDetector_initializeFromAutoNet(dwLightSourceDetectorHandle_t *obj, dwAutoNetHandle_t autonet, const dwLightSourceDetectorParams *detectorParams, dwContextHandle_t ctx)
Initializes LightSourceDetector module with a LightSourceNet module.
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
struct dwAutoNetObject * dwAutoNetHandle_t
Handle to a AutoNet object.
Definition: AutoNet.h:65
uint8_t streetLightMask[DW_LIGHTSOURCENET_DNN_OUTPUT_HEIGHT][DW_LIGHTSOURCENET_DNN_OUTPUT_WIDTH]
Definition: LspDetector.h:108
struct dwAutoNetOutputObject * dwAutoNetOutputHandle_t
Handle to a AutoNet output object.
Definition: AutoNet.h:71
dwStatus dwLightSourceDetector_detectAutoNet(dwLightSourceDetectorAutoBeamStatus *beamStatus, dwLightSourceDetectorMask *mask, const dwImageCUDA *imgBayer, dwAutoNetOutputHandle_t netOutput, dwLightSourceDetectorHandle_t obj)
Very simple API call to do inference on a frame.
dwLightSourceDetectorClass
Definition: LspDetector.h:68
struct dwLightSourceDetectorObject * dwLightSourceDetectorHandle_t
Handle to an object detector.
Definition: LspDetector.h:66
#define DW_API_PUBLIC
Definition: Exports.h:56
DNN Raw detection mask.
Definition: LspDetector.h:104
bool flag
High beam ON/OFF binary flag.
Definition: LspDetector.h:97