您的位置:首页 > 编程语言 > MATLAB

用Matlab绘彩色图像的直方图

2012-04-30 23:34 281 查看
直方图是常用的图表,用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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: