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!