Facial Detection
The system deploys a real-time algorithm to detect eye openness, yawning, and head orientation. Upon receiving a frame, the algorithm first tries to obtain the face bounding box in the image using a histogram of oriented gradient descriptors. With this bounding box and a pre-trained support vector machine model, it then uses a regression tree to detect the key facial structures such as eyes and mouth on the face and return their x-y coordinates.
To detect the openness of eyes and mouth, the algorithm takes advantage of the coordinates of facial landmarks that are returned by the machine learning model by calculating Eye Aspect Ratio (EAR) and Mouth openness ratio.
To detect the openness of eyes and mouth, the algorithm takes advantage of the coordinates of facial landmarks that are returned by the machine learning model by calculating Eye Aspect Ratio (EAR) and Mouth openness ratio.
where pi is the coordinates of the key points around eyes. The mouth openness ratio is calculated in the same manner [5].
Finally, the coordinates of some facial landmarks are linked to a predefined 3D model to obtain the transformation matrix that maps a point in the 3D world onto our image plane. The 3D model is kept still, therefore when the driver turns his head around, this transformation changes because the coordinates of his facial landmarks change. A point is projected in to the 3D world of the 2D image and connected the point that represents the nose and calculates the distance. If the distance is larger than the threshold, it means the driver is not looking ahead.
Finally, the coordinates of some facial landmarks are linked to a predefined 3D model to obtain the transformation matrix that maps a point in the 3D world onto our image plane. The 3D model is kept still, therefore when the driver turns his head around, this transformation changes because the coordinates of his facial landmarks change. A point is projected in to the 3D world of the 2D image and connected the point that represents the nose and calculates the distance. If the distance is larger than the threshold, it means the driver is not looking ahead.