Resolve "Reflection in Procrustes" - [merged]
thompson318 opened this issue · 3 comments
In GitLab by @StephenThompson on Nov 19, 2019, 16:32
Merges 19-procrustes-reflection -> master
Closes #19
This change makes the implementation of orthogonal_procrustes the same as in nifTK
MITK/Modules/PointReg/Maths/niftkPointRegMaths.cxx - DoSVDPointBasedRegistration(const std::vectorcv::Point3d& fixedPoints, specifically
// Arun Equation 13.
// cv::Mat X = svd.vt.t() * svd.u.t();
// Replace Arun Equation 13 with Fitzpatrick, chapter 8, page 470.
cv::Mat VU = svd.vt.t() * svd.u;
double detVU = cv::determinant(VU);
cv::Matx33d diag = cv::Matx33d::zeros();
diag(0,0) = 1;
diag(1,1) = 1;
diag(2,2) = detVU;
cv::Mat diagonal(diag);
cv::Mat X = (svd.vt.t() * (diagonal * svd.u.t()));
It avoids reflections when using data from the pelvis phantom.
I'm not sure why they were different in the first place.
In GitLab by @MattClarkson on Nov 19, 2019, 16:53
merged
In GitLab by @MattClarkson on Nov 19, 2019, 16:53
mentioned in commit d32b892
In GitLab by @MattClarkson on Nov 19, 2019, 16:53
Thanks for this.