用Matlab绘彩色图像的直方图

来源:互联网 发布:司机配货软件 编辑:程序博客网 时间:2024/05/14 02:53
直方图是常用的图表,用MATLAB实现如下:Img=imread('football.jpg');BW = Img;R=BW(:,:,1);[REDcounts,x] = imhist(R);G=BW(:,:,2);[Greencounts,y] = imhist(R);B=BW(:,:,3);[Bluecounts,z] = imhist(R);figure;subplot(131);imhist(R);title('histogram of Red');subplot(132);imhist(G);title('histogram of Green');subplot(133);imhist(B);title('histogram of Blue');figure;Histcounts=REDcounts+Greencounts+Bluecounts;Histogramdata=Histcounts';plot(Histogramdata);


from http://zhidao.baidu.com/question/93505561

原创粉丝点击