Repository navigation
Commit d1d92d9
authored
Add COVARIANCE reweighting for Ceres rotation averaging (colmap#4953)
## Summary
Adds `RotationAveragingReweighting::COVARIANCE` to whiten
relative-rotation constraints in the Ceres rotation averaging backend
using per-edge rotation covariances:
- `CeresRotationAverager` whitens each residual, $`r_{ij} \mapsto
\Sigma_{R,ij}^{-1/2} r_{ij}`$, where $`\Sigma_{R,ij}`$ is regularized
with an isotropic floor, $`\Sigma_{R,ij} + \sigma_{\text{floor}}^2 I_3`$
(`CeresRotationAveragerOptions::covariance_sigma_floor_deg`, 0.02° by
default). The pose graph keeps the raw covariances.
- The robust loss acts on the whitened, unitless residual with scale
`CeresRotationAveragerOptions::covariance_loss_scale` (3.0 standard
deviations by default), in place of `loss_function_scale` (in degrees).
- Splits Ceres rotation averaging preparation into `CheckPoseGraph`,
`PrepareWeights`, and `InitializeRotations` (reusing
`internal::TryComputeLeftSqrtInformation` and
`DynamicCovarianceWeightedCostFunction::FromLeftSqrtInformation`) so
both `RotationEstimator` and `CeresRotationAverager` validate
connectivity, sensor rotations, loss scales,
`covariance_sigma_floor_deg`, and that every valid edge has a finite,
symmetric positive-definite floored covariance before MST initialization
modifies the reconstruction, without repeating connected-components or
per-edge Cholesky factorizations.
- Adds `use_rotation_covariance` to `InitializeFromMaximumSpanningTree`,
preferring edges with the smallest $`\mathrm{tr}(\Sigma_R)`$ via weights
$`-\log \mathrm{tr}(\Sigma_R)`$. `RotationEstimator` runs MST
initialization once before the warm-start.
- Keeps the Huber warm-start on angular residuals with `UNIFORM` weights
so confidently wrong relative rotations (e.g., from symmetric
structures) do not dominate early iterations.
- `COVARIANCE` is unsupported by `L1_IRLS` (throws), and is ignored with
a warning when `CERES` falls back to `L1_IRLS` for gravity priors.
- Binds `RotationAveragingReweighting.COVARIANCE`,
`covariance_loss_scale`, and `covariance_sigma_floor_deg` in pycolmap.
## Tests
- `CeresRotationAverager.CovarianceWhitening`,
`CovarianceDownweightsUncertainEdges`, `CovarianceReweightingWithRigs`,
and `RotationEstimator.CeresChecksInputsBeforeInitialization` in
`rotation_averaging_ceres_test.cc`.
- `RotationAveraging.InitializeFromMaximumSpanningTreeWithCovariance`
and `RotationAveraging.CovarianceReweighting` in
`rotation_averaging_test.cc`.
- Python binding tests in `motion_averaging_test.py` and
`rotation_averaging_ceres_test.py`.
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>1 parent 5b6da88 commit d1d92d9
11 files changed
Lines changed: 850 additions & 171 deletions
File tree
- src
- colmap/estimators
- cost_functions
- pycolmap/estimators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | | - | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
104 | 125 | | |
105 | 126 | | |
106 | 127 | | |
| |||
220 | 241 | | |
221 | 242 | | |
222 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
223 | 251 | | |
224 | 252 | | |
225 | 253 | | |
| |||
236 | 264 | | |
237 | 265 | | |
238 | 266 | | |
239 | | - | |
240 | | - | |
241 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
242 | 272 | | |
243 | 273 | | |
244 | 274 | | |
245 | 275 | | |
246 | 276 | | |
247 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
248 | 288 | | |
249 | 289 | | |
250 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
51 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | | - | |
86 | 90 | | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
88 | 108 | | |
89 | | - | |
| 109 | + | |
90 | 110 | | |
| 111 | + | |
91 | 112 | | |
92 | 113 | | |
93 | 114 | | |
| |||
261 | 282 | | |
262 | 283 | | |
263 | 284 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | 285 | | |
280 | 286 | | |
281 | 287 | | |
| |||
554 | 560 | | |
555 | 561 | | |
556 | 562 | | |
| 563 | + | |
557 | 564 | | |
558 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
559 | 569 | | |
560 | 570 | | |
561 | 571 | | |
| |||
582 | 592 | | |
583 | 593 | | |
584 | 594 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | 595 | | |
625 | 596 | | |
626 | 597 | | |
627 | 598 | | |
628 | | - | |
| 599 | + | |
| 600 | + | |
629 | 601 | | |
630 | 602 | | |
631 | 603 | | |
| |||
636 | 608 | | |
637 | 609 | | |
638 | 610 | | |
639 | | - | |
| 611 | + | |
640 | 612 | | |
641 | 613 | | |
642 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
146 | | - | |
147 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
153 | | - | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| |||
0 commit comments