[PATCH 06/10] ipa: rkisp1: awb: Use gains from color temperature curve
Stefan Klug
stefan.klug at ideasonboard.com
Mon Feb 17 11:01:47 CET 2025
Use the color gains for white balance if calibrated light sources are
contained in the tuning file. The results are generally better
especially when large uniformly colored objects are in the scene. Pure
grey world model is still available by removing the color gains from the
tuning file.
Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>
---
src/ipa/rkisp1/algorithms/awb.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp
index 683a08c943fa..9244a1e64f41 100644
--- a/src/ipa/rkisp1/algorithms/awb.cpp
+++ b/src/ipa/rkisp1/algorithms/awb.cpp
@@ -159,6 +159,15 @@ void Awb::prepare(IPAContext &context, const uint32_t frame,
auto &awb = context.activeState.awb;
frameContext.awb.gains = awb.automatic.gains;
frameContext.awb.temperatureK = awb.automatic.temperatureK;
+ if (colourGainCurve_) {
+ const auto &gains = colourGainCurve_->getInterpolated(
+ awb.automatic.temperatureK);
+ frameContext.awb.gains.r() = gains[0];
+ frameContext.awb.gains.g() = 1.0;
+ frameContext.awb.gains.b() = gains[1];
+ } else {
+ frameContext.awb.gains = awb.automatic.gains;
+ }
}
auto gainConfig = params->block<BlockType::AwbGain>();
--
2.43.0
More information about the libcamera-devel
mailing list