Contents
Mission Statement
The MouseTrap misson is to provide an exceptional alternative input system to Gnome with a particular eye towards aiding the physically impaired community. Our aim is to give users the option to replace a mouse with a low-cost webcam which can interpret a user's head movement as computer input.
What is MouseTrap?
Mousetrap is a standalone GNOME application that allows users with physical impairments to move a mouse cursor. 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.
Why Python?
- Python as we all know is a dynamic, flexible and object-oriented programming language with a low learning curve which means that anyone with few programming knowledges can develop applications using python in a short time. For the last 3 years Python has been my favourite programming language and the fact that OpenCV offers python bindings helped me to erase any doubt of using it, but, there were a few more things to consider before choosing python definitely, one of them is the OpenCV hardware requirements. To keep track of the reference points it is necessary to continuously scan and process the new frames captured and this is performed with the OpenCV library. At the beginning the definitely use of python was being affected by this point considering that OpenCV was written in C and the hardware requirements could increase using bindings of the library. After executing some tests with both languages I saw the requirements where almost the same in both cases so, I made my decision.
OpenCV in MouseTrap
MouseTrap process the captured frames and calculates the reference points using OpenCV and following these steps:
- Get the current frame
- Detect the eyes region using the Haar Training method.
- Calculate the forehead point using the coordinates of the eyes region and distance formulas.
- Calculate the Optical Flow of the detected point using the Lucas-Kanade method to keep its track.
Depending on the selected movement method, MouseTrap will execute different calculations to get the new position if the mouse should be moved.
Need to see it working?
These are some videos to see how MouseTrap works:
Found a Bug? / have a request ?
Mailing List
License
MouseTrap has been released under the license GPL v2
See Also
The information on this page and the other MouseTrap-related pages on this site are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


