matlab之直方图的绘制

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yunduo93/article/details/89093438

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);

猜你喜欢

转载自blog.csdn.net/yunduo93/article/details/89093438
今日推荐