8000 Templating the static methods in the algorithm class IncrementalMapperImpl by B1ueber2y · Pull Request #3042 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Templating the static methods in the algorithm class IncrementalMapperImpl #3042

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

Closed

Conversation

B1ueber2y
Copy link
Contributor
@B1ueber2y B1ueber2y commented Dec 15, 2024

In this way we achieve reusability without touching the IncrementalMapper class. I also added static_assert to ensure type safety between Reconstruction and ObservationManager, and DatabaseCache and ObservationManager.

If we are happy with it I will move forward to update some core logics in the IncrementalTriangulator and ObservationManager to templated methods in an algorithm class in the following PRs as well.

@B1ueber2y B1ueber2y requested a review from ahojnnes December 15, 2024 13:05
@B1ueber2y B1ueber2y changed the title Templating the algorithm class IncrementalMapperImpl Templating the static methods in the algorithm class IncrementalMapperImpl Dec 15, 2024
@B1ueber2y
Copy link
Contributor Author

Made an update to change all the shared_ptr arguments to const reference in the algorithm class: 24f9776

@B1ueber2y B1ueber2y marked this pull request as draft December 15, 2024 15:14
@B1ueber2y
Copy link
Contributor Author

Actually we should remove dependencies across classes rather than doing static_assert. Will first improve the logic in a separate PR and then proceed with templating.

@B1ueber2y
Copy link
Contributor Author

Actually we should remove dependencies across classes rather than doing static_assert. Will first improve the logic in a separate PR and then proceed with templating.

Submitted here: #3043

B1ueber2y added a commit that referenced this pull request Dec 15, 2024
As mentioned in #3042, there are
some dependencies in the graph that we need to take care of to avoid
inconsistency, notably:
* ``ObservationManager`` and ``DatabaseCache`` shares a same
``CorrespondenceGraph`` object, so should not be listed as input
together to a static method
* ``ObservationManager`` has a reference to the ``Reconstruction``
object, so should not be listed as input together with a
``Reconstruction`` object to a static method

This PR contains the updates as follows:
* use const ref rather than smart pointers as input in the algorithm
class
* use ``NumCorrespondencesForImage`` from ``CorrespondenceGraph`` rather
than ``ObservationManager`` to avoid dependent input
* add getter for the ``Reconstruction`` object to the
``ObservationManager`` class to avoid dependent input.
@B1ueber2y B1ueber2y deleted the refactor/incremental_mapper_template branch December 17, 2024 22:08
HernandoR pushed a commit to HernandoR/colmap that referenced this pull request Dec 30, 2024
As mentioned in colmap#3042, there are
some dependencies in the graph that we need to take care of to avoid
inconsistency, notably:
* ``ObservationManager`` and ``DatabaseCache`` shares a same
``CorrespondenceGraph`` object, so should not be listed as input
together to a static method
* ``ObservationManager`` has a reference to the ``Reconstruction``
object, so should not be listed as input together with a
``Reconstruction`` object to a static method

This PR contains the updates as follows:
* use const ref rather than smart pointers as input in the algorithm
class
* use ``NumCorrespondencesForImage`` from ``CorrespondenceGraph`` rather
than ``ObservationManager`` to avoid dependent input
* add getter for the ``Reconstruction`` object to the
``ObservationManager`` class to avoid dependent input.
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.

1 participant
0