Python Vision
is a Python program that allows you to control your mouse using hand gestures. It leverages OpenCV and MediaPipe for hand tracking and gesture recognition.
- Hand Detection and Tracking: Uses MediaPipe to detect and track hand landmarks.
- Mouse Control: Move the mouse cursor with your index finger.
- Click Detection: Perform left-click actions by pressing your thumb on the PIP joint of your index finger.
- Focus Mouse: Keeping your middle finger up allow you to focus your mouse at a point (stop the flickering) and click easily.
- Python 3.6+
-
Clone the repository:
git clone https://github.com/dr4g0n369/pythonVision.git cd pythonVision
-
Create a virtual environment
python -m venv env
-
Install the required packages:
source ./env/Scripts/activate pip install -r requirements.txt
-
Run the program:
python handMouseControl.py
Make sure you are running it from the virtual environment created.
-
A window will open showing the webcam feed. Move your index finger to control the mouse cursor.
handDetector
: A class for detecting and tracking hands using MediaPipe.handMouseControl.py
: The main script to run the hand gesture-based mouse control.
- OpenCV
- MediaPipe
- pynput
- Inspired by this video tutorial.