| 53 | } |
| 54 | |
| 55 | auto PointToPointAligningTransform::findPureRotation_() const -> BestRotation |
| 56 | { |
| 57 | assert( totalWeight() > 0 ); |
| 58 | |
| 59 | // for more detail of this algorithm see paragraph "3.3 A solution involving unit quaternions" in |
| 60 | // http://graphics.stanford.edu/~smr/ICP/comparison/eggert_comparison_mva97.pdf |
| 61 | const Matrix3d s = sum12_ - outer( sum1_, centroid2() ); |
| 62 | const SymMatrix4d p = calculateMatrixP( s ); |
| 63 | |
| 64 | const Eigen::SelfAdjointEigenSolver<Eigen::Matrix4d> solver( toEigen( p ) ); |
| 65 | Eigen::Vector4d largestEigenVector = solver.eigenvectors().col( 3 ); |
| 66 | Quaterniond q( largestEigenVector[0], largestEigenVector[1], largestEigenVector[2], largestEigenVector[3] ); |
| 67 | return { Matrix3d{ q }, solver.eigenvalues()( 3 ) }; |
| 68 | } |
| 69 | |
| 70 | AffineXf3d PointToPointAligningTransform::findBestRigidXf() const |
| 71 | { |
nothing calls this directly
no test coverage detected