Skip to content

Ruban-Edward/AI-Virtual-Mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖱️ AI Virtual Mouse

Control your computer mouse using hand gestures powered by Python, OpenCV, and MediaPipe. This project uses real-time webcam input to detect hand landmarks and translate finger movements into mouse actions without requiring a physical mouse.

Python OpenCV MediaPipe License


📌 Features

  • 🖐️ Real-time hand tracking using MediaPipe
  • 🖱️ Control the mouse cursor using hand movements
  • 👆 Gesture-based mouse click detection
  • ⚡ Smooth cursor movement
  • 📷 Works with a standard webcam
  • 💻 Simple Python implementation

🛠️ Technologies Used

  • Python 3.8+
  • OpenCV
  • MediaPipe
  • AutoPy
  • NumPy

📂 Project Structure

AI-Virtual-Mouse/
│
├── AiVirtualMouseProject.py
├── HandTrackingModule.py
├── Output/
├── README.md
└── LICENSE.md

🚀 Installation

1. Clone the Repository

git clone https://github.com/Ruban-Edward/AI-Virtual-Mouse.git
cd AI-Virtual-Mouse

2. Install Python

Download and install Python 3.8 or later

https://www.python.org/downloads/

3. Install Required Libraries

pip install opencv-python mediapipe autopy numpy

▶️ Run the Project

Run the main file:

python AiVirtualMouseProject.py

Make sure your webcam is connected and accessible.


🖼️ Output

🖱️ Cursor Movement

Cursor Movement


✋ Stable Hand Detection

Stable Hand


👆 Selection Gesture

Selection Gesture


🖐️ Gesture Controls

Gesture Action
☝️ Index Finger Up Move Cursor
👍 Thumbs up Select / Click
✋ Hand Tracking Detects hand landmarks in real time

Gesture behavior may vary depending on your implementation.


⚙️ How It Works

  1. Captures live video from the webcam.
  2. Detects hand landmarks using MediaPipe.
  3. Tracks fingertip positions.
  4. Maps hand movement to screen coordinates.
  5. Controls the system mouse using AutoPy.
  6. Recognizes gestures to perform mouse actions.

📦 Dependencies

Install the required libraries:

pip install opencv-python
pip install mediapipe
pip install autopy
pip install numpy

🤝 Contributing

Contributions are welcome!

  1. Fork this repository
  2. Create a feature branch
git checkout -b feature-name
  1. Commit your changes
git commit -m "Add new feature"
  1. Push to your branch
git push origin feature-name
  1. Open a Pull Request

👨‍💻 Author

Ruban Edward

GitHub: https://github.com/Ruban-Edward


📄 License

This project is licensed under the MIT License.

See the LICENSE.md file for more information.


⭐ Show Your Support

If you found this project useful, consider giving it a ⭐ on GitHub!

About

Developed an AI-based system to control the mouse cursor using Python and OpenCV with the real-time camera.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages