This is a Python project for controlling a computer's mouse cursor using hand gestures. The program recognizes hand gestures through a webcam using the Mediapipe library and controls the mouse cursor via the PyAutoGUI library.
The project is divided into two files, app.py
and controller.py
. The app.py
file contains the main program logic while controller.py
is responsible for handling the mouse cursor movement and click events.
There is an extra file, requirements.txt
which you can use to install the libraries required for this project.
pip install opencv-python mediapipe pyautogui
pip install -r requirements.txt
pip install -r requirements.txt --upgrade
After installing the required libraries, run the app.py
file in a Python environment with a webcam. The program will start capturing video from the webcam, and the mouse cursor can be controlled using the following hand gestures:
-
Cursor moving: Raise all fingers together and move your hand to move the cursor and control it.
-
Cursor freezing: Close your thumb and Raise all other fingers together freeze the cursor and prevent it from moving.
-
Drag and drop: Close your hand into a fist and move it around to drag and drop objects.
-
Right-click: Raise your index finger while keeping the other fingers closed.
-
Left-click: Raise your middle finger while keeping the other fingers closed.
-
Double-click: Raise your index and middle finger while keeping the other fingers closed.
-
Scroll up: Move your index and middle finger towards the screen.
-
Scroll down: Move your index and middle finger away from the screen.
The program currently only supports controlling a single mouse cursor, and it may not work well in low-light conditions. It also doesn't support handling gestures of more than one hand, however this is easy to overcome, may be in comming commits of this project.
This project is licensed under the Apache License 2.0. The Apache License 2.0 is a permissive license that allows you to freely use, modify, distribute, and sell the software.
- Hand Gesture Recognition for controlling computer's Apps.
- Hand Gesture Recognition for controlling computer's Games.
- Hand Gesture Recognition for controlling computer's Media.
- Hand Gesture Recognition for controlling computer's Browsers.
- This project is still under development and may not
- Instagram : @youhaveme064
- Facebook : @DarkDev064
- Youtube : @DarkDev064
- Twitter : @darkdev064
- LinkedIn : @darkdev064