Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: Auto white balance #168

Open
iFloris opened this issue May 30, 2019 · 10 comments
Open

RFE: Auto white balance #168

iFloris opened this issue May 30, 2019 · 10 comments

Comments

@iFloris
Copy link

iFloris commented May 30, 2019

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 😄

@masc4ii
Copy link
Collaborator

masc4ii commented May 30, 2019

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

@iFloris
Copy link
Author

iFloris commented May 30, 2019

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?

@Jip-Hop
Copy link

Jip-Hop commented Jul 1, 2019

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."

@DeafEyeJedi
Copy link

DeafEyeJedi commented Jul 1, 2019 via email

@Jip-Hop
Copy link

Jip-Hop commented Jul 1, 2019

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.

@masc4ii
Copy link
Collaborator

masc4ii commented Jul 2, 2019

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?

@Jip-Hop
Copy link

Jip-Hop commented Jul 2, 2019

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.

@dannephoto
Copy link
Collaborator

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?

@DeafEyeJedi
Copy link

DeafEyeJedi commented May 13, 2020 via email

@Jip-Hop
Copy link

Jip-Hop commented Aug 16, 2020

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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants