This project allows you to control your mouse pointer using hand gestures, utilizing your computer's webcam. It is implemented in Python with the help of OpenCV, MediaPipe, and PyAutoGUI.
- Hand Detection: Uses MediaPipe to detect hand landmarks in real-time.
- Mouse Control: Move your mouse pointer by showing your hand to the webcam.
- Gesture Actions:
- Move the index fingertip to move the mouse pointer.
- Use different hand labels (right/left) to trigger mouse actions (move/click).
-
Clone the repository:
git clone https://github.com/PasinduGunathilake/a-Hand_Gesture_Mouse_pointer_r-.git cd a-Hand_Gesture_Mouse_pointer_r- -
Install Python dependencies:
pip install opencv-python mediapipe pyautogui
-
Run the script:
python hgp.py
-
Control the Mouse:
- Show your hand to the webcam.
- Moving your index finger (tip) will move the mouse pointer.
- If your right hand is detected, the pointer will move.
- If your left hand is detected, a mouse click will be triggered.
-
Exit:
- Press
xon your keyboard to exit the application.
- Press
- Make sure your webcam is connected and accessible.
- For best results, use the application in a well-lit environment.