It uses a webcam to track the motion of any object visible by the camera and moves the mouse cursor according to the path of the tracked object (a user's head, for example).
Distributed with software that allows accessible mouse clicking, MouseTrap will give most physically impaired users access to the full functionality of a mouse.
Our ultimate goal is to have a usable, stable solution that allows users to control their cursors just as well as someone using a mouse.
MouseTrap is written in Python, based on the OpenCV library and uses image processing to translate the user's head movements into mouse events (movements, clicks) which allow users to interact with the different desktops managers and applications.
The MouseTrap direct dependencies are:
The GTK+ Toolkit
GTK+ Python bindings
Open Computer Vision Library
Python Xlib library (just in case user doesn't use gnome)
Python AT-SPI bindings
A documentation system for C++, C, Java, IDL and PHP (this package is required for building the documentation)
NOTE: Each dependency may require other dependencies to be installed.
Install Git. Git is a distributed version control system. You will need it to get, compile, and run the source code for Mousetrap.
$ sudo apt-get install git-core
Use git to clone the repository on your local machine.
$ git clone git://git.gnome.org/mousetrap
Navigate to the directory where you cloned the repository and run the following command to begin installation:
If you run into errors, see the section entitled “Troubleshooting.” Next you need to compile the source code. To do this, run the following command:
Once this completes, you will need to install Mousetrap with the following command:
$ sudo make install
It is possible to modify the installation path using --prefix=/non/standard/path. After installing, you can run the program by typing:
These problems occur in Ubuntu 9.04 but may also appear in other distributions.
You need to install gnome-common from the GNOME CVS
$ sudo apt-get install gnome-common
***Error***: You must have glib-gettext >= 2.2.0 installed to build mouseTrap.
$ sudo apt-get install libglib2.0-dev
configure: error: Could not find python headers needed to build Python extensions
$ sudo apt-get install python2.6-dev
configure: error: Could not find python module Xlib
$ sudo apt-get install python-xlib
configure: error: Could not find python module opencv
$ sudo apt-get install python-opencv
There's not a first run configuration wizard nor a text console based one, yet. To configure MouseTrap it is necessary to execute MouseTrap and it will create the configuration file automatically.
To run MouseTrap the user has to open a terminal window, navigate to the folder where the software was installed and type in the command ./mousetrap.
After running MouseTrap, the software will take a few moments to analyze the images that are coming from the camera in order to find a tracking point (ideally the user's head). This process is visible in the script mapper and is denoted by the message “Found a matching point”.
The MouseTrap user interface is very simple and consists of the basic functions that the user needs in order to move a mouse cursor without a mouse. Please note that MouseTrap does not have a click function yet, meaning that the user can only move the cursor by the movement of his/her head but can not make it click. To enable the accessibility function for mouse clicking built in the Linux Operating system please follow these steps:
- Go to System->Assistive Technology menu.
- Click the Mouse Accessibility option.
- Enable the "Initiate click when stopping pointer movement" option.
See Figure 2 for a visual aid:
To learn more about this, please visit the Ubuntu Accessibility web page.
Figure 3 shows the main interface of MouseTrap
As visible in the image, MouseTrap looks for the person's head and marks the image with a green dot (see the Camera Image in Figure 3). The movement of the user's head will determine the movement of the green dot, hence moving the mouse cursor.
From the main interface the user has access to some of the features built in MouseTrap. To access them click on the Preferences button. Figure 4 shows the Preferences menu:
Through the Preferences menu, the user has access to 6 tabs: General, Camera, Algorithm, Addons, Mouse, Debug.
Figure 5 represents the Camera tab: