One of the components of the experimental portion of my PhD research project involved the acquisition, processing, and analysis of motion capture data. In order to process the data I developed a program called BVH Physics Tools. This program provides a visual interface for reviewing the data and exporting a variety of useful biometric parameters.

The image shown above is a screen shot of the main user interface of the program. The "Joint Hierarchy" panel on the left displays all of the joints in the file, and if one is clicked, its properties are shown in the "Joint Info" panel on the right. In this panel joint offsets, frame positions and frame rotations can be modified to observe their effect on the model.

The center viewport shows a 3D representation of the BVH skeleton. Joint and end site locations are represented by gray dots. The currently selected joint is indicated by the large yellow sphere. The mouse can be used to rotate the model. The Camera button menu can be used to reset the camera or move it to a few useful preset positions. The BVH motion capture recording can be browsed by moving the slider, with the Play and Pause buttons, by typing the frame number in and pressing Goto, or by using the < and > buttons to go back or forward a frame.

The [ and ] buttons allow a subset of the full time scale to be specified. The bottom slider navigates the subset range only. Pressing the [ or ] keys on the keyboard is the same as clicking the buttons. The subset range is also used when saving or exporting data.

Selecting Edit > Mass Segments displays the following window:

This window allows body segment mass distributions to be defined for use in physics calculations. These settings can be saved in an XML file. While early versions of the program automatically loaded this file on program launch, the current program requires that the file be selected from the File menu because I've added support for multiple BVH file standards. (Specifically iPi Studio and NaturalPoint Arena which use different rotation conventions.) The values in the screen shot were taken from literature [1].  If "Show Segment CoM" is checked, these locations are shown using red dots in the 3D view. If "Show Body CoM", the overall body center of mass location is shown with a large purple dot.

Selecting Edit > Interpolate Joint Rotations displays the following dialog:

This tool uses spherical linear interpolation to interpolate joint angles between the specified range. This means that it takes a joint rotation at the start frame, and the end frame, and replaces everything between them with an interplation between those two frames. This tool is useful when there is sufficient data missing in the iPi Studio recording that it's not possible to track forward or backward to get a reasonable approximation of a joint angle within a specific range. This is best explained with an example. Here are 3 frames from one of my motion captures:

Around frame 4838 the left thigh joint loses tracking and it isn't regained until around frame 4936. In order to fix this we can interpolate the left thigh joint between frames 4838 and 4936:

We could also check LShin and LFoot since nothing in that branch is being tracked properly.

The function this peforms is known in the literature as a SLERP (spherical linear interpolation). In the code I convert the angles to quaternions, and each quaternion is interpolated using the formula x = (1-t) xStart + t * xEnd where 0 <= t <= 1.

BVH Physics Tools includes various options for exporting data.



[1] Winter, D.A. BioMechanics and Motor Control of Human Movement. John Wiley & Sons, Inc. 2005.