merge #1
							
								
								
									
										14
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								main.py
									
									
									
									
									
								
							@ -6,7 +6,7 @@ import cv2
 | 
			
		||||
import numpy as np
 | 
			
		||||
 | 
			
		||||
def init():
 | 
			
		||||
	go = true
 | 
			
		||||
	go = True
 | 
			
		||||
	print('Initilizing Camera and cascade components..')
 | 
			
		||||
	try:
 | 
			
		||||
		camera = PiCamera()
 | 
			
		||||
@ -15,7 +15,7 @@ def init():
 | 
			
		||||
		print('[ OK ] Camera')
 | 
			
		||||
	except:
 | 
			
		||||
		print('[ Error ] Can not initialize PiCamera')
 | 
			
		||||
		go = false
 | 
			
		||||
		go = False
 | 
			
		||||
 | 
			
		||||
	try:
 | 
			
		||||
		face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
 | 
			
		||||
@ -23,14 +23,14 @@ def init():
 | 
			
		||||
		print('[ OK ] CascadeClassifier')
 | 
			
		||||
	except:
 | 
			
		||||
		print('[ Error ] Can not load cascade File')
 | 
			
		||||
		go = false
 | 
			
		||||
		go = False
 | 
			
		||||
	if (go):
 | 
			
		||||
		print('Starting Photo loop..')
 | 
			
		||||
		start(camera)
 | 
			
		||||
		start(camera, face_cascade)
 | 
			
		||||
	else: 
 | 
			
		||||
		print('closing')
 | 
			
		||||
	
 | 
			
		||||
def start(camera):
 | 
			
		||||
def start( camera, face_cascade):
 | 
			
		||||
	while True:
 | 
			
		||||
		try:
 | 
			
		||||
			print('Taking photo')
 | 
			
		||||
@ -61,9 +61,5 @@ def start(camera):
 | 
			
		||||
			print('Closing')
 | 
			
		||||
			break
 | 
			
		||||
	
 | 
			
		||||
def recognize():
 | 
			
		||||
 | 
			
		||||
def sendOK():
 | 
			
		||||
 | 
			
		||||
init()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user