A computer vision-based system that allows users to control their mouse cursor using hand gestures. This project uses MediaPipe for hand tracking and implements various mouse control gestures.
- Python 3.x
- OpenCV (cv2): For video capture and image processing
- MediaPipe: For hand landmark detection and tracking
- PyAutoGUI: For mouse control and system interactions
- NumPy: For numerical operations and calculations
-
Clone the repository: bash : git clone https://github.com/deepak-dobbala/Hand_Gesture_Recognition
-
Install required packages:bash : pip install opencv-python mediapipe pyautogui numpy
- Real-time hand tracking
- Smooth cursor movement using palm center
- Exponential smoothing for stable cursor control
- Multiple gesture recognition
-
Cursor Movement
- Tracks palm center for precise cursor control
- Continuous movement tracking
- Smoothing algorithm for stability
-
Left Click
- Trigger: Thumb tip touches index finger's middle joint
- Visual feedback: Blue dots show contact points
-
Right Click
- Trigger: Index fingertip touches middle fingertip
- Visual feedback: Green dots show contact points
-
Scrolling
- Requires: Three main fingers open (thumb, index, middle)
- Scroll Up: Thumb-index pinch
- Scroll Down: Index-middle pinch
- Other fingers must be closed
-
Zooming
- Trigger: Only thumb and pinky fingers extended
- Zoom In: Increase distance between thumb and pinky
- Zoom Out: Decrease distance between thumb and pinky
- Visual feedback: Yellow line shows zoom distance
-
Terminate Program
- Requires: Three main fingers open
- Trigger: Thumb tip touches middle fingertip
- Safely closes the application
- 60 FPS camera capture
- Optimized resolution (640x480)
- Real-time FPS display
- Single hand tracking for better performance
- Gesture priority system
- Smoothing algorithms for stable control
-
Run the main script: bash:Readme.md python src/main.py
-
Position your hand in front of the camera
-
Use the gestures described above to control your mouse
-
To exit, either:
- Use the terminate gesture
- Press 'q' on keyboard
- Ensure good lighting conditions
- Keep hand within camera frame
- Maintain appropriate distance from camera
- Allow time to familiarize with gestures
- Adjust gesture thresholds if needed
Key parameters can be adjusted in the code:
- Gesture detection thresholds
- Smoothing factors
- Scroll sensitivity
- Zoom sensitivity
- Click delay timings
Feel free to fork, submit PRs, or report issues. All contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.