⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eyesmouthlikelihood.m

📁 It is for Face Recognition
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function eyesMouthLikelihood()
%   z.li, 11-10-2003.
%   face detection from local facial features
% function dependency:
%   - adjustLogProb()
% input:
%   le   - 6x1:[(1)prob, (2)scale, (3)x, (4)y, (5)w, (6)h]
%   re   - 6x1:[(1)prob, (2)scale, (3)x, (4)y, (5)w, (6)h]
%   mo   - 5x1:[(1)prob, (2)scale, (3)x, (4)y, (5)theta]
% output:
%   p   - prob
%   stats - [angDiff minScale maxScale d a b]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function [p, stats]=eyesMouthLikelihood(le, re, mo)
function [p, stats]=eyesMouthLikelihood(le, re, mo)
  dbg = 'n';
  % input parameters
  if dbg=='y'
     le = [0.9, 2, 20, 30, 0, 0];
     re = [1.0, 3, 40, 31, 0, 0];
     mo = [0.8, 4, 32, 20, 0];
  end

  % compute max and min scales 
  scales=[le(2) re(2) mo(2)];
  maxScale = max(scales);
  minScale = min(scales);

  % compute eye pair angle 
  ep = le(3:4) - re(3:4);
  if ep(2) == 0   % flat angle
     angEyePair = 0;
  else
     angEyePair = atan(ep(2)/ep(1));
  end
  % eye pair and mouth line angle diff 
  angDiff = abs(angEyePair - mo(5));

  % symetry diff
  d = norm(le(3:4) - re(3:4));
  a = norm(le(3:4) - mo(3:4));
  b = norm(re(3:4) - mo(3:4));
    
  % output stats
  fprintf('\n stats=[angDiff minScale maxScale d a b]');
  stats = [angDiff minScale maxScale d a b]

  % init log prob
  logp = log(le(1)) + log(re(1)) + log(mo(1));
  logp = logp + adjustLogProb(angDiff, minScale, maxScale, d, a, b);

  p = exp(logp);
 

⌨️ 快捷键说明

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