How to determine if gamma decorrection is required?

asked 2015-09-24 05:00:50 -0500

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?

edit retag flag offensive close merge delete

Comments

1

"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)

berak gravatar imageberak ( 2015-09-24 05:47:37 -0500 )edit

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).

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-09-24 07:06:28 -0500 )edit