summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Klug <stefan.klug@ideasonboard.com>2025-04-29 13:59:19 +0200
committerStefan Klug <stefan.klug@ideasonboard.com>2025-05-19 15:35:47 +0200
commit0069b9ceb1e03d5887ac614e35d79602b003ff27 (patch)
tree6a038a7cb54a5bc9b281d9964ca6921f1a8da017 /src
parent848a3017b8eee31eb94add447850b2751f38aa62 (diff)
ipa: rkisp1: awb: Ignore empty AWB statisticsHEADmaster
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 <stefan.klug@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/ipa/rkisp1/algorithms/awb.cpp5
1 files changed, 5 insertions, 0 deletions
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 = &params->awb;
+ if (awb->awb_mean[0].cnt == 0) {
+ LOG(RkISP1Awb, Debug) << "AWB statistics are empty";
+ return;
+ }
+
RGB<double> rgbMeans = calculateRgbMeans(frameContext, awb);
/*