MATLAB: RGB to lαβ

colour spacergb to lαβ

Hello,
Can anyone advise on how to convert a colour space of an image from RGB to lαβ ? what is the syntax for this particular conversion?
Thanks, v

Best Answer

If you don't have the Image Processing Toolbox, you can look here for the formulas:
You can go from rgb to xyz, and then from xyz to lab. WARNING: you are not getting actual LAB values like you'd get if you measured your object with a chromameter, colorimeter, or spectrophotometer. You are merely getting "book values." Why is that? Well your object has a certain lab color but you can make the rgb values be whatever you want just by varying the exposure, white balance, or other settings. So how can all those possible rgb images give the absolute true lab values? They can't (unless you use calibrated imaging which I'm not going to get into now). All they can give you is book formulas, which make some assumptions. So you'll get different lab images for the different rgb images, not the one, true lab which is what your object actually is. I hope you understand that - did it make sense?