-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
36 lines (28 loc) · 809 Bytes
/
test.py
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
from SimpleCV import Camera, Display
#global x
def main():
x = 0;
cam = Camera (prop_set={'width':640, 'height':480})
disp = Display (resolution=(320,240))
while disp.isNotDone():
img = cam.getImage()
img = img.scale(0.5)
faces = img.findHaarFeatures("eye.xml")
#print "not Detected"
if faces:
for face in faces:
face.draw()
print "eyes Detected"
# x = 0
else:
# x += 1
print "close eyes"
#print (x)
#if x > 10:
# print "HOY GISING"
# return main()
img.save(disp)
#if x > 15:
#print("Hoy gising")
if __name__ == "__main__":
main()