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!

MocapView.zip