OpenCV 对其 RGB/BGR 颜色 space 使用了哪些颜色匹配函数?

Which color matching functions does OpenCV use for its RGB/BGR color space?

我使用的是 OpenCV 3.0,但我的问题应该与版本无关。我想知道 OpenCV 默认使用 the many RGB 颜色 space 中的哪一种。 也就是说,对于default representation, BGR中的图像,OpenCVspace使用哪个RGB

我怀疑他们是 CIE 1931 XYZ functions:

CIE 1931 RGB functions:


注意:这个问题已被反映 here(截至目前正在等待审核)。我会确保他们之间共享任何知识。

原来配色函数是捕获设备和显示设备的问题。查看 sRGB wiki page

的相关部分

Due to the standardization of sRGB on the Internet, on computers, and on printers, many low- to medium-end consumer digital cameras and scanners use sRGB as the default (or only available) working color space. As the sRGB gamut meets or exceeds the gamut of a low-end inkjet printer, an sRGB image is often regarded as satisfactory for home use. However, consumer-level CCDs are typically uncalibrated, meaning that even though the image is being labeled as sRGB, one can't conclude that the image is color-accurate sRGB.

OpenCV 可用于在颜色 space 之间进行转换,或使用 the right math 导出颜色 space 坐标。但是OpenCV没有"default"套配色函数。如果您的相机在 space X(例如,CIE XYZ)中捕获并且您的显示设备或打印机也在 space X 中显示,则可以使用 OpenCV 处理之间的数据,而无需考虑 space秒。但是,如果显示设备以不同的 space Y(比如 Adob​​e RGB)显示,则 OpenCV 可以 将图像从 space X 转换为space Y.

尽管 OpenCV 对 RGB 的颜色 space 几乎没有影响,但 cv::cvtColor 例外,它在定义明确的颜色 space 和原生 OpenCV RGB 之间进行转换。来自 coefficients used, we can see it uses the sRGB space.