开发者

How to convert sRGB to CIELAb and CIELab to sRGB efficiently? [closed]

开发者 https://www.devze.com 2023-01-19 12:33 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 4 years ago.

Improve this question

I don't understand how to convert sRGB to CI开发者_StackOverflowELab and backward. Help me please. it's desirable in с++ code


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:

  • Lab http://en.wikipedia.org/wiki/Lab_color_space
  • sRBG http://en.wikipedia.org/wiki/SRGB_color_space

The rest... you can do on your own :-)


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

0

精彩评论

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