Expose a bundle_adjustment
function
#146
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit exposes a
bundle_adjustment
function that has a similar functionality to the command line utilitycolmap bundle_adjuster
. One use case it enables is to allow one use pycolmap to run bundle adjustment after sparse reconstruction to refine the principal point, as jointly refining the principal point1 during sparse reconstruction would make sparse reconstruction on some scenes to fail.Note that not all available members of
ceres::Solver::Options
are exposed in this change, but only the ones modified byBundleAdjustmentOptions
in colmap2. Besides, the registeredCeresSolverOptions
usespy::module_local()
to avoid conflicts with downstream libraries.Example usage
Known problem
Though creating a
pycolmap.BundleAdjustmentOptions
object with a nesteddict
works as expected, i.e., the following examples work well:it gives an error while trying to create a
pycolmap.BundleAdjustmentOptions
object with itssolver_options
set to apycolmap.CeresSolverOptions
object, i.e. the following gives an error:The "new instance" mentioned in the RuntimeError message probably points to the
CeresSolverOptions
added in this commit, but I'm not sure about a way to solve this at the moment, plus, as reported above, usingdict
s to specify the option values works properly and works around this error.Footnotes
https://colmap.github.io/faq.html#frequently-asked-questions ↩
https://github.com/colmap/colmap/blob/3.8/src/optim/bundle_adjustment.h#L81-L89 ↩