From a16c54d2dbb540aebe9df439283b7a00871b4513 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 14 Feb 2024 18:03:13 +0000 Subject: [PATCH] Update raw image processing in scan This matches recent commits in labthings-picamera2 --- src/openflexure_microscope_server/things/smart_scan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index b03c2d93..807e869a 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -549,8 +549,8 @@ class SmartScanThing(Thing): Cb = np.array(lst["Cb"]) gr, gb = cam.colour_gains G = 1/lum - R = 1/lum/Cr/gr - B = 1/lum/Cb/gb + R = G/Cr/gr*np.min(Cr) # The extra /np.max(Cr) emulates the quirky handling of Cr in + B = G/Cb/gb*np.min(Cb) # the picamera2 pipeline white_norm_lores = np.stack([R, G, B], axis=2) zoom_factors = [i/n for i, n in zip(rgb[...,:3].shape, white_norm_lores.shape)] white_norm = zoom(white_norm_lores, zoom_factors, order=1)[:rgb.shape[0], :rgb.shape[1], :] # Could use some work