Virtual Keyboard using computer vision

isn’t it cool to take input from a virtual keyboard rather than a hardware keyboard!
Hello, After a long time, I am back with another interesting article on computer vision and OpenCV. As everyone knows computer vision is used to process images in machine learning. Today we are using OpenCV and cvzone library in python for this wonderful task everyone is aware of OpenCV and the cvzone is basically a library for detection of hands, pose, face detection, and other related tasks.
Let’s directly jump to the code.
first, we will create a conda environment for the task and install related packages
conda create --name virtual-keyboard python=3.6
conda activate virtual-keyboard
pip install opencv-python
pip install pynput
pip install mediapip
pip install cvzone==1.4.1
After that, we will import libraries to the python code and define the keyboard keys for further reference, and also we will be calling the “Handdetector” function so we can detect hands while clicking on characters. This function is part of cvzone.
Now we will create a function for creating the button for the keyboard using computer vision so that we can see these buttons on the camera while clicking on them virtually
Now we will be making the main part of our code as shown in below
first, we will be constructing the button by calling the function “drawALL” with a given specific size of rectangle after that we will be opening the webcam through the OpenCV module functions. We will be mapping out hand fingers with the key location in the as soon as we click on that key we will see output on the screen below a rectangular box. The “PutText” function will be put into the rectangle given below the keyboard section. After that .imshow function will show the image and waitkey is the function that will show the image after a given time.
So now let's see how our combined picture of the virtual keyboard look like

That’s all for today, I will meet you again in some other intersecting blog.
you can connect me on LinkedIn and you will find complete code on Github.
Join FAUN: Website 💻|Podcast 🎙️|Twitter 🐦|Facebook 👥|Instagram 📷|Facebook Group 🗣️|Linkedin Group 💬| Slack 📱|Cloud Native News 📰|More.
If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇