How to convert the RGB color map into an HSV color map

3 ビュー (過去 30 日間)
hamed abdulaziz
hamed abdulaziz 2013 年 12 月 29 日
コメント済み: Image Analyst 2013 年 12 月 29 日
Hi All,
I need to do these steps :
1-Convert an RGB image to colormap say M
2-Convert this RGB colormap M to an HSV colormap say cmap
By using this conversion in MATLAB cmap = rgb2hsv (M) that converts an RGB colormap M to an HSV colormap,But my question How can I get the RGB colormap M firstly then to us it in rgb2hsv(M) function? Please could anyone explain to me in example,Thanks in advance for Help.
I'll wait your answer impatiently,
  1 件のコメント
hamed abdulaziz
hamed abdulaziz 2013 年 12 月 29 日
編集済み: hamed abdulaziz 2013 年 12 月 29 日
I tried this(is it correct?) :
RGB=imread('d:\168.bmp');
n=65536;
% Converts the RGB image to an indexed image X ;n = colors
[IND,map] = rgb2ind(RGB,n);
% Convert RGB colormap to HSV colormap(is it correct?)
cmap=rgb2hsv(map);
% Calcula the color variance of the HSV colormap
color_variance=var(cmap);
Is the color_variance represent the actual color variance for an image,because I have three coloumns!!!

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

採用された回答

Image Analyst
Image Analyst 2013 年 12 月 29 日
No that does not make any sense. You can't just apply some different colormap to an indexed image and expect it to look sensible. It will look like garbage. And calculating the variance of a colormap is meaningless. Perhaps you want the color frequency image like this calculates but I don't know.
I think perhaps you're getting color map confused with colorspace. You want to do something, though I don't know what it is. And you think that this colormap approach is the way to do it, but it's not - it's a dead end. So why don't you tell me what you really want to do and I can recommend an approach. For example you want so segment out pixels of some particular color out of an image, or you want to classify the image into 5 different color classes.
  9 件のコメント
hamed abdulaziz
hamed abdulaziz 2013 年 12 月 29 日
How can I construct a color difference image?
Image Analyst
Image Analyst 2013 年 12 月 29 日
Transform into lab color space with makecform(). Find the mean L, a, and b in the region of interest. Then calculate delta images:
deltaLimage = Limage - meanL;
deltaAimage = Aimage - meanA;
deltaBimage = Bimage - meanB;
% Calculate deltaE image
deltaE = sqrt(deltaLimage .^ 2 + deltaAimage .^ 2 + deltaBimage .^ 2);
I have a delta E demo in my File Exchange.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRed についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by