Skip to content

Leon24k/Hand-Gesture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hand Gesture Volume Control

This project allows you to control your computer's system volume using hand gestures. By detecting the distance between your thumb and index finger, the app adjusts the system volume accordingly. It uses the MediaPipe library for hand tracking, pycaw for controlling system volume, and OpenCV for real-time video processing.

Features

  • Hand Gesture Recognition: Uses MediaPipe to detect hand landmarks and track the distance between the thumb and index finger.
  • Volume Control: Adjusts the system's master volume based on the detected hand gesture. The closer the thumb and index finger are, the lower the volume; the further apart they are, the higher the volume.
  • Real-time Feedback: Displays the current volume percentage and the hand gesture distance on the video feed.

Requirements

To run this project, you need to install the following Python libraries:

  • opencv-python
  • mediapipe
  • pycaw
  • numpy
  • comtypes

You can install these dependencies using the following command:

pip install opencv-python mediapipe pycaw numpy comtypes

How It Works

  • Hand Tracking: The app uses the MediaPipe library to track hand landmarks in real-time using the webcam.
  • Volume Calculation: It calculates the distance between the thumb (landmark 4) and the index finger (landmark 8).
  • Volume Mapping: The distance between these two landmarks is mapped to the system's volume range.
  • Volume Adjustment: Using the pycaw library, the system's volume is adjusted based on the calculated distance.

How to Use

  1. Run the script to launch the webcam feed.
  2. Position your hand in front of the camera with the thumb and index finger visible.
  3. Adjust the distance between your thumb and index finger to control the volume. As you move them apart, the volume increases. Moving them closer together decreases the volume.
  4. The current volume level will be displayed on the screen.
  5. Press Q to exit the program.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This project allows you to control your computer's system volume using hand gestures. By detecting the distance between your thumb and index finger, the app adjusts the system volume accordingly. It uses the MediaPipe library for hand tracking, pycaw for controlling system volume, and OpenCV.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages