Skip to content

About

A Python-based virtual mouse system that uses hand tracking to control cursor movement and mouse actions through computer vision.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

VirtualMouse

A Python-based virtual mouse system that uses computer vision and hand tracking to control the cursor and perform mouse clicks with a webcam.

Overview

This project combines OpenCV, MediaPipe, and Autopy to detect hand landmarks and translate simple hand gestures into mouse interaction.

Supported interactions

  • Move the cursor by pointing with your index finger
  • Click by bringing the index and middle fingers close together
  • Exit the application by pressing q

Project Structure

  • AiVirtualMouseProject.py – Main script that captures the webcam feed and maps gesture movement to mouse actions
  • HandTrackingModule.py – Hand landmark detector and utility module used by the main project

Tested Environment

This project was verified to run on Python 3.8.10 using the following interpreter:

C:\Users\Astro\AppData\Local\Python\pythoncore-3.8-64\python.exe

Verified working library versions in that environment:

opencv-python==5.0.0
numpy==1.22.4
mediapipe==0.10.5
autopy==import verified under Python 3.8

Installation

Install the required dependencies with:

pip install opencv-python==5.0.0 numpy==1.22.4 mediapipe==0.10.5 autopy

How to Run

  1. Open a terminal in the project directory.
  2. Run the main file using the same Python 3.8 interpreter:
C:\Users\Astro\AppData\Local\Python\pythoncore-3.8-64\python.exe -u "d:\E249_SEM_5\PROJECTS\VirtualMouse\AiVirtualMouseProject.py"
  1. Keep your hand in front of the webcam.
  2. Use the gestures described above to control the mouse.

Notes

  • A webcam is required for the hand-tracking feature to work.
  • This repository is shared mainly for the source code implementation.
  • Python 3.8.10 is the tested runtime for this project due to the library versions used here.

About

A Python-based virtual mouse system that uses hand tracking to control cursor movement and mouse actions through computer vision.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages