mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.33k stars 850 forks source link

Speed up reconstruction using external initial pose estimates #924

Open knicklicht opened 2 years ago

knicklicht commented 2 years ago

I noticed that the reconstruction for large scenes take a long time. Would providing initial guesses for camera poses that were aquired through some external mechanism speed up the pipeline? I am thinking of inertial measurement units or maybe even from a SLAM system rigidly attached to the camera? Where in the OpenSfM pipeline would I need to set these initial guesses?

fabianschenk commented 2 years ago

Hi @knicklicht,

What operation takes the longest in your experiment? Is it really the reconstruction itself or the matching? Did you try to split the dataset and to run OpenSfM each subset separately as described here? If it's the matching action, then you would need to implement some strategy to find "nearby" images in order to speed up the matching. If it's the reconstruction action, then you can try to implement something that runs the incremental reconstruction but uses a prior. Maybe this can help: https://github.com/mapillary/OpenSfM/blob/a1a253f148d6e5daf6f2247e43e7d3fd306def53/opensfm/reconstruction.py#L1624

kielnino commented 1 year ago

I would also like to have the ability to insert prior pose informartion. Unfortunately reconstruct_from_prior is only suitable to add new images to an existing reconstruction.

fabianschenk commented 1 year ago

Hi @kielnino ,

This is an open-source project, so if you find something lacks functionality, feel free to create a PR :smile:

Best, Fabian

kielnino commented 1 year ago

@fabianschenk Sure, but then the PRs must also be accepted at some point. My other PR is waiting for a month now (https://github.com/mapillary/OpenSfM/pull/957)

Best, Johannes

fabianschenk commented 1 year ago

Hi @kielnino ,

Fair point 😉 I imported the PR and we'll review it. As you might have guessed from the very few code changes in the last months, the development of OpenSfM has slowed down a bit on our side.

Best, Fabian

kielnino commented 1 year ago

@fabianschenk thank you. I have noticed the slow down but as the project is very mature, it is a pleasure to work with anyway. Thanks for making it public available. Maybe I will follow your suggestion and give the implementation of prior pose import a try by myself.