MLV-App icon indicating copy to clipboard operation
MLV-App copied to clipboard

RFE: Auto white balance

Open iFloris opened this issue 5 years ago • 10 comments

TLDR: It would be very helpful if MLVAPP could automatically determine the whitest white for white balancing.

Long version: Hello, I have been watching the progress made in MLV app with admiration and gratitude 🙇 💯 Last week I did a project with a lot of differing lighting settings; inside under fluorescent lighting and tungsten lighting, outside in the sun and outside in a forest.

This caused my MLV files to differ quite wildly in terms of white balance. I took me a long time to manually WB each file - I generally correct one or two files and then copy paste all settings to MLV files produced in the same shot. But because these shots were taken in different rooms and different locations, this no longer worked.

As such, it occurred to me that having an auto white-balance function would be very helpful in nearly any situation. As long as the app would get the white balance correct 90% of the time, it would be a huge timesaver.

I know about #84, so perhaps, if it is agreed that AWB would be a useful addition, this could be considered while reconstructing the color balancing pipeline 😄

iFloris avatar May 30 '19 09:05 iFloris

Thank you for the proposal. #84 is something different - that is no AWB. If a AWB would work better than picking the correct WB... hm... you need much luck I think. Let's see if we find some algorithm to realize this - or maybe someone gives a hint how to get a good AWB. Does this work maybe by averaging the whole picture, and setting the average to grey!?

masc4ii avatar May 30 '19 17:05 masc4ii

Thanks @masc4ii for your reply. As I recall from my college years there are (were?) two methods being used:

  • White Patch Retinex
  • The Gray World Assumption (which is what I used in college)

Searching for those gave me this article, which is full of things I do not understand: https://www.mathworks.com/help/images/comparison-of-auto-white-balance-algorithms.html

That article also talks about a method I have never heard of:

  • Cheng

This older discussion on DPreview also contains a number of interesting links: https://www.dpreview.com/forums/thread/3641620 It also mentions Multi-AWB as used by Ricoh and Pentax.

I also found a AWB method in C right here on GitHub: https://github.com/cpuimage/AutomaticWhiteBalance

Does any of this help?

iFloris avatar May 30 '19 18:05 iFloris

Sounds like a great addition! The Canon AWB setting doesn't work with RAW video. So would be very handy if MLV App could fill this gap in post.

I think this thread may be of interest too. ML can Auto adjust Kelvin + G/M in LiveView. "ML will compute the white balance for the current scene, using the center (200×200 pixels rectangle) as reference gray."

Jip-Hop avatar Jul 01 '19 22:07 Jip-Hop

Indeed I am all for this great addition for certain scenarios. Will be watching this one in particular.

Sent from my iPhone XR

On Jul 1, 2019, at 3:06 PM, Jip-Hop [email protected] wrote:

Sounds like a great addition! The Canon AWB setting doesn't work with RAW video. So would be very handy if MLV App could fill this gap in post.

I think this thread may be of interest too. ML can Auto adjust Kelvin + G/M in LiveView. "ML will compute the white balance for the current scene, using the center (200×200 pixels rectangle) as reference gray."

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

DeafEyeJedi avatar Jul 01 '19 23:07 DeafEyeJedi

I found this related thread from 2013. I guess the scenario described by iFloris would be solved if the Auto White Balance setting (in camera) would apply to MLV files too. But if that's impossible, auto white balance in MLV App would be a great addition.

Jip-Hop avatar Jul 01 '19 23:07 Jip-Hop

If the camera is able to do a AutoWB and saves it into the MLV, we can easily read it out and set the sliders. Calculating a AutoWB on the other side is very complex. There are 2 possible solutions:

  • if someone is good in math: do a inverse calculation of all WB operations we do in MLVApp. This is very complex (too complex for me atm) but could be fast.
  • we realize the same stupid and easy trail&error algorithm I implemented for the picker, which sets the sliders to all possible values and looks which setting produces the greyest grey. This algorithm could also be applied on all the picture e.g. in average. So for a 2MP picture this becomes more than 2 million times slower than the WB picker -> no good option.
  • someone has a third idea?

masc4ii avatar Jul 02 '19 07:07 masc4ii

Maybe we can learn from how RawTherapee does it? Their new implementation (AITC) works best if the camera white balance is already close to what it's supposed to be. But I guess their old/current implementation does what we're after.

Jip-Hop avatar Jul 02 '19 11:07 Jip-Hop

Maybe I´m talking out of my wb ass here but is it possible to obtain awb in early stages and stash those calculations away just in case it will be used later on? Connection to button in Mlv app making it possible to toggle between original wb and awb?

dannephoto avatar May 13 '20 13:05 dannephoto

Actually I like this idea, Danne. Out of your WB ass or not it’s still intriguing enough to be able to tingle in between original WB and new WB.

Sent from my iPhone Xr

On May 13, 2020, at 6:39 AM, dannephoto [email protected] wrote:

Maybe I´m talking out of my wb ass here but is it possible to obtain awb in early stages and stash those calculations away just in case it will be used later on? Connection to button in Mlv app making it possible to toggle between original wb and awb?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

DeafEyeJedi avatar May 13 '20 19:05 DeafEyeJedi

I've got a solution for Mac users with a DNG based workflow (e.g. exporting DNG files with MLV App with editing and grading done in DaVinci Resolve).

Since White Balance corrections in MLV App fall under Processing and not under RAW Correction, the White Balance values chosen in MLV App don't apply when exporting DNG files. And since AWB measurements from the camera aren't applied to the MLV files, I always end up with lots of clips with a white balance that's way off.

I was happily surprised when I found that in the Switch app by @dannephoto this problem was already solved. It computes AWB values and applies them to the DNG files upon export.

I ported the AWB portion of Switch into a Workflow, so Mac users can apply AWB to DNG sequences, regardless of which tool or camera was used to make the DNG files. It works really well together with exports from MLV App.

I hope this is useful for someone reading this issue 🙂

Jip-Hop avatar Aug 16 '20 20:08 Jip-Hop