[libcamera-devel] [RFC PATCH 0/1] IPU3 AWB gains correction

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Jun 17 10:07:56 CEST 2022


Hi Bingbu,

Thank you very much for your quick reply.

On Fri, Jun 17, 2022 at 06:58:36AM +0000, Cao, Bingbu via libcamera-devel wrote:
> Hi, JM,
> 
> For BNR parameters WB gain factor for the three channels [Ggr, Ggb, Gb, Gr].
> Their precision is U3.13 and the range is (0, 8) and the actual gain is
> Gx + 1, it is typically Gx = 1.
> 
> Pout = {Pin * (1 + Gx)}.
> 
> So that means for wb_gains.Ggr/gb/g/r = 0.5, the actual gain is 1.5.

Just to make sure my understanding is correct, does this mean the
following ?

wb_gains.gr = 0    -> actual gain = 1.0
wb_gains.gr = 4096 -> actual gain = 1.5
wb_gains.gr = 8192 -> actual gain = 2.0

> It seems not correct to changing ratio from 8192 to 4096 as its
> precision is U3.13.  I am not familiar with ipa implementation in
> libcamera, not sure other details.
> 
> > -----Original Message-----
> > From: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> > Sent: Thursday, June 16, 2022 5:12 PM
> > To: libcamera-devel at lists.libcamera.org
> > Cc: Cao, Bingbu <bingbu.cao at intel.com>; sakari.ailus at linux.intel.com;
> > Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> > Subject: [RFC PATCH 0/1] IPU3 AWB gains correction
> > 
> > Hi there,
> > 
> > Bingbu, Sakari, I cc'ed you because this patch is not aligned with the
> > current documentation in the intel-ipu3.h file, could you have a look
> > please ?
> > 
> > The part which worries me is that the green gains should be 0 for the
> > white balance to be correct which is not stated in the documentation at
> > all.
> > 
> > In order to demonstrate it I captured two frames, [1] is the actual SGo2
> > image quality, and [2] with this patch applied.
> > 
> > [1]: https://pasteboard.co/hUcL4U6eyyAH.png
> > [2]: https://pasteboard.co/2XIbkkL8kitl.png
> > 
> > There is a very clear benefit, that's why I submit this RFC as I think it
> > needs to be clarified :-).
> > 
> > Thanks !
> > JM
> > 
> > Jean-Michel Hautbois (1):
> >   ipa: ipu3: awb: Correct the coefficient factor
> > 
> >  src/ipa/ipu3/algorithms/awb.cpp | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list