Display L*A*B space channels separately
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Stephani Kanga
el 1 de Dic. de 2021
Respondida: Image Analyst
el 1 de Dic. de 2021
I want to display the component images of a true colour image in L*A*B space. Although, i don't want to show them all as grayscale images. I want the L* image to show the brightness(so this is going to be a grayscale image) and a* and b* images should show the corresponding hues.
0 comentarios
Respuesta aceptada
DGM
el 1 de Dic. de 2021
Editada: DGM
el 1 de Dic. de 2021
Lemme try that again...
RGB = imread('peppers.png');
[L A B] = imsplit(rgb2lab(RGB));
Lfill = 50*ones(size(L)); % pick some L level for representing A,B
Zfill = zeros(size(L));
Lvis = mat2gray(L);
Avis = lab2rgb(cat(3,Lfill,A,Zfill));
Bvis = lab2rgb(cat(3,Lfill,Zfill,B));
figure; imshow(Lvis)
figure; imshow(Avis)
figure; imshow(Bvis)
Más respuestas (1)
Image Analyst
el 1 de Dic. de 2021
Try this:
rgbImage = imread('peppers.png');
imshow(rgbImage);
labImage = rgb2lab(rgbImage);
[lImage, aImage, bImage] = imsplit(labImage);
% Show the L channel
subplot(3, 1, 1);
imshow(lImage, []);
impixelinfo;
title('L image')
% Create red to green colormap.
ramp = linspace(0, 1, 256)';
z = zeros(size(ramp))
colormapRG = [ramp, flipud(ramp), z];
% Create blue to yellow colormap.
colormapBY = [ramp, ramp, flipud(ramp)];
% Show the A channel
subplot(3, 1, 2);
imshow(aImage, 'Colormap',colormapRG);
impixelinfo;
caxis([-128, 127]);
title('A image')
% Show the B channel
subplot(3, 1, 3);
imshow(bImage, 'Colormap',colormapBY);
impixelinfo;
caxis([-128, 127]);
title('B image')
0 comentarios
Ver también
Categorías
Más información sobre Red en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!