Building A Drowsiness Detector Using Machine Learning

This method for drowsiness detection is fast, efficient, and easy to implement.

c0d3x27
Geek Culture

--

Photo by Kalegin Michail on Unsplash

W e are going to build a computer vision application that is capable of detecting drowsiness in video streams using facial landmarks with OpenCV, Python, and dlib. To build this detector, we’ll be using the eye aspect ratio (EAR), introduced by Soukupová and Čech.

EAR

Keeping it short and simple, the eye aspect ratio is an elegant solution that involves a very simple calculation based on the ratio of distances between facial landmarks of the eyes.

The eye aspect ratio equation. Based on the work by Soukupová and Čech in Real-Time Eye Blink Detection using Facial Landmarks

Figure 1: Open and closed eyes with landmarks pi automatically detected by [1]. The eye aspect ratio EAR in Eq. (1) plotted for several frames of a video sequence. A single blink is present

I will go straight into how the program detects drowsiness, leaving out face landmarks, face recognition, and other technical explanations. Let’s concentrate only on the…

--

--

c0d3x27
Geek Culture

OSCP || CompTIA Cysa+, Sec+, A+, ITF+,CSAP | | Bug Hunter | | Security Consultant | | 0-day Researcher