From 893e8e935723ae7ba926f45972f30c52c0f2a6b9 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 9 Sep 2020 17:25:31 +0100 Subject: [PATCH] Calibrate with greyworld AWB if available --- .../picamera_autocalibrate/recalibrate_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py b/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py index 91c5f3bb..ea9f0213 100644 --- a/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py +++ b/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py @@ -42,7 +42,12 @@ def adjust_exposure_to_setpoint(camera, setpoint): def auto_expose_and_freeze_settings(camera): """Freeze the settings after auto-exposing to white illumination""" logging.info("Allowing the camera to auto-expose") - camera.awb_mode = "auto" + if "greyworld" in camera.AWB_MODES: + print("Calibrating with greyworld AWB") + camera.awb_mode = "greyworld" + else: + print("Calibrating with auto AWB") + camera.awb_mode = "auto" camera.exposure_mode = "auto" camera.iso = ( 0