# Image Sensor Capture Best Practice

**URL:** <https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902>\
**Category:** DRIVE AGX Xavier General\
**Tags:** driveworks-cameras\
**Created:** [September 23, 2022, 10:14pm UTC](https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902 "2022-09-23T22:14:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.honey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@michael.honey](https://forums.developer.nvidia.com/u/michael.honey)\
**Post date:** [September 23, 2022, 10:14pm UTC](https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902/1 "2022-09-23T22:14:55Z")

</div>

Please provide the following info (check/uncheck the boxes after creating this topic):  
**Software Version**  
 DRIVE OS Linux 5.2.6  
 DRIVE OS Linux 5.2.6 and DriveWorks 4.0  
 DRIVE OS Linux 5.2.0  
 DRIVE OS Linux 5.2.0 and DriveWorks 3.5  
 NVIDIA DRIVE™ Software 10.0 (Linux)  
 NVIDIA DRIVE™ Software 9.0 (Linux)  
 other DRIVE OS version  
 other

**Target Operating System**  
 Linux  
 QNX  
 other

**Hardware Platform**  
 NVIDIA DRIVE™ AGX Xavier DevKit (E3550)  
 NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)  
 other

**SDK Manager Version**  
 1.8.3.10426  
 other

**Host Machine Version**  
 native Ubuntu 18.04  
 other

I’m looking for best practice advice. I’m concerned mainly with power consumption and effective processor utilization. I didn’t find details on this in the NvMedia documentation, the SIPL documentation, or sample source code.

I’m bringing camera data in from 11 cameras to a Drive AGX Xavier. This data is then published to an AI algorithm. I noticed in the documentation for NvMedia, the getImage function is a blocking function. I presume this means that the function does not return until a new frame has arrived since the last call. What is the best practice for pulling this data in without locking the processor from the interpretation of other sensor data?

Should each image sensor processing be launched on its own thread prior to a call to this function? What are other concerns to keep in mind?

Below is a snippet from the getImage function documentation:

 ![image](https://global.discourse-cdn.com/nvidia/original/3X/a/8/a824c18e5dfc24ec9e9607970bb6fb6fe228208e.png)

Any help is appreciated  
Thanks!

---

<div class="post-metadata">

**Author:** ![SivaRamaKrishnaNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sivaramakrishnanv/32/14043_2.png) [@SivaRamaKrishnaNV](https://forums.developer.nvidia.com/u/SivaRamaKrishnaNV)\
**Post date:** [September 26, 2022, 4:50pm UTC](https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902/3 "2022-09-26T16:50:29Z")

</div>

Dear @michael.honey,  
Did you check DW `sample_camera` sample for your use case? You need to update the rig file as per your need.

---

<div class="post-metadata">

**Author:** ![michael.honey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@michael.honey](https://forums.developer.nvidia.com/u/michael.honey)\
**Post date:** [September 27, 2022, 12:11am UTC](https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902/4 "2022-09-27T00:11:20Z")

</div>

Yes. sample\_camera executes a for loop that iterates over each camera for every frame render. However, this application is not processing the image data beyond changing its format and rendering it. This approach doesn’t seem well-suited to maximizing useful computation and minimizing power-usage. Is there a way to receive something like an event driven callback that can trigger computation?

Thanks

---

<div class="post-metadata">

**Author:** ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)\
**Post date:** [September 28, 2022, 10:11pm UTC](https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902/5 "2022-09-28T22:11:49Z")

</div>

Hi @michael.honey  
Please check [dwSensorCamera\_getImageAsync()](https://docs.nvidia.com/drive/driveworks-4.0/group __camera__ group.html#gadef0f9592afdd562a21f87ac9ea9910d) and the camera module [document](https://docs.nvidia.com/drive/driveworks-4.0/camera_mainsection.html), and see if it helps your case. Thanks.

---

<div class="post-metadata">

**Author:** ![michael.honey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@michael.honey](https://forums.developer.nvidia.com/u/michael.honey)\
**Post date:** [October 12, 2022, 5:58pm UTC](https://forums.developer.nvidia.com/t/image-sensor-capture-best-practice/228902/6 "2022-10-12T17:58:03Z")

</div>

I’ll dwSensorCamera\_getImageAsync() experiment with that. Thank you VickNV!
