Hi:
I'm trying to minimize the reprojection error with quaternions, however the function ceres::QuaternionRotatePoint gives a wrong result.
Than I checked the following two code snippets and find that they give different result to p[3].
snippet 1:
T p[3];
p[0] = T(X); p[1] = T(Y); p[2] = T(Z);
ceres::QuaternionRotatePoint(quaternion, p, p);
snippet 2:
T p[3], angleaxis[3];;
p[0] = T(X); p[1] = T(Y); p[2] = T(Z);
ceres::QuaternionToAngleAxis(quaternion, angleaxis);
ceres::AngleAxisRotatePoint(angleaxis, p, p);
I checked the code in rotation.h, it looks like that the bug was in ceres::UnitQuaternionRotatePoint, where q[0] * q[0] haven't been used in the calculation.
Is that a bug or I've just missed something?
Best.