Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracker.process() wrong undistortion #4

Open
Nicogene opened this issue Nov 23, 2016 · 0 comments
Open

Tracker.process() wrong undistortion #4

Nicogene opened this issue Nov 23, 2016 · 0 comments
Labels

Comments

@Nicogene
Copy link
Collaborator

Nicogene commented Nov 23, 2016

In process(), you compute the Essential matrix using distorted points, and then you use the undistorted one to get R and t from E. Moreover, you do undistortion twice(not necessary).
I report the portion of code that I'm referring to(Tracker.cpp lines 845 to 872):

//-- Normalize
vector<Point2f> vismatched1_, vismatched2_;
undistortPoints(vismatched1, vismatched1_, K1, k1, noArray(), K1);
undistortPoints(vismatched2, vismatched2_, K2, k2, noArray(), K2);

//-- Essential matrix with RANSAC
Mat E, R, t, mask;
E = findEssentialMat(vismatched2, vismatched1, 1.0, Point2d(0,0), RANSAC, 0.999, 0.0001, mask);
//correctMatches(E, vismatched1, vismatched2, vismatched1, vismatched2);

//Mat F = findFundamentalMat(vismatched2_, vismatched1_, FM_RANSAC, 0.1, 0.99, mask);
//correctMatches(F, vismatched1_, vismatched2_, vismatched1_, vismatched2_);
//E = K2.t()*F*K1;

//SVD svd(E);
//Matx33d W(0,-1,0,   //HZ 9.13
//      1,0,0,
//      0,0,1);
//Matx33d Winv(0,1,0,
//     -1,0,0,
//     0,0,1);
//R = svd.u * Mat(W) * svd.vt; //HZ 9.19
//t = svd.u.col(2); //u3

//-- Pose recovery
undistortPoints(vismatched1, vismatched1_, K1, k1);
undistortPoints(vismatched2, vismatched2_, K2, k2);
recoverPose(E, vismatched2_, vismatched1_, R, t, 1.0, Point2d(0,0), noArray());
@Nicogene Nicogene changed the title Tracker Tracker.process() wrong undistortion Nov 23, 2016
@Nicogene Nicogene added bug and removed bug labels Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant