www.gusucode.com > 图像识别 人脸识别和虹膜识别 > code7/gabor_eer.m

    %Gabor_eer
%计算FRR,FAR。
%result2中存放hamming距离
function [FRR FAR] = gabor_eer(threshold,result2)
icount = 0;
icount2 = 0;
% threshold = 0.38;     %hamming距离门限0.3281
% u=1;
% k=1;
for m=1:60              %第m人
    temp = result2{m,m};        %读出hamming距离
    %     temp = temp1(1:10,1:10);    %只取前十幅图进行比较
    temp2 = (temp>threshold);   %大于门限被拒识
    icount = icount+sum(sum(temp2));    %被误拒的样本数
    %     %将比较数据读到一维数组中,方便使用hist()进行分析-----
    %     for p = 1:9
    %         for q = p+1:10
    %             inkind(u) = temp(p,q);  %统计类内分布
    %             u=u+1;
    %         end
    %     end
    %     %将比较数据读到一维数组中,方便使用hist()进行分析-----
end
FRR = icount/11400; %2700(只取前十幅);%11400(二十幅都取);%(u-1); %比较次数(((20*19)/2)*60)=11400;
% inmean = mean(inkind);
% instd = std(inkind);


for m=1:59
    for n=m+1:60
        temp3 = result2{m,n};
        %         exkind(k) = temp3(1,1);         %统计类间分布
        %         k=k+1;
        if temp3(1,1)<=threshold        %小于等于门限被误识
            icount2 = icount2+1;        %误识数
        end
    end
end
FAR = icount2/1770; %(k-1);    %比较次数((60*59)/2)=1770;
% exmean = mean(exkind);
% exstd = std(exkind);