Distracted driving is the number one cause of accidents, the cause of these distractions may include drowsiness, using cell phone, intoxications due to cigarette or alcohol, etc. The proposed project aims at monitoring the attentiveness of the driver and alerting the driver when his/her alertness goes below a certain threshold. It uses image processing using OpenCV and yolo algorithm to detect the eyes and object respectively and sounds an alarm when the driver is either drowsy or using his cell phone or smoking a cigarette.
We built a device that detects drowsiness and alerts the driver if drowsiness is detected. Device which we built is portable and can be implemented in any vehicle. This device will capture out continuous real time images of the driver and check for drowsiness. Image processing is accomplished using a raspberry pi processor and open CV. Cell phone and cigarette detection is achieved by using YOLO algorithm. The video is acquired through the USB camera and fed into two algorithms. The first algorithm is used to determine the driver drowsiness. The second algorithm determines whether the driver is using a cell phone or smoking a cigarette while driving.
The first algorithm localizes the face and detects the key facial structure of it. The facial detection is done through OpenCV and NumPy. The face is continuously captured using the USB camera. The landmark indices of both eye area are highlighted in the frame. The open or closed state of eye is determined using the distance between upper eye lid and lower eye lid.
If the distance between upper eye lid and lower eye lid is less than a threshold value a timer is initiated up to three seconds after which the alarm is turned on to alert the driver of drowsy behavior.
The second algorithm is used to determine the usage of cell phone or a cigarette. The image acquired from the USB cam is given to yolo algorithm where it is converted it into a grid image that will give the feature of the object. Then using the OpenCV the input image data points are read and given to specified image in a NumPy array. As a result, image with a rectangular box is obtained using yolo and COCO data sets. If the object determined is a cell phone or a cigarette warning will be issued to driver through alarms.
