필터 지우기
필터 지우기

how can i generate the histogram of an hsv image?

조회 수: 3 (최근 30일)
Josephine
Josephine 2013년 12월 17일
댓글: Image Analyst 2013년 12월 17일
hi i wanna generate the histogram of an hsv image without using the hist function of matlab. can someone give me an algorithm or a step-by-step process on this? thanks in advance.
  댓글 수: 1
Image Analyst
Image Analyst 2013년 12월 17일
Why? What do you have against hist? Is imhist or histc okay?

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 17일
counters = zeros(1,10);
Hpart = YourImageAsHSV(:,:,1);
for K = 1 : numel(Hpart)
if Hpart(K) < 255/10
counters(1) = counters(1) + 1;
elseif Hpart(K) < 2*255/10
counters(2) = counters(2) + 1;
elseif Hpart(K) < 3*255/10
counters(3) = counters(3) + 1;
elseif Hpart(K) < 4*255/10
....
else
counters(10) = counters(10) + 1;
end
end
counters is now the 10-bin histogram of the "H" part of the HSV image.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by