I was really sleepy the first night at qHacks. I was looking to learn about openCV and the only thing I could think about was how tired I was.

What it does

It shows a live camera capture of a human face and tries to identify whether the subject's eyes are open or closed on each frame. It then keeps a running average of how long a user spends blinking or keeping their eyes shut. Beyond a certain threshold of "shuteye", the program turns off the camera and notifies the subject that they should go to sleep.

How I built it

I used openCV to caputure video and analyze individual frames for "closed eyes" using a tutorial I found on object tracking. I handled most of the "analysis" of the frames using a C++ backend. I then also made a GUI in Qt.

Challenges I ran into

I ran into issues with the chin being detected as a closed eye but could not quite avoid it without cutting off that part of the frame or covering the chin. Darkness, brightness, and the distance from the camera also have significant influence on the how accurate the eye detection is. I also tried to simply launch the program executable that was built in Visual Studio using a system process from the QML GUI but ran into several path issues with the "file or directory not being found". In the end, I managed to get the path right, but attempting to launch the executable cause the GUI to crash and I didn't have time to find an alternative.

Accomplishments that I'm proud of

I'm proud that I got the program running.

What I learned

I learned a lot about image processing, machine learning, but also regular C++ STL structures.

What's next for DropKnot

Detecting "redness" of an eye is something I had plans to start on but wound up delaying it through the entire hackathon.

Share this project: