Blog

Real-Time Motion Capture using Kinect and XNA

Jan 3

Written by:
Tuesday, January 03, 2012  RssIcon

UPDATE: Check the next blog post for an updated example project.

A while ago we discussed in the Forum how to use the Microsoft Kinect SDK to animate a character model in real-time and how to apply movement constraints (e.g. joint rotation limits). Yesterday our company got a new Kinect device and I figured I might spend the rest of the afternoon trying to write a small XNA sample.

Here is the result: (You can download the source code below the video.)

Description

The sample uses the “Marionette” approach that was discussed in the forum. It uses the ragdoll features of DigitalRune Animation and therefore automatically supports collision detection. The ragdoll should be able to interact with other physics objects (e.g. push a ball) – but I have not tested this yet.

This is my first motion capture attempt using Kinect. It was hacked together in only 4 hours (+1.5h clean-up and commenting) - that means, there is really a lot that should be improved. But it is a good proof-of-concept.

Download

Here you can download this XNA sample project including source code:

>>> Download KinectAnimationSample* <<<

*UPDATE: Check the next blog post for an updated example project.

Requirements

Instructions

  • After downloading unblock the zip file.
  • Extract the zip.
  • Move the folder KinectAnimationSample into the Samples/DigitalRune.Animation folder of the DigitalRune Engine

More information can be found in the source code. Have fun!

21 comment(s) so far...


Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

Im really intrested in creating something simmilar to this example of yours,but Im really not very familiar with Visual C#. ive downloaded your example to learn how to do that, but i cant debugg the project, i cant see it working.
Do you know what should i do to test this project? what should I do to debugg it?
i really apreciate your help.

By Lucas on   Tuesday, February 14, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

This sample is an advanced example that contains some very difficult topics (skeletal animation, ragdoll physics, etc.). If you don't have experience with these topics or VC#, my best advise is to start slow with simpler samples (e.g. with XNA samples from Microsoft App Hub).
For specific questions please visit our support forum.

By HelmutG on   Wednesday, February 15, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

Hi, seems amazing ,I've downloaded the trial version of digitalRune but, it's always
gives me the same problem with all samples "Error loading assembly pipeline Digitalrune.Animation.dll" , please help me with this!

By Hosam on   Friday, March 02, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@Hosam: Did you unblock the downloaded zip file before extracting the files? (See the instructions in the blog article.)

By HelmutG on   Friday, March 02, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

yes I did , and extracted the files but still the same error , do i need to license key
or something like that ?

By PowerHHR on   Friday, March 02, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

In the trial time (30 days) you don't need a license key. If the trial is expired you would normally see a message in a message box. Please ask in our support forum.

By HelmutG on   Friday, March 02, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

yes I did , and extracted the files but still the same error , do i need to license key
or something like that ?

By PowerHHR on   Friday, March 02, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

I attempted to convert this to use the final Kinect SDK version 1 but didn't get far.

Do you guys have an updated version?

Would be great if this was in GitHub!

By StationStops on   Monday, March 19, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@StationStops: Sorry, we haven't had the time to test Kinect SDK v1 yet.

Regarding GitHub: I think putting the sample including the DigitalRune Engine on GitHub would create the impression that the DigitalRune Engine itself is open source - which it isn't. But we will think about it...

By HelmutG on   Tuesday, March 20, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

Hi,

I downloaded the sample, Digital Rune and Kinect SDK Beta 2. After I install I compile after pointing the references to Digital Rune dlls correctly on Visual Studio and I run the application.

What I get is only a model following exclusively arm movements in a bad way, the legs of the model stay crossed and other body parts doesn't seem to respond to it also. In the video you seem to get a good result.

Do you know what might be?

Regards,
Caio

By Caio Cesar Moreira on   Saturday, March 24, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@Caio: Maybe you need to adapt the scaling of the model. The sample was tested with my height 166 cm and it does not "auto-scale" for larger persons. Also have a look at our forum. There is a pretty large thread where you might find more information (thread title is "Transforming Kinect coordinates to Character Model?").

By HelmutG on   Monday, March 26, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

Hello Good evening.
First thank you very much for putting the information. I am very interested in seeing your example with the kinect. I have added all libraries.
I use visual studio but I can not run it. I can not just run run How you?
Would greatly appreciate your response

By Carabias on   Tuesday, March 27, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@Carabias
Hi, maybe you must set project KinectAnimationSample as Set up StartUp Project

By robaks on   Wednesday, March 28, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

I'm really interested about this project and i its working proparly(actually it is amazing :) ), now i want to do some modification to it, is there a way i can find the dude.blender file, coz i'd like to study the bone structure thank you verymuch,

By kaml on   Sunday, April 15, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@kaml:
We only have the fbx file (from the AppHub Skinned Model sample, create.msdn.com/en-US/education/catalog/sample/skinned_model). A blender file should be available here: www.discoverthat.co.uk/games/xna-dude.htm (I have never tested this file.)

By HelmutG on   Sunday, April 15, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

hello
currently iam working with gesture recognition through kinect will u plz tell me how can i do that type of work in wpf instead of XNA

By Hasnat on   Wednesday, April 25, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@Hasnat: The DigitalRune Engine includes assemblies that do not require XNA and can be used with WPF. What exactly do you mean by "that type of work"?
For a more detailed discussion, please head over to our support forum.

By HelmutG on   Thursday, April 26, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

First of all this is a wonderfull project and we use this application as the starting step of our project for Microsoft imaginecup 2012 and we became the 3rd place in sri lanka!!!! so i'm back here to thank you for Digital rune and to pay back to the community. the main problem we had when using this project is that we couldn't be able to customize the Dude model so we were really upset, but after lots of hard work and studying about 3d modeling we were able to create our own 3d model which work almost equalnt to Dude model, there may be people like us having troubles of using this project so i thought of uploading the model we created.

www.ziddu.com/download/19261907/PersonFbX.rar.html

if you need any help from me please contact me i would really happy to help (imaa95@gmail.com )

By Imal hasaranga perera on   Sunday, April 29, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

@Imal: Congratulation! And thanks for sharing the model.

Under which license can we use this model? (Public domain, a Creative Commons license, MSPL, etc.) Sorry to bug you with this, but many users are wary to use a model without clear license terms attached.

By HelmutG on   Sunday, April 29, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

did you use kineck for wondows or the xbox 360 kinect for this program? thanks alot

By juankol19 on   Friday, October 12, 2012
Gravatar

Re: Real-Time Motion Capture using Kinect and XNA

We used the Xbox 360 Kinect.

By HelmutG on   Friday, October 12, 2012

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel