-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Use analytical Jacobian in IterativeUndistortion. Add trust region #2857
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
Making the Jacobian analytical brings some gain. However, Newton does not converge when the theta is larger than around 1.25 for the parameters in #2802. The loss landscape is very bad for Newton convergence, that leads to extreme oscillations. With the previous I dont think we can do better with Newton here. I also tried adding damping factors that does not give much gain. I believe we need to resort to other optimization approach in order to fully resolve the issue. |
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.
Thank you, this is a good improvement. I assume this now converges in fewer iterations than before and the autodiff Jacobian is faster to evaluate than numeric differentiation?
For the remaining failure cases, I am wondering whether we can benefit from @vlarsson's approach here: https://github.com/PoseLib/PoseLib/blob/master/PoseLib/misc/colmap_models.cc#L643
Thanks. I think the one from PoseLib (optimization on the radius first) only works with radial distortion, but does not work with tangential and ThinPrism. We could definitely try the idea of multiple initialization as in PoseLib, but I am not sure if it can resolve the convergence issue in our case. |
Attempt on #2802 (improvement but did not manage to fully fix as discussed in the post below)
Remove templating of CamFromImg as it is never used in the optimization (and is tricky to be used in the optimization due to the unrolling in IterativeUndistortion).
Use Jet from ceres to enable analytical Jacobian in the IterativeUndistortion.