Last active
July 1, 2020 14:55
-
-
Save LimaGuilherme/a2f18434ee062e95a906fc1e370fb520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
group_of_people_image = cv2.imread('images/image7.jpg') | |
frontal_face_classifier = cv2.CascadeClassifier('classifier/haarcascade_frontalface_default.xml') | |
image_in_gray_scale = cv2.cvtColor(group_of_people_image, cv2.COLOR_BGR2GRAY) | |
faces = frontal_face_classifier.detectMultiScale(image=image_in_gray_scale, scaleFactor=1.3, minNeighbors=6) | |
for (x_axis, y_axis, weight, height) in faces: | |
cv2.rectangle(group_of_people_image, (x_axis, y_axis), (x_axis + weight, y_axis + height), (255, 0, 0), 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment