Use analytical Jacobian in IterativeUndistortion. Add trust region#2857
Use analytical Jacobian in IterativeUndistortion. Add trust region#2857ahojnnes merged 11 commits intocolmap:mainfrom
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. |
ahojnnes
left a comment
There was a problem hiding this comment.
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.