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

📄 plotfaces.m

📁 It is for Face Recognition
💻 M
字号:
function []=plotFaces(faces, lEyes, rEyes, mouths, thresFaceProb, pcolor)

  hold on;
  nLEye = length(lEyes(1,:));
  nREye = length(rEyes(1,:));
  nMouth = length(mouths(1,:));
  nFace = length(faces(1,:));

  allx = [lEyes(3,:) rEyes(3,:) mouths(3,:)];
  ally = [lEyes(4,:) rEyes(4,:) mouths(4,:)];
  xmin = min(allx);
  xmax = max(allx);
  ymin = min(ally);
  ymax = max(ally);

  axis([xmin-5 xmax+5 ymin-5 ymax+5]);

  for j=1:nLEye
    plot(lEyes(3,j), lEyes(4,j), 'Or');
    plot(lEyes(3,j), lEyes(4,j), '+r');
  end

  for k=1:nREye
    plot(rEyes(3,k), rEyes(4,k), 'Ob');
    plot(rEyes(3,k), rEyes(4,k), '*b');
  end

  for t=1:nMouth
    plot(mouths(3,t), mouths(4,t), '^k');
  end

  styl = sprintf(':%s', pcolor);
  for i=1:nFace
    if faces(1,i) > thresFaceProb
       % plot eye pair line
       px=[faces(3,i) faces(5,i)];py=[faces(4,i) faces(6,i)];
       plot(px, py, '.', px, py, styl);
       % plot left eye-mouth line
       px=[faces(3,i) faces(7,i)];py=[faces(4,i) faces(8,i)];
       plot(px, py, '.', px, py, styl);
       % plot right eye-mouth line
       px=[faces(5,i) faces(7,i)];py=[faces(6,i) faces(8,i)];
       plot(px, py, '.', px, py, styl);    
    end
  end

  return;

⌨️ 快捷键说明

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