summaryrefslogtreecommitdiff
path: root/src/ipa
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa')
-rw-r--r--src/ipa/rpi/controller/rpi/alsc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ipa/rpi/controller/rpi/alsc.cpp b/src/ipa/rpi/controller/rpi/alsc.cpp
index b7413611..8a205c60 100644
--- a/src/ipa/rpi/controller/rpi/alsc.cpp
+++ b/src/ipa/rpi/controller/rpi/alsc.cpp
@@ -548,7 +548,9 @@ static void calculateCrCb(const RgbyRegions &awbRegion, Array2D<double> &cr,
for (unsigned int i = 0; i < cr.size(); i++) {
auto s = awbRegion.get(i);
- if (s.counted <= minCount || s.val.gSum / s.counted <= minG) {
+ /* Do not return unreliable, or zero, colour ratio statistics. */
+ if (s.counted <= minCount || s.val.gSum / s.counted <= minG ||
+ s.val.rSum / s.counted <= minG || s.val.bSum / s.counted <= minG) {
cr[i] = cb[i] = InsufficientData;
continue;
}