-
Notifications
You must be signed in to change notification settings - Fork 133
Add option to pass initial model to robust solvers. #136
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
Conversation
26c4b44
to
eba8315
Compare
@@ -307,6 +307,10 @@ RansacStats estimate_fundamental(const std::vector<Point2D> &x1, const std::vect | |||
ransac_opt_scaled.max_epipolar_error /= scale; | |||
BundleOptions bundle_opt_scaled = bundle_opt; | |||
bundle_opt_scaled.loss_scale /= scale; | |||
if (ransac_opt.score_initial_model) { | |||
*F = T2.transpose().inverse() * (*F) * T1.inverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check that this normalization is correct (and for H
below).
Are there other estimators that I missed for which the input model has to be normalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably estimate_shared_focal_relative_pose
(the focal length)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think this should probably be normalized as well. Perhaps re-initializing the cameras similar to
image_pair->camera1 = Camera("SIMPLE_PINHOLE", std::vector<double>{image_pair->camera1.focal() / scale, 0.0, 0.0}, -1, -1);
image_pair->camera2 = Camera("SIMPLE_PINHOLE", std::vector<double>{image_pair->camera2.focal() / scale, 0.0, 0.0}, -1, -1);
or something similar.
Some results from posebench where I first ran the estimators as usual and the re-ran with the estimated model as the initial one:
The AUC values are very similar and the runtime goes down a bit when using the initial model. I did not change the |
@ghanning this looks good to me. Are there any changes planned or is it ready to merge? |
@vlarsson Ready to merge. |
See #134.
In C++ this is controlled by the new
score_initial_model
flag inRansacOptions
.When using the Python bindings the user should pass the initial model as an optional argument.