Driver Drowsiness Detection

This project describes a computer vision system that can automatically detect driver drowsiness in a real-time video stream and then play an alarm if the driver appears to be drowsy.

METHODOLOGY

The general flow of our drowsiness detection algorithm is fairly straightforward. First, we’ll setup a camera that monitors a stream for faces. If a face is found, we apply facial landmark detection and extract the eye regions. Now that we have the eye regions, we can compute the eye aspect ratio to determine if the eyes are closed.If the eye aspect ratio indicates that the eyes have been closed for a sufficiently long enough amount of time, we’ll sound an alarm to wake up the driver.

Once we have our eye regions, we can apply the eye aspect ratio to determine if the eyes are closed. If the eyes have been closed for a sufficiently long enough period of time, we can assume the user is at risk of falling asleep and sound an alarm to grab their attention. A countless number of people drive on the highway day and night. Taxi drivers, bus drivers, truck drivers and people traveling long-distance suffer from lack of sleep. Due to which it becomes very dangerous to drive when feeling sleepy.

The facial landmarks produced by dlib are an indexable list. The dlib library ships with a Histogram of Oriented Gradients-based face detector along with a facial landmark predictor — we instantiate both of these. To extract the eye regions from a set of facial landmarks, we simply need to know the correct array slice indexes.

Our drowsiness detector hinged on two important computer vision techniques:

  • Facial landmark detection
  • Eye aspect ratio