How to convert rgb value to lab using neural network?

4 次查看(过去 30 天)
Have problems with the input and output

回答(1 个)

Image Analyst
Image Analyst 2019-1-3
This is either easy, difficult, or impossible. First of all, you don't need a neural network to do this. That's way too hard and less accurate than using the book formulas.
It's easy if you use rgb2lab(). However that gives you the book formulas. And the book formulas may be good for some things like segmentation, but they are not accurate lab values. If you looked at the lab value of some part of your image, and then took your spectrophotometer (which is the accepted gold standard instrument for making color measurements) and measured the same physical part of the scene, they would not be the same. So the lab you get is somewhat relative, not accurate in the absolute. That is, it's easy, but it's not possible because it's not giving the "true" values.
The more difficult way (of course, like I do) is to do calibrated color imaging. To do this you have to train your system using known colors from a standard and using a regression to develop a transform to convert rgb to lab. It will be far more accurate and match closely your spectrophotometer. This is what I and most/all other color experts do.
Now a CNN might be able to replicate using a regression with standard colors, but it will take far, far more time to train. And you'd have to train it with true lab values, which means taking images of something like an X-rite Color Checker Chart and plugging the true LAB values in for the chips so that you now have calibrated lab images to train your cnn with. Way, way more complicated than just doing a regression and takes a lot of time to train and there is no guarantee it would be any better than the regression. I would not do it.
  2 个评论
ZHI QU
ZHI QU 2019-1-3
Thanks for the answer! I would like to train my system using standard colors and regression to develop a transform. Do you have related tutorial or example?
Image Analyst
Image Analyst 2019-1-3
No. You'll have to adapt some tutorials that the Mathworks includes with the Deep Learning Toolbox. Cal lthem and ask them for the appropriate one to use.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by