Tuesday, July 19, 2016

asf/amc to X3D H-Anim conversion

Recently, we're working on human gait analysis-related research. While studying related literature, we found CMU Graphics Lab Motion Capture Database, which has huge amount of motion capture data using Vicon motion capture system. Database includes video taken while capturing motion (mpg), sensor raw data (c3d) ,reconstructed skeleton from sensor data (asf/amc) and animated video of skeleton (avi). There are tvd files you can download but I couldn't get much information about the file format.

The motivation of this work is that it is difficult to find the motion capture data that I wanted. For instance, I wanted to find the data of walking along the circular path over a minute. All you can do is search the database with keyword "walking" and should download each mpg or avi video and check it is longer than a minute and if a person walked along a circular path. It is very exhaustive work and I found it is faster to download entire avi clips in database and see the videos one by one (because downloading each avi in searched result takes too much time).

So my idea is to make a webpage using X3DOM, shows skeleton animation in interactive 3D without manually download files. It is possible because H-Anim specification is ready for the standardized character animation description and thankfully, X3DOM developers implemented the specification.

Therefore I implemented a converter from asf/amc to X3D H-Anim. The converted x3d file can be visualized in X3DOM framework. To reduce the work needed I use the exist MATLAB parser for asf/amc. If you are Korean, this page helps you to understand how asf/amc format describes skeleton data.

The important and difficult part of converting asf/amc to H-Anim specification is the existence of "axis" information in asf file format, and inverted multiplication order or rotation matrix between those two. In asf, local axis of a idle(neutral?) bone may not aligned with global coordinate. However in H-Anim, bone (joint in H-Anim specification) is aligned with global coordinate. So you have to convert animation data stored in amc by changing local rotation to global rotation. And asf/amc descripbes left-to-right multiplication of rotation matrix, while rotation matrix of H-Anim should be right-to-left.

Below is an example of X3DOM scene, converted from asf/amc. (I think Google Blogger now blocks external js include...?)

Link


Now I'm converting the entire database (which takes so much time because MATLAB is not good for this kind of work...) and I planned to make a separate page to visualize CMU database using X3DOM. I hope to finish and open it in near future.


No comments:

Post a Comment