-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Templating the static methods in the algorithm class IncrementalMapperImpl #3042
Conversation
Made an update to change all the shared_ptr arguments to const reference in the algorithm class: 24f9776 |
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 |
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.
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.
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.