Last active
November 5, 2023 16:57
-
-
Save ojwoodford/d2d75b47173489cda41b9caa958f0b01 to your computer and use it in GitHub Desktop.
Comparison of Bundle Adjustment optimization using JSO and NLLSsolver in Julia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JSO | |
using BundleAdjustmentModels, CaNNOLeS | |
function jso_func() | |
# Dry run to do compilation | |
model = BundleAdjustmentModel("problem-16-22106") | |
stats = cannoles(model, method=:Newton_noFHess) | |
# Output these results | |
model = BundleAdjustmentModel("problem-16-22106") | |
@time stats = cannoles(model, method=:Newton_noFHess) | |
print(stats) | |
end | |
# NLLSsolver | |
using VisualGeometryOptimization, NLLSsolver | |
function nlls_func() | |
# Optimize the problem | |
options = NLLSsolver.NLLSOptions(iterator=NLLSsolver.levenbergmarquardt, reldcost=1.0e-6) | |
# Dry run to do the compilation | |
problem = loadBALproblem("problem-16-22106") | |
NLLSsolver.optimize!(problem, options) | |
# Repeat the optimization, and report the timings | |
problem = loadBALproblem("problem-16-22106") | |
@time result = NLLSsolver.optimize!(problem, options) | |
display(result) | |
end | |
# Run the tests | |
jso_func() | |
nlls_func() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment