Skip to content

SamipPandey/Hand-Gesture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

✋ Hand Gesture Media Controller

A real-time hand gesture control system built using OpenCV, MediaPipe (Tasks API), and PyAutoGUI.
This application uses your webcam to detect hand landmarks and control system volume and media playback using simple finger gestures.


📌 Features

  • 🎥 Real-time webcam hand tracking
  • 🖐 AI-based 21-point hand landmark detection
  • 🔊 Volume control using thumb + index finger distance
  • ⏯ Play/Pause control using thumb + middle finger gesture
  • 🧠 Built with MediaPipe's modern Tasks API
  • 🖥 Live visual feedback with landmark rendering

🛠 Technologies Used

  • Python
  • OpenCV
  • MediaPipe (Tasks API - Hand Landmarker)
  • PyAutoGUI
  • Math (distance calculations)
  • Time (cooldown handling)

🧠 How It Works

  1. The webcam captures live video frames.
  2. Each frame is processed by MediaPipe’s Hand Landmarker model.
  3. The model detects 21 hand landmarks.
  4. Specific landmark distances are calculated:
    • Thumb (ID 4)
    • Index finger tip (ID 8)
    • Middle finger tip (ID 12)
  5. Gestures are interpreted based on distance thresholds.
  6. PyAutoGUI triggers system key presses.

✋ Gesture Controls

Gesture Action
Thumb + Index far apart Volume Up
Thumb + Index very close Volume Down
Thumb + Middle touching Play / Pause

A 2-second cooldown prevents repeated play/pause triggers.


📦 Installation

1️⃣ Install Python (Recommended: Python 3.11)

MediaPipe works best with Python 3.10–3.11.

Check version:

python --version

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages