how to show lab space image
6 次查看(过去 30 天)
显示 更早的评论
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)?
0 个评论
采纳的回答
Ameer Hamza
2018-5-2
What about conversion to RGB before displaying.
imshow(lab2rgb(image));
2 个评论
Ameer Hamza
2018-5-2
If you have a lap space image, then converting it to RGB might result in loss of some information: https://www.mathworks.com/help/images/use-color-space-conversion-to-handle-out-of-gamut-colors.html
更多回答(1 个)
Image Analyst
2018-5-2
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 个评论
Image Analyst
2018-11-16
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
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!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!