DriveWorks SDK Reference
3.0.4260 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  dwLightSourceDetectorOutput
 
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

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_processLightSourcePipeline (dwLightSourceDetectorOutput *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_setCUDAStream (cudaStream_t stream, dwLightSourceDetectorHandle_t obj)
 Sets the CUDA stream used. More...
 

Data Structure Documentation

◆ dwLightSourceDetectorOutput

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

◆ dwLightSourceDetectorParams

struct dwLightSourceDetectorParams
Data Fields
bool enablePostProcCPUTest Enable CPU post processing code for sanity/unit test or not. Default off.
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.

float32_t threshold[DW_LIGHTSOURCE_CLASS_COUNT] Class detection thresholds.

Typedef Documentation

◆ dwLightSourceDetectorHandle_t

typedef struct dwLightSourceDetectorObject* dwLightSourceDetectorHandle_t

Handle to an object detector.

Definition at line 65 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 67 of file LspDetector.h.

Function Documentation

◆ 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_processLightSourcePipeline()

DW_API_PUBLIC dwStatus dwLightSourceDetector_processLightSourcePipeline ( dwLightSourceDetectorOutput 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_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