Adjust white balance

I am considering some image processing algorithms for manipulating white balance. It seems that the previous Stackoverflow question answers the question about automatic white balance algorithms pretty well.

However, I am wondering how to convert from one temperature to another, i.e. making an assumption (and its big assumption) that the white balance algorithm can process the processed image (for example, JPEG, etc.) and set the overall temperature in the scene to 6500, how would you algorithmically “cool” or “warm” the scene to a certain temperature? This would be a normal operation in an image editing program, although they usually work with RAW images that do not have processed processing (manipulating color space or otherwise). In the case of RAW files - is it possible that individual RAW files contain enough information (in the file header) regarding the color calibration of the camera sensor to make a certain temperature transformation more deterministic?

Any input is appreciated - thanks!

+7
source share
3 answers

If you are working with a RAW image, you can use the Von Kries offer - and multiply by the gain matrix 3x3 diagonal . To find these 3 numbers, you can photograph an object that is “white” under some lighting conditions — for example, MacBeth ColorChecker. If you cannot do this, try using some automatic white balance algorithms.

Processing WB in JPEG is problematic because it usually happens after a non-linear function - Gamma. You need to apply the inverse Gamma function, and only then can you make the white balance.

+5
source

The standard reference for this question is the Charles Poynton Color Hour, and this question will be answered: http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC20 . I hope that by reading the other parts of the frequently asked questions, you will get an idea of ​​how to fill out the matrix.

+1
source

White balance is just a parameter in the header of an EXIF ​​RAW image. This is a short integer, meaning you can record your desired color temperature setting there.

0
source

All Articles