THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Hand mouse control is simple software, that allows you to control the mouse cursor using webcam and your hands. With this software you can move mouse cursor, left click, right click, and scroll using hand gestures.
So, this is a simple software to control your mouse using hand gestures.
This code can run on Windows, Linux-based systems, and MacOS
-
Download this project by clicking
Codebutton, thenDownload ZIP, then unpack downloaded archive -
To run this project you need latest version of Python(link)
Please note that Python is preinstalled in the most of Linux-based OSes, you can check installation by entering
python3 --versionin your terminalIt's recommend to
Add Python to PATH, with this setting you will be able to run python by typingpythonin cmd -
You need to install all required modules:
pyautogui mediapipe opencv-python (cv2)You can do this in many ways
-
Using
pip3: type in cmd/terminalpip3 install <module>, for examplepip3 install pyautogui -
Or using
requirements.txt: open the project folder in cmd/terminal and type `pip3 install -r requirements.txt
-
-
Run
hand-gesture-mouse-control.pyand after webcam window appears, try to move mouse cursor using hand gesture -
If everything works fine enjoy using this software, otherwise if you can`t use any gestures(clicks are not registering) try increasing
press_threshold_multiplyervariable in code, or if you experience random clicks, try decreasing that variable.Please note that some random clicks can appear because of bad webcam image quality.
You can move mouse cursor by touching thumb with middle finger and moving hand
You can perform left click by touching thumb with index finger
You can perform right click by touching thumb with ring finger
You can scroll by touching red point(i dont know how to name it ¯\_(ツ)_/¯ ) with thumb and moving hand up or down
Tip: you can combine some actions, for example: press LMB and move cursor to select text, or use scrollbar
