?? markfeatures.m
字號:
%Script markFeatures
%For marking eye and mouth positions in face images.
%Writes a file called Labels.mat, in which each row indexes an image, and
%the columns are [x,y] positions of subject's right eye, [x,y] left eye,
%and [x,y] of mouth. Specify the image directory and the destination
%directory (Where you want the labels saved) at the top of the script.
imgdir = 'C:\Documents and Settings\Marian Bartlett\My Documents\TestDir\FaceImages\'
destdir = 'C:\Documents and Settings\Marian Bartlett\My Documents\TestDir\'
cd (imgdir)
r = dir;
%get marks
marks = [];
for i = 3:(size(r,1))
t = r(i).name;
[X,map] = imread([ t ]);
figure(1);
colormap gray;
if isfloat(X)
image(gray2ind(mat2gray((X))));
else
image(X);
end
title(t);
disp 'Click subjects right eye, left eye, then mouth.'
[m,n] = ginput(3); pos = round([m,n]);
pos = reshape(pos',1,6);
marks = [marks; pos];
end
cd (destdir)
save Labels marks r
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -