As the death toll from the Wuhan coronavirus still risen, I felt anxious and helpless through everyone here were talking and laughing on New Year's Eve. Not sure what should I do and I just wrote this python3 program to make people aware of the importance of wearing respirator masks when defeating the virus.
In this program, we use CascadeClassifier
to add respirators masks to the recognized faces in the capture. Before everything start, we have to import the necessary packages:
import argparse
import cv2
We use argparse
to construct the argument parse for more flexible usage. The respirator image cloud be found on eBay, Google... and transparent background required as .png
format. The haarcascade_frontalface_default.xml
could be found at OpenCV official git repository https://github.com/opencv/opencv/tree/master/data/haarcascade
.