1. 程式人生 > >在圖片上面畫積分投影曲線

在圖片上面畫積分投影曲線

path='D:\facedatabase\eyes\3.jpg';
I=imread(path);
hf=figure(1);
haxes=axes('parent',hf,'units','normalized','position',[0.1 0.1 0.8 0.8]);
axes(haxes);
image(I);
axis on
I=rgb2gray(I);
I=double(I);
[m,n,t]=size(I)
s1=zeros(1,n);
for i=1:n
    for j=1:m
        s1(i)=s1(i)+I(j,i);
    end
end
hold on
x=1:n;
plot(x,s1/100);
s1
axis on;
axis auto;