フィルターのクリア

Color conversion RGB to Lab

2 ビュー (過去 30 日間)
med BT
med BT 2017 年 3 月 6 日
コメント済み: med BT 2017 年 3 月 6 日
Hello, I want to convert a RGB image to L*a*b*, I did some research and I found two different codes, and the results are also differents.
1st code :
src = 'Img1.jpg';
rgbI = imread(src);
labI=rgb2lab(rgbI);
imshow(labI(:,:,1),[0 100])
2nd code :
src = 'shad.jpg';
rgbI = imread(src);
labTransform = makecform('srgb2lab');
labI = applycform(rgbI, labTransform);
imshow(labI)
Could you please tell me which one is the correct conversion.
  2 件のコメント
Stephen23
Stephen23 2017 年 3 月 6 日
Your source images are different:
src = 'Img1.jpg';
src = 'shad.jpg';
med BT
med BT 2017 年 3 月 6 日
I work on the same image

サインインしてコメントする。

回答 (1 件)

Stephen23
Stephen23 2017 年 3 月 6 日
編集済み: Stephen23 2017 年 3 月 6 日
The makecform default illuminant is ICC, but sRGB uses D65. So you need to specify the correct whitepoint for that conversion
makecform('srgb2lab', 'AdaptedWhitePoint', whitepoint('D65'))

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by