# Absolute orientation alignment with vectors

I have two trajectories of a moving object. Each trajectory is composed of poses at discrete time. Each pose is a translation vector and a rotation matrix.

Each trajectory defines the same path (with noise) but expressed in some arbitrary frame of reference. I need to find the relative transformation that aligns both trajectories.

This is the absolute orientation problem that can be solved with Horn's method for a collection of points in the 3D space. So, I can solve this by taking into account just the translation vectors of the poses. However, I'd like to include the rotations as well.

Does this new problem have a name? Is there any known technique to solve it?

• I don't get it. Aren't the rotation matrices independent of the frame of reference? If so they are already aligned. Mar 20, 2015 at 13:27
• There are degenerated cases in which it doesn't happen. For example, consider a trajectory with a single pose. By aligning only the translation, the axes of each pose are free and they may not be aligned. However, you have enough information to find the correct rotation. Mar 20, 2015 at 14:12

A simple modification of Horn's approach can be made to incorporate local rotation information: rather than just matching the centers of the body (trajectory points), use several off-centered points on the body such as the endpoints of a tied reference frame (in a way, forming dipoles, quadrupoles, octupoles...). Then use Horn's method on this augmented point set.

By adjusting the remoteness of these points from the center, you can trade good translational fitting for good rotational fitting.

This aside, you can probably develop a method based on static equilibrium of two solids (formed by the whole trajectories), where elastic forces are developed between corresponding points as a function of distance and torques as a function of misalignment.

CAUTION: in case there is significant scaling difference, you will need to adjust the remoteness proportionally to the size of the whole trajectory, otherwise artificial discrepancies will arise because of rescaling.

• That's exactly what I thought. But depending on the distance of the off-centered points I get different accuracy in the results, so I feel the overall approach is a little hacky. Mar 20, 2015 at 14:16
• I don't think so. In any case you will need a relative weighting of the translational vs. rotational information, leading to an adjustable solution (both extremes being pure translational or pure rotational fitting). Using discrete points can be seen as a finite approximation of a "perfect" setting of the equations (limit when the remoteness tends to zero, leading to a differential expression). But I doubt that the finite approximation be unstable.
– user16034
Mar 20, 2015 at 14:23
• Other remark: you can check that a method is bias-free (i.e. when two trajectories are exact replicas of each other up to a similarity transform, the method should match them perfectly; the off-centered points method is bias-free). But in case of different trajectories, there is little you can do to discuss accuracy, as there is no "exact" solution you can refer to (no ground truth).
– user16034
Mar 20, 2015 at 14:31
• Actually, I have several pairs of trajectories with different timestamp scaling, so I meant that I'm not able to find a configuration that gives stable results in all the cases. Anyway, you made a good point and I found your comments very helpful. Thanks a lot. Mar 20, 2015 at 14:43