RGB to Lab color space
11 次查看(过去 30 天)
显示 更早的评论
I want to converte RGB values to Lab, I read that conversion goes between XYZ color space. Ofcourse, I find directly alghorithm in Matlab
labTransformation = makecform('srgb2lab');
labI = applycform(image,labTransformation);
l = labI(:,:,1);
a = labI(:,:,2);
b = labI(:,:,3);
but it shows me values between 0-255 and I need standard values for Lab, L=0-100, a,b=-127+128. Because later I want calculate C and H with a, b values.
Thanks.
0 个评论
采纳的回答
Adam
2016-12-6
Just using
lab = rgb2lab(rgb);
seems to give results in the expected output range. I'm not sure what all the extra work of creating a colour transform gives you, even if it did give the answer you want.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!