Building on Windows
Clone this wiki locally
This is a community-contributed wiki. Feel free to improve it or post an issue if you have questions or troubles.
As many operations involved in the build process are lengthy ones (setting up Windows, installing system updates, installing Visual Studio Pro, building/installing the Boost library), the whole process can take a couple of days to complete, depending on what you already have installed.
Make sure the device (Kinect, etc.) is unplugged before starting the installation.
Download the OpenNI installer here.
Select OpenNI Binaries, Unstable, and your OS option.
Now, install the drivers for your device:
With this, we should be able to communicate with the device.
If we want to do more interesting things like track skeleton, track hands, detect users, poses and gestures we need some middleware.
So, download the middleware installer from here.
Select OpenNI Compilant Middleware Binaries, Unstable, and your OS option.
That's it, you have the OpenNI stack installed! To try, plug the device and go to Start Menu → PrimeSense → NITE → Samples → Sample-PointViewer. Go in front of the camera and wave your hand! Other samples can be found on the same menu.
Install the compiler
Of course, we'll need a compiler. We could use MinGW,
but it's currently not possible due to incompatibilities
So, install Visual Studio 2010 Pro (DVD and online updates).
Make sure the "VC++ compiler" option is checked.
Other languages (Visual Basic, C#, F#, etc.) can be left out.
Install PyOpenNI dependencies
PyOpenNI are the bindings that will allow you to use OpenNI from Python.
To build it, we'll need to install first:
CMake from its website
→ Accept the default location. Add to PATH for all users.
Git for Windows from Google Code (full installer)
The default options are fine.
Python (of course) from its homepage
You should have version 2.7 or later.
→ We accept the default location,
The Boost set of C++ libraries
Get an installer from here.
Download & Build PyOpenNI
Open a Git shell (Start Menu → Git → Git Bash) and type:
git clone https://github.com/jmendeth/PyOpenNI.git
Then close the
Open a command prompt (Start Menu → Accessories → Command Prompt) and type:
md PyOpenNI-build cd PyOpenNI-build cmake -G "Visual Studio 10" ..\PyOpenNI
No warnings or errors should appear.
- Open the `PyOpenNI-build` folder and double-click on `PyOpenNI.sln`. Visual Studio will then be launched.
In the “Solution Configuration” dropbox, select
Generate the solution by pressing the F7 key.
PyOpenNI-build folder. Inside
lib, there should be the finished module,
:: copy Boost-python cp C:\boost\stage\lib\boost_python-vc100-mt-1_51.dll C:\Python27\Lib\site-packages :: copy and rename openni.dll cp bin\Release\openni.dll C:\Python27\Lib\site-packages\openni.pyd
Now, open Python and try:
No error message should be displayed.