background preloader

PyKinect Programming

Facebook Twitter

Python Tools for Visual Studio - Home. PyKinect – write Kinect games using Python!

Python Tools for Visual Studio - Home

API Reference We are very excited to announce PyKinect with PTVS 1.1. PyKinect enables writing awesome games and interfaces using Python: Dino goes on a diet: Before (grey) and After (yellow) Set breakpoints & Explore Kinect sensor data in the debugger directly Prerequisites: - CPython 2.7 - PyGame ( - Kinect SDK ( 32-bit only!) - Speech support (Kinect for Windows Runtime Language Pack, version 0.9) - A kinect sensor (note you don’t need an Xbox 360 to use PyKinect) - A kinect Power/USB Adaptor (eg: Sample from Installation: Assuming you’ve already installed PTVS & a CPython interpreter, install PyGame, Kinect SDK and PyKinect (order doesn’t matter).

Note: PyKinect only works with a 32-bit CPython setup currently Run the demos: File/New project/… /Kinect Game - this is the “hello world!” Pykinect & Pygame make writing Kinect games easy For a slightly more involved sample, please see: Notes about PyKinect: A couple of things to watch out for: Python Tools for Visual Studio - Home. The pykinect package provides access to the Kinect device.

Python Tools for Visual Studio - Home

The pykinect package includes both the "nui" and "audio" subpackages. The nui package provides interactions with the Kinect cameras including skeleton tracking, video camera, as well as the depth camera. The audio subpackage provides access to the Kinect devices microphones. pykinect.nui package the pykinect.nui package provides access to the Kinect devices cameras. Runtime class The runtime class is the primary entry point for starting to work with the Kinect cameras. With nui.Runtime() as kinect: pass The runtime class has several arguments which can be used when constructing it to control what functionality is available or what device is used. Runtime(nui_init_flags = ..., index = 0) From here additional methods and attributes of the runtime class can be accessed for interacting with the Kinect device: RuntimeOptions class Provides a set of options which can be enabled per-Kinect sensor.

Device class ImageStream class Camera class. Start. Software Development Kit (SDK) The Kinect for Windows SDK enables you to use C++, C#, or Visual Basic to create applications and experiences that support gesture and voice recognition by using the Kinect for Windows sensor and a computer or embedded device.


The Developer Toolkit contains additional resources, sample applications with full source code Kinect Studio, and other resources to simplify and speed up application development. Kinect for Windows SDK The download includes drivers for using the Kinect for Windows sensor on a computer running Windows 8, Windows 7, or Windows Embedded Standard 7. Also included are APIs and device interfaces. 2013-09-17T00:00:00,222 MB,English Kinect for Windows Developer Toolkit The download includes Human Interface Guidelines, sample applications (with full source code), Kinect Studio, Face Tracking SDK, and other resources. Draw - Pygame Documentation. Pygame module for drawing shapes Draw several simple shapes to a Surface.

draw - Pygame Documentation

These functions will work for rendering to any format of Surface. Rendering to hardware Surfaces will be slower than regular software Surfaces. Most of the functions take a width argument to represent the size of stroke around the edge of the shape. If a width of 0 is passed the function will actually solid fill the entire shape. All the drawing functions respect the clip area for the Surface, and will be constrained to that area. Most of the arguments accept a color argument that is an RGB triplet. These functions must temporarily lock the Surface they are operating on. Pygame.draw.rect() draw a rectangle shape rect(Surface, color, Rect, width=0) -> Rect Draws a rectangular shape on the Surface.

Keep in mind the Surface.fill() method works just as well for drawing filled rectangles. Pygame.draw.polygon() draw a shape with any number of sides polygon(Surface, color, pointlist, width=0) -> Rect Simple Paint with PyGame.