def scanForFace():
while 1:
#This is where we will scan back and forth hunting for a face. We will
#begin turning the turret and scanning at the same time.
#Turn Servo one click right and start back other way when we max out
#Do a cap.read() command
ret, frame = cap.read()
gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(
gray,
scaleFactor = 1.3,
minNeighbors = 5
)
for (x,y,w,h) in faces:
foundFace = True
aimToFace()
评论列表
文章目录