pub fn absolute_orientation(
from: &[Vector3<f64>],
to: &[Vector3<f64>],
) -> Option<Se3>Expand description
The rigid motion carrying from onto to, in the least-squares sense.
Returns None when there is nothing to solve: fewer than three pairs,
mismatched lengths, or points so nearly collinear that the rotation
about their common line is not determined. That last case is not a
numerical accident โ three points on a line genuinely do not fix a
rigid motion, and answering anyway would be inventing the missing
degree of freedom.
ยงReflections
The decomposition can produce an improper rotation โ a reflection โ when the points are coplanar and the noise happens to favour it. Flipping the sign of the least significant singular direction gives the best proper rotation instead. Without that correction the result mirrors the cloud, which looks almost right and is entirely wrong.