필터 지우기
필터 지우기

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

조회 수: 5 (최근 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 CenterFile Exchange에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by