This commit is contained in:
HeshamTB 2018-11-30 11:11:40 +00:00
commit 8ff03abb53
4 changed files with 139161 additions and 5 deletions

View File

@ -55,7 +55,7 @@ void loop() {
//if (Serial.read() == 'o') {
digitalWrite(relayPin, HIGH);
playBuzzer(300,true);
delay(7000);
delay(4000);
digitalWrite(relayPin, LOW);
IROK = false;
UltraOK = false;

139158
faces/m

File diff suppressed because it is too large Load Diff

View File

@ -37,6 +37,7 @@ def init():
go = False
if (go):
print('Starting Photo loop..')
print('Known people are '+str(loadNames()))
start(camera, face_cascade)
else:
@ -57,7 +58,7 @@ def start( camera, face_cascade):
init()
img = rawCapture.array
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.2,5)
faces = face_cascade.detectMultiScale(gray, 1.3,5)
i = 0;
for (x,y,w,h) in faces:
i += 1
@ -87,7 +88,7 @@ def recognize(image,face_recognizer, names):
label= face_recognizer.predict(img)
except:
print('[ Error ] Error in Recognize() function')
if label[1] > 120:
if label[1] > 100:
return 'unknown'
else:
print(str(label) + ' >>'+names[label[0]])

View File

@ -125,3 +125,4 @@ def addName(newName):
with open("faces/names.json","w") as write_file:
json.dump(names,write_file)
start()