1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page camera_usecase1 Camera Workflow
5 Initialize the Sensor Abstraction Layer
8 dwSAL_initialize(&sal, sdk);
11 Initialize the parameter string for a camera sensor, in this case we request a processed image (yuv), a camera
12 ar0231-rccb with sf3324 module and BAE exposure type at group C. We specify a gmsl protocol and create the sensor
15 dwSensor cameraSensor = DW_NULL_HANDLE;
16 dwSensorParams params;
17 params.parameters = "output-format=yuv,camera-type=ar0231-rccb-bae-sf3324,camera-group=c";
18 params.protocol = "camera.gmsl";
19 dwSAL_createSensor(&cameraSensor, params, sal);
22 after starting the sensor, the camera will start acquiring frames
30 We read a frame, which is stored as a `::dwCameraFrameHandle_t` and specify a timeout value in microseconds
34 dwCameraFrameHandle_t frameHandle = DW_NULL_HANDLE;
35 dwTime_t timeout = 33000;
36 dwSensorCamera_readFrame(&frameHandle, timeout, cameraSensor);
40 many outputs can be return after reading, the only extra cost are eventual streaming and conversion, depending
41 on the output chosen. Also the output type is influenced by how we created the camera. Since we specified
42 processed image (yuv), we can request a processed image as output. In order to know what properties such an image has,
43 it is possible to call `dwSensorCamera_getImageProperties()`
44 with `::dwCameraOutputType` equal to `::DW_CAMERA_OUTPUT_NATIVE_PROCESSED`.
48 dwImageHandle_t imageNative;
49 dwSensorCamera_getImage(&imageNative, DW_CAMERA_IMAGE_OUTPUT_NATIVE_PROCESSED,...);
50 dwImageHandle_t imageCUDA_RGBA;
51 dwSensorCamera_getImage(&imageCUDA_RGBA, DW_CAMERA_IMAGE_OUTPUT_CUDA_RGBA,...);
53 // CODE: use imageNative (maybe send to serializer)
54 // CODE: use imageCUDA_RGBA
58 return frames to the fifo
62 dwSensorCamera_returnFrame(...);
66 stop the sensor and release
70 dwSAL_releaseSensor(&cameraSensor);
74 - @ref dwx_camera_sample