I'm building myself a QT-based camera controlUI. I want to be able to read the state of camera controls after setting them to confirm that the settings have changed. I've read "The Picamera2 Library" pdf and don't see a simple way to get the values. Here's my current path I'm on, which seems a little awkward. Is there a better way?
I create a Picamera2 object called picam2, create a config, and maybe set some camera controls.
I look at picam2.camera_config["controls"], which gives me a dictionary of controls that have been set. If I print this, I can see the controls that have been set. When I iterate through the dictionary items the type returned is variable, Some are standard python types but many are Libcamera controls. enumerations. For these enums, I can use their .value property to get the value.
So programatically, need to iterate on the keys in the picam2.camera_config["controls"] directory, then parse for known data_types (bool, int, tuple,etc), then assume the rest are the libcamera enum types that have a .value property.
Is this "the easy way"?
I create a Picamera2 object called picam2, create a config, and maybe set some camera controls.
I look at picam2.camera_config["controls"], which gives me a dictionary of controls that have been set. If I print this, I can see the controls that have been set. When I iterate through the dictionary items the type returned is variable, Some are standard python types but many are Libcamera controls. enumerations. For these enums, I can use their .value property to get the value.
So programatically, need to iterate on the keys in the picam2.camera_config["controls"] directory, then parse for known data_types (bool, int, tuple,etc), then assume the rest are the libcamera enum types that have a .value property.
Is this "the easy way"?
Statistics: Posted by mikeabuilder — Sat Oct 19, 2024 8:54 pm — Replies 0 — Views 19