diff --git a/src/openflexure_microscope_server/things/camera/picamera.py b/src/openflexure_microscope_server/things/camera/picamera.py index 40ad6bda..29afc35b 100644 --- a/src/openflexure_microscope_server/things/camera/picamera.py +++ b/src/openflexure_microscope_server/things/camera/picamera.py @@ -640,7 +640,8 @@ class StreamingPiCamera2(BaseCamera): :param target_white_level: Raw target white level, this should be an integer within the range set by the bit-depth of the camera sensor (10-bit for PiCamera v2, 12 Bit for Picamera HQ. If None the default will be used for - the current sensor. This is approximately 70% saturated. + the current sensor. This is approximately 40% saturated, but after gamma + curve is applied, the pixel values will have a value around 200. :param percentile: The percentile to use instead of maximum. Default 99.9. When calculating the brightest pixel, a percentile is used rather than the maximum in order to be robust to a small number of noisy/bright pixels. diff --git a/src/openflexure_microscope_server/things/camera/picamera_recalibrate_utils.py b/src/openflexure_microscope_server/things/camera/picamera_recalibrate_utils.py index 77175f11..0a5637ab 100644 --- a/src/openflexure_microscope_server/things/camera/picamera_recalibrate_utils.py +++ b/src/openflexure_microscope_server/things/camera/picamera_recalibrate_utils.py @@ -120,10 +120,11 @@ def adjust_shutter_and_gain_from_raw( :param camera: A Picamera2 object. :param target_white_level: The raw value we aim for, the raw value of the brightest pixels should be approximately this bright. The value to set depends on the - sensor bit depth. We recommend values of 700 for 10-bit sensors and 2800 for - 12-bit sensors. This is about 70% of saturated once the blacklevel is + sensor bit depth. We recommend values of 400 for 10-bit sensors and 1600 for + 12-bit sensors. This is about 40% of saturated once the blacklevel is subtracted. The maximum possible value depends on the sensor bit depth, the - sensor blacklevel and the tolerance argument. + sensor blacklevel and the tolerance argument. While this only uses 40% of the + sensor range, after gamma this corresponds to pixel value ~200. :param max_iterations: We will terminate once we perform this many iterations, whether or not we converge. More than 10 shouldn't happen. :param tolerance: How close to the target value we consider "done". Expressed as a