Virtual-Mouse is a mouse that brings functionalities of a regular mouse to your PC camera. It brings the convenience of moving cursor and clicking functionalities just by showing hand gestures to your camera.
You need a camera/webcam set up with your PC.
Very simple. Just download or clone the repository and install the following Python modules and your are good to go! Simply run the program and it will pop up a window showing the camera. Show up your hand, you will notice 2 circles in 2 dedicated fingers Thumb
& Index Finger
in the camera view.
Q: How can I move my mouse cursor?
A: It's Simple! Just move your Index Finger
to move your cursor!
Q: How can I click to a button or on something?
A: It's also really simple! All you need to touch your Index Finger
with your Thumb
or just need to make the distance between Index
and Thumb
Fingers minimum 20
pixels!
Tip: You can also change the minimum distance by changing 20
here:
Line 37 in 3243afa
- Python 3.9.5
- An IDE for editing code:
Module | Version | pip Command |
---|---|---|
msvc-runtime | 14.29.30133 | pip install msvc-runtime==14.29.30133 |
opencv-python | 4.6.0.66 | pip install opencv-python==4.6.0.66 |
mediapipe | 0.8.10 | pip install mediapipe==0.8.10 |
PyAutoGUI | 0.9.53 | pip install pyautogui==0.9.53 |
Some predicted Problems with Solutions mentioned down there!
Error:
ImportError: DLL load failed while importing _framework_bindings: The specified module could not be found.
Solve:
For the module msvc-runtime
this error should be fixed. If it not, please install Microsoft Visual C++. If you have that in your PC, please consider installing the updated Microsoft Visual C++. If you get that error after installing, please Restart your PC!
Error:
ConnectionAbortedError: cv2: No Camera Found!
Solve:
This error occurs, when the program can't find your Camera. It usually appears when you use more than one camera! You have to specify a single camera by changing the camera number here:
Line 5 in 62db0a2
0
here because there is a single camera in my PC! You can try changing it to 1
or 2
!