diff options
author | David Plowman <david.plowman@raspberrypi.com> | 2020-12-08 20:44:38 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-12-11 23:31:21 +0200 |
commit | dbcf4d82473936ce1cfaac0613fba99fb592c957 (patch) | |
tree | e209eb297135edf5d2b1d5e74cb5d863005ab0a4 /src/ipa/raspberrypi/controller/rpi/awb.cpp | |
parent | 748f48a00620d706ee32013d28462ab907a94705 (diff) |
ipa: raspberrypi: awb: Add GetConvergenceFrames method to AWB base class
We add a GetConvergenceFrames method to the AwbAlgorithm class which
can be called when the AWB is started from scratch. It suggests how
many frames should be dropped before displaying any (while the AWB
converges).
The Raspberry Pi specific implementation makes this customisable from
the tuning file.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/awb.cpp')
-rw-r--r-- | src/ipa/raspberrypi/controller/rpi/awb.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 020825e3..10600f75 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -59,6 +59,7 @@ void AwbConfig::Read(boost::property_tree::ptree const ¶ms) bayes = params.get<int>("bayes", 1); frame_period = params.get<uint16_t>("frame_period", 10); startup_frames = params.get<uint16_t>("startup_frames", 10); + convergence_frames = params.get<unsigned int>("convergence_frames", 3); speed = params.get<double>("speed", 0.05); if (params.get_child_optional("ct_curve")) read_ct_curve(ct_r, ct_b, params.get_child("ct_curve")); @@ -165,6 +166,16 @@ void Awb::Initialise() prev_sync_results_ = sync_results_; } +unsigned int Awb::GetConvergenceFrames() const +{ + // If colour gains have been explicitly set, there is no convergence + // to happen, so no need to drop any frames - return zero. + if (manual_r_ && manual_b_) + return 0; + else + return config_.convergence_frames; +} + void Awb::SetMode(std::string const &mode_name) { std::unique_lock<std::mutex> lock(settings_mutex_); |