/NonMouse

a webcam-based virtual gesture mouse that is easy to use with hands on the desk.

Primary LanguagePythonApache License 2.0Apache-2.0

a webcam-based virtual gesture mouse that is easy to use with hands on the desk


Features

  • No need for anything other than a webcam and host PC.
  • Gesture-based HCI has been around for some time, but shooting from above makes the mouse easier to use.
  • NonMouse can be invoked by the global hotkey even when this application is inactive.
  • Works well with typing.
  • Just download from the latest release(windows, mac only).

Installation

πŸ“ Executable file

Download the zip file that matches your environment from the latest release.

OR

🐍 PyPI

Run the following script.

$ pip install nonmouse

(If you have trouble installing mediapipe, please visit the official website.)

Usage

1. Install a camera

The following three ways of placing the device are assumed.

  • Normal: Place a webcam normally and point it at yourself (or use your laptop's built-in camera)

    γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-09-13 午後5 33 21 γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-09-13 午後5 33 21
  • Above: Place it above your hand and point it towards your hand.

    γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-09-13 午後5 33 21 γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-09-13 午後5 33 21
  • Behind: Place it behind you and point it at the display.

    γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-09-13 午後5 33 21 γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-09-13 午後5 33 21

2. Run

  • Run the executable as described in the GitHub wiki.

    OR

  • Run the following script from the continuation of the installation.

    For windows and linux(global hotkey function does not work in linux.)

    $ nonmouse

    For MacOS, you need execute permission.

    $ sudo nonmouse

3. Settings

When you run the program, You will see a screen similar to the following. On this screen, you can set the camera and sensitivity.

γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2021-12-02 154251

  • Camera
    Select a camera device. If multiple cameras are connected, try them in order, starting with the smallest number.

  • How to place
    Select the location where you placed the camera. Place the camera in one of the following positions: Normal, Above, Behind in [πŸ“· Install a Camera].

  • Sensitivity
    Set the sensitivity. If set too high, the mouse cursor will shake slightly.

When you are done with the settings, click continue. The camera image will then be displayed, and you can use NonMouse with the settings you selected.

4. Hand Movements

stop cursor left click right click scroll
aaa aaa aaa aaa

The following hand movements are enabled only when you hold down Alt(Windows), Command(MacOS). You can define your own global hotkeys by rewriting here. You can use this function even if the window is not active.This feature is only available on windows and mac.

  • cursor
    • Mouse cursor: tip of index finger β†’ A blue circle will appear at the tip of your index finger.
    • Stop mouse cursor: Attach the tip of your index finger to the tip of your middle finger. β†’ The blue circle disappears.
  • left click
    • Left click: Attach the fingertips of your thumb to the second joint of your index finger β†’ A yellow circle will appear on the tip of your index finger.
    • Left click release: Release the thumb fingertip and the second joint of the index finger. β†’ The yellow circle disappears.
    • Double click: Left click twice within 0.5 seconds.
  • other
    • Right click: Hold the click state for 1.5 second without moving the cursor. β†’ A red circle will appear at the tip of your index finger.
    • Scroll: Scroll with the index finger with the index finger folded β†’ a black circle will appear.

Note

  • Use it with a bright light at hand.
  • Keep your hand as straight as possible to the camera.

5. Quit

Press Ctrl+C, when a terminal window is active.
Press close button(Valid only on windows, linux) or Esc key, when an application window is active.

Build

Note
The built binary files can be downloaded from latest realease.

In app-mac.spec and app-win.spec, change pathex to fit your environment.
Run the following scripts for each OS.

  • windows

    Copy and paste the location obtained by pip show mediapipe into datas, referring to what is written originally.
    Run the following script.

    $ pip show mediapipe
    ...
    Location: c:\users\namik\appdata\local\programs\python\python37\lib\site_packages
    ...
    #Copy and paste into the datas in win.spec
    $ pyinstaller config/win.spec
    ... ````
  • mac

    Create a venv environment and perform pip install, because the directory specified in datas is for an assumed venv environment.

    $ git clone https://github.com/takeyamayuki/NonMouse.git
    $ cd NonMouse
    $ python3 -m venv venv
    $ . venv/bin/activate
    (venv)$ pip install -r requirements.txt
    (venv)$ pyinstaller config/mac.spec