How does SleePi work?
SleePi determines the position of the eyes and uses the Eye Aspect Ratio (EAR) to determine when the eyes are closed (or more squinted than usual). When the system detects that the user is sleepy, it starts playing a loud alarm sound trough the AUX port on Raspberry Pi (it can be connected to the car's speaker system). The alarm keeps playing until the user opens his eyes.
The first and most important step is to obtain a video from the Raspberry Pi's camera. We resized the obtained video to 640x480 pixels and converted it to grayscale, making it suitable for ongoing operation. From there on, the facial parts like eyebrows, nose, mouth, eyes and facial structure were captured. The eyes were then confined to ascertain the PERCLOS, which depends on the Eye Aspect Ratio (EAR). The EAR was calculated during the calibration process, which was used to decide the drowsiness limit