[PATCH v2 13/17] utils: tuning: rkisp1: Add lux module

Paul Elder paul.elder at ideasonboard.com
Mon Jan 27 12:32:23 CET 2025


On Thu, Jan 23, 2025 at 12:41:03PM +0100, Stefan Klug wrote:
> Now that the lux module is available, add it to the rkisp1 tuner.
> 
> While at it, sort the imports correctly.
> 
> Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>

> 
> ---
> 
> Changes in v2:
> - Added this patch
> ---
>  utils/tuning/rkisp1.py | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/utils/tuning/rkisp1.py b/utils/tuning/rkisp1.py
> index 9f40fd8bd63b..207b717a029c 100755
> --- a/utils/tuning/rkisp1.py
> +++ b/utils/tuning/rkisp1.py
> @@ -6,18 +6,19 @@
>  #
>  # Tuning script for rkisp1
>  
> -import coloredlogs
>  import logging
>  import sys
>  
> +import coloredlogs
>  import libtuning as lt
> -from libtuning.parsers import YamlParser
>  from libtuning.generators import YamlOutput
> -from libtuning.modules.lsc import LSCRkISP1
>  from libtuning.modules.agc import AGCRkISP1
>  from libtuning.modules.awb import AWBRkISP1
>  from libtuning.modules.ccm import CCMRkISP1
> +from libtuning.modules.lsc import LSCRkISP1
> +from libtuning.modules.lux import LuxRkISP1
>  from libtuning.modules.static import StaticModule
> +from libtuning.parsers import YamlParser
>  
>  coloredlogs.install(level=logging.INFO, fmt='%(name)s %(levelname)s %(message)s')
>  
> @@ -45,12 +46,15 @@ lsc = LSCRkISP1(debug=[lt.Debug.Plot],
>                  # This is the function that will be used to smooth the color ratio
>                  # values.  This can also be a custom function.
>                  smoothing_function=lt.smoothing.MedianBlur(3),)
> +lux = LuxRkISP1(debug=[lt.Debug.Plot])
>  
>  tuner = lt.Tuner('RkISP1')
> -tuner.add([agc, awb, blc, ccm, color_processing, filter, gamma_out, lsc])
> +tuner.add([agc, awb, blc, ccm, color_processing, filter, gamma_out, lsc, lux])
>  tuner.set_input_parser(YamlParser())
>  tuner.set_output_formatter(YamlOutput())
> -tuner.set_output_order([agc, awb, blc, ccm, color_processing,
> +
> +# Bayesian AWB uses the lux value, so insert the lux algorithm before AWB.
> +tuner.set_output_order([agc, lux, awb, blc, ccm, color_processing,
>                          filter, gamma_out, lsc])
>  
>  if __name__ == '__main__':
> -- 
> 2.43.0
> 


More information about the libcamera-devel mailing list