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

1 件のコメント

sixwwwwww
sixwwwwww 2013 年 10 月 20 日
What do you mean by lab values? Can you please explain?

サインインしてコメントする。

回答 (2 件)

Matt Kindig
Matt Kindig 2013 年 10 月 25 日

0 投票

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 件のコメント

pritha Das
pritha Das 2013 年 10 月 25 日
thank you very much....it z working....cn u tell me how to convert an image pixel by pixel form from 0 to 255?
Matt Kindig
Matt Kindig 2013 年 10 月 25 日
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???
Matt Kindig
Matt Kindig 2013 年 10 月 25 日
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().
pritha Das
pritha Das 2013 年 10 月 26 日
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
pritha Das
pritha Das 2013 年 10 月 26 日
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
pritha Das
pritha Das 2013 年 10 月 26 日
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
Image Analyst
Image Analyst 2013 年 10 月 26 日
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 ExchangeConvert 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