Virtual Mouse is a program that enables user to simulate Mouse operations such as Click, Double Click, Scroll Down, Scroll Up using Hand(Marker Less).
- Prerequisite
- Installation
- How To Use Non GUI
- Controls
- GUI Design
- Demo
- Features
- Acknowledgement
- References
The program was completely written using Python 3.7.0 in association with several other libraries such as OpenCV and Numpy for image processing, Google's MediaPipe library for human hand pose estimation. This program also utilizes IP Webcam Android Application for image acquisition which is freely availabale on Play Store.
NOTE: If the resolution and quality of builtin Webcam is good enough then there is no necessity of IP Webcam Application
NOTE: Ensure that pip is properly installed and Python 3.7 is added to PATH
This library is used for Image Processing and image acquisition.
NOTE: This application was developed without using OpenCV with CUDA GPU Support.
$ pip install opencv-python
Numpy is neccessary not only because it is dependencies of OpenCV but it is also used in image aquisition from IP Webcam and decode it into suitable format for further image processing operations.
$ pip install numpy
The sole purpose of MediaPipe is to detect palm and it's associated 20 landmarks on palm.
$ pip install mediapipe
Pynput is used to simulate mouse operations.
$ pip install pynput
IP Webcam(Developed By: Pavel Khlebovich) available freely at Play Store.
To clone and run this application, you'll need Git installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/Ashvin-G/Virtual-Mouse.git
Step 1: Run the IP Webcam Application and scroll down to very bottom and "Start server".
Step 2: Ensure that the Mobile and Laptop/PC are on the same network. I would recommend USB tethering.
Step 3: Note down the IPv4 address generated by the IP Webcam.
Step 4: Edit main.py and replace
url = "Enter your URL here/shot.jpg"
with your IPv4 address.
For example
url = http://100.73.6.196:8080/shot.jpg
Step 5: Run the python script.
🔴 Scroll Down 🟣 Scroll Up 🟡 Double Click 🟢 Click ⚪ Mouse PositionThe ⚪ will help in moving the cursor. To perform any Mouse operation move your thumb to corresponding finger tips.
This is the landing window
This is the help window
Features | Availability |
---|---|
Click | ✔️ |
Double Click | ✔️ |
Scroll Down | ✔️ |
Scroll Up | ✔️ |
Hold and Drag | ❌ |
Scroll Left | ❌ |
Scroll Right | ❌ |
The Logo is from www.freepik.com.
Designed By: macrovector_official / Freepik
How to use Google's MediaPipe
Mouse Simulation using Pynput
How Build and Install OpenCV with CUDA GPU Support
⭐ Star me on GitHub — it motivates me a lot!