GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nutter-toolbox/gesture-volume-control: Volume-Control-Using-Computer-Vision is a type of software in which the device volume can be controlled using the thumb and first finger as it use cv2 module and detects the hand.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
handtrackingmodule.py
handtrackingmodule.py
 
 
volume control.py
volume control.py
 
 

Repository files navigation

Here's a README file for your project that explains the trackingmodule.py and volumecontrol.py files:


Hand Tracking and Volume Control

Overview

This project demonstrates hand tracking using a webcam to control the system volume based on hand gestures. The hand tracking is achieved with MediaPipe, and volume control is managed via the pycaw library.

Files

1. trackingmodule.py

This module implements hand detection and landmark extraction using the MediaPipe library.

Dependencies

  • cv2 (OpenCV)
  • mediapipe
  • time

Class

handDetector: A class for detecting and tracking hand landmarks.

  • Methods:
    • __init__(self, mode=False, maxHands=2, detectionCon=0.5, modelComplexity=1, trackCon=0.5): Initializes the hand detection model with specified parameters.
    • findHands(self, img, draw=True): Processes an image to detect hands and optionally draws landmarks on the image.
    • findPosition(self, img, handNo=0, draw=True): Extracts the positions of hand landmarks and returns them as a list.

Usage

  1. Run the script to start hand tracking and display video with detected hand landmarks.

    python trackingmodule.py
  2. Press 'q' to exit the video window.

2. volumecontrol.py

This script uses hand tracking to control the system volume based on the distance between the thumb and index finger.

Dependencies

  • cv2 (OpenCV)
  • numpy
  • handtrackingmodule (custom module)
  • math
  • pycaw (Python Core Audio Windows)

Functionality

  • Webcam Setup: Initializes the webcam and sets resolution.
  • Hand Detection: Uses handDetector from trackingmodule.py to track hand landmarks.
  • Volume Control: Maps the distance between the thumb and index finger to system volume levels using the pycaw library.

How to Run

  1. Ensure you have the required dependencies installed:

    pip install opencv-python numpy pycaw
  2. Run the script to start hand tracking and control the volume:

    python volumecontrol.py
  3. Adjust the distance between your thumb and index finger to change the volume. The volume will be updated in real-time based on the gesture.

  4. Press 'd' to stop the video stream and exit.

License

This project is licensed under the MIT License.

Acknowledgements

  • OpenCV for computer vision functionalities.
  • MediaPipe for hand tracking.
  • pycaw for audio control on Windows.

Feel free to modify or expand upon any sections as needed for your project!

About

Volume-Control-Using-Computer-Vision is a type of software in which the device volume can be controlled using the thumb and first finger as it use cv2 module and detects the hand.

volume-control-using-computer-vision.vercel.app

Topics

mediapipemediapipe-handsmediaplayerpythonpython-cvpython-cv2python-cvxpytime

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.