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

답변 (2개)

Matt Kindig
Matt Kindig 2013년 10월 25일
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

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?
pritha Das
pritha Das 2013년 10월 25일
편집: pritha Das 2013년 10월 25일
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.

댓글을 달려면 로그인하십시오.

Jan
Jan 2013년 10월 25일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2013년 10월 20일

댓글:

2013년 10월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by