8000 Add changes needed for MP-SfM by Zador-Pataki · Pull Request #3269 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add changes needed for MP-SfM #3269

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 16 commits into
base: main
Choose a base branch
from

Conversation

Zador-Pataki
Copy link

Summary

This PR introduces the core functionality required for MP-SfM. It adds new Ceres cost functions and integrates them into COLMAP’s pipeline via ExtendBundleAdjusterWithDepth, with full Python bindings. Additionally, it includes several utility functions to improve the robustness and efficiency of the MP-SfM pipeline, particularly in challenging reconstruction scenarios.

Main Changes

  • Added two new Ceres cost functions: ScaledDepthErrorCostFunction and TruncatedLogScaledDepthErrorCostFunction
  • ExtendBundleAdjusterWithDepth: adds per-3D point depth constraints efficiently to an existing BA problem
  • Utility pybindings:
    • get_xy and get_point3D_ids methods in Image avoid iterating in python
    • FindPoints3DWithGoodTriangulationAngle: follows "FilterPoints3DWithSmallTriangulationAngle" but instead returns the points. Needed in MP-SfM and is inefficient in python. However, it is unclear if this should be in observation manager.
  • Extended Retringulate() with optional exclusion of specific image IDs. This is needed because for low-overlap pairs, introducing high error 3D points can be harmful

8000
else
cost_function = ScaledDepthErrorCostFunction::Create(depth);

ceres::LossFunction* loss_function = CreateLossFunctionPerPoint(loss_name, loss_param, loss_magnitude);
Copy link
Member

Choose a reason for hiding this comment

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

Can be called only once instead of at each iteration, since the parameters are identical.

Copy link
Author

Choose a reason for hiding this comment

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

unclear which line. loss_param, loss_magnitude and depth are all per 3D point in this implementation. the if statement could be done once but not sure how to implement this in cpp

@@ -134,7 +134,8 @@ class IncrementalTriangulator {
// Image pairs are under-reconstructed if less than `Options::tri_re_min_ratio
// > tri_ratio`, where `tri_ratio` is the number of triangulated matches over
// inlier matches between the image pair.
size_t Retriangulate(const Options& options);
size_t Retriangulate(const Options& options,
const std::unordered_set<image_t>& ignore_image_ids = {});
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem to be used anywhere?

Copy link
Author

Choose a reason for hiding this comment

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

Indeed. This is used only in MP-SfM. Problem?

}
return lf;
}
void ExtendBundleAdjusterWithDepth(ceres::Problem* problem,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we do not have a depth class with standardized format in COLMAP, does it make sense to implement this outside COLMAP?

@@ -402,6 +402,65 @@ size_t ObservationManager::FilterPoints3DWithSmallTriangulationAngle(
return num_filtered;
}

std::vector<bool> ObservationManager::FindPoints3DWithGoodTriangulationAngle(
Copy link
Contributor

Choose a reason for hiding this comment

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

Now I see that this does the same thing as FilterPoints3DWithSmallTriangulationAngle. Does it make sense to refactor and share some code between the two methods?

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.

3 participants
0