In my last post, I worked on Detecting Face and Eyes in an Image using Python. In this post, I will extend the same functionality, but on a Live Image. Now, Live Image means, it will open the device’s camera(Webcam) and start capturing the image. This is exactly what a makeup app does. It detects the face, eyes, lips, and then allows one to put makeup. Cool right?
In this post, I will just write down the algorithm with a small addition of Smile Detection and Eyeglasses Detection. The previous algorithm was not working well when I used my daughter’s image with glasses. Then I found out that openCV has a couple of other XML files that can be useful. Below is the list of files under “Haarcascades”.
When I was trying to run the algorithm, my daughter caught a glimpse of my face with colorful squares all around. She was super excited and wanted some squares on her face too. That way, I got my another two test cases.
- Images with glasses
- Detecting multiple faces and features
So now, without spending much time on chitchat, let’s dive directly into my modified version of the Face Detection algorithm.
Now, This algorithm works quite well on a single face. But, if there are multiple faces, it gets a little confused. Oh well, I can live with that!
To open a makeup palette and put it nice and clean? That requires another level of perfection. Let’s keep that fun project for some other day!
Here, is the Github link for this project.
Thank You!
0