Control your mouse with the Microsoft Kinect using OpenKinect

Category: Python - Miscellaneous

This is a simple code that uses the Kinect in order to simulate the mouse on the screen. In order for this code to work you must have a Linux machine, the freenect module from OpenKinect, NumPy, and Xlib. The last three can be downloaded and installed by running sudo apt-get install {PROGRAM NAME HERE}. Freenect needs to be downloaded and installed for python using the terminal and there are good instructions here how to do it http://openkinect.org/wiki/Getting_Started. You will also need to install the python wrapper. This can be done by following the instructions on this site: http://openkinect.org/wiki/Python_Wrapper. To run the code you must first cd into the directory in which the code resides and then in the terminal run the command sudo python {THE NAME YOU STORED THE CODE BELOW AS}.py. This should run the code. The code needs superuser privileges. Also if you wonder why the mouse will stop tracking your hand, there are two reasons. 1) This code is not super sophisticated, all it does is find the minimum point in the depth image and scales the coordinates to the size of the screen and moves the mouse there so if your stomach is the closest thing to the screen it will track it and place the mouse there. The other reason the mouse might stop tracking is because there is a counter in the that will only let it run 10000 iterations. This is just a safety precaution in case you are not able to control the mouse and the computer freaks out. The last thing you need to know to run this code is that the main_mouse() function takes to arguments, the first is the x dimension of your screen and the second is the y dimension. THE CODE WILL NOT FUNCTION PROPERLY ON MULTIDISPLAY COMPUTERS. Thank You Date: 22 May, 2012


Computer - Control - Freenect - Kinect - Linux - Microsoft - Mouse - Numpy - Openkinect - Vision - Xlib

Homepage: http://code.activestate.com/recipes/578082-control-your-mouse-with-the-microsoft-kinect-using/

Developer: Alexander James Wallar

License: Freeware

Operating System: Windows

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Archimedes will be a Computer Aided Design (CAD) program developed side by side with architecture offices in order to fulfill all their needs.

developer Developer: archimedes
license License: GNU General Public License (GPL)
operating systems Operating System: All 32-bit MS Windows (95/98/NT/2000/XP), All BSD Platforms (FreeBSD/NetBSD/OpenBSD/Apple Mac OS X), All POSIX (Linux/BSD/UNIX-like OSes), OS Independent (Written in an interpreted language)


Network Failure is a puzzle game featuring a jumbled up computer network.

developer Developer: networkfailure
license License: GNU General Public License (GPL)
operating systems Operating System: 32-bit MS Windows (NT/2000/XP), All POSIX (Linux/BSD/UNIX-like OSes), OS Portable (Source code to work with many OS platforms)


VSpeech is a program that allow users to control their computer by their voice such as : control system & program, browse the Web, custom dictionary, dictation.

developer Developer: bk02.net
license License: GNU General Public License (GPL)
operating systems Operating System: All 32-bit MS Windows (95/98/NT/2000/XP)


Offers computer spy software and mobile phone inspector for investigation or detective purpose.

developer Developer: Remote Keylogger
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


Keylogger program records typed characters, digits, special symbols and any other data entered by keyboard in an encrypted text file.

developer Developer: Keylogger
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


Browse capture keystrokes tool that is easy to use and records all PC activities of your children, spouse, friends.

developer Developer: capture keystrokes
license License: GNU General Public License (GPL)
operating systems Operating System: Not Available


A simple Atom client written in Microsoft ASP using MSXML.

developer Developer: Francesco Passantino
license License: Freeware
operating systems Operating System: Windows


This module can be used to calculate file hashes, store them in a database file
and retrieve them at a later date.

developer Developer: eysi
license License: Freeware
operating systems Operating System: Windows


This demo requires you to be using a Linux machine and to have libfreenect installed with the python wrapper.

developer Developer: Alexander James Wallar
license License: Freeware
operating systems Operating System: Windows