can u please tell me how to write the number of unique hues included in an in matlab?
조회 수: 2 (최근 30일)
이전 댓글 표시
i have written a code
image = imread('filename');
figure, imshow(image);
hsv_image = rgb2hsv(image);
i = hsv_image(:,:,2)>0.2.* (hsv_image(:,:,3)>0.15 .* hsv_image(:,:,3)<0.95);
figure
hist(i,20);
and further i would like to know how to do this in matlab.
Suppose Q is the maximum value of the histogram. Let the
hue count be the number of bins with values greater than c ⋅Q ,
q = maximum value in histogram
N = {i | H(i) > cq}
here C= 0.1.
plz help me......
댓글 수: 0
채택된 답변
Image Analyst
2013년 10월 3일
I don't know what you're doing by calculating i. What's the point of that? To get the number of unique hues, you can use the unique() function.
hsv = rgb2hsv(rgbImage);
hueImage = hsv(:,:,1);
numberOfUniqueHues = unique(hueImage)
댓글 수: 7
Image Analyst
2013년 10월 4일
Then you want the max of the counts.
Perhaps you'd be interested in the color frequency image: http://www.mathworks.com/matlabcentral/fileexchange/28164-color-frequency-image
추가 답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!