DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Camera Blindness Detection Interface

Detailed Description

Detect regions in the view which are blocked.

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

Data Structures

struct  dwBlindnessDetectionOutput
 Holds the outputs for ClearSightNet. More...
 
struct  dwBlindnessDetectorParams
 Holds init params for Blindness Detector. More...
 

Macros

#define DW_CLEARSIGHTNET_DETECTOR_MAX_IMAGES   16
 Maximum number of images to run detector on. More...
 
#define DW_CLEARSIGHTNET_NUM_MAX_REGIONS   8
 Number of sub-regions in each direction. More...
 
#define DW_CLEARSIGHTNET_NUM_OUTPUT_CHANNELS   3
 Number of ClearSightNet output channels. More...
 

Typedefs

typedef struct dwBlindnessDetectorObject * dwBlindnessDetectorHandle_t
 Handle to a BlindnessDetector. More...
 

Functions

DW_API_PUBLIC dwStatus dwBlindnessDetector_detect (const dwImageCUDA *inputImage, dwBlindnessDetectorHandle_t handle)
 Runs asynchronous inference using the provided DNN model. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_getCUDAStream (cudaStream_t *stream, dwBlindnessDetectorHandle_t handle)
 Gets CUDA stream used by the Blindness detection. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_getOutput (dwBlindnessDetectionOutput *output, dwBlindnessDetectorHandle_t handle)
 Return a blindness detection output. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_initDefaultParams (dwBlindnessDetectorParams *params)
 Initializes default parameters for Blindness detector module. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_initialize (dwBlindnessDetectorHandle_t *handle, const dwBlindnessDetectorParams *params, dwContextHandle_t ctx)
 Initializes a Blindness detector module. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_release (dwBlindnessDetectorHandle_t handle)
 Releases the Blindness detector module. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_reset (dwBlindnessDetectorHandle_t handle)
 Resets the Blindness detector module. More...
 
DW_API_PUBLIC dwStatus dwBlindnessDetector_setCUDAStream (cudaStream_t stream, dwBlindnessDetectorHandle_t handle)
 Sets the CUDA stream for CUDA related operations. More...
 

Data Structure Documentation

◆ dwBlindnessDetectionOutput

struct dwBlindnessDetectionOutput
Data Fields
float32_t blindnessRatio Overall blindness ratio value (between 0 and 1)
float32_t fullBlindRatio Full blindness ratio value (between 0 and 1).
dwImageHandle_t mask RGBA mask (of same size as output blob) with multiple class information encoded into different channels.
uint8_t numRegionsX number of region dividers in X
uint8_t numRegionsY number of region dividers in Y
float32_t partBlindRatio Partial blindness ratio value (between 0 and 1).
float32_t regionBlindnessRatio[DW_CLEARSIGHTNET_NUM_MAX_REGIONS][DW_CLEARSIGHTNET_NUM_MAX_REGIONS] overall blindness ratios for each sub-region
float32_t regionDividersX[DW_CLEARSIGHTNET_NUM_MAX_REGIONS - 1] region dividers in X (in output blob pixels)
float32_t regionDividersY[DW_CLEARSIGHTNET_NUM_MAX_REGIONS - 1] region dividers in Y (in output blob pixels)
float32_t regionFullBlindRatio[DW_CLEARSIGHTNET_NUM_MAX_REGIONS][DW_CLEARSIGHTNET_NUM_MAX_REGIONS] full blindness ratios for each sub-region
float32_t regionPartBlindRatio[DW_CLEARSIGHTNET_NUM_MAX_REGIONS][DW_CLEARSIGHTNET_NUM_MAX_REGIONS] partial blindness ratios for each sub-region

◆ dwBlindnessDetectorParams

struct dwBlindnessDetectorParams
Data Fields
dwClearSightNetHandle_t clearSightNetHandle handle to ClearSightNet DNN module
uint8_t numRegionsX number of region dividers in X
uint8_t numRegionsY number of region dividers in Y
float32_t regionDividersX[DW_CLEARSIGHTNET_NUM_MAX_REGIONS - 1] region dividers in X (in image fractions)
float32_t regionDividersY[DW_CLEARSIGHTNET_NUM_MAX_REGIONS - 1] region dividers in Y (in image fractions)
uint32_t temporalFilterWindow num frames over which to temporally filter blindness ratio

Macro Definition Documentation

◆ DW_CLEARSIGHTNET_DETECTOR_MAX_IMAGES

#define DW_CLEARSIGHTNET_DETECTOR_MAX_IMAGES   16

Maximum number of images to run detector on.

Definition at line 63 of file BlindnessDetector.h.

◆ DW_CLEARSIGHTNET_NUM_MAX_REGIONS

#define DW_CLEARSIGHTNET_NUM_MAX_REGIONS   8

Number of sub-regions in each direction.

Definition at line 69 of file BlindnessDetector.h.

◆ DW_CLEARSIGHTNET_NUM_OUTPUT_CHANNELS

#define DW_CLEARSIGHTNET_NUM_OUTPUT_CHANNELS   3

Number of ClearSightNet output channels.

Definition at line 66 of file BlindnessDetector.h.

Typedef Documentation

◆ dwBlindnessDetectorHandle_t

typedef struct dwBlindnessDetectorObject* dwBlindnessDetectorHandle_t

Handle to a BlindnessDetector.

Definition at line 108 of file BlindnessDetector.h.

Function Documentation

◆ dwBlindnessDetector_detect()

DW_API_PUBLIC dwStatus dwBlindnessDetector_detect ( const dwImageCUDA inputImage,
dwBlindnessDetectorHandle_t  handle 
)

Runs asynchronous inference using the provided DNN model.

The inference pipeline is as follows:

  1. DataPreparation: Input images are prepared by scaling, padding and other transformations set in dataConditionerParams at initialization time in order to have the right properties required by the DNN. If the given DNN model expects batched input, the given images are divided into batches, where each batch has the expected batch size.
  2. Inference: Inference is run on the prepared image in an asynchronous fashion. This means that an inference call can be queued using dwBlindnessDetector_detect() and then other computation can be performed and dwBlindnessDetector_getOutput(), whenever called, will automatically wait for inference to finish before returning the output.
Parameters
[in]inputImageImage where the detector is to be applied.
[in]handleSpecifies the BlindnessDetector handle.
Returns
DW_SUCCESS
DW_INVALID_HANDLE -If the given context handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
DW_INVALID_ARGUMENT
Deprecated:
Will be removed. please consider using BlindnessDetector_processPipeline apis dwBlindnessDetector_bindInput(), dwBlindnessDetector_bindOutput(), dwBlindnessDetector_process() or dwBlindnessDetector_processDLA()

◆ dwBlindnessDetector_getCUDAStream()

DW_API_PUBLIC dwStatus dwBlindnessDetector_getCUDAStream ( cudaStream_t *  stream,
dwBlindnessDetectorHandle_t  handle 
)

Gets CUDA stream used by the Blindness detection.

Parameters
[out]streamThe CUDA stream currently used.
[in]handleA handle to the BlindnessDetector module.
Returns
DW_INVALID_HANDLE - If the given context handle is invalid,i.e. null or of wrong type
DW_SUCCESS

◆ dwBlindnessDetector_getOutput()

DW_API_PUBLIC dwStatus dwBlindnessDetector_getOutput ( dwBlindnessDetectionOutput output,
dwBlindnessDetectorHandle_t  handle 
)

Return a blindness detection output.

Parameters
[out]outputStruct encoding blindness detection output
[in]handleA BlindnessDetector handle
Returns
DW_INVALID_HANDLE - If the given context handle is invalid,i.e. null or of wrong type
DW_BAD_CAST - If cannot cast the given handle to the expected type.
DW_SUCCESS
Deprecated:
Will be removed. please consider using BlindnessDetector_processPipeline apis dwBlindnessDetector_bindInput(), dwBlindnessDetector_bindOutput(), dwBlindnessDetector_process() or dwBlindnessDetector_processDLA()

◆ dwBlindnessDetector_initDefaultParams()

DW_API_PUBLIC dwStatus dwBlindnessDetector_initDefaultParams ( dwBlindnessDetectorParams params)

Initializes default parameters for Blindness detector module.

Parameters
[out]paramsBlindnessDetector parameters.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT
Note
Default precision depends on the current GPU.

◆ dwBlindnessDetector_initialize()

DW_API_PUBLIC dwStatus dwBlindnessDetector_initialize ( dwBlindnessDetectorHandle_t handle,
const dwBlindnessDetectorParams params,
dwContextHandle_t  ctx 
)

Initializes a Blindness detector module.

Parameters
[out]handleA pointer to the Blindness detection algorithm.
[in]paramsStruct encoding config parameters.
[in]ctxSpecifies the handler to the context to create BlindnessNet.
Returns
DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwBlindnessDetector_release()

DW_API_PUBLIC dwStatus dwBlindnessDetector_release ( dwBlindnessDetectorHandle_t  handle)

Releases the Blindness detector module.

Parameters
[in]handleThe object handle to release.
Returns
DW_INVALID_HANDLE - If the given context handle is invalid,i.e. null or of wrong type
DW_BAD_CAST - If cannot cast the given handle to the expected type.
DW_SUCCESS
Note
This method renders the handle unusable.

◆ dwBlindnessDetector_reset()

DW_API_PUBLIC dwStatus dwBlindnessDetector_reset ( dwBlindnessDetectorHandle_t  handle)

Resets the Blindness detector module.

Parameters
[in]handleSpecifies the detector to reset.
Returns
DW_INVALID_HANDLE - If the given context handle is invalid, i.e. null or of wrong type
DW_BAD_CAST - If cannot cast the given handle to the expected type.
DW_SUCCESS

◆ dwBlindnessDetector_setCUDAStream()

DW_API_PUBLIC dwStatus dwBlindnessDetector_setCUDAStream ( cudaStream_t  stream,
dwBlindnessDetectorHandle_t  handle 
)

Sets the CUDA stream for CUDA related operations.

Note
The ownership of the stream remains by the callee.
Parameters
[in]streamThe CUDA stream to be used. Default is the one passed during initialization.
[in]handleA handle to the BlindnessDetector module for which to set CUDA stream.
Returns
DW_INVALID_HANDLE - If the given context handle is invalid,i.e. null or of wrong type
DW_SUCCESS