📄 inputfacialfeatures.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function inputFacialFeatures()
% z.li, 11-20-2003.
% input facial features
% function dependency:
% - n/a
% input:
% nLEye
% nREye
% nMouth
% output:
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function [lEyes, rEyes, mouths] = inputFacialFeatures(nLEye, nREye, nMouth)
function [lEyes, rEyes, mouths] = inputFacialFeatures(nLEye, nREye, nMouth)
% const
minScale = 4;
maxScale = 4.001;
minProb = 0.999;
maxProb = 1.0;
% prep interface
figure(1);
clf;
axis([1 100 1 100]);
hold on;
% scales and probs
n = max([nLEye, nREye, nMouth]);
prob = random('unif', minProb, maxProb, n, 1);
scales = random('unif', minScale, maxScale, n, 1);
% input left eye
fprintf('input left eye positions (n=%d)..', nLEye);
for i=1:nLEye
% create arbitrary 2D data....
[tx,ty] = ginput(1);
plot(tx,ty,'+r');
lEyes(1,i) = prob(i);
lEyes(2,i) = fix(scales(i));
lEyes(3,i) = tx;
lEyes(4,i) = ty;
lEyes(5,i) = 0;
lEyes(6,i) = 0;
end
% input right eye
fprintf('input right eye positions (n=%d)..', nREye);
for i=1:nREye
% create arbitrary 2D data....
[tx,ty] = ginput(1);
plot(tx,ty,'+b');
rEyes(1,i) = prob(i);
rEyes(2,i) = fix(scales(i));
rEyes(3,i) = tx;
rEyes(4,i) = ty;
rEyes(5,i) = 0;
rEyes(6,i) = 0;
end
% input mouth
fprintf('input mouth positions (n=%d)..', nMouth);
for i=1:nMouth
% create arbitrary 2D data....
[tx,ty] = ginput(1);
plot(tx,ty,'^k');
mouths(1,i) = prob(i);
mouths(2,i) = fix(scales(i));
mouths(3,i) = tx;
mouths(4,i) = ty;
mouths(5,i) = 0; % all horizontal mouth
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -