| With the rapid development of technology and economy, the cars are owned by more and more people. While the popularity of cars can greatly improve people’s quality of living, but the traffic safety issues caused by it are also increasingly, and that serious threat to people’s lives and property safety. The driver fatigue is one of the main factors causing traffic safety issues. Therefore, research on driver fatigue detection technology can help improve traffic safety, thereby contributing to the protection of people’s lives and property.In this thesis, STM32F207VCT6as processing chip, OV9655image sensor as an image input device, designed a low-cost anti-drowsy driving and fatigue detection system. This system through the analysis on the state of driver’s eyes to determine whether the driver fatigue and issue alerts when fatigue. Experiments show that the system in real time, accuracy and reliability have some assurance.In this thesis, the PERCLOS(Percentage of Eyelid Closure over the Pupil Overtime) as the basis to determine whether the driver is fatigue. The main contents of this thesis involves three key image processing algorithms. The first is face detection algorithm. The traditional image projection method susceptible to interference from the environment, so use the principles of edge detection and the prior knowledge of face to improve the traditional image projection and enhance its anti-jamming capability, making the results more accurate, real-time, reliable. The second is eyes location algorithm. It is using the prior knowledge of face to improve the traditional image projection to get a more accurate rough positioning result, then the principles of morphology is used to get the connected region of eye to achieve the precise positioning result. The third is eye state recognition. When the eye is open, there is little difference between its width and its height. While the eye is closed, its width will be much longer than its height. Therefore, a simple method based on the width-height ratio of eye to judge the state of eye is present. Finally, a circular queue is used to record the state of eye, and then calculate the value of PERCLOS to determines whether the driver fatigue. Experiments show that the algorithm is designed in this thesis with good accuracy, reliability and timeliness. |