Hi, let me try to answer as much as I can:
Memotech Bill wrote: ↑
Mon Jun 21, 2021 3:10 pm
It is well documented that you can only control the red and blue white balance gains if AWB mode is set to off.
- The analogue and digital gains can only be controlled if the ISO value is set to zero. With any setting in the documented range (100-800) the gains seem to be automatically adjusted.
- Exposure mode only has any effect if the shutter speed is set to zero.
- Exposure compensation only has any effect if ISO is set to a non-zero value.
Yes on all counts here I think. If you specify an ISO value that is effectively the same as setting fixed gain values, so you no longer have any other control over the analogue and digital gains. If you further fix the shutter (i.e. set a non-zero value) then the AE/AGC algorithm has no levers left and so other settings (such as exposure mode or compensation) will have no effect.
Also, the brightness, contrast and saturation controls must be affecting the gain in the complete processing pipeline, but they do not appear to affect the gains reported in the MMAL status callback.
Brightness and contrast are handled by the tone (gamma) curve, so aren't reported anywhere as a "gain". Saturation is dealt with by a 3x3 matrix so that's not a global gain either (though cranking it up would lead to more colour noise).
It is also noticeable that it is possible to adjust the analogue and digital gains over quite wide ranges while having negligible effect on the final image. Presumably these later controls act to counter the gain changes.
Ultimately these parameters all get clamped somewhere, so once you hit those limits nothing really changes any more.
Is it possible to have at least some qualitative documentation of the image pipeline describing where the different controls are applied, and how they interact?
The principal steps in the handling of brightness and colours are:
1. Exposure and analogue gain (this happens in the sensor)
2. Simultaneous application of global digital gain and colour gains (this is now in the ISP).
3. 3x3 colour matrix.
4. Gamma transform.
I'd also point you at this
document, section 5. It's about our libcamera implementation, but it's doing the same kind of things.
Or do I need to move to using libcamera?
No, but it gives you more control and we can explain exactly what is going on. I won't say it doesn't still have some deficiencies, but it might be worth a try (our libcamera-apps
would be a place to start).