About getting awb gains under AWB_MODE_AUTO lively and relation between awb gains and sensor frames?

Hi,
I ever asked the question about get awb gains lively and got some reply that using iAutoControlSettings.getWbGains() but unluckily this interface is only for AWB_MODE_MANUAL. But in the document link shared by Jerry Chang I found it seems there be a API for get awb gains under AWB_MODE_AUTO lively which is iMetaData.getAwbGains(). Firstly I’d like to check if this API the correct one for me?
When using this API I meet some problems: I got a sensor which has special function that it can do HDR merge and ALTM on chip that I need to set the AWB gains ISP being using to sensor registers and suppose that after sensor registers is with AWB gain values from ISP using that ISP get new AWB gains around 1,1,1,1 based on next ALTM frames. But the truth I found is that after I set the AWB gains ISP is using to sensor registers, For the next frames if light environment has no change, ISP still uses same AWB gains as before, but the frame color changes a lot wrongly since sensor registers are written with ISP AWB gains already(ISP gains are hoped to become around 1.0f, 1.0f, 1.0f, 1.0f since AWB gains are used when sensor do HDR merge and ALTM).
Could you give some guide on this?
Thanks
Bing.Yan

hello bing.yan,

it looks like a follow-up of Topic 315789.
may I know what’s your code snippets to obtain the AWB values.

Hi Jerry,
From other topic I saw someone said iAutoControlSettings->getWbGains() is to get wb gains when AWB_MODE_MANUAL only? is that true? Per my test it seems be so, under AWB_MODE_AUTO I can only get all 1.000f values for R G B channels.
I use this API in demo userAutoWhiteBalance, in main.cpp there is position calling iAutoControlSettings->setWbGains(…) , I added iAutoControlSettings->getWbGains() after the calling, and I can only get 1.000f for all R G B gains always.
What I demand is I get gains of ISP using and set them to sensor registers, and then ISP switch the gains to around 1.00f when AWB stable. That’s what I demanded behavior so that the sensor ALTM can work normally.
Currently I use the manual AWB way in the demo userAutoWhiteBalance and can achieve some result as I wanted merely. But I don’t know if there is any better way?
Thanks
Bing.Yan

you must use manual mode if you would like to call setWbGains to change wbGains.

Hi Jerry,
Thanks, actually I don’t want to change awb gains of ISP. What I need is to get ISP used awb gains and set them to sensor registers. after sensor has used these gains, the frames output from sensor will be have the gains, then ISP should calculate new gains out which should be similar to 1.0f value.
That’s behavior I want.
Thanks,
Bing.Yan

hello bing.yan,

I’m confused.
may I know what’s your capture pipeline? ISP calculated from frame-N and apply the new AWB settings to frame-N+1

Hi Jerry,
if seneor registers got the awb gains at frame-N, then these gains are applied on frame-N+2.
Because there is special functions working in sensor chip internal, sensor needs to get AWB gains lively from ISP when ISP working under AWB_MODE_AUTO, and sensor uses these gains to the frames, then after ISP get the new frames, ISP will update AWB gains to new values, should be around 1.0f. That’s my suppose.
Currently I tried getting AWB gains by API iMetaData->getAwbGains(), and set gains to sensor registers, but ISP does not update it’s AWB gains to values around 1.0f as I wanted, the AWB gains got from iMetaData->getAwbGains() have no much change even if after I set the ISP AWB gains to sensor, whatever numbers of frames past after that. That’s not behavior I wanted or supposed.

Thanks
Bing.Yan

hello bing.yan,

you should not set gains to sensor registers, instead, it seems you should have cctBias.
however, it’s related to image quality tuning, we’re not support tuning stuffs via public forum discussion thread.

Hi Jerry,
What I need is simple, find a way to get the AWB gains of ISP using, and set them to sensor registers, and ISP do update to awb gains based on sensor output frames with awb gains from ISP. We just need to focus on how to achieve this. About the image quality there’s method to control.
Thanks
Bing.Yan

Current don’t have any API to get the AWB gain while AWB running in Auto mode. The getAwbGains() API get the value set by setAwbGains().

Hi @ShaneCCC
Thanks for the reply. Is there any place calling the API setAwbGains() if user does not call it manually? I ever test and found that: I didn’t call setAwbGains() and only called getAwbGains(), when light condition changes, I can see the awb gains got changes also. seems this iMeataData->getAwbGains() API works under AWB_MODE_AUTO without manually calling iMetaData->setAwbGains() previously?

Thanks
Bing.Yan

I guess it’s floating if there’s no any one call the setAwbGains().
Could you change to manual mode and set a value by setAwbGains then switch to Auto mode to get the value again to clarify it.

Thanks

Hi @ShaneCCC
Actually it’s not floating, without calling iMetaData->setAwbGains, under different light the iMetaData->getAwbGains can get good gain values which matches the light temperature. About Manual mode, the API is iAudtoControlSettings->getWbGains and setWbGains. The APIs of class iMetaData and iAutoConrtolSettings are different. Should be iMetaData->getAwbGains and setAwbGains is for AUTO mode while iAudtoControlSettings->getWbGains and setWbgains is for Manual mode. Setting gains under Manual mode has no effect to Auto mode actually.
Thanks
Bing.Yan

OK, looks like I was confused with them.
Suppose iMetaData->getA wbGain get the running value correctly.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.