How to convert an image from rgb to lab by pixel by pixel matrix???

like i have image...i have to read it in matlab...then if i want to change the rgb values of the image to lab values...then what will b its steps.... i mean L* A* B* values

Answers (2)

You can convert rgb to L*A*B colorspace using the makecform() and applycform() functions. From the documentation:
cform = makecform('srgb2lab');
lab_IMG = applycform(IMG,cform);

8 Comments

thank you very much....it z working....cn u tell me how to convert an image pixel by pixel form from 0 to 255?
I can't read your text-speak. What does "it z working" mean?
sorry...it is working....bt i not only want to convert the L* A* b* color space value from rgb but also convert it pixel by pixel matrix from rgb to l*a*b* value....how to do it?? can u please tell. i mean by your coding the image is changing....then if i want to plot pixel by pixel matrix from 0-255 from rgb image and then want to convert them into l*a*b values in pixel by pixel matrix form what should i do???
I have no idea what pixel by pixel means in this context. The commands I provided above convert an RGB image to L*A*B* all at once, so every pixel is modified to the new colorspace. Both the RGB and L*A*B* images should range from 0-255.
It is not clear what it means to "plot pixel by pixel matrix". Do you just want to display the image? If so, just use image() or imshow().
i mean to say....for rgb image we can plot matrix from 0-255...then if we convert rgb to L*a*b then we can get another matrix from the image of converted L*a*b...to i want to know how to do that?i mean i how to plot matrix of a image...then how we can change that matrix to its correspond l*a*b values using coding in matlab
i mean to say....for rgb image we can plot matrix from 0-255...then if we convert rgb to L*a*b then we can get another matrix from the image of converted L*a*b...to i want to know how to do that?i mean i how to plot matrix of a image...then how we can change that matrix to its correspond l*a*b values using coding in matlab
look what u have provided it is working...it directly converts a rgb image to its L*a*b color space value... bt if want to the same thing in matrix form then what will b the coding
Matt already answered this. See his last comment. There is no difference between an image and a matrix, if that is what you are wondering.

Sign in to comment.

This is a perfect question for an internet research: Asking e.g. Google for "Matlab rgb lab" and you will find e.g.:

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 20 Oct 2013

Commented:

on 26 Oct 2013

Community Treasure Hunt

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

Start Hunting!