Virtual Keyboard with Hand Gestures

🚀 Built a Virtual Keyboard with Hand Gestures Using Python! 🖥️ This project allows users to type on a virtual keyboard by simply moving their hands in front of the webcam. It uses OpenCV, MediaPipe, and pynput to recognize hand gestures and simulate keyboard inputs.

Project Objective

The objective of this project is to create a hands-free typing experience using computer vision. Users can control a virtual keyboard by detecting hand gestures in real-time, enhancing accessibility and user interaction.

Steps Involved:

Data Preparation:

  • Captured real-time video using OpenCV.
  • Detected hand landmarks using MediaPipe.
  • Mapped finger positions to corresponding virtual keys.

Model Selection:

  • Used MediaPipe for accurate hand landmark detection.
  • Implemented custom logic to map hand gestures to keyboard inputs.

Development:

  • Simulated key presses using the pynput library.
  • Designed a virtual keyboard interface with reduced button opacity for better visibility.
  • Added space bar and backspace functionality for seamless typing.
  • Repositioned the text display area for improved readability.

Evaluation:

  • Tested the system with various hand gestures and lighting conditions.
  • Validated accuracy and responsiveness of gesture recognition.
  • Enhanced UI to provide clear visual feedback during typing.

Typing Results:

The virtual keyboard demonstrated reliable performance in recognizing hand gestures and simulating keyboard inputs. It accurately detected key presses, space bar, and backspace gestures, offering a smooth typing experience.

Example Usage:

During a demo session, the system successfully allowed the user to type a complete sentence using hand gestures, achieving high accuracy and real-time responsiveness.

Results:

By leveraging AI and computer vision techniques, the Virtual Keyboard with Hand Gestures offers a novel and accessible way to interact with computers, making typing more intuitive and engaging.

Images and Videos from the Project



View the Code