lab color space is (0-100),(-128-127),(-128-127), given an image under lab color space, how to show it suitably (imshow is not appropriate)?

 채택된 답변

Ameer Hamza
Ameer Hamza 2018년 5월 2일

0 개 추천

What about conversion to RGB before displaying.
imshow(lab2rgb(image));

댓글 수: 2

xiao
xiao 2018년 5월 2일
then does this have any difference with imshow(imread(image)) directly? Is this just the way what lab space look like?
Ameer Hamza
Ameer Hamza 2018년 5월 2일

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2018년 5월 2일

0 개 추천

You can look at each channel one at a time
subplot(3, 1, 1);
imshow(labImage(:, :, 1), []);
title('L Image', 'FontSize', 20);
subplot(3, 1, 2);
imshow(labImage(:, :, 2), []);
title('A Image', 'FontSize', 20);
subplot(3, 1, 3);
imshow(labImage(:, :, 3), []);
title('B Image', 'FontSize', 20);

댓글 수: 3

That is good but there is anyway to save each subplot to file? That is not using the the save menu option? I'm asking because using any of the following code will write an image that is not using the same mapping in gray scale:
imwrite(labImage(:, :, 3),'imgfile.png');
imwrite(labImage(:, :, 3),gray(100),'imgfile.png');
imwrite(labImage(:, :, 3),gray(256),'imgfile.png');
Nor the following:
imshow(labImage(:, :, 3), []);
cmap = colormap;
imwrite(labImage(:, :, 3),cmap, 'imgfile.png');
If you want a grayscale rendering of the image, not the actual values, you can convert to uint8 and then use a standard format like PNG:
uint8Image = uint8(255 * mat2gray(labImage(:, :, 1)));
imwrite(uint8Image, 'L Channel.PNG');
uint8Image = uint8(255 * mat2gray(labImage(:, :, 2)));
imwrite(uint8Image, 'A Channel.PNG');
uint8Image = uint8(255 * mat2gray(labImage(:, :, 3)));
imwrite(uint8Image, 'B Channel.PNG');
Arthur Fernandes
Arthur Fernandes 2018년 11월 19일
I didn't know about that mat2gray function, I was wandering if Matlab had someting more direct. But still better than using my on code. Thank you!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2018년 5월 2일

댓글:

2018년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by