Hello, i am trying to convert a image from rgb to lab, separate yours colors space work with it and after that unite this spaces again, and convert back to rgb but something is wrong, can anyone help me? ( sorry for my english )

2 views (last 30 days)
(portuguese version)Ola eu estou tentando converter uma imagem do rgb para o espaço lab e entao separar seus canais de cores para trabalhar com eles, depois disso quero unilos novamente e converte-los de volta para o rgb alguem pode me ajudar segue o codigo :
x=imread('img1.jpg');
colorTransform = makecform ('srgb2lab');
lab=applycform(x,colorTransform);
l=double(lab(:,:,1));
a = double(lab(:,:,2));
b = double(lab(:,:,3));
truecolor_image = cat(3, l, a, b);
cform_lab2srgb = makecform('lab2srgb');
rgb = applycform(truecolor_image, cform_lab2srgb);
figure();
imshow(rgb,[]), title('Teste');

Answers (0)

Community Treasure Hunt

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

Start Hunting!