Lab颜色模式简介:
From:http://wenku.baidu.com/view/67b1b11f650e52ea551898f7.html
OpenCV中使用cvCvtColor加CV_BGR2Lab转成CIELAB后取值范围:
有时根据需要,我们使用 cvCvtColor( img, img, CV_BGR2Lab );把色彩空间从RGB转换成CIE l* a* b*。但是我们发现转成CIELAB后的L*, a*, b*的值非常诡异,我们在OpenCV的文档中看到,
0 <= L <= 100
-127 <= a <= 127
-127 <= b <= 127
但是我们发现转出来值没有负的,而且L有时还大于100,这是为什么呢? 我思考许久还是不知为什么,去Google终于找到原因:
RGB CIE L*a*b* ( CV_BGR2Lab, CV_RGB2Lab, CV_Lab2BGR, CV_Lab2RGB )
in the case of 8-bit and 16-bit images R, G and B are converted to floating-point format and scaled to fit the 0 to 1 range
where
and
On output , , The values are then converted to the destination data type:
8-bit images
L = L * 255 \ 100, a = a + 128, b = b + 128
currently not supported
L, a, b are left as is
也就是说 L, a, b最后的取值变为了 0 - 255,如果我们的图像是8bit的话。提醒一下,此时IplImage中每个像素为uchar类型。呃...
From:http://hi.baidu.com/jasonlyy/item/77c4d298487561d37a7f0123