From 71b680c8635c7b4c9c28ba347bac91d466aa4ec8 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Thu, 3 Apr 2025 17:49:19 +0200 Subject: ipa: rkisp1: Damp color temperature regulation Damp the regulation of the color temperature with the same factor as the gains. Not damping the color temperature leads to visible flicker, as the CCM changes too much. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/ipa/rkisp1/algorithms/awb.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ipa/rkisp1/algorithms/awb.cpp') diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 601de9c4..03c5fc99 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -324,8 +324,6 @@ void Awb::process(IPAContext &context, RkISP1AwbStats awbStats{ rgbMeans }; AwbResult awbResult = awbAlgo_->calculateAwb(awbStats, frameContext.lux.lux); - activeState.awb.automatic.temperatureK = awbResult.colourTemperature; - /* * Clamp the gain values to the hardware, which expresses gains as Q2.8 * unsigned integer values. Set the minimum just above zero to avoid @@ -336,9 +334,12 @@ void Awb::process(IPAContext &context, /* Filter the values to avoid oscillations. */ double speed = 0.2; + double ct = awbResult.colourTemperature; + ct = ct * speed + activeState.awb.automatic.temperatureK * (1 - speed); awbResult.gains = awbResult.gains * speed + activeState.awb.automatic.gains * (1 - speed); + activeState.awb.automatic.temperatureK = static_cast(ct); activeState.awb.automatic.gains = awbResult.gains; LOG(RkISP1Awb, Debug) -- cgit v1.2.1