A sophisticated computer automation tool that uses computer vision and machine learning to detect hand gestures in real-time and trigger customizable system actions. X3Gesture employs MediaPipe's hand tracking technology combined with custom gesture recognition algorithms to provide a hands-free control interface for your PC.
- Real-time Hand Gesture Detection: Utilizes MediaPipe's hand tracking for accurate gesture recognition
- Customizable System Actions: Trigger various system operations through hand gestures
- User-friendly GUI: Clean and intuitive interface for easy configuration
- Robust Error Handling: Comprehensive error management and logging system
- Performance Optimization: Configurable resolution settings and gesture cooldown
- Consistent Gesture Recognition: Multi-frame validation to prevent false positives
-
Advanced Gesture Validation
- Implements a consecutive frame validation system
- Requires multiple consistent detections before triggering actions
- Reduces false positives while maintaining responsiveness
-
Intelligent Finger Tracking
- Custom algorithms for precise finger position analysis
- Special handling for thumb movement detection
- Euclidean distance calculations for accurate gesture measurement
-
Flexible Architecture
- Modular design separating GUI and core functionality
- Callback-based action system for easy extensibility
- Configurable parameters for customized operation
-
X3GestureController (x3gesture_controller.py)
- Handles core gesture detection logic
- Manages camera input and frame processing
- Implements MediaPipe integration
- Provides real-time visualization
- Manages gesture state tracking
-
X3GestureToolGUI (x3gesture_gui.py)
- Provides user interface for configuration
- Handles system action execution
- Manages user preferences
- Implements notification system
The tool uses a sophisticated approach to detect hand gestures:
# Pseudo-code representation of the gesture detection logic
1. Capture frame from camera
2. Process frame using MediaPipe Hands
3. Extract hand landmarks
4. Calculate finger positions and distances
5. Apply gesture recognition rules
6. Validate gesture across multiple frames
7. Trigger action if gesture is confirmed
- Clone the repository:
git clone https://github.com/mubbashirulislam/x3gesture.git
cd x3gesture
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Launch the application:
python x3gesture_gui.py
-
Configure settings in the GUI:
- Set gesture cooldown time
- Choose resolution mode
- Select desired action for fist gesture
- Click "Start Gesture Detection" to begin
-
Available actions:
- Lock Screen
- Open Calculator
- Show Notification
- Shutdown PC
Setting | Description | Default |
---|---|---|
Gesture Cooldown | Minimum time between gesture triggers | 1.0 seconds |
Resolution Mode | High/Low resolution camera capture | Low |
Camera Index | Device camera selection | 0 |
Detection Confidence | Minimum confidence for hand detection | 0.7 |
Tracking Confidence | Minimum confidence for hand tracking | 0.7 |
The tool includes several optimizations:
-
Frame Processing
- Configurable resolution for different performance needs
- Efficient landmark calculation using NumPy operations
- Memory-optimized frame handling
-
Gesture Recognition
- Multi-frame validation to reduce CPU usage
- Cooldown mechanism to prevent action spam
- Early exit conditions for non-matching gestures
This project is licensed under the MIT License - see the LICENSE file for details.