-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtestFaceDetection.m
More file actions
36 lines (27 loc) · 1008 Bytes
/
Copy pathtestFaceDetection.m
File metadata and controls
36 lines (27 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function testFaceDetection()
DirPath = 'Images/DB1/'; % File Path
S = dir(fullfile(DirPath,'db1_*.jpg')); % Pattern to match filenames.
%% Read in all images inside the database
for k = 1:numel(S)
% Read one image from database folder.
F = fullfile(DirPath,S(k).name);
im = imread(F);
faceMaskIm = faceMask(im);
eyeMapn = eyeMap(im, faceMaskIm);
[P1, P2] = eyeDetect(eyeMapn, faceMaskIm);
%Show raw image from database.
figure; imshow(im);
%Show Image which is used to detect blobs when finding eyes.
%figure; imshow(combinedMask(eyeMapn, faceMaskIm));
% Show blue dots for eyes.
if(P1 ~= -1)
hold on; plot(P1(1), P1(2), 'ro' ...
,'MarkerSize', 6, ...
'MarkerEdgeColor', 'b', ...
'MarkerFaceColor', 'b');
hold on; plot(P2(1), P2(2), 'ro' ...
,'MarkerSize', 6, ...
'MarkerEdgeColor', 'b', ...
'MarkerFaceColor', 'b');
end
end