Employee
Employee

Reputation: 3233

OpenCV - Correctly recoverPose after findEssentialMat

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?

Upvotes: -1

Views: 2550

Answers (1)

Dr Yuan Shenghai
Dr Yuan Shenghai

Reputation: 1915

I really have no idea whats is your problem. Try to give like whats the input, whats "your expected output" whats the actual output.

But i do know where to find sample https://github.com/avisingh599/mono-vo

try to take a look at sample here. It is pure 2D to 2D opencv based estimation. only thing different is that they use dataset saclaing to adjust the translational vector scale. 2D to 2D alone only give a relative translation.

http://www.youtube.com/watch?v=homos4vd_Zs

enter image description here

Upvotes: 0

Related Questions