Skip to content

Add re_max_angle_error to configuration and improve track merging logic#48

Draft
zitongzhan wants to merge 2 commits into
cre185:masterfrom
zitongzhan:fix_merge_complete
Draft

Add re_max_angle_error to configuration and improve track merging logic#48
zitongzhan wants to merge 2 commits into
cre185:masterfrom
zitongzhan:fix_merge_complete

Conversation

@zitongzhan
Copy link
Copy Markdown
Collaborator

This pull request refactors to the track completion and merging logic in the track_retriangulation.py module. The changes enhance track merging, observation completion, and correspondence handling, as well as configurable options for error thresholds.

Key improvements and refactors include:

Track Merging and Correspondence Handling

  • Refactored the merge_tracks function to use view graph correspondences for merging, ensuring only tracks with valid feature correspondences are considered. The merging logic now uses a union-find data structure and updates track ownership for merged observations, increasing merge accuracy and efficiency. [1] [2]
  • Added the _build_correspondence_lookup helper function to efficiently map feature correspondences from the view graph, enabling more precise and robust track merging.

Observation Completion and Validation

  • Improved the complete_tracks function to avoid duplicating observations, prevent cross-track conflicts, and only add valid observations, using a new _obs_tuple helper for observation identity. [1] [2] [3]
  • Replaced the previous reprojection-based observation validation for merging and completion with an angular error check (_point_angular_reprojection_is_valid), controlled by a new re_max_angle_error threshold in the configuration. [1] [2] [3] [4]

Configuration and API Updates

  • Added the re_max_angle_error parameter to the COLMAP configuration for finer control over angular error during observation validation.
  • Updated function signatures to consistently require the view_graph parameter for functions that depend on feature correspondences, such as merge_tracks and complete_and_merge_tracks. [1] [2] [3]
  • Enabled track merging as an optional step, controlled by the enable_merge flag in the triangulator options.

num_changed_observations += retriangulate_underreconstructed_pairs(
view_graph, cameras, images, tracks, TRIANGULATOR_OPTIONS, pair_retry_counts
num_changed_observations += abs(
complete_and_merge_tracks(view_graph, cameras, images, tracks, tracks_orig, TRIANGULATOR_OPTIONS)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The complete and merge tracks is added, but the retriangulate_underreconstructed_pairs is removed. This need KPI validation

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