====== Recovering the skeleton from magnetic motion tracking data ======
{{ liberty-arm-tracking.jpg?300|Sensor placement on the arm}}
This page describes the implementation of a paper of James F. O'Brien et. al. on Automatic Joint Parameter Estimation from Magnetic Motion Capture Data.
It requires the sensors to be attached as rigidly as possible to the limbs, especially their orientation should not change too much.
==== Algorithm ====
{{bone-sketch.jpg?200 |The mathematical idea behind this calibration}}
It is based on the following idea: Two sensors ''i'' and ''i+1'' define two coordinate systems ''**T**i'' and ''**T**i+1''. If they are rigidly attached to their bones, then the translation ''**l**'' expressed in ''**T**i'' and the translation ''**c**'' expressed in ''**T**i+1'' always result in the same point in space: The joint connecting their bones.
This gives three linear equations per joint and frame. Stacking all equations of one joint gives an overdetermined linear equation system, which can be solved using a singular value decomposition.
By trying this estimation on every possible pair of sensors and calculating the residual error, we can also estimate which sensors are likely connected by a joint. Using the residuals we can construct a tree which defines the structure of the "bones".
==== Implementation ====
{{liberty-arm1.png | Calibration result: the small coordinate systems are the sensors, the black lines are the inferred bones and the space between them is the residual error}}
We have it implemented in Matlab. For 4 sensors it takes about 25 seconds to infer the bone structure using 50000 frames.
**Files**:
{{bone_calibration.tar.gz|The implementation of the calibration in Matlab/Octave}}
{{liberty-testlogs.tar.gz|Our first test data}}
**Reference**:
//James F. O'Brien, Robert E. Bodenheimer, Jr., Gabriel J. Brostow, Jessica K. Hodgins// :
[[http://www.gvu.gatech.edu/animation/Papers/obrien:2000:AJP.pdf|Automatic Joint Parameter Estimation from Magnetic Motion Capture Data (2000)]]
==== C++ tools ====
Now there are some {{liberty_calibration_cpp_080314.tar.bz2|C++ tools}} to performs this calibration and save its results. There is also a tool to replay the data in an OpenGL window. It requires the [[http://www.robertnz.net/nm10.htm|Newmat matrix library]] which you may have to recompile from [[http://www.robertnz.net/ftp/newmat10.tar.gz|sources]]. You can download the mercurial repository with
hg clone http://toychest.in.tum.de/users/kresse/skeleton_calib/
A screenshot of the C++ graphical viewer:
{{liberty_fltk-viewer.png|FLTK-based viewer for the motion data}}