The Gesture Controller is a Python-based project that uses a webcam to capture hand gestures and perform various system control actions such as adjusting volume, brightness, scrolling, and mouse control. It leverages OpenCV for video capture, MediaPipe for hand tracking, and PyAutoGUI for automating GUI interactions.
- Gesture Recognition: Detects various hand gestures and maps them to specific actions.
- System Control: Adjust system brightness and volume, scroll horizontally and vertically, and control the mouse cursor.
- Pinch Gestures: Supports pinch gestures for finer control over system settings.
- Python 3.x
- OpenCV
- MediaPipe
- PyAutoGUI
- PyCaw
- Screen Brightness Control
-
Clone the repository:
git clone https://github.com/your-repo/gesture-controller.git cd gesture-controller
-
Install the required packages:
pip install opencv-python mediapipe pyautogui comtypes screen-brightness-control
-
For volume control, you need to install
pycaw
:pip install pycaw
Run the gesture_controller.py
script to start the gesture controller.
python gesture_controller.py
- FIST: Click and drag.
- V_GEST: Move the mouse cursor.
- MID: Left-click.
- INDEX: Right-click.
- TWO_FINGER_CLOSED: Double-click.
- PINCH_MAJOR: Control system brightness (horizontal) or volume (vertical).
- PINCH_MINOR: Scroll horizontally or vertically.
The Gest
class enumerates the various gestures using binary encoding.
The HLabel
class enumerates the hand labels for major and minor hands.
The HandRecog
class processes the hand landmarks provided by MediaPipe and converts them into recognizable gestures.
The Controller
class executes commands based on detected gestures.
The GestureController
class handles video capture, processes frames to detect hand landmarks using MediaPipe, and manages the overall gesture control logic.
This project is licensed under the MIT License.