交互性体感操控
Access rate limit exceeded. Please log in to continue.
Gesture-Controlled Virtual Keyboard ✋⌨️
A gesture recognition system based on MediaPipe that controls a virtual keyboard by capturing hand movements via a camera.
🚀 Core Features
- 3x3 Grid Direction Recognition: Precisely locates the palm's position within a 9-zone grid on the screen.
- Gesture-to-Key Mapping: Customizable keyboard combinations mapped to 8 directions.
- Long Press Trigger: Sustained gestures (1+ seconds) trigger special operations.
- Fist Stop: Closing the fist immediately releases all active keys.
- Mirror Mode: Supports switching between left and right hand usage.
🛠️ Technical Implementation
Key Algorithms
# Hand Region Judgment Logic
if wrist_x < third_width:
if wrist_y < third_height: direction = "Top-Left"
elif wrist_y < 2*third_height: direction = "Left"
else: direction = "Bottom-Left"
Tech Stack
- Hand Tracking: MediaPipe Hands
- Image Processing: OpenCV
- GUI Interface: Tkinter
- Keyboard Simulation:
keyboardlibrary - Performance Optimization: Real-time processing at 60 FPS
📦 Installation & Usage
Install Dependencies
pip install opencv-python mediapipe keyboard pillow
Run Program
python main.py
🎮 Operation Guide
-
Gesture Setup:
- Click interface buttons to select a direction (e.g., "Top-Left").
- Press physical keyboard keys to complete binding (up to 3-key combinations).
-
Control Modes:
- Move palm into the 3x3 grid area to trigger corresponding keys.
- Hold gesture for 1 second to trigger long-press state.
- Close fist to immediately stop all key inputs.
-
Mirror Mode:
- Click "Toggle Mirror Mode" button to adapt for left or right hand usage.
📂 Project Structure
Gesture_Keyboard/
├── main.py # Main program
└── README.md
💡 Application Scenarios
- Accessibility Assistance: Provides an input solution for individuals with mobility challenges.
- Motion Gaming: Replaces controller directional pads for game control.
- Presentation Control: Remotely control PPT slides.
- Smart Home: Control smart devices via gestures.
🚨 Known Limitations
- Requires good lighting conditions.
- Complex backgrounds may affect recognition accuracy.
- Currently supports single-hand input only.
Running Interface
⭐ If you like this project, please Star it for support!
🐛 Bug Reports: Please include environment configuration and error logs.