-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOW-TO] get current value of Brightness, Contrast, etc #168
Comments
These are runtime controls and so they apply to particular images from the camera. The trouble is that there's quite a long pipeline between sending values, the camera or ISP seeing them, doing something about them, and then you getting frames back which reflect them (and are all sat in a queue waiting to be read). If you want to monitor the settings every second, for example, you could do
You can also capture an entire "request" which includes all the images and settings from the camera, for example you'd amend the example above with
Picamera2 itself doesn't keep track of all the most recent values you sent. If that's what you wanted, you'd have to do it yourself:
Hope that helps! |
Help was appreciated! I'm converting an already existing IP camera based on raspberry, which went from USB camera device I'm new to PiCamera2 and overall in libcamera lib so I need to learn step by step how to migrate I don't need to read continuously the cap properties but:
Then when a cap (camera controls states) is necessary to change (human activity on UI) |
Solved keeping local dict of applied properties |
I'm using Raspberry Pi4 Bullseye with PiCamera2 (IMX219) which is used as a remote camera and receive commands
from TCP socket and send back frames using UDP to another computer.
I was able to change camera controls with TCP Commands using camera.set_controls() but I was not able to
understand how to retrieve the actual value for example of Brightness necessary to update a trackbar which
regulate the current value of Brightness, Contrast, and Sharpness.
`
def command_set_cap(data):
`
Reading back camera.controls I can have ONLY the limits and default for needed camera options:
`
print(self.__camera.camera_controls)
{
'FrameDurationLimits': (1000, 1000000000, 0),
'ColourCorrectionMatrix': (-16.0, 16.0, 0),
'NoiseReductionMode': (0, 4, 0),
'Contrast': (0.0, 32.0, 1.0),
'AwbMode': (0, 7, 0),
'ScalerCrop': ((0, 0, 0, 0), (65535, 65535, 65535, 65535), (0, 0, 0, 0)),
'AwbEnable': (False, True, 0),
'ExposureValue': (-8.0, 8.0, 0.0),
'ColourGains': (0.0, 32.0, 0),
'AeExposureMode': (0, 3, 0),
'Sharpness': (0.0, 16.0, 1.0),
'Brightness': (-1.0, 1.0, 0.0),
'AeConstraintMode': (0, 3, 0),
'AeMeteringMode': (0, 3, 0),
'AnalogueGain': (1.0, 32.0, 0),
'Saturation': (0.0, 32.0, 1.0),
'ExposureTime': (0, 999999, 0),
'AeEnable': (False, True, 0)
}
`
The text was updated successfully, but these errors were encountered: