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

📄 geteyelocation.m

📁 It is for Face Recognition
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function getEyeLocation()
%   z.li, 09-09-2004
%   get eye locations by manual labeling
% function dependency:
%   - n/a
% input:
%   img    - image
%   nFace  - how many faces
% output:
%   eyes   - nFace x 4 location data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function [eyes]=getEyeLocation(img, nFace)
function [eyes]=getEyeLocation(img, nFace)

imshow(img, [0, 255]); hold on;
eyes = zeros(nFace, 4); 
% get eye locations
for k=1:nFace
  [lx ly]=ginput(1); 
  lx = fix(lx); ly=fix(ly); plot(lx, ly, '+r'); 
  fprintf('\n left eye at: [%d %d]', lx, ly);
  [rx ry]=ginput(1); 
  rx = fix(rx); ry = fix(ry); plot(rx, ry, '+m');
  fprintf('\n right eye at: [%d %d]', rx, ry);
  eyes(k,:)=[lx ly rx ry];
end

eyes = fix(eyes);

⌨️ 快捷键说明

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