Detect Face With Opencv and Python 3.6
Detect Face With Opencv and Python 3.6
Detect Face With Opencv and Python 3.6
import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
video_capture = cv2.VideoCapture(1)
while True:
_, frame = video_capture.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
canvas = detect(gray, frame)
cv2.imshow('Video Capture', canvas)
if cv2.waitKey(1) & 0XFF == ord('q'):
break
video_capture.release()
cv2.destroyAllWindows()