- added display of gain metadata and frame duration limits

This commit is contained in:
2024-07-16 08:01:02 +02:00
parent 4c65e0d86a
commit 5e3fe05f4d
2 changed files with 10 additions and 6 deletions
+7 -3
View File
@@ -94,14 +94,18 @@ def process(request):
cv2.putText(m.array, timestamp, (0, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) cv2.putText(m.array, timestamp, (0, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)
if metadata is not None: if metadata is not None:
fontsize = 0.8
# Display gains
cv2.putText(m.array, f"AnalogueGain : {metadata.AnalogueGain:.1f}, DigitalGain: {metadata.DigitalGain:.1f}, set: {gain}", (20, m.array.shape[0] - 110), cv2.FONT_HERSHEY_SIMPLEX, fontsize, (0, 240, 0), 2)
# Display exposure time # Display exposure time
cv2.putText(m.array, f"ExposureTime : {metadata.ExposureTime:.1f}/{shutter:.1f}", (20, m.array.shape[0] - 80), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 240, 0), 2) cv2.putText(m.array, f"ExposureTime : {metadata.ExposureTime:.1f}, set: {shutter:.1f}", (20, m.array.shape[0] - 80), cv2.FONT_HERSHEY_SIMPLEX, fontsize, (0, 240, 0), 2)
# Display frame time # Display frame time
cv2.putText(m.array, f"FrameDuration : {metadata.FrameDuration:.1f}", (20, m.array.shape[0] - 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 240, 0), 2) cv2.putText(m.array, f"FrameDuration : {metadata.FrameDuration:.1f}, limits: ({picam2.camera_controls['FrameDurationLimits'][0]}, {picam2.camera_controls['FrameDurationLimits'][1]})", (20, m.array.shape[0] - 50), cv2.FONT_HERSHEY_SIMPLEX, fontsize, (0, 240, 0), 2)
# Display FPS on frame # Display FPS on frame
cv2.putText(m.array, f"Frame rate : {fps_ist:.1f}/{fps_soll:.1f}", (20, m.array.shape[0] - 20), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 240, 0), 2) cv2.putText(m.array, f"Frame rate : {fps_ist:.1f}, set: {fps_soll:.1f}", (20, m.array.shape[0] - 20), cv2.FONT_HERSHEY_SIMPLEX, fontsize, (0, 240, 0), 2)
shutter_keys = {'w': -1000, 's': -100, 'x': -1, 'e': 1000, 'd': 100, 'c': 1} shutter_keys = {'w': -1000, 's': -100, 'x': -1, 'e': 1000, 'd': 100, 'c': 1}
gain_keys = {'h': -1, 'j': 1} gain_keys = {'h': -1, 'j': 1}
+3 -3
View File
@@ -2,8 +2,8 @@
"AeEnable": 0, "AeEnable": 0,
"AwbEnable": 0, "AwbEnable": 0,
"NoiseReductionMode": 0, "NoiseReductionMode": 0,
"ExposureTime": 20007, "ExposureTime": 29,
"AnalogueGain": 9.0, "AnalogueGain": 64.0,
"FrameRate": 16, "FrameRate": 1,
"AeExposureMode": 0 "AeExposureMode": 0
} }