A real-time hand tracking web application that uses your webcam to detect hand gestures and visualize finger touches. Built with MediaPipe Hands and Vite.
- Real-time Hand Detection: Tracks up to 2 hands simultaneously using MediaPipe Hands
- Finger Touch Detection: Detects when thumb touches other fingers (index, middle, ring, pinky)
- Visual LED Indicators: Color-coded LED panels for left and right hands
- Live Video Feed: Mirrored camera view with hand landmark visualization
- Responsive Design: Modern, dark-themed UI with glassmorphism effects
The application uses MediaPipe's hand tracking model to:
- Detect hand landmarks in real-time from your webcam
- Calculate distances between thumb tip and other fingertips
- Activate corresponding LED indicators when fingers touch
- Display visual connections on the video canvas
Each finger has a unique color when activated:
- Index Finger: Red 🔴
- Middle Finger: Blue 🔵
- Ring Finger: Green 🟢
- Pinky Finger: Magenta 🟣
- Node.js (v14 or higher)
- npm or yarn
- A webcam
- Modern web browser (Chrome, Firefox, Edge)
- Clone the repository:
git clone https://github.com/igungor06/Hand-Tracking-Simulator.git
cd Hand-Tracking-Simulator- Install dependencies:
npm install- Start the development server:
npm run dev-
Open your browser and navigate to the local server address (typically
http://localhost:5173) -
Allow webcam access when prompted
To create a production build:
npm run buildTo preview the production build:
npm run preview- Vite: Fast build tool and development server
- MediaPipe Hands: Google's hand tracking solution
- Vanilla JavaScript: No framework overhead
- CSS3: Modern styling with animations and glassmorphism
Hand-Tracking-Simulator/
├── src/
│ ├── main.js # Main application logic
│ ├── style.css # Styling and animations
│ ├── counter.js # Utility functions
│ └── javascript.svg # Assets
├── public/
│ └── vite.svg # Public assets
├── index.html # Entry HTML file
├── package.json # Dependencies and scripts
└── README.md # This file
- Position Your Hands: Bring your hands into the webcam frame
- Touch Gestures: Touch your thumb to any fingertip
- Visual Feedback: Watch the corresponding LED light up and see the golden connection line on the video feed
- Both Hands: Try using both hands simultaneously for dual tracking
You can adjust the touch sensitivity by modifying the TOUCH_THRESHOLD constant in src/main.js:
const TOUCH_THRESHOLD = 0.08; // Lower = more sensitive, Higher = less sensitiveContributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
Project Link: https://github.com/igungor06/Hand-Tracking-Simulator
Enjoy tracking your hands! 👋✨