提交 dd9d080c 编写于 作者: A Aref Ariyapour

Fix exit key in blink detection example

Set q for exiting the program. Move cv2.waitKey() outside the for loop that detects face landmarks.
上级 d34c622b
...@@ -57,7 +57,6 @@ def main(): ...@@ -57,7 +57,6 @@ def main():
cv2.rectangle(small_frame, left_eye[0], right_eye[-1], color, thickness) cv2.rectangle(small_frame, left_eye[0], right_eye[-1], color, thickness)
cv2.imshow('Video', small_frame) cv2.imshow('Video', small_frame)
cv2.waitKey(1)
ear_left = get_ear(left_eye) ear_left = get_ear(left_eye)
ear_right = get_ear(right_eye) ear_right = get_ear(right_eye)
...@@ -80,6 +79,9 @@ def main(): ...@@ -80,6 +79,9 @@ def main():
closed_count = 0 closed_count = 0
process = not process process = not process
key = cv2.waitKey(1) & 0xFF
if key == ord("q"):
break
def get_ear(eye): def get_ear(eye):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册