📄 getfaceicons.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function getFaceIcons()
% z.li, 12-26-2003.
% get face in icons with specified size
% function dependency:
% - showFeretFace()
% input:
% truth - ground truth about eye, mouth, nose location
% W, H - size of icon in pels, notice that the area has been fixed by
% showFeretFace()
% output:
% faceIcnos - facial area sub image
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function [faceIcons]=getFaceIcons(truth, W, H)
function [faceIcons]=getFaceIcons(truth, W, H)
dbg='n';
if dbg=='y'
truth = load('fbGndTruth.dat');
W = 20; H = 30; % implicit 2 by 3 constraint
end
n = length(truth(:,1));
m=1; offs=0;
if dbg == 'y'
n = 20;
end
for k=1:n
face = showFeretFace(truth, k);
[h w] = size(face);
if h ~=0 & w ~=0
fht(m) = h; fwid(m) = w; hwr(m) = h/w;
[icon vec]=scaleImage(face, W, H);
if dbg=='y'
figure(1); subplot(4,5,k); colormap('gray'); imagesc(icon);
figure(2); subplot(4,5,k); imshow(face, 256);
end
faceIcons(:,m)=vec;
fprintf('\n >>k=%d,m=%d>> ', k, m);
m=m+1;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -