[Feat]: WB (White balance) by color temperature
Version
2.6.1
Environment that reproduces the issue
Samsung A35 - Android 13
Use case description
Dear.
Currently I am using: streamer.settings.camera.whiteBalance.availableAutoModes to get the awb list.
And using whiteBalance.autoMode (set) to set the wb mode.
availableAutoModes returns a list of integers, as my device is returning: [1, 2, 3, 4, 5, 6, 7, 8, 0]
Currently the camera apps of the devices are using wb based on color temperature (eg from 2300K to 10000K).
How can I set the white balance like that ?
Thanks.
Proposed solution
No response
Alternative solutions
No response
Hi,
In Android camera2, I guess this value in Kelvin is infered from COLOR_CORRECTION_TRANSFORM and COLOR_CORRECTION_GAINS.
As it is not a direct camera2 API settings, it is not that easy.
We need to find the transformation between COLOR_CORRECTION_GAINS, COLOR_CORRECTION_TRANSFORM <-> tempature in K
Hi Most camera apps and live streaming apps use the K parameter for white balance. I think that might be a common standard and really necessary for this library. Do you plan to develop in that direction for this feature?
Hi,
Yes, I plan to implement it. But I have got other priorities right now. The formula for COLOR_CORRECTION_GAINS, COLOR_CORRECTION_TRANSFORM <-> tempature in K seems complex and undocumented. If you find a documentation or an official API, I will integrate it ASAP.
Hi,
Yes, I plan to implement it. But I have got other priorities right now. The formula for COLOR_CORRECTION_GAINS, COLOR_CORRECTION_TRANSFORM <-> tempature in K seems complex and undocumented. If you find a documentation or an official API, I will integrate it ASAP.
Hi. I also tried searching Google and it was hard to find official documentation for converting color temperature with K. I have now tried this formula and it works as a fallback although it is not 100% accurate. https://stackoverflow.com/a/50077521
Hi,
I won't add the temperature to RggbChannelVector now, but I can add a setter/getter for RggbChannelVector (almost what you did).
I think the implementation would be a ColorCorrection class in CameraSettings.
I think that's a reasonable way to go until a more accurate method is found.
The 3.0.0-RC contains an API to set RggbChannelVector in the ColorCorrection class.