Latest recipes tagged "hand_tracking"http://code.activestate.com/recipes/tags/hand_tracking/new/2012-04-15T18:49:00-07:00ActiveState Code RecipesOpenKinect Mouse Control Using Python (Python)
2012-04-15T18:49:00-07:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/578104-openkinect-mouse-control-using-python/
<p style="color: grey">
Python
recipe 578104
by <a href="/recipes/users/4179768/">Alexander James Wallar</a>
(<a href="/recipes/tags/3d/">3d</a>, <a href="/recipes/tags/computer/">computer</a>, <a href="/recipes/tags/computer_vision/">computer_vision</a>, <a href="/recipes/tags/depth/">depth</a>, <a href="/recipes/tags/hand_tracking/">hand_tracking</a>, <a href="/recipes/tags/kinect/">kinect</a>, <a href="/recipes/tags/mouse/">mouse</a>, <a href="/recipes/tags/opencv/">opencv</a>, <a href="/recipes/tags/openkinect/">openkinect</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/tracking/">tracking</a>, <a href="/recipes/tags/vision/">vision</a>).
Revision 2.
</p>
<p>This is a simple code that lets a user control the mouse and left-click using the Microsoft Kinect, Python, and OpenKinect. </p>
<pre class="prettyprint"><code>Computer Prerequisites:
-OpenKinect
-Python Wrapper for OpenKinect
-A Linux machine using Ubuntu
-OpenCV 2.1
-OpenCV 2.3
-Python 2.7.2
-A Microsoft Kinect
-A Microsoft Kinect USB Adapter
-PyGame
-Xlib for Python
</code></pre>
<p>To run this code you either need to start it in the terminal or you need to write a short bash script that runs the code. This is necessary because it requires super-user privileges.</p>
<p>The Bash script is (Assuming the code is saved by the name 'Hand Tracking.py' in /home/$USER directory:</p>
<pre class="prettyprint"><code>#!bin/bash
cd 'home/$USER'
gksudo python 'Hand Tracking.py'
</code></pre>
<p>The code is heavily commented and most of what you will need to know is there. </p>