January 2018
Intermediate to advanced
268 pages
6h 20m
English
Now that we know how to detect and track faces, let's have some fun with it. When we capture a video stream from the webcam, we can overlay funny masks on top of our faces. It will look something like the following image:

If you are a fan of Hannibal, you can try this one:

Let's look at the code to see how to overlay the skull mask on top of the face in the input video stream:
import cv2 import numpy as np face_cascade = cv2.CascadeClassifier('./cascade_files/haarcascade_frontalface_alt.xml') face_mask = cv2.imread('./images/mask_hannibal.png') ...Read now
Unlock full access