summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/awb.h
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-09-15 20:00:48 +0200
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-10-06 15:59:40 +0200
commit3a240e56a8d266846548f9d9b3c70da3ee9533c9 (patch)
treeb98e34e532e656966e53543d910a37045fa27484 /src/ipa/ipu3/algorithms/awb.h
parent195e6d09685be76a53f2890a224796c15a9f7e26 (diff)
ipa: ipu3: awb: Correct the relevant zones proportion
The algorithm uses the statistics of a cell only if there is not too much saturated pixels in it. The grey world algorithm works fine when there are a limited number of outliers. Consider a valid zone to be at least 80% of unsaturated cells in it. This value could very well be configurable, and make the algorithm more or less tolerant. While at it, implement it in a configure() call as it will not change during execution, and cache the cellsPerZone values estimated with std::round as we are using cmath. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/awb.h')
-rw-r--r--src/ipa/ipu3/algorithms/awb.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h
index 3385ebe7..681d8c2b 100644
--- a/src/ipa/ipu3/algorithms/awb.h
+++ b/src/ipa/ipu3/algorithms/awb.h
@@ -48,6 +48,7 @@ public:
Awb();
~Awb();
+ int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
void prepare(IPAContext &context, ipu3_uapi_params *params) override;
void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;
@@ -85,6 +86,10 @@ private:
std::vector<RGB> zones_;
Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];
AwbStatus asyncResults_;
+
+ uint32_t cellsPerZoneX_;
+ uint32_t cellsPerZoneY_;
+ uint32_t cellsPerZoneThreshold_;
};
} /* namespace ipa::ipu3::algorithms */