https://github.com/prabeshpathak2002/hand-tracking-using-mediapipe
Real-time hand tracking in Python using OpenCV and MediaPipe. Detects and visualizes hand landmarks from your webcam feed, highlights fingertips, and prints landmark positions. Great for gesture recognition, computer vision demos, and interactive projects.
https://github.com/prabeshpathak2002/hand-tracking-using-mediapipe
computer-vision image-recognition mediapipe opencv
Last synced: about 2 months ago
JSON representation
Real-time hand tracking in Python using OpenCV and MediaPipe. Detects and visualizes hand landmarks from your webcam feed, highlights fingertips, and prints landmark positions. Great for gesture recognition, computer vision demos, and interactive projects.
- Host: GitHub
- URL: https://github.com/prabeshpathak2002/hand-tracking-using-mediapipe
- Owner: PrabeshPathak2002
- License: mit
- Created: 2025-06-07T06:50:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-07T07:16:32.000Z (about 1 year ago)
- Last Synced: 2025-06-17T08:07:28.966Z (about 1 year ago)
- Topics: computer-vision, image-recognition, mediapipe, opencv
- Language: Python
- Homepage:
- Size: 1.93 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hand Tracking with OpenCV and Mediapipe
This project demonstrates real-time hand tracking using [OpenCV](https://opencv.org/) and [Mediapipe](https://mediapipe.dev/) in Python. It detects hand landmarks from your webcam feed and can be easily extended for gesture-based applications (e.g., controlling a snake game with your finger).
## Features
- Real-time hand detection and landmark tracking
- Configurable camera index and number of hands
- Option to select and use specific landmarks (e.g., index finger tip)
- FPS display on video feed
- Modular code with resource management
## Requirements
- Python 3.7+
- opencv-python
- mediapipe
Install dependencies with:
```sh
pip install -r requirements.txt
```
## Usage
Run the main script:
```sh
python HandTrackingModule.py
```
- Press `q` to quit the video window.
- The script prints the position of the index finger tip (landmark 8) in the console.
## Customization
- To use a different camera, change `camera_index` in `main()` or the class constructor.
- To track different landmarks, modify the `landmark_ids` parameter in `findPosition`.
## File Structure
- `HandTracking.py` – Simple script for hand tracking.
- `HandTrackingModule.py` – Modular, class-based version with more features.
- `requirements.txt` – Python dependencies.
## Screenshot

## Hand Landmarks
