Control your system volume with the wave of your hand! This project uses a webcam to capture real-time hand movements and adjusts the volume based on the distance between your thumb and index finger.
- Real-time Hand Tracking: Utilizes MediaPipe for accurate hand detection.
- Volume Control: Adjust system volume by varying the distance between your thumb and index finger.
- Visual Feedback: Interactive graphics to show current volume and hand landmarks.
- Python 3.x
- OpenCV
- MediaPipe
- PulseAudio
-
Clone the repository:
git clone https://github.com/harshaparida/Controlling_volume_using_hand_gestures.git cd hand-gesture-volume-control
-
Install the required packages:
pip install opencv-python mediapipe pulsectl
Run the following command to start the volume control application:
python hand_gesture_control.py
- Capture Video: The webcam captures video frames.
- Process Frames: MediaPipe processes the frames to detect hand landmarks.
- Calculate Distance: The distance between the thumb and index finger is calculated.
- Adjust Volume: The system volume is adjusted based on the distance.
- Hand Landmarks: The thumb and index finger are highlighted with green circles.
- Connecting Line: A green line connects the thumb and index finger.
- Background Color: The background color changes based on the volume level.
- Volume Display: Current volume percentage is displayed on the frame.
Enhance your multimedia experience with just a wave of your hand. Happy coding!