source: proiecte/PPPP/ica/markFeatures.m.bkp @ 138

Last change on this file since 138 was 138, checked in by (none), 14 years ago

PPPP - ica

File size: 1015 bytes
Line 
1%Script markFeatures
2%For marking eye and mouth positions in face images.
3%Writes a file called Labels.mat, in which each row indexes an image, and
4%the columns are [x,y] positions of subject's right eye, [x,y] left eye,
5%and [x,y] of mouth. Specify the image directory and the destination
6%directory (Where you want the labels saved) at the top of the script.
7
8
9imgdir = 'C:\Documents and Settings\Marian Bartlett\My Documents\TestDir\FaceImages\'
10destdir = 'C:\Documents and Settings\Marian Bartlett\My Documents\TestDir\'
11
12cd (imgdir)
13r = dir;
14
15%get marks
16marks = [];
17for i = 3:(size(r,1))
18    t = r(i).name;
19    [X,map] = imread([ t ]);
20
21    figure(1);
22    colormap gray;
23    if isfloat(X)
24        image(gray2ind(mat2gray((X))));
25    else
26        image(X);
27    end
28    title(t);
29    disp 'Click subjects right eye, left eye, then mouth.'
30    [m,n] = ginput(3); pos = round([m,n]);
31    pos = reshape(pos',1,6);
32    marks = [marks; pos];
33end
34
35cd (destdir)
36save Labels marks r
Note: See TracBrowser for help on using the repository browser.