📄 testing.m
字号:
%
% 测试,计算FRR和FAR
% function [out_d,out_dt]=testing()
% 计算类内距离
%
MM=3;
Dist=[];
for i=0:99
for j=1:MM
eval(['load Log_orth\im_' num2str(i) '_',num2str(j) ]);
temp1=im_weight;
% temp1=temp1(1:end);
clear im_weight;
for k=4:6
eval(['load Log_orth\im_' num2str(i) '_',num2str(k)]);
temp2=im_weight;
% temp2=temp2(1:end);
clear im_weight;
dista=0;
% dista=1-dot(temp1,temp2)/(norm(temp2)*norm(temp1))
dista=norm(temp2-temp1);
Dist=[Dist dista];
end
end
end
%计算类间距离
Dis=[];
for i=0:98
for ii=i+1:99
for jj=1:MM
eval(['load Log_orth\im_' num2str(i) '_',num2str(jj) ]);
temp3=im_weight;
% temp3=temp3(1:end);
clear im_weight;
for jjj=4:6
eval(['load Log_orth\im_' num2str(ii) '_',num2str(jjj) ]);
temp4=im_weight;
% temp4=temp4(1:end);
clear im_weight;
% dis=1-dot(temp3,temp4)/(norm(temp3)*norm(temp4))
dis=norm(temp4-temp3);
Dis=[Dis dis];
end
end
end
end
save Gabor_15orth.mat Dis Dist
% out_d=Dis;
% out_dt=Dist;
% FAR=[];GAR=[];
% W_P=[];
% B_P=[];
% D_max=max(Dis);
% H_max=max(Dist);
% DI_max=max(D_max,H_max);
% Dis=Dis/DI_max;
% Dist=Dist/DI_max;
% Dis=Dis;
% Dist=Dist;
% nn=0.01;
% for i=0:nn:1
% n=0;m=0;
%
%
% far=size(find(Dis<i),2)/size(Dis,2);% 计算错误接受率
% gar=1-size(find(Dist>i),2)/size(Dist,2);% 计算错误拒绝率
%
%
% W_d=sum(Dist>i&Dist<i+nn);
% B_d=sum(Dis>i&Dis<i+nn);
%
% W_persent=W_d/size(Dist,2);
% B_persent=B_d/size(Dis,2);
%
% W_P=[W_P W_persent];
% B_P=[B_P B_persent];
% FAR=[FAR far*100];
% GAR=[GAR gar*100];
% end
% % eval(['save EI' num2str(MM) '_0.1_FAR FAR;']);
% % eval(['save EI' num2str(MM) '_0.1_FRR GAR;']);
% x=0:nn:1;
%
% figure(1)
% plot(x,W_P*100,'b--',x,B_P*100,'k');
% xlabel('Distance');
% ylabel('Percent(%) ');
% figure (2);
% semilogx(FAR, GAR,'r-*');
% xlabel('False Accept Rate(%)');
% ylabel('Genuine Accept Rate(%)');
% hold on
% hold on;
% aa=0:nn:5.0;
% bb=aa;
% plot(aa,bb,'--');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -