matlab直方图-histogram
hist也可以进行直方图先实现,matlab官网推荐使用histogram
histogram
❤ histogram(i):显示图像i的灰度直方图(默认为255个灰度级)
❤ histogram(i,n):n为指定灰度级显示直方图
❤ [count, x] = histogram( i ) 获取直方图信息,count为每一级灰度像素个数,x为灰度级
代码示例
X = randn(1000,1);
h = histogram(I);
nbins = 25;
h = histogram(I,nbins);