Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

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

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

// 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?

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?

@reynoldscem-oculo
Copy link

reynoldscem-oculo commented Nov 28, 2025

@Zador-Pataki is the intent still to get this stuff merged? I'm quite interested in using some functionality that exists in both MP-SfM and which has since been added to colmap. Wondering what the best way to do so would be.

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.

4 participants