Closed Gordon999 closed 1 month ago
I wonder if you've reused controls
as a variable, pointing to a dictionary object? (Yes, I've done that!)
So maybe
import libcamera
...
picam2.set_controls({"AeEnable": True,"AeExposureMode": libcamera.controls.AeExposureModeEnum.Normal})
Excellent, thankyou.
The picamera2 hailo example I based my code on uses..
controls = {'FrameRate': 30} config = picam2.create_preview_configuration(main, lores=lores, controls=controls)
so I have renamed 'controls' and my code now works
Solved
Describe the bug Using https://github.com/raspberrypi/picamera2/blob/main/examples/hailo/detect.py and trying to send controls to the camera. It fails as shown below
To Reproduce from libcamera import controls picam2.set_controls({"AeEnable": True,"AeExposureMode": controls.AeExposureModeEnum.Normal}) AttributeError: 'dict' object has no attribute 'AeExposureModeEnum'
Expected behaviour I expect the camera to switch Mode
Console Output, Screenshots picam2.set_controls({"AeEnable": True,"AeExposureMode": controls.AeExposureModeEnum.Normal}) AttributeError: 'dict' object has no attribute 'AeExposureModeEnum'
hardware: Pi5, hailo, pi v3 camera