The Hand Gesture Calculator is an interactive application that uses hand gestures to operate a virtual calculator. The application leverages the MediaPipe library to detect hand landmarks and OpenCV for real-time video processing, allowing users to perform basic arithmetic operations through hand gestures.
- Hand Gesture Recognition: Uses MediaPipe to track hand landmarks and detect gestures.
- Virtual Calculator: Displays a calculator interface on the screen with buttons for numbers and arithmetic operations.
- Gesture-Based Input: Allows users to interact with the calculator using thumb and index finger gestures.
- Hand Detection: The application captures video from the webcam and detects hand landmarks using MediaPipe.
- Gesture Detection: When the thumb and index finger are close together, the application checks if they are over any calculator buttons.
- Button Interaction: If the gesture corresponds to a button on the calculator, it performs the associated action (e.g., number entry, arithmetic operations, or clearing the input).
- Display Results: The calculator updates and displays the result of arithmetic operations in real-time.
- Python 3.x
- OpenCV
- MediaPipe
math
library (standard Python library)
-
Clone the repository:
git clone https://github.com/yourusername/hand-gesture-calculator.git cd hand-gesture-calculator
-
Install the required Python packages:
pip install opencv-python mediapipe
-
Run the main script:
python calculator.py
-
The application will open a window showing the live video feed from your webcam.
-
Interact with the virtual calculator by moving your right hand and using thumb and index finger gestures to press the calculator buttons.