From 0069b9ceb1e03d5887ac614e35d79602b003ff27 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Tue, 29 Apr 2025 13:59:19 +0200 Subject: ipa: rkisp1: awb: Ignore empty AWB statistics When the AWB engine doesn't find a valid pixel because all pixels lie outside the configured colour range it returns an AWB measurement value of 255, 255, 255. This leaves the regulation in an unrecoverable state noticeable by a completely green image. Fix that by skipping the AWB calculation in case there were no valid pixels. Signed-off-by: Stefan Klug Reviewed-by: Daniel Scally Reviewed-by: Kieran Bingham --- src/ipa/rkisp1/algorithms/awb.cpp | 5 +++++ 1 file changed, 5 insertions(+) (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 8991f9cf..3bafed02 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -298,6 +298,11 @@ void Awb::process(IPAContext &context, const rkisp1_cif_isp_stat *params = &stats->params; const rkisp1_cif_isp_awb_stat *awb = ¶ms->awb; + if (awb->awb_mean[0].cnt == 0) { + LOG(RkISP1Awb, Debug) << "AWB statistics are empty"; + return; + } + RGB rgbMeans = calculateRgbMeans(frameContext, awb); /* -- cgit v1.2.1