DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Camera Workflow

Initialize the Sensor Abstraction Layer

dwSAL_initialize(&sal, sdk);

Initialize the parameter string for a camera sensor, in this case we request a processed image (yuv), a camera ar0231-rccb with sf3324 module and BAE exposure type at group C. We specify a gmsl protocol and create the sensor

dwSensor cameraSensor = DW_NULL_HANDLE;
params.parameters = "output-format=yuv,camera-type=ar0231-rccb-bae-sf3324,camera-group=c";
params.protocol = "camera.gmsl";
dwSAL_createSensor(&cameraSensor, params, sal);

after starting the sensor, the camera will start acquiring frames

while(loop) {

We read a frame, which is stored as a dwCameraFrameHandle_t and specify a timeout value in microseconds

...
dwTime_t timeout = 33000;
dwSensorCamera_readFrame(&frameHandle, timeout, cameraSensor);
...

many outputs can be return after reading, the only extra cost are eventual streaming and conversion, depending on the output chosen. Also the output type is influenced by how we created the camera. Since we specified processed image (yuv), we can request a processed image as output. In order to know what properties such an image has, it is possible to call dwSensorCamera_getImageProperties() with dwCameraOutputType equal to DW_CAMERA_OUTPUT_NATIVE_PROCESSED.

...
dwImageHandle_t imageNative;
dwSensorCamera_getImage(&imageNative, DW_CAMERA_IMAGE_OUTPUT_NATIVE_PROCESSED,...);
dwImageHandle_t imageCUDA_RGBA;
dwSensorCamera_getImage(&imageCUDA_RGBA, DW_CAMERA_IMAGE_OUTPUT_CUDA_RGBA,...);
// CODE: use imageNative (maybe send to serializer)
// CODE: use imageCUDA_RGBA
...

return frames to the fifo

stop the sensor and release

dwSAL_releaseSensor(&cameraSensor);

For more details see: