开发者

OpenCV - How does it handle color profiles?

开发者 https://www.devze.com 2022-12-19 19:56 出处:网络
I have a jpeg.Its color profile is sRGB, of course.I load it into \"image\" and call cvCvtColor(image, gray, CV_BGR2GRAY);

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 cvtColoring RGB-to-L*a*b*/L*u*v* (But, how? Does OpenCV assume the gamma of the input image?).

0

精彩评论

暂无评论...
验证码 换一张
取 消