Commit a0e01668 by Maarten L. Hekkelman

take largest in value for best quaternion

parent 2c774914
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
# set the project name # set the project name
project(cifpp VERSION 3.0.0 LANGUAGES CXX) project(cifpp VERSION 3.0.1 LANGUAGES CXX)
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......
...@@ -477,13 +477,13 @@ Quaternion AlignPoints(const std::vector<Point>& pa, const std::vector<Point>& p ...@@ -477,13 +477,13 @@ Quaternion AlignPoints(const std::vector<Point>& pa, const std::vector<Point>& p
// calculate t = (N - λI) // calculate t = (N - λI)
Matrix t = N - IdentityMatrix(4) * lambda; Matrix t = N - IdentityMatrix(4) * lambda;
// calculate a Matrix of cofactors for t, since N is symmetric, t must be symmetric as well and so will be cf // calculate a Matrix of cofactors for t
Matrix cf = Cofactors(t); Matrix cf = Cofactors(t);
int maxR = 0; int maxR = 0;
for (int r = 1; r < 4; ++r) for (int r = 1; r < 4; ++r)
{ {
if (cf(r, 0) > cf(maxR, 0)) if (std::abs(cf(r, 0)) > std::abs(cf(maxR, 0)))
maxR = r; maxR = r;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment