Eye Tracking Based Virtual Mouse Using Webcam and Computer Vision
Keywords:
Eye tracking, Gaze estimation, Human-computer interaction, Computer vision, MediaPipe, Iris landmarks, Virtual mouse, Webcam, Accessibility, PyAutoGUIAbstract
Most people still interact with a computer through a mouse, a keyboard, or a touchpad, none of which are usable by everyone. This project explores whether an ordinary webcam, without any specialised eye-tracking hardware, can be turned into a working substitute for a mouse. The prototype is built in Python around OpenCV for video capture, MediaPipe for facial and IRI landmark detection, NumPy for the underlying geometry, PyAutoGUI for using mouse commands on the operating system, and Tkinter for a small control panel. A single RGB camera watches the user's face; the position of the iris within each eye is estimated frame by frame, and a nine-point calibration routine learns how that position maps onto the screen. To keep the cursor from jittering, its motion is smoothed rather than updated instantaneously. Left and right clicks are triggered by closing one eye at a time, while a longer, deliberate closure of both eyes switches the system into a text-selection mode; looking toward the top or bottom of the frame scrolls the page. The system should be read as a working proof of concept rather than a finished product — it has not yet been through a formal user study, so this paper reports what was built and how and leaves the accuracy number and completion-time figure for the evaluation described in Section VIII.
References
Santos R, Santos N, Jorge PM, Abrantes A. Eye gaze as a human-computer interface. Procedia Technology. 2014 Jan 1;17:376-83.
Falch L, Lohan KS. Webcam-based gaze estimation for computer screen interaction. Frontiers in Robotics and AI. 2024 Apr 2;11:1369566.
Google AI Edge, “MediaPipe Face Mesh,” MediaPipe documentation.
Google AI Edge, “MediaPipe Iris,” MediaPipe documentation.
Hiley JB, Redekopp AH, Fazel-Rezai R. A low cost human computer interface based on eye tracking. In2006 International Conference of the IEEE Engineering in Medicine and Biology Society 2006 Aug 30 (pp. 3226-3229). IEEE.
Zeng Z, Liu S, Cheng H, Liu H, Li Y, Feng Y, Siebert FW. GaVe: A webcam-based gaze vending interface using one-point calibration. Journal of Eye Movement Research. 2023 Jan 25;16(1):2.
Hamid A, Kristensson PO. 40 years of eye typing: Challenges, gaps, and emergent strategies. Proceedings of the ACM on Human-Computer Interaction. 2024 May 28;8(ETRA):1-9.
PyAutoGUI Documentation, Python mouse and keyboard automation documentation