A Python-based virtual calculator that leverages OpenCV for real-time hand gesture recognition, enabling touchless interaction. This project integrates computer vision techniques with a trained Artificial Neural Network (ANN) model to interpret hand gestures as numerical inputs, facilitating arithmetic operations without physical contact.
- Hand Gesture Recognition: Utilizes OpenCV to detect and interpret hand gestures in real-time.
- Digit Classification: Employs a trained ANN model (
MNIST_ANN.py) to classify hand-drawn digits accurately. - Virtual Interface: Provides an on-screen calculator interface that responds to recognized gestures.
- Real-Time Feedback: Displays inputs and results dynamically, enhancing user interaction.
-
Clone the Repository:
git clone https://github.com/aksayush2005/VirtualCalculator_using_OpenCV.git cd VirtualCalculator_using_OpenCV -
Set Up a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
Ensure you have Python 3.x installed. Then, install the required packages:
pip install opencv-python numpy
-
Train the ANN Model:
Before running the calculator, train the digit classification model:
python CUSTOM_ANN.py
This script trains an ANN on a custom dataset(custom_hand_data.zip) and saves the model.Ensure the dataset is present in the working directory.
-
Run the Virtual Calculator:
After training the model, launch the calculator interface:
python calculator.py
A window will open using your webcam. Use hand gestures to input numbers and perform calculations.
├── CUSTOM_ANN.py # Script to train the ANN model on the custom dataset
├── calculator.py # Main application script for the virtual calculator
├── custom_hand_data.zip # Custom Dataset,ensure that it is present in the working directory
Contributions are welcome! If you'd like to enhance functionality, fix bugs, or improve documentation, please fork the repository and submit a pull request.
This project is open-source and available under the MIT License.
- OpenCV for providing powerful computer vision tools.