M4 Body Definition File

 

The M4 Body Definition File is formatted as an XML file.  Just as a note, the original implementation used OpenCV hence some of the format still has some left-overs from this implementation.

 

XML Tags

opencv_storage

Start of Templates.  Must be present

num_templates

Number of templates in the Body Definition File.

 

Template Tags

Template_n

Start of Template number n.  The type_id attribute should be set to opencv-matrix since the data is currently formatted according to OpenCV matrix standards (row based).  Other matrix formats may be implemented in the future.

name

Name of the Rigid Body.

rows

number of rows.  This will always be 4 when using OpenCV matrix format with X values in first row, Y values in second and Z in third.  The last row will always have 1.0000 in each column.

cols

The number of columns.  This is the same as the number of points in the rigid body.

resid

The residual when the body was measured

dt

Data Type.  Currently only data type f (float) is supported and thus should always be set to f.

data

This is the coordinates for each point specified in the the local coordinate system with point 1 being the origin.  the data is formatted as

 

Point1.x Point2.x Point3.x.....Point1.y Point2.y Point3.y.....Point1.z Point2.z Point3.z     1.00000 1.00000 1.00000.....

 

Example of a M4 Body Definition File with 2 bodies defined

<?xml version="1.0" encoding="utf-8"?>

<opencv_storage>

<!-- Marker Template Configuration -->

  <num_templates>2</num_templates>

  <!-- ------------------------ -->

  <!-- Rigid Body Definition #1 -->

  <!-- ------------------------ -->

  <Template_1 type_id="opencv-matrix">

     <name>6LEDBody</name>

     <rows>4</rows>

     <cols>6</cols>

     <resid>0.735536</resid>

     <dt>f</dt>

     <data>0.000000 -38.532391 -4.320033 -10.248395 -33.849831 -39.174374 0.000000 0.000000 -47.484428 12.001620 11.188959 -45.219646 0.000000 0.000000 0.000000 24.656393 22.697945 5.740541 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 </data>

  </Template_1>

  <!-- ------------------------ -->

  <!-- Rigid Body Definition #2 -->

  <!-- ------------------------ -->

  <Template_2 type_id="opencv-matrix">

     <name>4LEDBody</name>

     <rows>4</rows>

     <cols>4</cols>

     <resid>0.203939</resid>

     <dt>f</dt>

     <data>0.000000 -32.347015 -25.643072 -13.093020 0.000000 0.000000 -12.134756 -27.416777 0.000000 0.000000 0.000000 -1.827325 1.000000 1.000000 1.000000 1.000000 </data>

  </Template_2>

</opencv_storage>

 

< Back