SIGN IN SIGN UP

Refit missing E/F/H in MaybeDecomposeRelativePoses for old databases (#4389)

- Fixes #4387: `global_mapper` crashed on databases written by older
COLMAP versions, which stored the two-view geometry `config` (CALIBRATED
/ UNCALIBRATED / PLANAR / ...) but persisted the corresponding
`E`/`F`/`H` matrix as NULL. `EstimateTwoViewGeometryPose` then
`THROW_CHECK`ed the missing matrix and aborted.
- `MaybeDecomposeRelativePoses` now refits the missing matrix from the
cached inlier matches before calling `EstimateTwoViewGeometryPose`:
- `CALIBRATED` → `EssentialMatrixEightPointEstimator` on inlier camera
rays
- `UNCALIBRATED` → `FundamentalMatrixEightPointEstimator` on inlier
image points
- `PLANAR` / `PANORAMIC` / `PLANAR_OR_PANORAMIC` →
`HomographyMatrixEstimator` (DLT) on inlier image points
- If the inlier set is too small for the estimator's `kMinNumSamples` or
the fit returns no model, the pair is counted as a failed decomposition
and skipped (no crash).
- Leaves `EstimateTwoViewGeometryPose`'s `THROW_CHECK`s in place: they
still catch programmer errors at non-old-DB call sites such as
`incremental_mapper_impl.cc`.
J
Johannes Schönberger committed
6cfbc0404cb973ca79a6835bb88bb020ed96bc8f
Parent: d200013
Committed by GitHub <noreply@github.com> on 5/10/2026, 1:13:28 PM