OpenCV - How does it handle color profiles?
I have a jpeg. Its color profile is sRGB, of course. I load it into "image" and call
cvCvtColor(image, gray, CV_BGR2GRAY);
to convert it to grayscale. When I step into that routine in the debugger, I find it multiplying pixels by these values:
#define cscGr_32f 0.299f
#define cscGg_32f 0.587f
#define cscGb_32f 0.114f
Waaaait a minute. Those are the luminance values for NTSC RGB, not sRGB. Furthermore, I cannot see that it's doing anything about gamma correction. I am confused. When OpenCV decodes the image, does开发者_如何学运维 it remove gamma correction and convert to NTSC RGB?
Bonus question: Is there an OpenCV forum where the gurus hang? I've googled in vain.
It ignores. OpenCV usually does not perform gamma correction. Well, it does, only when cvtColor
ing RGB-to-L*a*b*/L*u*v* (But, how? Does OpenCV assume the gamma of the input image?).
精彩评论