Hand Gesture-Based Cursor Control and Arithmetic Solver

Welcome to the Hand Gesture-Based Cursor Control and Arithmetic Solver project! 🚀 This project uses hand gestures to control your computer's cursor, input numbers and arithmetic operators, and solve basic mathematical equations.

Features ✨

  • Cursor Control: Move the mouse cursor with your hand gestures.
  • Gesture-Based Arithmetic Input: Input numbers and operators through hand gestures.
  • Equation Solver: Perform basic arithmetic operations and display the results.
  • Mouse Actions: Simulate left and right mouse clicks through specific gestures.

Technologies Used 🛠️

  • Python: The primary programming language used.
  • OpenCV: For capturing and processing video from the webcam.
  • MediaPipe: For hand tracking and gesture recognition.
  • PyAutoGUI: For controlling the mouse cursor and simulating clicks.

Installation 📦

  1. Clone the Repository:

    git clone https://github.com/zaid-commits/hand-gesture-calculator.git
  2. Navigate to the Project Directory:

    cd hand-gesture-calculator
  3. Install the Required Dependencies:

    pip install -r requirements.txt

Usage 🚀

  1. Run the Script:

    python main.py
  2. Perform Hand Gestures:

    • Move Cursor: Use your index finger to move the cursor on the screen.
    • Input Numbers: Show your fingers to input numbers from 0 to 5.
    • Input Operators: Use specific gestures to input arithmetic operators (+, -, *, /).
    • Click: Perform a click by bringing your thumb and index finger close together.
    • Solve Equation: Display the "equals" gesture to solve the current arithmetic expression.
  3. Exit the Program:

    • Press the Esc key to exit the application.

Example Gestures 🤲

  • Numbers:

    • 0: All fingers closed.
    • 1: Thumb up.
    • 2: Thumb and index finger up.
    • 3: Thumb, index, and middle fingers up.
    • 4: Thumb, index, middle, and ring fingers up.
    • 5: All fingers up.
  • Operators:

    • +: Extend your index and middle fingers.
    • -: Extend your index finger only.
    • *: Extend your thumb and index finger (making an "L" shape).
    • /: Cross your index and middle fingers.
  • Click: Thumb and index finger touching.

  • Equals: Make a fist and then extend your index finger.

Requirements 📋

  • Python 3.x
  • OpenCV
  • MediaPipe
  • PyAutoGUI

You can install the dependencies using:

pip install opencv-python mediapipe pyautogui

Contributing 🤝

Contributions are welcome! If you have any improvements or bug fixes, please create a pull request or open an issue.

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments 🙏

Contact 📫

Feel free to reach out if you have any questions or suggestions: