Skip to content

Gesture-Controlled Virtual Keyboard : This Python project uses computer vision to control a virtual keyboard with hand gestures via your webcam. Unlock the future of digital interaction today!

Notifications You must be signed in to change notification settings

rishabhk165/Hand_Gestures_Control_cv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Libraries to be Installed

  1. pip install opencv-python
  2. pip install numpy
  3. pip install cvzone
  4. pip install pynput

Gesture-Controlled Virtual Keyboard using Hand Gestures

Welcome to an exciting project that lets you control a virtual keyboard with just your hand gestures! This captivating Python script uses the power of computer vision to detect and track your hand in real-time through your webcam. As you make specific hand gestures, the code translates them into keyboard inputs, allowing you to interact with the virtual world like never before!

How It Works:

  1. Feel the Magic of Libraries: The script kicks off by importing the necessary Python libraries that bring this enchanting experience to life:

    • cv2 (OpenCV): An enchanting library that captures the wonders of your webcam's video and works magic on the images, just like an alchemist!
    • numpy: The mystical sorcerer of numerical computations and array handling, always ready to perform its spellbinding calculations!
    • cvzone: A secret library of hand detection and tracking sorcery, essential for detecting your majestic hand in the webcam feed.
    • pynput: A mystical controller capable of simulating the ancient art of keyboard key presses with a flick of its wand!
  2. Enchanting Webcam Setup: The script opens the portal to your webcam, creating a mystical gateway to the world of magic. It sets the desired resolution for capturing the extraordinary video frames.

  3. Hand Detection Sorcery: This is where the real magic begins! The script invokes the hand detection model from cvzone, a powerful spellcaster that detects your hand's presence in the webcam feed. This wizardry comes with a confidence threshold and can recognize up to one hand at a time.

  4. Commanding the Keyboard Spirits: The code conjures a virtual keyboard controller using the pynput library. This enchanted artifact shall respond to your hand gestures, translating them into the ancient language of keyboard key presses.

  5. Hand Gesture Magic: Inside the loop of eternal enchantments, the script continuously captures bewitching video frames from the webcam.

  6. Frame Skipping Sorcery: To enhance the magic's performance, the script occasionally skips hand detection for a few frames. This spell helps maintain the balance between accuracy and speed.

  7. Eyes on the Hand Crystal Ball: The script gazes into the crystal ball, checking for your hand's presence in the mystical video frame. If your hand is found, it delves deep into the hand's palmistry to reveal the locations of its powerful landmarks, such as the fingertips!

  8. Divining the Finger Status: The script invokes the art of divination to determine if the ancient digits, the thumb, and four fingers, are open or closed. This knowledge reveals which fingers are raised high (up) and which are humbly rested (down).

  9. Enchanting Keyboard Inputs: As you weave your hand gestures, the script attentively listens to the changes in your finger status. When your fingers open wide like a blossoming flower, it performs a magical incantation that simulates pressing the right arrow key. Conversely, when all fingers come together in unity, like the petals of a closed bud, the script elegantly presses the left arrow key. This enchantment ensures that keyboard inputs are only executed when your hand spell changes.

  10. Gaze into the Mirror: The script mesmerizes you with a magical reflection, displaying the real-time webcam feed enchanted with the knowledge of your hand gestures. It's as if the mystical world of gestures is unfolding before your eyes!

  11. Endless Possibilities: As you embark on this magical journey, you can explore various hand gestures to discover their secrets. Your imagination is the limit to what you can achieve with this gesture-controlled virtual keyboard!

  12. Freedom to Depart: To bring this adventure to a temporary pause, you can cast a spell by pressing the "q" key while the enchanted webcam feed window is in focus. The magic will be put on hold, but you can always resume it whenever your heart desires!

Welcome to the enchanting realm of gesture-controlled magic! The more you explore, the more magical surprises await you. Have fun shaping your digital world with the mere flick of your hand!

About

Gesture-Controlled Virtual Keyboard : This Python project uses computer vision to control a virtual keyboard with hand gestures via your webcam. Unlock the future of digital interaction today!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages