Skip to main content

Facial Landmarks Detection with DLIB Library

This week, my friend from my country started to do intership at University of Liverpool with me. Her name is Maksude Tuğçe Zile. We will work on a Project that involves measuring angles and distances between spesific landmarks in facial images. We will prefer to Python programming languages because my final Project was about opencv with python. We will try to place a point spesific landmarks in human's faces.(for instance we want to detect eye right outer and eye right inner etc. ) I am going to show how to detect eyes and eyebrows with opencv using dlib library.

What is Facial Landmark Detection ?

Facial Landmark Detection is a computer vision topic and it deals with the problem of detecting distinctive features in human faces automatically.
  • Tip of the nose
  • Corners of the eyes
  • Corners of the eyebrows
  • Corners of the mouth
  • Eye pupils
The detected landmarks are used in several different applications.

How to install Dlib ?

Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems.

We will use python programming language on Windows. To compile Dlib on Windows could be difficult. I have used steps shown as follow:

Step 1: Install Visual Studio 2015
Step 2: Install CMake v3.8.2
Step 3: Install Anaconda 3
Step 4: Download Dlib
Step 5: Build Dlib library
Step 6: Build Dlib examples
Step 7: Install Dlib’s Python modüle

For more details, you can visit this tutorial.






Comments

Post a Comment

Popular posts from this blog

Creating a Database for Wide-Close-Normal Eyes

In this stage, we are trying to classify different eyes shapes. The most important thing in this classification is distance between of two eyes. For example, if the space between two eyes is smaller than the width of one eye, this is close set eye or if vice versa, this is wide set eye. For normal set eyes, we specified a tolerance value and tested over approx. a hundred images. Then, we classified these images which called wide-close- normal eyes. In next stage, we will try in our program each image and make a histogram to get a correct result for classification. For instance this is close set eyes. Normal Set Eyes Wide Set Eyes Close Set Eyes

Simple Eyes Classification

There are lots of multiple kind of eyes on people. We can`t understand which kind of eyes at first view. In this samples, we will show you how to detect type of eyes. Even if there are a lot of variable eyes, firstly we will try to simple classification. We will consider only 3 types of eyes which are CAT EYE, OVAL EYE, DROOPY EYE. We shouldn`t  try to low definition images to get accurate results. 1. CAT EYE 2. ROUND/OVAL EYE 3. DROOPY EYE

Rotate an Facial Images

If you want to measure any facial landmarks correctly, you should rotate facial image which is not straight. The person who taken an photo may not stand straight. To avoid this situation, firstly we drew two lines throught eyes and nose. We rotate the image according to eye line. After that, we found the angle between two lines. This angle should be about 90 degrees for correct and straight face photos. If this angle is between 85-95 degrees, this photo can use to measuring and we rotate the image other but if it is not, the program gives an warning which is "This photo was rejected. Please take a photo again". So this method will give much more correct. Taken image Rotated image As you can see, the program gave a warning because the photo taken has an incorrect angle. Taken photo Rotated and original photo The program didn't give a warning. This photo is suitable.