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:
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
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?