raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
891 stars 188 forks source link

devices: imx708: Add a new IMX708 helper class #1093

Closed naushir closed 2 months ago

naushir commented 3 months ago

This class provides a convenient helper function set enable/disable sensor HDR mode without relying on external tools. Usage example:

from picamera2.devices.imx708 import IMX708
from picamera2 import Picamera2

camera_num = 0
c = IMX708(camera_num)
c.set_hdr_mode(True)
picam2 = Picamera2(camera_num)

Note that after calling IMX708.set_hdr_mode(), you must re-initialise the Picamera2 instance.

A change to the CameraManager class is also needed to allow it to be reset as it caches sensor modes internally in libcamera.

davidplowman commented 3 months ago

Thanks, Naush. Just a couple of general observations... firstly, we should fix the flake8 complaints, and secondly, could we maybe add some kind of a test for this? We could even make it an example - "here's how you handle an imx708".