[PATCH v3 2/9] libcamera: software_isp: Store color temperature to metadata

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Jan 9 17:54:33 CET 2025


Quoting Milan Zamazal (2024-12-10 15:34:32)
> Image color temperature is a piece of information that should be
> reported in metadata, let's put it there.
> 
> Metadata is currently not reported in simple pipeline but we should make
> at least newly added information ready to be reported.
> 
> Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
> ---
>  src/ipa/simple/algorithms/awb.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp
> index f4fe1af6..30af3d31 100644
> --- a/src/ipa/simple/algorithms/awb.cpp
> +++ b/src/ipa/simple/algorithms/awb.cpp
> @@ -12,6 +12,8 @@
>  
>  #include <libcamera/base/log.h>
>  
> +#include <libcamera/control_ids.h>
> +
>  #include "libipa/colours.h"
>  #include "simple/ipa_context.h"
>  
> @@ -34,7 +36,7 @@ void Awb::process(IPAContext &context,
>                   [[maybe_unused]] const uint32_t frame,
>                   [[maybe_unused]] IPAFrameContext &frameContext,
>                   const SwIspStats *stats,
> -                 [[maybe_unused]] ControlList &metadata)
> +                 ControlList &metadata)
>  {
>         const SwIspStats::Histogram &histogram = stats->yHistogram;
>         const uint8_t blackLevel = context.activeState.blc.level;
> @@ -63,6 +65,7 @@ void Awb::process(IPAContext &context,
>         RGB<double> rgbGains{ { 1 / gains.red, 1 / gains.green, 1 / gains.blue } };
>         uint32_t temperature = estimateCCT(rgbGains);
>         context.activeState.awb.temperatureK = temperature;
> +       metadata.set(controls::ColourTemperature, temperature);

As long as this doesn't break anything - adding it even if it's not yet
used is fine with me! (and beneficial to get it in)


Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

>  
>         LOG(IPASoftAwb, Debug)
>                 << "gain R/B: " << gains.red << "/" << gains.blue
> -- 
> 2.44.2
>


More information about the libcamera-devel mailing list