11-10-2016, 10:49 AM
clc;
close all;
clear all;
cam=webcam; c1=0;
EyeDetect = vision.CascadeObjectDetector('EyePairBig');
for co=0:650
I=snapshot(cam);
BB1=step(EyeDetect,I);
ay=sum(BB1(
);
if(ay==0)
c1=c1+1;
if(c1==100)
disp('turn the face');
end
else
Eyes=imcrop(I,BB1);
k=size(Eyes);
l2=k(2)/3;
w=round(l2);
ey=imcrop(Eyes,[0 0 l2 k(1)]);
figure (1),
subplot(3,1,1)
imshow(ey);
k2=size(ey);
a=rgb2gray(ey);
sa=sum(a(
);
subplot(3,1,2)
plot(1
ize(a,1),mean(a,2));
c1=0;
subplot(3,1,3)
imshow(I);
clc;
end
end
close all;
clear all;
cam=webcam; c1=0;
EyeDetect = vision.CascadeObjectDetector('EyePairBig');
for co=0:650
I=snapshot(cam);
BB1=step(EyeDetect,I);
ay=sum(BB1(
![Smile Smile](https://studentbank.in/images/smilies/smile.gif)
if(ay==0)
c1=c1+1;
if(c1==100)
disp('turn the face');
end
else
Eyes=imcrop(I,BB1);
k=size(Eyes);
l2=k(2)/3;
w=round(l2);
ey=imcrop(Eyes,[0 0 l2 k(1)]);
figure (1),
subplot(3,1,1)
imshow(ey);
k2=size(ey);
a=rgb2gray(ey);
sa=sum(a(
![Smile Smile](https://studentbank.in/images/smilies/smile.gif)
subplot(3,1,2)
plot(1
![Confused Confused](https://studentbank.in/images/smilies/confused.gif)
c1=0;
subplot(3,1,3)
imshow(I);
clc;
end
end