Human Movements - The Easiest Motion Capture File Format
This is the second post of the "Reallistic Human Movements with Silverlight" series. I'll spend a little time talking about the .bvh file format structure. I’m still working on the code and that’s why I’ll make this post short in order to get back to the mocap code. There is a link to more relevant info at the bottom.
I updated to the motion capture source code (download attachment to this blog) that contains a major fix related to joint rotation.
The latest sample is here: https://nokola.com/mocap
Some people thought the sample is a saved video – it is not. The sample shows rendering of 3D motion capture data at real time on Silverlight. Try out the new “body fat” slider! If you click “Add another person” then “Show Info” you’ll see the x, y, z angles for joint rotations in realtime.
Before going on, a quick overview of one way animation studios do motion capture today:
1. A human (e.g. actor or martial artist) is placed in a special costume for motion capture
2. There are numerous cameras surrounding that person (e.g. 24 cameras) that take videos of the person
3. Software processes the videos to "understand" where the person's hands, feet, etc are and saves this information in a motion capture file
One such file format is .BVH (Biovision motion capture).
The bvh contains 2 sections:
1. Skeleton data describing the hierarchy and initial pose of the human skeleton whose motion is being captured
2. Frame data describing how the human's joints move over time
The skeleton data looks something like this:
HIERARCHY
ROOT Hips
{
OFFSET 0.00 0.00 0.00
CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
JOINT Chest
{
OFFSET 0.00 5.21 0.00
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT Neck
{
OFFSET 0.00 18.65 0.00
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT Head
{
OFFSET 0.00 5.45 0.00
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET 0.00 3.87 0.00
}
}
}
…
For each joint, we have its 3D offset relative to its parent joint (Hips is the parent of Chest) and its channel information.
You can read more about this here: https://www.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
One thing missing from the above page is that it is very important to note the order of the channels –this is the order in which you have to rotate the joints. For example order of “Zrotation Xrotation Yrotation” means that you have to rotate by z,x,y in that order.
The bug that I fixed in my code was related to that. If you don’t follow the order in the file, you’ll end up with weirdly moving figures or jitter in the playback.
The second part of the .bvh file is the frame information – I encourage you to read about it here: https://www.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html
This resource explains it pretty well!
More Info
One person also asked me “how do I capture my own motion data?” Usually this is pretty costly (e.g. $10,000-$20,000), but could be made with lower cost too!
I’ll talk a little bit about this in the next post. In the meantime you can search for “motion capture single camera” or "markerless motion capture" on the internet. This seems to be the cheaper way to do it (cheaper as in $50-$500). Recent scientific developments (last few months) in markerless motion capture really open the possibility for the public to use this technology!
Comments
Anonymous
May 29, 2009
PingBack from http://asp-net-hosting.simplynetdev.com/human-movements-the-easiest-motion-capture-file-format/Anonymous
May 29, 2009
Nikola, previously on showing his Shock game , is back with a new interesting project, a Motion CaptureAnonymous
June 22, 2009
I love the silverlight implementation of a .bvh player. Congratulations. I'm a programmer who golfs and have been using silverlight since it came out. It would be interesting to try and figure out the body angles for golf swing analysis in Silverlight! I downloaded your sample to learn more about the subject in my "spare" time. Any insight on using it for golf would be appreciated! Thank you, Scott scott.dugan@hotmail.comAnonymous
July 01, 2009
Hi Scott, Thanks for the comment and I'm glad you like it. golf is easy: check out the motion library here: http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/3dsmax-friendly-release-of-cmu-motion-database subject #63 and #64 are golfers. Click the "full motion list" on the above site to see the motion description. I got the motions for my demo from the same library. You can download the .bvh files from there and use them directly in the mocap viewer on http://nokola.com/mocap.htmlAnonymous
August 11, 2009
This is an AWESOME demo!!! Do you have plans to make the BVH reader support more 3D programs? I noticed that the current code expects the root object to be the HIPS. Some applications like Poser make WORLD_ROOT the root object.Anonymous
August 11, 2009
Hi Mike, Thank you for the support! I think the source should load Poser bvh files fine, although haven't tried it. It's not looking for HIPS in particular and any root should do (the hips was just for the example). I have some plans for the reader (making a game with reallistic movements), but want to finish my space game first :) Are you interested in making something with this Silverlght mocap viewer? Thanks,Anonymous
August 11, 2009
Yes. I was very excited about making an action game when I saw your post. It looks like your application has tremendous potential. I have been looking for a way to do something like this for a while. I tried importing a bvh file of a simple walk cycle that I created using Poser 6. But, it gave me the following runtime error. "Unsupported number of channels for ROOT element: 3". I was guessing that it was caused by Poser giving me a different root element. But, I wasn't sure. I can e-mail you the BVH file if you would like to see it. Thanks, MikeAnonymous
August 11, 2009
The comment has been removedAnonymous
August 11, 2009
Thanks. I'll work on making these changes. Keep up the good work!!!Anonymous
August 11, 2009
Thanks!!! :)Anonymous
April 22, 2010
The comment has been removedAnonymous
April 22, 2010
The comment has been removedAnonymous
April 22, 2010
forgot something - in the motion capture source code http://blogs.msdn.com/nikola/attachment/9655943.ashx the "loading" is separated from the view (graphics). If you translate Loader.cs, Motion.cs and Node.cs into Matlab, you'll have the loader.