Effacer les filtres
Effacer les filtres

How to convert Lab to RGB image and its matlab code?

2 vues (au cours des 30 derniers jours)
somasekar jalari
somasekar jalari le 28 Oct 2015
Commenté : Image Analyst le 4 Jan 2017
In my program,first converted rgb image to lab but after processing the image , i want convert Lab to rgb image. so i request you, pls provide matlab code for converting lab to rgb image?

Réponse acceptée

Thorsten
Thorsten le 28 Oct 2015
help cform tells you
rgb = imread('peppers.png');
cform = makecform('srgb2lab');
lab = applycform(rgb, cform);
  7 commentaires
Stephen23
Stephen23 le 4 Jan 2017
@zee falcon: what output do you expect? How are you checking it?
Image Analyst
Image Analyst le 4 Jan 2017
zee, you can also use rgb2lab(). But like Steven asked, what output are you expecting? You get an image. And do see that image you can use imshow(), or you can just look at it's values in the variable editor in the workspace. But no output will get "shown" unless you do one of those two things. Otherwise all you get is a new variable.

Connectez-vous pour commenter.

Plus de réponses (2)

Image Analyst
Image Analyst le 28 Oct 2015
Try this
labImage = rgb2lab(rgbImage);
  3 commentaires
somasekar jalari
somasekar jalari le 30 Oct 2015
thank you
zee falcon
zee falcon le 4 Jan 2017
I want to convert rgb images to lab. But above code is not working.It not shows any output after the conversion.Help me out

Connectez-vous pour commenter.


Stalin Samuel
Stalin Samuel le 28 Oct 2015
  2 commentaires
somasekar jalari
somasekar jalari le 28 Oct 2015
i am getting error after compile the above matalb code: ??? Error using ==> times Integers can only be combined with integers of the same class, or scalar doubles.
Error in ==> Lab2RGB at 34 fY = (~YT) .* (L / 903.3) + YT .* fY;
somasekar jalari
somasekar jalari le 30 Oct 2015
thank u

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by