diff options
author | Stefan Klug <stefan.klug@ideasonboard.com> | 2025-04-03 17:49:20 +0200 |
---|---|---|
committer | Stefan Klug <stefan.klug@ideasonboard.com> | 2025-05-20 11:20:08 +0200 |
commit | 7991293cec286b5e87d7be39d7119d422989ea51 (patch) | |
tree | 9724d99f6c8e0a3e2db1e5ec05faa2a2085e27bc /src | |
parent | 71b680c8635c7b4c9c28ba347bac91d466aa4ec8 (diff) |
ipa: rkisp1: awb: Take the CCM into account for the AWB gains calculation
The AWB measurements are taken after the CCM. This can be seen by
enabling debug logging on AWB, disabling AWB (stats will still be
processed) and manually chaning the CCM.
This means that the estimated colour temperature and the corresponding
CCM also lead to changed rgbMeans which in turn leads to oscillations.
Fix that by applying the inverse transform on the rgbMeans.
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ipa/rkisp1/algorithms/awb.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 03c5fc99..bd8430ad 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -405,6 +405,12 @@ RGB<double> Awb::calculateRgbMeans(const IPAFrameContext &frameContext, const rk } /* + * The ISP computes the AWB means after applying the CCM. Apply the + * inverse as we want to get the raw means before the colour gains. + */ + rgbMeans = frameContext.ccm.ccm.inverse() * rgbMeans; + + /* * The ISP computes the AWB means after applying the colour gains, * divide by the gains that were used to get the raw means from the * sensor. |