Translate hand gestures and position to a cursor
This Python script utilizes the MediaPipe library to detect hand gestures from a webcam feed and control the cursor movement on the screen accordingly. It allows users to perform pinch gestures to simulate mouse clicks.
- Python 3.x
- OpenCV (cv2)
- MediaPipe
- NumPy
- Pillow
- Tkinter
- win32api
- ttkthemes
- screeninfo
- pyautogui
- Make sure you have Python installed on your system.
- Install the required Python packages using pip: pip install opencv-python mediapipe numpy pillow tk ttkthemes pyautogui
- Additionally, if you are on a Windows system, install the
pywin32package: pip install pywin32
- Run the
hand_gesture_control.pyscript using Python. - Adjust the detection confidence, tracking confidence, and cursor sensitivity sliders to fine-tune the hand detection and cursor movement.
- Click the "START" button to initiate hand gesture control.
- Perform pinch gestures (bringing thumb and index finger close together) to simulate mouse clicks.
- Click the "START" button again to stop hand gesture control.
- Real-time hand gesture detection and cursor control.
- Adjustable parameters for detection confidence, tracking confidence, and cursor sensitivity.
- Pinch gesture recognition for mouse clicks.
This project utilizes the MediaPipe library for hand tracking and gesture recognition.
This project is licensed under the MIT License - see the LICENSE file for details.
Ihab ELbani ALIAS Eurekios