when i am trying to make a histogram of an image without imhist(). my values does not match.
i=imread('lena.tif');[count,b]=imhist(i,16);
what is the value of b? is b a range or interval ? if yes then what it is for each bin?
my program without imhist()
imData=imread('lena.tif');for i=1:m for j=1:n histo=imData(i,j);if ((histo==0) || (histo<=15)) count(1)=count(1)+1;elseif ((histo==16) || (histo<=31)) count(2)=count(2)+1; : : :elseif((histo==224) || (histo<=239)) count(15)=count(15)+1;else count(16)=count(16)+1;end end
my value of this 'count' doesn't match with previous by using imhist().
Best Answer