直方图是常用的图表,用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
本文介绍如何使用MATLAB进行图像颜色通道的直方图分析。通过读取图像文件并分离RGB颜色通道,分别计算各通道的直方图,并最终绘制整体直方图。此方法适用于图像处理和计算机视觉领域的研究。
1万+

被折叠的 条评论
为什么被折叠?



