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:
- 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.
- 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?
"I have an application wherein I need to train classifiers based on color image intensity values" - just out of couriosity (and because color based classifiers are a rare thing) - what kind of classifier is that ?
(also, by default, opencv uses BGR)
Apart of the coloured classifiers, have you tried to think in the inverse way: gamma correct the "linear" colour-space images? IMHO the gamma correction may give better classification results (at least it was in my case).