Message ID | 20250403154925.382973-16-stefan.klug@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
On Thu, Apr 03, 2025 at 05:49:20PM +0200, Stefan Klug wrote: > 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> > > --- > > Changes in v2: > - Improved commit message > - Added comment in the code > > Changes in v3: > - Fixed typo in comment > --- > src/ipa/rkisp1/algorithms/awb.cpp | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp > index 47b29725af51..03449e87e1a0 100644 > --- a/src/ipa/rkisp1/algorithms/awb.cpp > +++ b/src/ipa/rkisp1/algorithms/awb.cpp > @@ -397,6 +397,12 @@ RGB<double> Awb::calculateRgbMeans(const IPAFrameContext &frameContext, const rk > rgbMeans = rgbMeans.max(0.0); > } > > + /* > + * 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 > -- > 2.43.0 >
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 47b29725af51..03449e87e1a0 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -397,6 +397,12 @@ RGB<double> Awb::calculateRgbMeans(const IPAFrameContext &frameContext, const rk rgbMeans = rgbMeans.max(0.0); } + /* + * 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