DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

LightSourceDetector

Detailed Description

Defines LightSourceDetector module for light source detection.

Note
SW Release Applicability: These APIs are available in NVIDIA DRIVE Software releases.

Data Structures

struct  dwLightSourceDetectorAutoBeamStatus
 
struct  dwLightSourceDetectorMask
 DNN Raw detection mask. More...
 
struct  dwLightSourceDetectorParams
 

Typedefs

typedef struct dwLightSourceDetectorObject * dwLightSourceDetectorHandle_t
 Handle to an object detector. More...
 

Enumerations

enum  dwLightSourceDetectorClass {
  DW_LIGHTSOURCE_CLASS_CAR = 0,
  DW_LIGHTSOURCE_CLASS_STREET_LIGHT = 1,
  DW_LIGHTSOURCE_CLASS_OTHER_LIGHT = 2,
  DW_LIGHTSOURCE_CLASS_COUNT = 3
}
 

Functions

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. More...
 
DW_API_PUBLIC dwStatus dwLightSourceDetector_getCUDAStream (cudaStream_t *stream, dwLightSourceDetectorHandle_t obj)
 Gets the CUDA stream used. More...
 
DW_API_PUBLIC dwStatus dwLightSourceDetector_initDefaultParams (dwLightSourceDetectorParams *detectorParams)
 Initializes LightSourceDetector parameters with default values. More...
 
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. More...
 
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. More...
 
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. More...
 
DW_API_PUBLIC dwStatus dwLightSourceDetector_release (dwLightSourceDetectorHandle_t obj)
 Releases the LightSourceDetector module. More...
 
DW_API_PUBLIC dwStatus dwLightSourceDetector_reset (dwLightSourceDetectorHandle_t obj)
 Resets the LightSourceDetector module. More...
 
DW_API_PUBLIC dwStatus dwLightSourceDetector_setCUDAStream (cudaStream_t stream, dwLightSourceDetectorHandle_t obj)
 Sets the CUDA stream used. More...
 

Data Structure Documentation

◆ dwLightSourceDetectorAutoBeamStatus

struct dwLightSourceDetectorAutoBeamStatus
Data Fields
bool flag High beam ON/OFF binary flag.

◆ dwLightSourceDetectorMask

struct dwLightSourceDetectorMask

◆ dwLightSourceDetectorParams

struct dwLightSourceDetectorParams
Data Fields
float32_t classThreshold[DW_LIGHTSOURCE_CLASS_COUNT] Class detection thresholds.
uint32_t glareThreshold Glare detection threshold (in bayer pixel value)
dwRect ROI Region of interest for each image at the corresponding index.

The image is cropped at the given ROI. The cropped region is then be scaled while keeping the aspect ratio and is padded to have the right size for DNN. Default ROI is the whole image.

Typedef Documentation

◆ dwLightSourceDetectorHandle_t

typedef struct dwLightSourceDetectorObject* dwLightSourceDetectorHandle_t

Handle to an object detector.

Definition at line 66 of file LspDetector.h.

Enumeration Type Documentation

◆ dwLightSourceDetectorClass

Enumerator
DW_LIGHTSOURCE_CLASS_CAR 

Car (or other road user with active light)

DW_LIGHTSOURCE_CLASS_STREET_LIGHT 

Street light.

DW_LIGHTSOURCE_CLASS_OTHER_LIGHT 

Other light.

DW_LIGHTSOURCE_CLASS_COUNT 

Total class count.

Definition at line 68 of file LspDetector.h.

Function Documentation

◆ dwLightSourceDetector_detectAutoNet()

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.

Parameters
[out]beamStatusStruct encoding results of LSP detection (currently the high beam control flag)
[out]maskoutput segmentation masks for each class
[in]imgBayerStoring pointer to RAW Bayer image (used to detect road sign glare), can be null
[in]netOutputautonet output tensor which gives inference output for lsp
[in]objSpecifies the LightSourceDetector module handle.
Returns
DW_INVALID_HANDLE - If the given context handle is invalid.
DW_BAD_CAST - If cannot cast the given handle to the expected type.
DW_SUCCESS DW_API_PUBLIC

◆ dwLightSourceDetector_getCUDAStream()

DW_API_PUBLIC dwStatus dwLightSourceDetector_getCUDAStream ( cudaStream_t *  stream,
dwLightSourceDetectorHandle_t  obj 
)

Gets the CUDA stream used.

Parameters
[out]streamThe CUDA stream used.
[in]objA pointer to the LightSourceDetector handle.
Returns
DW_SUCCESS operation completed successfully DW_INVALID_ARGUMENT null handle passed

◆ dwLightSourceDetector_initDefaultParams()

DW_API_PUBLIC dwStatus dwLightSourceDetector_initDefaultParams ( dwLightSourceDetectorParams detectorParams)

Initializes LightSourceDetector parameters with default values.

Parameters
[out]detectorParamsLightSourceDetector parameters.
Returns
DW_SUCCESS parameters initialized DW_INVALID_ARGUMENT if nullptr passed

◆ dwLightSourceDetector_initialize()

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.

Parameters
[out]objA pointer to LightSourceDetector handle that is initialized from parameters.
[in]ctxSpecifies the handle to the context.
[in]lspnetSpecifies the handle to the LightSourceNet module.
[in]detectorParamsA pointer to LightSourceDetector parameters.
Returns
DW_SUCCESS initialization succeeded DW_INVALID_ARGUMENT one of the parameters invalid (nullptr or null handle)

◆ dwLightSourceDetector_initializeFromAutoNet()

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.

Parameters
[out]objA pointer to LightSourceDetector handle that is initialized from parameters.
[in]autonetSpecifies the handle to the AutoNet module.
[in]detectorParamsA pointer to LightSourceDetector parameters.
[in]ctxSpecifies the handle to the context.
Returns
DW_SUCCESS initialization succeeded DW_INVALID_ARGUMENT one of the parameters invalid (nullptr or null handle)

◆ dwLightSourceDetector_processLightSourcePipeline()

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.

NOTE: This call combines all processing steps that may execute atomically: bind input bind output pre-process inference post-process copy result This call will overwrite the previous input/output bindings.

Parameters
[out]outputStruct encoding results of LSP detection (currently the high beam control flag)
[in]imgRGBStoring pointer to post-ISP RGB or RCB image where the detector is to be applied.
[in]imgBayerStoring pointer to RAW Bayer image (used to detect road sign glare), can be null
[in]objSpecifies the LightSourceDetector module handle.
Returns
DW_SUCCESS operation completed successfully DW_INVALID_ARGUMENT one of the parameters are invalid (nullptr or null handle)

◆ dwLightSourceDetector_release()

DW_API_PUBLIC dwStatus dwLightSourceDetector_release ( dwLightSourceDetectorHandle_t  obj)

Releases the LightSourceDetector module.

Parameters
[in]objObject handle to release.
Returns
DW_SUCCESS successfully released DW_INVALID_ARGUMENT null pointer passed
Note
This method renders the handle unusable.

◆ dwLightSourceDetector_reset()

DW_API_PUBLIC dwStatus dwLightSourceDetector_reset ( dwLightSourceDetectorHandle_t  obj)

Resets the LightSourceDetector module.

Parameters
[in]objObject handle to release.
Returns
DW_SUCCESS the module was successfully reset DW_INVALID_ARGUMENT null pointer passed

◆ dwLightSourceDetector_setCUDAStream()

DW_API_PUBLIC dwStatus dwLightSourceDetector_setCUDAStream ( cudaStream_t  stream,
dwLightSourceDetectorHandle_t  obj 
)

Sets the CUDA stream used.

Parameters
[in]streamThe CUDA stream used.
[in]objA pointer to the LightSourceDetector handle that is updated.
Returns
DW_SUCCESS operation completed successfully DW_INVALID_ARGUMENT null handle passed