[PATCH v3 21/23] libtuning: lsc: rkisp1: Do not calculate ratios to green
Stefan Klug
stefan.klug at ideasonboard.com
Wed Jul 3 16:17:10 CEST 2024
The current LSC algorithm for the rkisp1 just forwards the LSC tables to
the hardware, so absolute factors are needed and not ratios compared to
green. Therefore every channel needs to be calculated independently.
Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>
---
utils/tuning/libtuning/modules/lsc/rkisp1.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/utils/tuning/libtuning/modules/lsc/rkisp1.py b/utils/tuning/libtuning/modules/lsc/rkisp1.py
index 512233aeae9d..56df23ec7b42 100644
--- a/utils/tuning/libtuning/modules/lsc/rkisp1.py
+++ b/utils/tuning/libtuning/modules/lsc/rkisp1.py
@@ -38,8 +38,12 @@ class LSCRkISP1(LSC):
# \todo Should these ratio against the average of both greens or just
# each green like we've done here?
- cr, _ = self._lsc_single_channel(image.channels[lt.Color.R], image, gr)
- cb, _ = self._lsc_single_channel(image.channels[lt.Color.B], image, gb)
+
+ # The LSC tables in the our rkisp1 algorithm represent gains on the
+ # corresponding channel, not ratios with respect to green, so calculate
+ # them independently
+ cr, _ = self._lsc_single_channel(image.channels[lt.Color.R], image, None)
+ cb, _ = self._lsc_single_channel(image.channels[lt.Color.B], image, None)
return image.color, cr.flatten(), cb.flatten(), cgr.flatten(), cgb.flatten()
--
2.43.0
More information about the libcamera-devel
mailing list