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

Jean-Michel Hautbois jeanmichel.hautbois at ideasonboard.com
Fri Jun 17 09:53:32 CEST 2022


Hi Bingbu,

On 17/06/2022 08:58, Cao, Bingbu 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)}.

That is very interesting, as I thought it would be Pout = {Pin * Gx} !
It means that, applying a gain of 1 for green channel is really forcing 
Ggr and Ggb to be 0 !

> 
> So that means for wb_gains.Ggr/gb/g/r = 0.5, the actual gain is 1.5.
> 
> 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.

Nope, indeed, this is not the correct ratio !
But now I know what is expected, I think.

Thanks !
JM

> 
> 
> ________________________
> BRs,
> Bingbu Cao
> 
>> -----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(-)
>>
>> --
>> 2.34.1
> 


More information about the libcamera-devel mailing list