作者commun (酷哥)
看板AVEncode
标题[请问]使用 MATLAB 作FOR回圈统计
时间Tue May 8 17:31:56 2007
command Window
>> fig=imread('cameraman.tif ');
imshow(fig);
[m,n]=size(fig);
histogram=zeros(1,256);
for i=1:m
for j=1:n
gray=fig(i,j);
histogram(1,gray+1)=histogram(1,gray+1)+1; <这行是什麽意思?>
end
end
plot(histogram);
另外这个是做彩色的R G B分离统计,但是我没办法写在一起R G B都要各写一次,很麻烦请
各位大大帮我
command Window
>> fig=imread('autumn.tif');
R=fig(:,:,1);
[m,n]=size(R);
histogram=zeros(1,256);
for i=1:m
for j=1:n
gray=R(i,j);
histogram(1,gray+1)=histogram(1,gray+1)+1;
end
end
plot(histogram);
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.141.4.1