Ask Your Question

Revision history [back]

How to determine if gamma decorrection is required?

I've read that OpenCV does not enforce its own version of the RBG color space (say sRGB or AdobeRGB) - this depends on the image capture device and/or image file format and imread will simply load the same values in. I have an application wherein I need to train classifiers based on color image intensity values, and am facing the following doubt:

  1. If the image is in sRGB, it has been gamma corrected (with say gamma = 2.2) and therefore I need to de-correct it with gamma set to 1/2.2 in order to convert to a linear RGB colorspace and perform operations on it.
  2. If the image is already in a linear RGB colorspace, I can directly perform operations without gamma correction.

Firstly, am I thinking of this the right way about decorrection being required?Secondly, if so, is there any way to determine whether gamma decorrection is required, in both scenarios of the image source being known/unknown respectively?