5,337
edits
(→Slurp) |
|||
Line 73: | Line 73: | ||
&= \sum_{k=1}^{N}(\operatorname{arccos} |q \cdot (r_k * \bar{p}_k)|)^2 | &= \sum_{k=1}^{N}(\operatorname{arccos} |q \cdot (r_k * \bar{p}_k)|)^2 | ||
\end{align*} | \end{align*} | ||
</math> | |||
===Chord distance=== | |||
The geodesic least squares cannot be solved using linear algebra. | |||
Instead you can use ''chord distance'': | |||
<math> | |||
\begin{aligned} | |||
d_{\text{chord}}(q_1, q_2) &= \min(\Vert q_1 - q_2 \Vert, \Vert q_1 + q_2 \Vert)\\ | |||
& 0 \leq d_{\text{chord}}(q_1, q_2) \leq \sqrt{2} | |||
\end{aligned} | |||
</math> | |||
In this case, our least squares problem is: | |||
<math display="block"> | |||
\mathbf{S}_{\text{chord}} = \sum_{k=1}^{N}\left( \min( \Vert (q*p_k) - r_k \Vert, \Vert (q*p_k)+r_k \Vert ) \right)^2 | |||
</math> | |||
==Combined Point + Frame Alignment Problem== | |||
Given a spatial profile matrix <math>M(E)</math> and orientation frame profile matrix <math>U(S)</math>, we can normalize the scale to have unit-eigenvalue and the napply linear interpolation with dimensional constant <math>\sigma</math>: | |||
<math display="block"> | |||
\Delta_{xf}(t, \sigma) = q \cdot \left[ (1-t) \frac{M(E)}{\epsilon_{x}} + t \sigma \frac{U(S)}{\epsilon_{f}} \right] \cdot q | |||
</math> | |||
Or alternatively, we can use slerp: | |||
<math display="block"> | |||
q(t) = \operatorname{slerp}(q_{x:opt}, q_{f:opt}, t) | |||
</math> | </math> | ||
==Resources== | ==Resources== | ||
* [https://arxiv.org/pdf/1804.03528.pdf The Quaternion-Based Spatial Coordinate and Orientation Frame Alignment Problems by Andrew Hanson] [https://journals.iucr.org/a/issues/2020/04/00/ib5072/ib5072.pdf Edited Paper] | * [https://arxiv.org/pdf/1804.03528.pdf The Quaternion-Based Spatial Coordinate and Orientation Frame Alignment Problems by Andrew Hanson] [https://journals.iucr.org/a/issues/2020/04/00/ib5072/ib5072.pdf Edited Paper] |