Skip to content

Latest commit

ย 

History

History
88 lines (60 loc) ยท 2.73 KB

File metadata and controls

88 lines (60 loc) ยท 2.73 KB

๐Ÿ–๏ธ Hand Gesture Volume Control

Python OpenCV MediaPipe

Control your system volume with Minority Report-style hand gestures! ๐ŸŽš๏ธโœจ

This project uses Computer Vision and AI to track your hand in real-time. simply pinch your fingers to adjust the volume. No mouse, no keyboard, just magic.


๐Ÿš€ Features

  • Real-time Hand Tracking: Powered by Google's MediaPipe for lightning-fast detection.
  • Intuitive Controls:
    • Pinch to Adjust: Distance between thumb and index finger controls volume.
    • Visual Feedback: Dynamic volume bars and percentage indicators.
    • FPS Counter: Monitor performance in real-time.
  • Smoothed Audio: (Advanced Mode) Silky smooth volume transitions without jitter.
  • Volume Lock: (Advanced Mode) Flex your pinky to lock the volume level! ๐Ÿ”’

๐Ÿ› ๏ธ Prerequisites

  • Python 3.7+
  • A Webcam

๐Ÿ“ฆ Installation

  1. Clone the Magic:

    git clone https://github.com/Omkarkkale/Hand-gestures-Volume-control-using-Open-CV.git
    cd Hand-gestures-Volume-control-using-Open-CV
  2. Install Dependencies:

    pip install -r requirements.txt

๐ŸŽฎ How to Use

1. The "Pro" Controller (Recommended)

This version includes the fancy visuals, smoothing, and volume locking.

python ADV_VOL_CTRL.py
  • Adjust Volume: Pincher movement (Thumb โ†”๏ธ Index Finger).
  • Lock Volume: Fold your Pinky Finger down. The interface color changes to Green! ๐ŸŸข
  • Unlock: Straighten your Pinky.

2. The "Basic" Controller

Simple, raw, effective.

python VolHandContol.py

๐ŸŽฅ Demo

Click the link below to watch the demo video:

โ–ถ๏ธ Watch Demo Video

๐Ÿ“ธ Screenshots

๐Ÿง  How it Works

  1. Capture: OpenCV grabs frames from your webcam.
  2. Detect: MediaPipe identifies 21 hand landmarks.
  3. Calculate: We measure the Euclidean distance between landmark 4 (Thumb Tip) and 8 (Index Tip).
  4. Map: This distance is mapped to your system's volume range using NumPy.
  5. Control: PyCaw interfaces with Windows Audio APIs to change the volume.

๐Ÿค Contributing

Got an idea to make it cooler? Open an issue or submit a PR!

๐Ÿ“œ License

Free to use for educational purposes!