ReconstructMe SDK  1.1.739-75658
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups Pages
Transform

Access and manipulate transformation matrices. More...

reme_error_t reme_transform_set_predefined (reme_context_t c, reme_transform_t t, float *coordinates)
 Set the matrix to a predefined transform.
 
reme_error_t reme_transform_make_relative (reme_context_t c, const float *a_t, const float *b_t, float *c_t)
 Calculate the relative transform between two coordinate frames.
 

Detailed Description

Access and manipulate transformation matrices.

In the ReconstructMe SDK rigid transformations are represented using 4x4 floating point homogeneous matrices. The upper 3x3 part contains the rotation matrix. The last column contains the translation vector. The last row is constant.

| Rxx Rxy Rxz Tx |
| Ryx Ryy Ryz Ty |
| Rzx Rzy Rzz Tz |
|   0   0   0  1 |

The memory layout is row-major. Flattened to a one dimensional array the above matrix is transformed into

| Rxx Rxy Rxz Tx Ryx Ryy Ryz Ty Rzx Rzy Rzz Tz 0 0 0 1|

Coordinate Systems

ReconstructMe uses a couple of right-handed coordinate systems that you should be aware of. For one ReconstructMe uses the sensor coordinate system. This coordinate system is attached to the sensor in the following way

sensor_frame.png
Sensor Coordinate Sytem

Next, ReconstructMe uses the world coordinate system. This frame aligns with the sensor coordinate system when the reconstruction starts. From then on, the world coordinate system stays fixed. The volume to be reconstructed is expressed in terms of this coordinate system. Below is an example for the world coordinate system

world_frame.png
World Frame

Finally, ReconstructMe uses the CAD coordinate system. This coordinate system aligns with the world coordinate system but is rotated around x+ about 180 degrees.

cad_frame.png
CAD Frame

This coordinate system is often used when exporting Surface models to to common 3D file formats, in order to allow third-party programs to display the content correctly upon opening.

Representation

The right-handed coordinate systems are represented by 4x4 single precision floating point homogeneous matrices. The upper 3x3 part contains the basis vectors in columns, the last column contains the origin of the frame and the last row is constant. In this respect coordinate systems are represented in the same way as transformation matrices. For details see Transform

Function Documentation

reme_error_t reme_transform_set_predefined ( reme_context_t  c,
reme_transform_t  t,
float *  coordinates 
)

Set the matrix to a predefined transform.

Parameters
cA valid context object
tA predefined transform type
coordinatesA pointer to mutable Transform data.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure
Examples:
example_reconstructmesdk_memory_management.cpp, and example_reconstructmesdk_surface.cpp.
reme_error_t reme_transform_make_relative ( reme_context_t  c,
const float *  a_t,
const float *  b_t,
float *  c_t 
)

Calculate the relative transform between two coordinate frames.

Given two coordinate frames, a_t and b_t in the same parental coordinate frame, calculate b_t with respect to a_t. The result is stored in c_t.

Parameters
cA valid context object
a_tA pointer to non mutable Transform data.
b_tA pointer to non mutable Transform data.
c_tA pointer to mutable Transform data.
Return values
REME_ERROR_SUCCESSOn success
REME_ERROR_UNSPECIFIEDOn failure