From 17e41b2a3a144a80e60f28e15a4c2aaa42c87105 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Mon, 28 Apr 2025 11:36:04 +0100 Subject: utils: raspberrypi: ctt: Fix NaNs in chromatic aberration tables NaNs can appear if no black dots can be found and analysed in a particular region of the calibration image. There needs to be at least one such dot in every 8x8 cell covering the image. This is now detected, and an error message issued. No CAC tables are generated, so CAC is disabled. Bug: https://github.com/raspberrypi/libcamera/issues/254 Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Acked-by: Kieran Bingham Signed-off-by: Kieran Bingham --- utils/raspberrypi/ctt/ctt.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'utils/raspberrypi/ctt/ctt.py') diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py index 96f1b5e6..186afda5 100755 --- a/utils/raspberrypi/ctt/ctt.py +++ b/utils/raspberrypi/ctt/ctt.py @@ -198,9 +198,12 @@ class Camera: """ Write output to json """ - self.json['rpi.cac']['cac'] = cacs - self.log += '\nCAC calibration written to json file' - print('Finished CAC calibration') + if cacs: + self.json['rpi.cac']['cac'] = cacs + self.log += '\nCAC calibration written to json file' + print('Finished CAC calibration') + else: + self.log += "\nCAC calibration failed" """ -- cgit v1.2.1