MATLAB Answers

GammaCorrection/ White balance

28 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

  0 Comments

Sign in to comment.

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 24 May 2017
hello! i have similar problem that i am trying to solve : there is a set of pictures all off them have ColorChecker chart. i already creat a program that extract all the patchs of the ColorChecker chart ( i am more interested in the 6 gray patchs; from white to black). My goal is based on one of the ColorChecker chart from one of the images of my choice, i want to apply a correcrtion ( gamma correction , white balance, exposure compensation.. i really don't know which one) on the rest of the images so that at end all the gray patchs in every single images have the same RGB value. Thank you in advance!
Image Analyst
Image Analyst on 25 May 2017
Start a new question, and try to explain it better. It makes little sense to make it such that all the gray chips will have the same RGB value. In that case, the entire image will have the same RGB value, and what good is that?
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.