Skip to content

Absolute location priors in rotation averaging, global positioning, and BA - #41

Draft
sarlinpe wants to merge 1 commit into
cycle-consistencyfrom
location-prior
Draft

sarlinpe wants to merge 1 commit into
cycle-consistencyfrom
location-prior

Conversation

@sarlinpe

@sarlinpe sarlinpe commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Anchor the reconstruction to an external world frame using absolute localizations of some frames, e.g. from visual localization against a georeferenced map. The reconstruction is then expressed in that frame and the priors make it robust to drift.

Input (--location-priors <file.npz>, format documented in vidmap/mapper/location_priors.py): for the localized frames, image names, a confidence in [0, 1], R_cam_from_world with a 6x6 pose covariance, and 2D-3D correspondences (CSR) to a set of world points. Use --gt-reconstruction with a COLMAP model of the localized frames to force them to be keyframes.

  • Rotation averaging: Cauchy-robust absolute rotation priors weighted by their covariance and confidence; the spanning-tree initialization is aligned to the prior frame.
  • Global positioning: bearing constraints from the 2D-3D correspondences, stiff in GP1 to initialize positions and softer in GP2 so that coherent blocks of outliers can be overruled. GP1 is aligned to the priors with a 4-DoF (scale, translation) RANSAC, separately for each part of the reconstruction that is only weakly covisible with the rest (e.g. across cuts, counting only the tracks that GP1 explains), with translation only when the anchors are too close to observe the scale; the scale prior is relaxed once at least two frames are anchored.
  • Bundle adjustment: robust reprojection constraints to the prior world points; the first pose is no longer fixed when priors are active.
  • Native costs: the residuals are appended to the upstream COLMAP problems: rotation priors (on the Eigen-quaternion frame rotations, which also frees the averager's fixed frame) in a new vidmap_native.rotation_averaging module, bearing constraints in vidmap_native.global_positioning, and constant-point reprojections in vidmap_native.bundle_adjustment.
  • Keyframes: keyframes.selection.force_gt_keyframes (enabled by --gt-reconstruction).
  • CLI: --location-priors in vidmap.run and vidmap.map; vidmap.map also honors --split-cuts.
  • Viewer: reference (GT) poses aligned by Sim(3), with optional per-frame confidence colors and position covariance ellipses read from pose_covariances.npz / pose_confidence.json next to the reference reconstruction, plus hover tooltips.
  • Tests for the npz loader, the rotation-averaging alignment to the priors, and the GP/BA costs.

@sarlinpe
sarlinpe added this pull request to stack #43 October 9, 2026 15:45
@sarlinpe
sarlinpe marked this pull request as draft October 9, 2026 22:41
…nd BA

Anchor the reconstruction to an external world frame using absolute localizations of some
frames (e.g. from visual localization against a georeferenced map), given as a generic .npz
(--location-priors; format documented in vidmap/mapper/location_priors.py): per-frame
rotation with covariance and confidence, plus 2D-3D correspondences to world points.

- Rotation averaging: Cauchy-robust absolute rotation priors weighted by their covariance and
  confidence; the spanning-tree initialization is aligned to the prior frame.
- Global positioning: bearing constraints from the 2D-3D correspondences (stiff in GP1 to
  initialize positions, softer in GP2 so coherent blocks of outliers can be overruled), with a
  4-DoF (scale, translation) RANSAC alignment of GP1 to the priors; relaxed scale prior once
  at least two frames are anchored.
- Bundle adjustment: robust reprojection constraints to the prior world points; the first pose
  is no longer fixed when priors are active.
- --gt-reconstruction now also forces its images to be keyframes
  (keyframes.selection.force_gt_keyframes), so that prior frames become keyframes.
- vidmap.map / vidmap.run: --location-priors; vidmap.map also honors --split-cuts.
- Viewer: reference (GT) poses aligned with Sim(3), optional per-frame confidence coloring and
  position covariance ellipses (pose_covariances.npz / pose_confidence.json next to the
  reference reconstruction), hover tooltips.
- Tests for the .npz loader.

This branch has not been deployed

No deployments
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