Having fun with Qt and Kinect

Like so many others I bought a Xbox Kinect a couple of months ago. I think I had only like three or four gaming sessions with it before forgetting the whole thing. Recently my interest in graphics stuff has been on the rise again (my interests are clearly cyclic web, graphics programming, FPGAs, other electronics, audio programming , mobile programming, photography, travelling, mountains, staring at an empty wall – add one more a year, drop one, rinse and repeat) and decided to pick up the Kinect from gathering dust.

So here’s a quick thingy I made (with Qt of course) last night:

The shortness and occasional bad framerate of the video are because of the capture tool.

I’ve got all sorts of wacky ideas I can implement with the Kinect, so more stuff coming later.

This entry was posted in Programming and tagged , , . Bookmark the permalink.

5 Responses to Having fun with Qt and Kinect

  1. George says:

    Hi, I am a Qt enthusiast and I’ve been thinking about buying a kinect device to do some hacking, and looking over the internet found your video that combines both things. Loved that but you haven’t shared what you used to do that. Did you made your own wrapper of libfreenect, or you used some Qt/C++ wrapper already done?

    • Juha Turunen says:

      Hi,

      setting it up was pretty easy. There’s some instructions here on compiling the libfreenect (on Windows). It seems to compile fine with the mingw that ships with with QtSDK (or at least I think it used it – I have another mingw installation on my system too, but they’re probably pretty much the same). All you need to do is download the libusb binary (put the dll somewhere in your PATH and the libusb.a to \lib and the headers to \include of the mingw installation you’re using) and get CMAKE. You don’t really need GLUT or pthreads unless you want to compile the examples (you can get prebuilt binaries of those from the web if you just want to play around with them). After building it just copy the end products to the right places (just like libusb).

      And yes I made a quick Qt wrapper for the libfreenect. All it does is starts a new thread, changes the wrappers thread affinity to it, runs the libfreenect eventloop (see the glview demo source) in it and emits signals when there are new frames available from the camera. The signals get automagically converted to events for the main thread’s (which does the rendering) eventloop by Qt. Easy peasy.

      Sorry no public source right now, because the code is a bit messy and I’m too pedantic to put it on public display If you need help getting it working drop me an email.

      • Ong Thế Phương says:

        I am doing my project with the camera Kinect along with an arm-typed robot. I am using C++ for the code and Qt for creating GUI. And now I have trouble with integrating Kinect and Qt. It has been 2 weeks, and I still cannot solve this problem at all.

        I use Qt 5.6 and Kinect SDK, my camera is Kinect v1. It is rough for me to show the stream video captured from Kinect in QWidget. Could you please help me with it, as detailed as possible, or send me your Qt wrapper, I really need it.I will appreciate it if you can help me cross over this problem.

        Thanks in advance! Sorry for bothering you.

  2. Mina says:

    Hello Juha,

    I am fairly new to Qt, and I also just picked me up a Kinect just to tinker with it and hoping to integrate it in a couple of Qt Apps. I was wondering if you have any tips for getting started to get Qt and Kinect to play nice using the libfreenect or OpenNI & NITE.

    Thanks.

    Mina

  3. Hello there, You’ve performed a fantastic job. I’ll definitely digg it and individually suggest to my friends. I’m sure they will be benefited from this web site.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>