6
# Get user supplied values
9
# Create the haar cascade
10
faceCascade = cv2.CascadeClassifier(cascPath)
13
video_capture = cv2.VideoCapture(0)
14
ret, image = video_capture.read()
15
#gray = cv2.cvtColor(image, cv2.CV_BGR2GRAY)
18
# Detect faces in the image
19
faces = faceCascade.detectMultiScale(
24
flags = cv2.CASCADE_SCALE_IMAGE
27
# Draw a rectangle around the faces
28
for (x, y, w, h) in faces:
29
cv2.rectangle(image, (x, y), (x+w, y+h), (255, 36, 36), 5)
31
cv2.imwrite("processed_shot.png", image)