Expand Facial Features
Explore techniques to enlarge eyes and lips in digital images using Python. Understand how to use MediaPipe face detection and OpenCV for seamless facial feature expansion to enhance photos naturally.
Introduction
Looking at someone’s face, we first notice the color, size, and form of their eyes and the shape of their lips. Digital photo enhancements, like expanding the lips or the eyes, can lend a professional and polished look to your photos. This lesson will teach us how to exaggerate facial features in digital images.
Objective
This lesson goes through the steps needed for developing a lightweight utility written in the Python programing language that can make our eyes and lips look bigger in digital photos without appearing unnatural.
Dependencies
We’ll be using the following external Python libraries.
Library | Version |
| 0.8.9 |
| 4.4.0.46 |
| 1.19.4 |
| 1.0.7 |
Let’s code this utility!#
Let’s take a look at the main functions of this utility.
The remove_black_border function
As its name implies, this function removes the black borders around a chosen image. Let’s examine this function.
- Line 2 computes the indices of the elements that are non-zero in the