Manual Whitebalance ISP

Instead of using ISP’s nvarguscamerasrc white balance function, I would like to calculate white balance myself and set the white balance gains in my sensor.
Therefore I use code from your argus manual white balance example. Reading and settings white balance works pretty good!
I get image data, I get the averages bins, I calculate gain factors from it and send them to sensor.

In the following image I dont correct WB anymore but I still read the averages. What I get is a result I would expect:

Before correction:
r:0.099 gO:0.160 gE:0.158 b:0.084 WBGains: r:1.610 gO:1.000 gE:1.016 b:1.907
After correction:
r:0.163 gO:0.164 gE:0.162 b:0.164 WBGains: r:1.010 gO:1.000 gE:1.016 b:1.004

So what you can see is that all colors seem pretty balanced. But the Image I get on my monitor is way too red/blueish. (This is not about my monitor, auto white balance works pretty good on that monitor).

So it seems, even when the image has the right color balance in the averages, the overall image output is wrong balanced. So there must be some extra color balancing on the data.

I also disabled whitebalance in the ISP and I also set color correction matrix to [1 0 0 0 1 0 0 0 1].

Is there any other color manipulation that I forgot?

Best regards,

May need camera partner help for the tuning process.

we have developed our own camera driver for OmniVision 10-bit MIPI-CSI sensor.

Is it a problem? Is this intended only for example cameras to work?

Best regards,

For image quality need consult with camera partner to get the tuning tools for the tuning process.