Face filters are common applications that we use almost every day in our lives. From Snapchat to Instagram there are thousands of filters that allow you to look like an animal, a princess or even another human being. As fun as it is to use these filters, it is also simple to build your own custom face filter. Using basic and efficient OpenCV techniques we will build a custom face filter that replaces your nose with a dog nose.

In this article, we will learn about the implementation of face filters using a 68 point landmark detector and OpenCV.

Understanding the landmark stabilizer.

For this implementation, we will make use of the 68 point landmark stabilizer. Download the stabilizer using this link. The landmark stabilizer is a file from the dlib package that makes it easy to identify 68 points on the human face. These landmarks are a key factor in building the face filter.

dlibPIN IT

As shown above, these points can help in locating the coordinate points of the nose, eyes and lips. Using these points it is possible to place the filter exactly on the location needed. So let us get started with the implementation.

If you don’t already have dlib installed you can install this package using

pip install dlib  

Once you have downloaded the landmark stabilizer and installed dlib, we can start with the implementation. Select the filter you want to apply for your face. I have selected the animated image of a dog’s nose. If you would like to use the same image you can download it here.

#developers corner #dlib #face filter #landmarks #opencv

How to Build Your Own Face Filter With OpenCV?
5.30 GEEK