Implementation

Our Eye Guard will be a desktop application, which can be run in the background and give user alerts anytime. Alerts include information about blink rate, distance between user’s face and the screen. Also, alerts will be given in different modes according to the task that user is doing and will be different from teenager users and adult users. When users first use the application, they need to set some basic personal information like age, gender, etc, which can help us identify whether they are teenagers or adults.

The main challenge for our application is the accuracy of eye fatigue detection, which will be mainly based on blink rate and related algorithms. To solve these problems as much as possible, we design our implementation based on some blink tracking approaches [2] and OpenCV related algorithm=s. Therefore, we choose Python as the programming language to fit OpenCV and its highly recommended GUI frame, Tkinter.

We use the EAR ration(eye aspect ratio) [4] to detect the real time eye blink. The EAR is mostly constant when an eye is open and is getting close to zero while closing an eye. We set a threshold value for the EAR ration to detect the eye blink.

Basic Structure

Our software structure design is based on the lecture The Modular Structure of Complex Systems by Parnas. [3] According to the concept of module design principle, our module structure is based on the decomposition criterion known as information hiding.

Simply said, our software system will divide into three basic modules:

One module for interacting with the operating system.

One module interacts with the user.

One module provides the algorithms and data structure.

A:1 OPERATING SYSTEM-HIDING MODULE

Operating System-Hiding Module provides functions which can interact with the operating system.

For example, If our application wants to play audio to remind the users to relax, it needs to call the play audio function which is in the operating system hiding module.

A:2 BEHAVIOR-HIDING MODULE

The Behavior-Hiding Module defines the main user interface and implements the function in the requirement documents.

For example, users choose the work model or change the reminder methods; all the interactions are defined in the Behavior-Hiding Module.


A:3 ALGORITHM & DATA STRUCTURE MODULE

The Algorithm & Data Structure Module provides the algorithm and libraries which generate the facial expression, blink rate data , etc to the Behavior-Hiding Module.

For example, after the user sets the work model and starts the application, Behavior-Hiding Module will call some functions in Algorithm & Data Structure Module to generate blink rate data or other facial expression data.

The relation between the tree modules are as following show:



Basic workflow of our application:

  1. User set work model like teenager model and choice reminder methods like audio.

  2. According to the work model set parameters and standards.

  3. Application opens the webcam to detect the user's facial expression.

  4. Generate facial expression data, like the user's eye blink rate and distance between face and screen.

  5. Application judges whether the user is in visual fatigue status based on the data generated by facial expression detection.

  6. Give the feedback to the user. Like remind the user to relax through playing audio.


Final Project