Mouse Movement using Eyetracking

CS 490 Project by myself and Michael Orzel


For Portable Natural User Interface Development (PNUI) we implemented a python version of the OpenCV code here to control your computer mouse using your eye.

How it Works

OpenCV has built in haarcascades for face and eye detection, however none for pupil detection, which we use to control the mouse (using the windows api library for python).

Following the algorithm used by TangoWithCode, we instead use OpenCV's circle detection within the already detected eye area, and select the circle with the darkest overall color as the pupil, since your pupil is entirely black.

Once you have the location of the pupil, you can calculate how far from the center of the eye it is and move the mouse accordingly, treating the pupil like a joystick.

Source

here

<-- Back to Home