MATLAB Answers

GammaCorrection/ White balance

11 views (last 30 days)
azarm
azarm on 16 Apr 2012
Answered: Mahmoud Afifi on 12 Aug 2019
hey everybody,
i have an RGB image, which needs a white balance. As i make it linear, overexposure happens (especially in the sky area)! anybody knows how can i make a logarithmic correction considering the gamma?! tnx in advance,
cheers, Azarm

Answers (2)

Image Analyst
Image Analyst on 16 Apr 2012
Use the "Curves" tool in Photoshop. Or, I really like the highlights and shadows tool.
Or, you can do trial and error by multiplying your image by the gamma function ( http://en.wikipedia.org/wiki/Gamma_correction). Be sure to adjust the amplitude to take into account that the different channels have different values for the white region. For example what you want to be white is (230, 200, 170) and so the gamma function will need to be different if you want to end up with white at (245,245,245) or whatever. I wouldn't go all the way to 255 because otherwise there may be some pixels that get saturated.
Or you can do it the best, but most difficult, way and that is to take a picture of a Color Checker chart ( http://en.wikipedia.org/wiki/ColorChecker) and derive the transform to map your input color image into the desired color image. The math is too involved to post here, but I've done it in MATLAB.
  3 Comments
zouhair jimmouh
zouhair jimmouh on 25 May 2017
Dear Image Analyst ! thank you for taking the time to answer me.
here is my question.

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!