libcamera/utils/raspberrypi/ctt
David Plowman 36ba0e5515 utils: raspberrypi: ctt: Fix NaNs in lens shading tables
The problem occurs when the calculation could lead to a final row (or
column) of grid squares with no pixels in them (and hence, NaNs).

One specific case is a Pi 5 with an image width (or height) of 1364,
so that's 682 Bayer quads. To give 32 grid squares it was calculating
22 quads per cell. However, 31 * 22 = 682 leaving nothing in the final
column.

The fix is to do a rounding-down division by the number of cells minus
one, rather than a rounding-up division by the number of cells. This
turns the corner case from one where the final row/column has no
pixels to one where we don't quite cover the full image, which is how
we have to handle these cases.

Bug: https://github.com/raspberrypi/libcamera/issues/254
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-04-29 16:14:48 +01:00
..
alsc_only.py utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP 2024-06-13 11:02:26 +01:00
cac_only.py utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP 2024-06-13 11:02:26 +01:00
colors.py libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
convert_tuning.py utils: raspberrypi: ctt: Add option to convert between vc4/pisp targets 2024-06-13 11:02:39 +01:00
ctt.py utils: raspberrypi: ctt: Add a maximum gain parameter for LSC 2024-06-13 11:02:39 +01:00
ctt_alsc.py utils: raspberrypi: ctt: Fix NaNs in lens shading tables 2025-04-29 16:14:48 +01:00
ctt_awb.py utils: raspberrypi: ctt: Adapt tuning tool for both VC4 and PiSP 2024-06-13 10:13:33 +01:00
ctt_cac.py utils: raspberrypi: ctt: Added CAC support to the CTT 2024-06-13 11:02:16 +01:00
ctt_ccm.py utils: raspberrypi: ctt: Adapt tuning tool for both VC4 and PiSP 2024-06-13 10:13:33 +01:00
ctt_config_example.json utils: raspberrypi: ctt: Add a maximum gain parameter for LSC 2024-06-13 11:02:39 +01:00
ctt_dots_locator.py utils: raspberrypi: ctt: Added CAC support to the CTT 2024-06-13 11:02:16 +01:00
ctt_geq.py libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
ctt_image_load.py utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP 2024-06-13 11:02:26 +01:00
ctt_lux.py libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
ctt_macbeth_locator.py libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
ctt_noise.py libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
ctt_pisp.py utils: raspberrypi: ctt: Update tuning tool for HDR 2024-06-13 11:02:38 +01:00
ctt_pretty_print_json.py utils: raspberrypi: ctt: Update tuning tool for HDR 2024-06-13 11:02:38 +01:00
ctt_ransac.py libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
ctt_ref.pgm libcamera: utils: Raspberry Pi Camera Tuning Tool 2020-05-11 23:54:45 +03:00
ctt_tools.py utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP 2024-06-13 11:02:26 +01:00
ctt_vc4.py utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP 2024-06-13 11:02:26 +01:00
ctt_visualise.py utils: raspberrypi: ctt: Improved color matrix fitting 2023-07-28 08:31:38 +01:00