File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 50
50
camera = picamera .PiCamera ()
51
51
camera .resolution = (1000 ,1000 )
52
52
53
- print ("Everything is loaded correctly" )
53
+ print ("Everything was loaded as intended" )
54
+
54
55
while True :
55
56
input_state = GPIO .input (21 )
56
57
if input_state == False :
57
- #time_ = time.time()
58
- print ("Starting to capture. Get ready" )
59
58
GPIO .output (12 , 1 )
60
59
date = time .strftime ("%Y-%m-%d_%H:%M:%S" )
61
60
82
81
#flags = cv2.cv.CV_HAAR_SCALE_IMAGE
83
82
flags = cv2 .CASCADE_SCALE_IMAGE
84
83
)
85
- if faces :
84
+ if faces == ():
85
+ print ("No faces found" )
86
+ continue
87
+ else :
86
88
for (x , y , w , h ) in faces :
87
89
boundary_factor = 0.1
88
90
# Make new image for detection
89
91
recog = image [y - int (boundary_factor * h ):y + int (h * (1 + boundary_factor )), x - int (boundary_factor * w ):x + int (w * (1 + boundary_factor ))]
90
-
91
- else :
92
- print ("No face detected" )
93
92
94
93
### Analysing in CNN ###
95
94
recog = cv2 .resize (recog , (150 ,150 ))
99
98
GPIO .output (12 , 0 )
100
99
GPIO .output (16 , 1 )
101
100
print prediction
102
- #print ("time needed: %.4f" %(time.time()-time_))
103
101
time .sleep (5 )
104
102
GPIO .output (16 , 0 )
105
- recog = []
You can’t perform that action at this time.
0 commit comments