Skip to content

irajverma/Virtual-Mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–±οΈ Virtual Mouse using Hand Gesture Recognition

This project is a Python-based Virtual Mouse that uses your webcam to track hand gestures and control your computer’s cursor. It leverages MediaPipe for hand detection and PyAutoGUI for cursor control and clicking.


πŸ“Œ Features

  • Move the mouse cursor using your index finger.
  • Perform mouse clicks by bringing your thumb and index finger close together.
  • Real-time webcam-based hand tracking.
  • No additional hardware required.

πŸ“‚ Tech Stack

  • Python
  • MediaPipe β€” Hand landmark detection
  • OpenCV β€” Image processing and webcam feed
  • PyAutoGUI β€” Mouse control

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/your-username/virtual-mouse-hand-gesture.git
cd virtual-mouse-hand-gesture
  1. Install Dependencies Make sure you have Python 3.7 or later. Install the required libraries:

bash Copy Edit pip install opencv-python mediapipe pyautogui 3. Run the Script bash Copy Edit python cursor.py Allow webcam access when prompted.

🎯 How It Works The webcam captures your hand in real-time.

MediaPipe identifies hand landmarks.

If the index finger tip (landmark id 8) is detected, the cursor is moved.

If the thumb tip (landmark id 4) comes close to the index finger tip, a mouse click is triggered.

🧠 Future Enhancements Add support for drag and drop.

Enable scrolling gestures.

Improve accuracy with smoothing algorithms.

Add GUI controls for sensitivity and gesture calibration.

πŸ›‘οΈ Disclaimer This is a prototype and may not work perfectly across all lighting conditions or camera resolutions.

πŸ™Œ Acknowledgements MediaPipe by Google

PyAutoGUI Documentation

πŸ§‘β€πŸ’» Author Raj Verma Feel free to contribute, fork, or suggest improvements!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages