Skip to content

Control your mouse without touching it! Virtual Mouse is a Python-powered gesture-control system using MediaPipe and OpenCV. Move your cursor, click, and take screenshots — all with your hand. Built for fun, accessibility, and real-world AI practice.

Notifications You must be signed in to change notification settings

06arpita/Virtual-Mouse-Hand-Tracking-Controlled-Mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Virtual-Mouse-Hand-Tracking-Controlled-Mouse

Control your mouse without touching it! Virtual Mouse is a Python-powered gesture-control system using MediaPipe and OpenCV. Move your cursor, click, and take screenshots — all with your hand. Built for fun, accessibility, and real-world AI practice.

Files

  • virtual_mouse.ipynb – main notebook
  • util.py – helper functions (distance, angle)

Gesture Demonstration

  • Hand landmarks are provided by MediaPipe; the notebook converts landmark coordinates into gestures.

  • Utility functions get_angle and get_distance (in util.py) compute angles between joints and distances between landmarks — they are used to detect different gestures.

-Gesture rules (from the code):

  1. Move mouse: when thumb–index distance is small (thumb_index_dist < 50) and a certain finger angle is open (> 90°) → move cursor to index fingertip.

  2. Left click: specific finger angle arrangement + thumb_index_dist > 50.

  3. Right click: swapped angle arrangement + thumb_index_dist > 50.

  4. Double click: both key angles are small (< 50) and thumb_index_dist > 50.

  5. Screenshot: both key angles are small and thumb_index_dist < 50 (saves my_screenshot_.png).

[Exact angle checks and threshold values are implemented in the notebook functions is_left_click, is_right_click, is_double_click, is_screenshot, and detect_gesture.]

About

Control your mouse without touching it! Virtual Mouse is a Python-powered gesture-control system using MediaPipe and OpenCV. Move your cursor, click, and take screenshots — all with your hand. Built for fun, accessibility, and real-world AI practice.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published