Info

この質問は閉じられています。 編集または回答するには再度開いてください。

can anyone tell me about hsv color space and how rgv2hsv conersion work and why it is needed to count no of pixel

1 回表示 (過去 30 日間)
Anamika baruah
Anamika baruah 2014 年 7 月 1 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
[index, map]=rgb2ind(I,65300); pixels= prod(size(index)); hsv=rgb2hsv(map); h = hsv(:,1); s = hsv(:,2); v = hsv(:,3); darks = find(v <.2)'; lights = find(s < .05 & v > .85)'; h([darks lights])= -1; disp(length(darks)) black = length(darks)/pixels; white = length(lights)/pixels; red = length(find((h >.9167 | h <=.083) & h~=-1))/pixels; yellow=length(find(h >.083 & h<=.25))/pixels; green=length(find(h > .25 & h<= .4167))/pixels; cyan= length(find(h > .4167 & h<= .5833))/pixels; blue=length(find(h > .5833 & h <= .75))/pixels; magenta=length(find(h > .75 & h <= .9167))/pixels;

回答 (1 件)

Image Analyst
Image Analyst 2014 年 7 月 1 日
Well I know about color spaces but I don't know why the person who wrote your code wants to count pixels with various colors in the image. I guess it depends on the image. Why don't you post yours?
  1 件のコメント
Anamika baruah
Anamika baruah 2014 年 7 月 2 日
it counts the no pixels to compute the histogram of the image

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by