Convert from sRGB to RGB by applying inverse gamma, convert RGB to XYZ using 3x3 matrix, convert XYZ to Lab using standard formula and D6500 white point
In case, I have prepared a list of links (in different programming languages) which can be helpful for the conversion process (sRGB to LAB and back) and also, conversion of sRGB to linear RGB. Linear RGB can be further used for white balance and color calibration of an image (provided color patch, like Macbeth color chart).
(v) OpenCV does not provide sRGB to linear RGB conversion but it does the conversion inside color.cpp code (OpenCV_DIR\modules\imgproc\src\color.cpp). Check out method called initLabTabs(), there is a gamma encoding and decoding. OpenCV color conversion API: http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html
发布评论
评论(2)
通过应用反伽马从 sRGB 转换为 RGB,使用 3x3 矩阵将 RGB 转换为 XYZ,使用标准公式和 D6500 白点将 XYZ 转换为 Lab
参考:
其余的......你可以自己做:-)
Convert from sRGB to RGB by applying inverse gamma, convert RGB to XYZ using 3x3 matrix, convert XYZ to Lab using standard formula and D6500 white point
References:
The rest... you can do on your own :-)
为了以防万一,我准备了一个链接列表(使用不同的编程语言),这对于转换过程(sRGB 到 LAB 和返回)以及 sRGB 到线性 RGB 的转换很有帮助。线性 RGB 还可用于图像的白平衡和颜色校准(提供色标,如 Macbeth 色卡)。
有趣的链接:
(i)了解 sRGB 和线性 RGB 空间:http://filmicgames.com/archives/299; http://www.cambridgeincolour.com/tutorials/gamma- Correction.htm
(ii) MATLAB 教程:https://de.mathworks.com/help /vision/ref/colorspaceconversion.html
(iii) Python 包: http://pydoc.net/Python/pwkit/0.2.1/pwkit.colormaps/
(iv) C 代码:http://svn.int64.org/viewvc/int64/colors/color.c?view=markup
(v) OpenCV 不提供 sRGB 到线性 RGB 转换,但它在 color.cpp 代码内进行转换(OpenCV_DIR\modules\imgproc\src\color.cpp)。查看名为initLabTabs()的方法,有一个gamma编码和解码。 OpenCV 颜色转换 API: http://docs.opencv.org/3.1 .0/de/d25/imgproc_color_conversions.html
In case, I have prepared a list of links (in different programming languages) which can be helpful for the conversion process (sRGB to LAB and back) and also, conversion of sRGB to linear RGB. Linear RGB can be further used for white balance and color calibration of an image (provided color patch, like Macbeth color chart).
Interesting links:
(i) Understanding sRGB and linear RGB space: http://filmicgames.com/archives/299; http://www.cambridgeincolour.com/tutorials/gamma-correction.htm
(ii) MATLAB tutorial: https://de.mathworks.com/help/vision/ref/colorspaceconversion.html
(iii) Python package: http://pydoc.net/Python/pwkit/0.2.1/pwkit.colormaps/
(iv) C code: http://svn.int64.org/viewvc/int64/colors/color.c?view=markup
(v) OpenCV does not provide sRGB to linear RGB conversion but it does the conversion inside color.cpp code (OpenCV_DIR\modules\imgproc\src\color.cpp). Check out method called initLabTabs(), there is a gamma encoding and decoding. OpenCV color conversion API: http://docs.opencv.org/3.1.0/de/d25/imgproc_color_conversions.html