I have correct correspondances between consecutive frames, and need to estimate the transformation between them to generate a trajectory. The following C++ pipeline, the generated trajectory goes no sense.
auto EssentialMatrix = cv::findEssentialMat(points_previous,
points_current,
camera_focal_length,
camera_principal_point,
cv::RANSAC,
0.999,
1.0,
mask);
auto inliers = cv::recoverPose(EssentialMatrix,
points_previous,
points_current,
CameraMatrix,
R,
t,
mask);
t_pos_ = t_pos_ + 1.0 *(R_pos_*t);
R_pos_ = R * R_pos_;
So, my question is: how to correctly recover the transformation between two consecutive frames with C++ OpenCV utilities? Are additional steps needed to do so?