Vehicle Accident Prevention System by Detecting Drowsy Driver Using Matlab
Vehicle Accident Prevention System by Detecting Drowsy Driver Using Matlab
https://doi.org/10.22214/ijraset.2022.44526
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VI June 2022- Available at www.ijraset.com
I. INTRODUCTION
According to World Health Organisation (WHO) every year the lives of approximately 1.3 million people are lost as a result of a
road traffic accidents. Road accidents leads to death or severe injuries which cannot be recovered back for life time. They lead to
permanent disabilities. Road accidents causes a lot of economic losses. One accident causes an entire family to suffer. Loss of a
person cannot be recovered, also if a person survives with disabilities a person has to take care of the affected.
Drowsy driving, also called as driver fatigue and tired driving is known as controlling the automobile while feeling sleepy. There
are many causes for a driver drowsiness such as tiredness and stress due to work, sleeplessness, driving for long hours etc. 35.7% of
the total accidents are caused due to drowsy driving. According to a survey 27% of drivers report feeling tired and to keep eyes open
and 1 in 25 drivers agree feeling drowsy while driving.
II. OBJECTIVE
Driver safety in the car is one of the most wanted system to avoid accidents. Our objective of the project is to ensure safety system.
For enhancing the safety we are detecting the eye blinks of the driver and estimating the driver status by using Viola Jones
algorithm and alerting the driver in case of no face detection or eyeball movement. This warning message helps the driver to
concentrate on driving and have a safe journey.
III. PROPOSED WORK
In this project work digital image processing (DIP) techniques are used to process the image acquired and the computer vision
toolbox which includes a function vision.CascadeObjectDetector( ) is used to detect the features of human face in Matlab. The
function vision,CascadeObjectDetector( ) in Matlab is used to detect the human face and its features is based upon the Viola Jones
algorithm.
A. Flow Chart
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4721
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VI June 2022- Available at www.ijraset.com
1) Image Acquisition: A web camera is placed facing the driver and it acquires live image of the automobile driver. The colour
image is converted into gray scale by using rgb2gray( ), an inbuilt function of Matlab.This image is further processed to detect
eye ball movement.
2) Diving into frames: After acquiring the image this image is divided into individual frames. And each frame is divided into a
group of blocks. Out of the entire image the face part is extracted based on number of pixels and it is evaluated for eye
detection.
3) Face Detection & eye Detection: For every time interval ‘t’, face is detected and further divided into frames for the detection of
eye. imfindcircles( ), a function in Matlab detects circular objects (with strong and weak edges) from image captured whose
radii specified are approximately equal to radius
4) Eye Ball Movement Detection: Using vision cascade techniques based on the number of white and black pixels in the image the
eye is detected and from the radius range of the eye ball specified, the presence or absence of the eye ball can be determined.
5) Determining the direction of eye ball: The direction of eye ball movement can be determined from the direction of pupil and
iris from the eye of automobile driver. The direction straight, left or right will be indicated if the eyes are open. And if the eyes
are detected to be closed an alarm sound is indicated to alert the driver.
A. Haar-Like Features
Alfred Haar, a Hungarian mathematician gave the concepts of Haar wavelets, which are a sequence of rescaled “square-shaped”
functions.
Haar-features are digital image features used for face detection. As humans contain lighter and darker regions at various parts of
their face that indicates organs. Haar-structures are used to identify lighter and darker regions of the face by summing up the number
of pixel values in the image and comparing them. The sum of the darker pixels is smaller than the sum of the lighter pictures.
Edge Features
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4722
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VI June 2022- Available at www.ijraset.com
Line Features
The four-sided features are used for finding diagonal features in the face
B. Integral Image
The disadvantage of haar-feature it is difficult to calculate haar-features as the number of pixels in the larger features are huge. This
problem can be overcome by crating integral images.
Integral image is an easy way to calculate sum of pixel values in a image or rectangular part of image. The value at each point is
obtained by the sum of all the pixels above the value, the value of the pixel and pixels which are to the left of the value.
For example:
C. Adaptive boosting(AdaBoost)
AdaBoost is technique or a training process that decides which features are to be used and which features can be eliminated for
detecting the faces in the images.
The AdaBoost runs all the subregions of an image for checking the performance of the classifier. Subregions that produce strong
response in the classifier are treated as ‘positives’ and the subregions that produce weak responses are treated as ‘negatives’.
The ‘positives’ indicate the presence of the face and the ‘negatives’ indicate absence of the face.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4723
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VI June 2022- Available at www.ijraset.com
D. Cascading Classifiers
The AdaBoost identifies the strong classifier and weak classifier based on its performance and assigns weights based on the
performance (best classifiers with more weight). The weak classifiers are cascaded in order to become a strong classifier.
When the subregion is applied as input to first classifier it checks for the presence of face features if it is detected to be face, the
output is treated as ‘maybe’ (true) and this subregion is applied as input to next classifier. If the classifier does not detect the face
then the output is ‘no’ (false) and the subregion is discarded.
Cascading classifiers are used for the faster detection of facial features.
VI. RESULTS
A. Detetion Of An Opened Eye
1) Eye Balls in Forward Direction: If the direction of eye balls is detected to look forward or straight then it is indicated by up
arrow.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4724
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VI June 2022- Available at www.ijraset.com
2) Eye Balls Facing Towards Left: If the direction of eye balls is detected to look left side then it is indicated by left arrow.
3) Eye balls facing towards right: If the direction of eye balls is detected to look right side then it is indicated by right arrow.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4725
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue VI June 2022- Available at www.ijraset.com
VII. CONCLUSION
Many accidents occur due to fatigue or drowsiness of the driver, Viola Jones algorithm is implemented in Matlab to detect the
condition of the driver whether the driver is drowsy or not. In this project the condition of the driver is verified for every time period
continuously and all the conditions verified to be accurate.
If the driver is detected to be drowsy an alarm is set to ring for a minute continuously to alert the driver and focus on driving, so as
to prevent from occurring of the accidents.
REFERENCES
[1] P. Viola and M. J. Jones, Robust real-time face detection, International Jour nal of Computer Vision, 57 (2004), pp. 137{154
[2] Rapid Object Detection using a Boosted Cascade of Simple Features https://web.iitd.ac.in/~sumeet/viola-cvpr-01.pdf
[3] Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems by Aurelien Geron
[4] General framework for object detection; CP Papageorgiouetal. https://www.researchgate.net/pub lication/3766402_General_framework_for_object_d etection
[5] www.mathworks.com
[6] https://www.mygreatlearning.com/blog/violahttps://www.mygreatlearning.com/blog/viola-jones-algorithm/jones-algorithm/
[7] Breaking Down Facial Recognition: The Viola-Jones Algorithm https://towardsdatascience.com/thehttps://towardsdatascience.com/the-intuition-behind-facial-
detection-the-viola-jones-algorithm-29d9106b6999intuition-behind-facial-detection-the-violahttps://towardsdatascience.com/the-intuition-behind-facial-
detection-the-viola-jones-algorithm-29d9106b6999jones-algorithm-29d9106b6999
[8] Face detection as done in 2001: Viola Jones
[9] Algorithm
[10] https://iq.opengenus.org/face-detectionhttps://iq.opengenus.org/face-detection-using-viola-jones-algorithm/using-viola-jones-algorithm/
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4726