March 2020
Intermediate to advanced
366 pages
9h 8m
English
Now, we will put what we learned in the previous section into a method that will take an image and return the biggest face in the image. We are returning the biggest face to simplify things since we know that, in our application, there is going to be a single user sitting in front of the webcam. As a challenge, you could try to expand this to work with more than one face!
We call the method to detect the biggest face (detect_face). Let's go through it step by step:
def detect_face(self, rgb_img, *, outline=True): frameCasc = cv2.cvtColor(cv2.resize(rgb_img, (0, 0), ...