VolVision is a real-time, gesture-based volume controller that uses your webcam to track hand movements. By measuring the distance between your thumb and index finger, VolVision adjusts your system volume smoothly.
For Windows
- Real-time hand tracking using MediaPipe
- Gesture-based system volume control
- Visual feedback overlay:
- Hand landmarks
- Pinch-distance line
- Markers and volume percentage text
- Uses Pycaw to control Windows audio
- Lightweight and easy to extend
- Detects and tracks hand landmarks in real time
- VolVision extracts:
- Thumb tip
- Index finger tip
- Handles webcam capture
- Draws hand landmarks
- Renders the pinch-distance line
- Displays the current volume percentage
- Controls the system’s master volume
- Maps pinch distance → volume scalar
- Minimum distance → 0% volume
- Maximum distance → 100% volume
- Linear scaling in between
Install the required Python packages:
opencv-python==4.10.0.84
mediapipe==0.10.14
pycaw==20230407
comtypes==1.1.14Install them with
pip install opencv-python mediapipe pycaw comtypes
before this, get your webcam on and ensure its connected, be ready to get your hand into view.
- open Powershell in the project directory
- activate the virtual enviorment for windows (isolated because of dependencies)
& .\venv\Scripts\Activate.ps1
if successfull it will turn into
(venv) your/path/here
- run the application
python ./main.py
- press Q to quit
#setup webcam
capture = cv2.VideoCapture(0)
If you’re unsure which camera index your webcam uses run the test_camera.py script to find the correct one
Run it with (while in your venv):
python .\test_camera.py
Sit tight! It takes a second.
Use the index that prints as available and update the specified line accordingly
enjoy! :D
