This project created for dijital image processing class. this project is a real-time fatigue detection system that uses advanced image processing algorithms to detect eye fatigue. The system leverages the Dlib library for face and eye detection and OpenCV for video capture and display.
Ensure that you have Python 3 installed. You can download it from https://python.org/
cd Fatigue-Detection-System
python3 -m venv fatigue-detection-env
source fatigue-detection-env/bin/activate # On Windows use `fatigue-detection-env\Scripts\activate`
Ensure that you have cmake installed. You can download it from https://cmake.org/download/
pip install opencv-python dlib numpy scipy requests
python detection.py
-
Eye Aspect Ratio (EAR) Calculation: The system calculates the eye aspect ratio to determine the openness of the eyes. If the eyes are closed for a certain number of consecutive frames, it indicates fatigue.
-
Face and Eye Detection: Using Dlib's pre-trained models, the system detects faces and facial landmarks, which include the coordinates of the eyes.
-
Real-time Video Capture: OpenCV captures video from the webcam and processes each frame to detect fatigue.
-
Fatigue Alert: If the system detects fatigue, it displays a "FATIGUE DETECTED!" message above the detected face.