Skip to content

rishideepc/Gesture_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gesture Volume Control App

A real-time hand gesture-based volume control application that allows users to control their device volume using hand gestures!

Features

  • Hand Gesture Recognition: Uses MediaPipe for accurate hand landmark detection
  • Real-time Volume Control: Adjusts system volume based on finger distance
  • Visual Feedback: Live camera feed with volume bar and percentage display
  • Modern UI: Built with Kivy/KivyMD framework
  • Windows Audio Integration: Native Windows audio control via pycaw

How It Works

The app detects hand gestures through your webcam and measures the distance between your thumb and index finger. The measured distance is then translated into volume levels:

  • Bring fingers closer: Decrease volume
  • Spread fingers apart: Increase volume

Requirements

  • Python 3.8 or higher
  • Windows OS (for audio control features)
  • Webcam/Camera

Installation

Option 1: Run from Source

  1. Clone this repository:

    git clone <repository-url>
    cd Gesture_App
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the application:

    python main.py

Option 2: Build Standalone Executable

On Windows:

build.bat

On Linux/Mac:

chmod +x build.sh
./build.sh

The executable will be created in the dist/ folder.

Usage

  1. Launch the application
  2. Click the "Click" button to start the camera
  3. Show your hand to the camera
  4. Adjust volume by changing the distance between your thumb and index finger
  5. The volume bar on the left shows the current volume level

Project Structure

Gesture_App/
├── main.py              # Main application file
├── helper.py            # Hand detection helper module
├── requirements.txt     # Python dependencies
├── GestureApp.spec      # PyInstaller configuration
├── build.bat            # Windows build script
├── build.sh             # Linux/Mac build script
└── README.md            # This file

Dependencies

  • kivy: GUI framework
  • kivymd: Material Design components for Kivy
  • opencv-python: Computer vision and camera handling
  • mediapipe: Hand landmark detection
  • numpy: Numerical operations
  • pycaw: Windows audio control
  • comtypes: COM interface support (Windows)
  • pyinstaller: Executable packaging

Development

Code Structure

  • MainApp: Main Kivy application class

    • Initializes camera, hand detector, and audio interface
    • Handles real-time video processing
    • Updates volume based on hand gestures
  • handDetector (helper.py): Hand detection wrapper

    • findHands(): Detects and draws hand landmarks
    • findPosition(): Returns hand landmark positions

Building from Source

To create a distributable executable:

  1. Ensure all dependencies are installed
  2. Run the build script for your platform
  3. Find the executable in dist/GestureVolumeControl.exe (Windows) or dist/GestureVolumeControl (Linux/Mac)

Troubleshooting

Camera not detected:

  • Check if your camera is properly connected
  • Ensure no other application is using the camera
  • Try changing the camera index in main.py (line 60)

Audio control not working:

  • Ensure you're running on Windows
  • Check that your audio devices are properly configured
  • Run as administrator if needed

Import errors:

  • Verify all dependencies are installed: pip install -r requirements.txt
  • Use a virtual environment to avoid conflicts

Recent Fixes

  • Fixed critical math bug in distance calculation (line 106)
  • Replaced deprecated .tostring() with .tobytes() for OpenCV compatibility
  • Added comprehensive error handling
  • Fixed class name typo (handDectector → handDetector)
  • Changed default camera index from 1 to 0
  • Removed unused imports
  • Added proper resource validation

License

This project is open source and available for educational purposes.

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

Acknowledgments

  • MediaPipe for hand tracking technology
  • Kivy/KivyMD for the GUI framework
  • OpenCV for computer vision capabilities

About

A truly distinctive cross-platform mobile app, offering users with an unparalleled level of convenience to manipulate their devices using just hand gestures!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages