matlab 自带函数hist画一个图像的直方图

a = double(imread('rice.png')); % matlab自带图片
hist(a(:),10); % 分成十个bin

效果图:


[N,X] = hist(...) also returns the position of the bin centers in X.
[no,xo] = hist(a(:),10);

no是每个bin对应的y值

xo是每个bin的中心位置x值

猜你喜欢

转载自blog.csdn.net/jizhidexiaoming/article/details/80796929