Closed patrikhuber closed 1 year ago
Ceres added ceres::RotationMatrixToEulerAngles()
, but only post-2.1. It would go something like this:
Eigen::Matrix3d rot_mtx_ceres;
Eigen::Vector3d euler_angles_ceres;
ceres::QuaternionToRotation(camera_rotation.coeffs().data(), rot_mtx_ceres.data());
ceres::RotationMatrixToEulerAngles<ceres::IntrinsicZYX>(rot_mtx_ceres.data(), euler_angles_ceres.data());
But it's probably better to use Eigen's Euler angles functionality everywhere.
Done in b74f499c25fced14ea6efe11a5551e28f5112a9d, and released in v.1.4.0.
The contour fitting is commented out at the moment in fit-model-ceres. It needs extracting the yaw angle from the rotation quaternion, which Eigen currently doesn't have a function for. It could be re-added easily, we just need a reliable way to convert from the estimated rotation quaternion to a yaw angle.