April 2018
Beginner
552 pages
13h 58m
English
import cv2 import numpy as np
frontalface_cascade= cv2.CascadeClassifier('haarcascade_frontalface_alt.xml')
if frontalface_cascade.empty():
raiseIOError('Unable to load the face cascade classifier xml file')
capture = cv2.VideoCapture(0)
scale_factor = 0.5
# Loop until you hit the Esc key while True:
ret, frame = capture.read()
frame = cv2.resize(frame, None, fx=scale_factor, fy=scale_factor,
interpolation=cv2.INTER_AREA)