diff --git a/ocv_rpicam.py b/ocv_rpicam.py index 21930d7..8793833 100755 --- a/ocv_rpicam.py +++ b/ocv_rpicam.py @@ -94,14 +94,18 @@ def process(request): cv2.putText(m.array, timestamp, (0, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) 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 - 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 - 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 - 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} gain_keys = {'h': -1, 'j': 1} diff --git a/settings.json b/settings.json index fd4f37c..856f5fa 100755 --- a/settings.json +++ b/settings.json @@ -2,8 +2,8 @@ "AeEnable": 0, "AwbEnable": 0, "NoiseReductionMode": 0, -"ExposureTime": 20007, -"AnalogueGain": 9.0, -"FrameRate": 16, +"ExposureTime": 29, +"AnalogueGain": 64.0, +"FrameRate": 1, "AeExposureMode": 0 } \ No newline at end of file