8000 Incremental Model Refiner by tsattler · Pull Request #2145 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Incremental Model Refiner #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Incremental Model Refiner #2145

wants to merge 15 commits into from

Conversation

tsattler
Copy link
Contributor
@tsattler tsattler commented Sep 5, 2023

A variant of the point_triangulator (the code is based on the point_triangulator). For a given number of iterations, it, in each iteration, runs bundle adjustment and then completes and merges tracks. The bundle adjustment optimizes the camera parameters as well, allowing the refiner to handle inaccurate input poses better than the point_triangulator.

@ahojnnes ahojnnes enabled auto-merge (squash) September 10, 2023 10:57
@ahojnnes ahojnnes disabled auto-merge September 10, 2023 11:01
@ahojnnes
Copy link
Contributor

@tsattler This is a nice new feature. The CI pipeline fails for some reasons though, which prevents me from merging the changes. Thanks.

@tsattler
Copy link
Contributor Author

It used to work on some earlier release. Unfortunately, I haven't had the time to figure out where the problem is and to fix it. Planning to do this on one of the next days.

@ahojnnes
Copy link
Contributor

No rush at all, thanks.

@eduardohenriquearnold
Copy link

Hi @tsattler, I believe I have fixed the compiling errors due to code changes,. I'm not sure if there were any tests failing as the pipeline logs are no longer available. What is the best way to submit my changes? Can I push to your local branch?

@sarlinpe
Copy link
Member

What is a typical use case for this?

@tsattler
Copy link
Contributor Author

You are given an initial set of camera poses and intrinsics that might not be super accurate, so you want to refine them. This helps getting better poses and a better model.

@sarlinpe
Copy link
Member
sarlinpe commented Feb 20, 2024

Since PR #2429 simplifies the point triangulator, it would make sense to also simplify this PR to reuse components of the IncrementalMapper and IncrementalMapperController (maybe by providing a way to overwrite existing_image_ids_)

@tsattler
Copy link
Contributor Author

Will have a look once I find some time on my hands

@Dawars
Copy link
Contributor
Dawars commented Jul 20, 2024

I'm also trying to get this to work because of DetectorFreeSfM.

Triangulation is well encapsulated in IncrementalMapperController.
existing_image_ids_ ist set to reconstruction_->RegImageIds() in IncrementalMapper::BeginReconstruction making it difficult to set the variable from the outside.
The IncrementalMapper mapper object is only created in IncrementalMapperController::TriangulateReconstruction which means that accessing existing_image_ids_ has to go through 2 levels.

Here my proposed solution:

  • Add an optional parameter to TriangulateReconstruction for the fixed image ids
  • Add a setter function and call it after BeginReconstruction.

Here is the implementation: main...Dawars:colmap:incremental_model_refiner

Any feedback is welcome

@Dawars
Copy link
Contributor
Dawars commented Jul 27, 2024

@ahojnnes @sarlinpe

@sarlinpe
Copy link
Member

Thanks @Dawars, this indeed looks like a reasonable solution. Could you create a new PR such that I can provide detailed feedback there?

@tsattler
Copy link
Contributor Author

Why not do it part of this PR? After all, it is about the same thing?

@sarlinpe
Copy link
Member
sarlinpe commented Jul 31, 2024

Sure, if you have yourself time to update this PR to match the current state of the repo. The changes proposed by @Dawars look good to me.

@Dawars
Copy link
Contributor 8000
Dawars commented Jul 31, 2024

I don't have write permission here, so I created the new PR. #2685
Do I need to add tests/python bindings?

Adjusted the IncrementalModelRefiner to work with the current version of colmap.
@tsattler
Copy link
Contributor Author
tsattler commented Apr 8, 2025

@ahojnnes @sarlinpe I adjusted the code to work with the current version of Colmap. I tested it and it seems to work as intended. If you find time, can you please have a look?

@@ -110,6 +110,8 @@ int main(int argc, char** argv) {
commands.emplace_back("image_undistorter", &colmap::RunImageUndistorter);
commands.emplace_back("image_undistorter_standalone",
&colmap::RunImageUndistorterStandalone);
commands.emplace_back("incremental_model_refiner",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would probably just call it "model_refiner" but no strong opinions.

@ahojnnes
Copy link
Contributor

Thanks @tsattler and sorry for the slow response. If you could add a short description for the new command in doc/cli.rst that would be great, otherwise this looks good to me.

@ahojnnes
Copy link
Contributor

... and the code format needs to be fixed using scripts/format/c++.sh

Fixed stupid bugs, formatted the code
@tsattler
Copy link
Contributor Author

... and the code format needs to be fixed using scripts/format/c++.sh

Done.

@tsattler
Copy link
Contributor Author

@ahojnnes the checks seems to be passing. How about I rename the method "model_refiner" (instead of "incremental_model_refiner"), add a description to doc/cli.rst , and we merge?

@ahojnnes
Copy link
Contributor

@ahojnnes the checks seems to be passing. How about I rename the method "model_refiner" (instead of "incremental_model_refiner"), add a description to doc/cli.rst , and we merge?

Sounds great to me. Thank you 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0