isface.m

来自「It is for Face Recognition」· M 代码 · 共 39 行

M
39
字号
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function isFace()
%   z.li, 05-25-2004
%   face prob based on multiple local SVM classification
% function dependency:
%   - n/a
% input:
%   fmj, nfmj, Rj - model j: nxd. 
%   x1, x2, x3  - unknown image: 1xd
% output:
%   p  -  prob of face
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function [p]=isFace(fm1, nfm1, R1, fm2, nfm2, R2, fm3, nfm3, R3, x1, x2, x3)
function [p]=isFace(fm1, nfm1, R1, fm2, nfm2, R2, fm3, nfm3, R3, x1, x2, x3)
    
 % const
 method = 'quadratic';

 % build 3 local models
 [X1, Y1, err1, m11, m12]=buildLocalModel(x1, R1, fm1, nfm1, method);
 [X2, Y2, err2, m21, m22]=buildLocalModel(x2, R2, fm2, nfm2, method);
 [X3, Y3, err3, m31, m32]=buildLocalModel(x3, R3, fm3, nfm3, method);

 % boosting the classification 
 c1=classify(x1, X1, Y1, method);
 c2=classify(x2, X2, Y2, method);
 c3=classify(x3, X3, Y3, method);
 C=[c1, c2, c3];

 % simple min err classify
 [minErr, indx]=min([err1, err2, err3]);
 if C(indx(1))== 1
    p = 1.0;
 else
    p = 0;
 end


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?