ofxKinect2: addon of Kinect for Windows v2 device with Microsoft SDK


I have ported Microsoft Kinect v2.0 SDK to OF.

Still very simple; It only supports color/depth/ir. I will implement body tracking soon. :slight_smile:
SDK itself is also still very uncompleted. So it will change a lot.

I am afraid there’s not many people can use this yet because it’s preview and Microsoft only provide x64 library for VS so far (and I think it only works upon Windows8 or higher with official driver). But I have just post this for someone who wants to make experiments with it on OF.

Here’s a branch of OF for x64 apps for VS.

I added vs64 checkbox to projectGenerator so you can use it to create your own project.

Note that you should add include/ library directory for Kinect2 manually after generated.
add to C++ -> General -> Additional Include Directories: $(KINECTSDK20_DIR)\inc;
add to Linker -> General -> Additional Library Directories: $(KINECTSDK20_DIR)\lib\x64;

I will add them to libs folder after it’s redistributable.
Good luck!


woooow thank you very much!!! looks very nice… will give it a try later!!!

1 Like

Very nice addon, thanks!

I’m actually trying to wrap the Body source in this addon. Do you have some instructions about how to achieve this?

EDIT: I’ve managed to get the IBodies by taking them directly in the Kinect SDK, the same as way the BodyBasics-D2D example.

I’m having a hard time getting this x64 version of OF to work. Can anyone give me clearer instructions?
Using VS 2012, I can get the project generator to create the examples, but none of those load correctly - I get a message saying the main version of the OF library is missing:

E:\openFrameworks-Win64\libs\openFrameworksCompiled\project\vs64\openframeworksLib.vcxproj : error  : Project "E:\openFrameworks-Win64\libs\openFrameworksCompiled\project\vs64\openframeworksLib.vcxproj" could not be found.

Am I missing a step, do I need to build the OF core seperately somehow?


Sorry I found I have just forgot adding vs64 projects. I have added so check the latest one. :slight_smile:




thanks for the quick update - I’m getting closer, but I’m now seeing one new error:

Error    2    error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'    E:\openFrameworks-Win64\examples\empty\emptyExample\PocoNetSSLmdd.lib(SSLManager.obj)    emptyExample


I have checked mine but can’t get that error.

Did you success to run “addons/ofxKinect2/example” ?

Also in project generator, did you generate a project with checking “win VS64 projects” instead of “win VS projects” ?
Watch out it is checked “win VS projects” as default so you should change it.

I found the same problem as Mr. drosen.

my steps, on visual studio 2012
1.download the openframeworks8.1 from http://www.openframeworks.cc/versions/v0.8.1/of_v0.8.1_vs_release.zip.
2.download the batch files from your github https://github.com/sadmb/openFrameworks/archive/Win64.zip.
3.unzip these files.
4.overwrite the batch files to openframeworks8.1.
5.Run setupCommandLine.cmd and compileAllExamples.cmd in \of_v0.8.1_vs_release\scripts\vs64.

I also came across with those errors, so as a workaround, I integrated sadmb’s addon to prisonerjohn’s branch of oF 64-bit. I used this branch mainly because I needed videos and assimp.

Oh, I got it.
The error says you use 32bit libraries for 64bit compile.

I didn’t modify batch files inside my 64bit project because I made it just for this ofxKinect2 addon. It’s not perfect package. So you may not use cmd files. Please use projectGenerator for creating new project. (And try “addons/ofxKinect2/example” for checking if ofxKinect2 works)

Here’s a step:

  1. Download https://github.com/sadmb/ofxKinect2/archive/master.zip.

  2. Download https://github.com/sadmb/openFrameworks/archive/Win64.zip.

  3. Unzip them and copy ofxKinect2 folder into openframeworks-Win64/addons folder.

  4. Open “addons/ofxKinect2/example/example.sln”.

  5. Compile it.

  6. If you want to create your own project for ofxKinect2, then run “openframeworks-Win64/projectGenerator/projectGenerator.exe”.

  7. Check “ofxKinect2”, “win VS64 projects” and “create project” then you got your new project folder generated.

  8. Open sln file and modify project property as below.
    add to C++ -> General -> Additional Include Directories: $(KINECTSDK20_DIR)\inc;
    add to Linker -> General -> Additional Library Directories: $(KINECTSDK20_DIR)\lib\x64;

So you can compile it.


@drosen @ou2s
Does this instruction help you? Please let me know if you got the same error with my steps.

I see.Thanks!


I followed your instructions, and the app does compile successfully now.
However, it seems to be missing a .dll for me so the application cannot run.

the program can't start because zlib1.dll is missing from your computer. Try reinstalling the program to fix this problem.

getting closer though!

When I used the ofxGui addons, I found tessellator problem that is not work correctly.
Maybe we have to build TESSTessellator of x64 versions.

1.download libtess2: https://github.com/memononen/libtess2

2.download SDL-1.2dev: http://www.libsdl.org/download-1.2.php, and copy to Contrib/SDL.

3.Edit the project property on Visual Studio 2012, x64/Release,
target: static library(.lib)
runtime library->multithread(/MT)
and build it.

rename: libtess2.lib->tess2.lib
copy to \openFrameworks\libs\tess2\lib\vs

Thank you, Mr. sadmb.
Your library is very useful for me.

I don’t have that error so I can’t try but you can download x64 dll of zlib1.dll below.

Maybe you can find the other one with google easily. So try them if it doesn’t work.

It’s great help.

I fixed it on my x64 project and I also fix some other bugs for using projectGenerator.
I have checked ofxGui working now. :slight_smile:

Great addon!
@ou2s: could you share your code how to acces the bodies? I’m trying to do something similar. Thanks!


I am also working on body tracking though it is kinda slow…
Feel free to hack this and share. :slight_smile:

you may find some help here: https://github.com/jhurlbut/Cinder-Kinect2
the cinder version works quite well.

I’ll take a look how they did it but first need to finish some other stuff.


cool. thanks!
I also have an example of official SDK so I can make it if I have enough time to work on… :wink:

Hey, does anyone know if this will work with the XBox One Kinect? Or is it just the updated Kinect for Windows?



Just the Kinect 4 Windows V2 for now