Last change
on this file since 109 was
94,
checked in by (none), 14 years ago
|
PPPP - ica serial implementation
|
File size:
904 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 | function [] = markFeats(imgdir, destdir, fname)
|
---|
9 |
|
---|
10 | cd (imgdir)
|
---|
11 | r = dir;
|
---|
12 |
|
---|
13 | %get marks
|
---|
14 | marks = [];
|
---|
15 | for i = 3:(size(r,1))
|
---|
16 | t = r(i).name;
|
---|
17 | [X,map] = imread([ t ]);
|
---|
18 |
|
---|
19 | figure(1);
|
---|
20 | colormap gray;
|
---|
21 | if isfloat(X)
|
---|
22 | image(gray2ind(mat2gray((X))));
|
---|
23 | else
|
---|
24 | image(X);
|
---|
25 | end
|
---|
26 | title(t);
|
---|
27 | disp 'Click subjects right eye, left eye, then mouth.'
|
---|
28 | [m,n] = ginput(3); pos = round([m,n]);
|
---|
29 | pos = reshape(pos',1,6);
|
---|
30 | marks = [marks; pos];
|
---|
31 | end
|
---|
32 |
|
---|
33 | cd (destdir)
|
---|
34 | save(fname, 'marks', 'r')
|
---|
Note: See
TracBrowser
for help on using the repository browser.