-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Ayush Jaiswal | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Fatigue(Drowsiness) Detection using OpenCV[](https://github.com/jaisayush/Fatigue-Detection-System-Based-On-Behavioural-Characteristics-Of-Driver/blob/master/LICENSE) [](https://github.com/jaisayush) | ||
## Applications | ||
### This can be used by riders who tends to drive the vehicle for a longer period of time that may lead to accidents | ||
## Code Requirements | ||
### The example code is in Python ([version 2.7](https://www.python.org/download/releases/2.7/) or higher will work). | ||
## Dependencies | ||
``` | ||
1)import cv2 | ||
2)import immutils | ||
3)import dlib | ||
4)import scipy | ||
5)import playsound | ||
6)import queue | ||
7)import time | ||
8)import sys | ||
``` | ||
## Description | ||
### A computer vision system made with the help of opencv that can automatically detect driver drowsiness in a real-time video stream and then play an alarm if the driver appears to be drowsy. | ||
## Algorithm | ||
● We utilised a pre trained frontal face detector from Dlib’s library which is based on a modification to the Histogram of Oriented Gradients in combination with Linear SVM for classification. | ||
|
||
● The pre-trained facial landmark detector inside the dlib library is used to estimate the location of 68 (x, y)-coordinates that map to facial structures on the face. The 68 landmark output is shown in the figure below. However, we utilised the 70 landmark model. | ||
|
||
<img src="https://github.com/jaisayush/Fatigue-Detection-System-Based-On-Behavioural-Characteristics-Of-Driver/blob/master/face.PNG"> | ||
|
||
● We then calculate the aspect ratio to check whether eyes are opened or closed. | ||
|
||
● The eye is open if Eye Aspect ratio is greater than threshold. (Around 0.3) | ||
|
||
<img src="https://github.com/jaisayush/Fatigue-Detection-System-Based-On-Behavioural-Characteristics-Of-Driver/blob/master/eye.PNG"> | ||
|
||
● A blink is supposed to last 200-300 milliseconds. | ||
|
||
● A drowsy blink would last for 800-900 ms. | ||
|
||
<img src="https://github.com/jaisayush/Fatigue-Detection-System-Based-On-Behavioural-Characteristics-Of-Driver/blob/master/eye_aspect_ratio.PNG"> | ||
|
||
## Execution | ||
To run the code, run | ||
|
||
``` | ||
python blinkDetect.py | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.