This Python project utilizes computer vision and hand tracking techniques to control your keyboard using hand gestures. It allows you to perform various keyboard actions by detecting the orientation and movement of your hands.
- Control keyboard actions with hand gestures
- Supports both left and right hands
- Recognizes vertical and horizontal hand orientations
- Provides real-time visualization of hand tracking
Make sure you have the following libraries installed:
- cv2 (OpenCV)
- cvzone
- pynput
- numpy
- keyboard
You can install them using requirements.txt file:
pip install -r requirements.txt
- Connect a webcam to your computer.
- Run the Python script.
- A live video stream will open with hand tracking enabled.
- Perform the following gestures with your hand:
-
- Open Palm: Presses the Up arrow key
- Closed Palm: Presses the Down arrow key
-
- Open Palm: Presses the Right arrow key
- Closed Palm: Presses the Left arrow key
-
- Open Palm: No action
- Closed Palm: No action
-
- To exit the program, press Q.
- Adjust the webcam resolution by uncommenting the cap.set() lines and setting your desired values.
- You can modify the gesture-based actions in the main() function according to your preferences.