Life2Coding
Python OpenCV Based Face Masking/Overlaying Example Tutorial

Face detection is the basic thing you can do with the OpenCV. But using this basic functionality you can overlay a mask on your face. You have to place the transparent mask after detecting the face to the location where it fits well. In this case, I put a sunglass over the eye. And after that, I locate the mouth position and overlay a cigar to the mouth. Then it looks really good. You can easily do the same by following the python code given below. It also works for videos as well.

Requirements:

Python Code:

Output:

Webcam:

Thugs-Life-313x250 Python OpenCV Based Face Masking/Overlaying Example Tutorial

Video File:

 

Thugs-LIfe-OpenCV-409x250 Python OpenCV Based Face Masking/Overlaying Example Tutorial

life2coding_icon [] Python OpenCV Based Face Masking/Overlaying Example Tutorial

Life2Coding

Technology Related Blog at Life2Coding
Feel free to contact us for your any kind of technical problems. We are here to help you.
life2coding_icon [] Python OpenCV Based Face Masking/Overlaying Example Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.