In this video, we build an AI Virtual Mouse using Python, OpenCV, and MediaPipe that lets you control your computer with hand gestures.
Using your webcam, the program tracks your index finger and thumb to move the cursor and perform mouse clicks.
🚀 Features of this AI Virtual Mouse
Move cursor using index finger
Click using pinch gesture (thumb + index finger)
Real-time hand tracking
No physical mouse required
This is a great Python computer vision project for beginners and a perfect demo for students learning Artificial Intelligence, OpenCV, and gesture recognition.
🧠 Technologies Used
Python
OpenCV
MediaPipe
PyAutoGUI
📦 Install Required Libraries
Open Command Prompt / Terminal and run:
pip install opencv-python
pip install mediapipe
pip install pyautogui
Or install everything together:
pip install opencv-python mediapipe pyautogui
▶️ Run the Project
Save the code as
virtual_mouse.py
Run the file:
python virtual_mouse.py
Show your hand to the webcam
Move index finger → move mouse
Pinch thumb + index → mouse click