Something that has bothered me for quite a while is manually adjusting the lamellae of the fans in my car to point the air flow into the direction of my face. Especially during long distance drives having a constant (A/C-controlled) air flow blowing into the face helps to concentrate and not to become tired. Some studies (e.g. this one) could show that an increased eye blink ratio correlates with drowsiness. The overall goal of this project is to have a system in my car which detects whether the driver is tired based on eye blink frequency and then point the air flow of the fans into the direction of the face.
AutoFan is a device which automates this task using machine vision. By using a face detection algorithm the relative position of the head in front of the camera is inferred. The driver's level of drowsiness is detected by measuring eye blink frequency. This information is then used to control the lamellae of a fan in order to dynamically point the air flow to the face.
The overall goal is to have a working prototype before I start to tinker with the fans and electronics in my car. For this purpose I have designed a servo-controlled fan using FreeCad. The lamellae of the fan are controlled by a Raspberry Pi 2, which also takes care of the algorithms for face detection, the estimation of the relative position of the head and eye blink detection. The software framework is written in Python making use of libraries such as OpenCV (e.g. by using a haar-cascade classifier for face detection) or multiprocessing (e.g. for making efficient use of the Raspberry's four CPU cores).
All design files and the corresponding code can be found in my GitHub repository.
Detailed project description:
- The Mechanical Prototype
- Controlling the Servos
- Correcting for Lens Distortions
- Face Detection using a Haar Cascade Classifier
- Solving the Math: Computing the Servo Angles
Please note: As this is an ongoing project, I will update this text once certain components of the project are finished...
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.