Closed ScottMcMichael closed 6 years ago
Zack implemented the Ceres dynamic variant and submitted a pull request.
The LLHError and other similar ones are not the main cost functions used by bundle adjustment. It is conceivable that using the autodiff would speed up computing that error term when the function is given by a formula, but since the slowest term to evaluate in the cost function will still have to use numerical differentiation and projections in to the camera, I doubt the tool will get faster overall.
Maybe this could be kept in mind in the far future when we have more resources to fine-tune this tool.
A few suggested optimizations to increase the efficiency of our bundle_adjust tool:
Rewrite LLHError to use autodiff, this will be faster than numeric diff.
Look at http://ceres-solver.org/interfacing_with_autodiff.html, see if it is possible to use an autodiff/numeric diff hybrid to increase speeds.
Look at the Ceres dynamic variant to remove the large switch statement based on the number of intrinsics: http://ceres-solver.org/nnls_modeling.html?highlight=numericdiffcostfunction#dynamicnumericdiffcostfunction