close all;
clear all; char name ; name = '001'; char nm ; nm = 'nm-01'; a=cell(1,200); c=0; for i=47:102 b= num2str(i);% num2str将x转为字符 if i<100 p1 =(strcat('G:\GaitDatasetB-silh\silhouettes\',name,'\',name,'\',nm,'\090\',name,'-',nm,'-',... '090-0',b,'.png')); else p1 =(strcat('G:\GaitDatasetB-silh\silhouettes\',name,'\',name,'\',nm,'\090\',name,'-',nm,'-',... '090-',b,'.png')); end c=c+1; a{1,c}=edge(imread(p1)); end [height,width]=size(a{1,1}); sum=zeros(height,width); total=c; for i=1:c for j=1:height for y=1:width sum(j,y)=a{1,i}(j,y)+sum(j,y); end end end figure();imshow(sum);title('sum'); for j=1:height for y=1:width gei(j,y)=sum(j,y)/total; end end
figure();imshow(gei);title('gei');
|