This Python project utilizes the MediaPipe library and OpenCV to perform real-time hand gesture recognition. With this code, you can control your computer's cursor and keyboard using hand gestures.
- Detects and tracks hand landmarks in real time.
- Recognizes left and right-hand gestures for mouse and keyboard control.
- Control the mouse cursor and perform keyboard actions (e.g., move, click, swipe) using hand gestures.
- Easily customizable for different hand gestures and actions.
Before running the code, make sure you have the following dependencies installed:
- Python 3.x
- OpenCV (
pip install opencv-python
) - MediaPipe (
pip install mediapipe
) - PyAutoGUI (
pip install pyautogui
)
-
Clone this repository:
git clone https://github.com/baukk/Gesture-Recognition.git
-
Navigate to the project directory:
cd Gesture-Recognition
-
Run the code:
python main.py
-
A window will open showing the webcam feed. Move your hand in front of the camera to control the cursor and perform gestures.
-
To exit the program, press 'q' in the OpenCV window.
-
Left Hand (Mouse Control):
- Move your left hand to control the mouse cursor.
- When the index finger tip is above the index finger middle, it simulates a left mouse click.
-
Right Hand (Keyboard Control):
- Move your right hand to control the keyboard.
- Swipe right or left to simulate arrow key presses ('right' or 'left').
- Swipe up or down to simulate arrow key presses ('up' or 'down').
You can customize this code to recognize additional hand gestures and map them to different actions. Modify the code to add your own gestures and actions.
This project uses the MediaPipe library for hand landmark detection and tracking.
This project is licensed under the MIT License.
- GitHub: gauravzack
Feel free to contribute to this project and make it even more awesome! If you have any questions or suggestions, please open an issue or pull request.
Enjoy controlling your computer with hand gestures! 🖐️🖥️