Oct 29, 2010

Image histogram in MATLAB


%load rgb image
src = 'C:\rainbow.jpg';
rgbI = imread(src);
grayI = rgb2gray(rgbI);

%get image histogram
[counts bins]=imhist(grayI);

%show histogram
bar(bins,counts);


No comments:

Post a Comment

Post a Comment