Repository navigation
Commit 78cc729
authored
Fix default prior_position_loss_scale to sqrt(chi2_95_3dof) (colmap#4936)
## Problem
`IncrementalPipelineOptions::prior_position_loss_scale` and
`IncrementalMapper::Options::prior_position_loss_scale` default to
`7.815` ($\chi^2_{0.95, 3}$), drifting from
`CeresPosePriorBundleAdjustmentOptions::prior_position_loss_scale`
(`std::sqrt(kChiSquare95ThreeDof)` $\approx 2.795$) and overriding it in
`IncrementalMapper::AdjustGlobalBundle`. Because Ceres loss functions
(`CauchyLoss(a)`, `HuberLoss(a)`, `SoftLOneLoss(a)`) apply `a` to the
whitened residual norm ($\rho(s)$ at $s = \|r\|^2$ with scale $a^2$),
passing $a = 7.815$ moves the robust transition to $\approx 7.8\sigma$
instead of the intended 95% 3-DOF threshold $\sqrt{\chi^2_{0.95, 3}}
\approx 2.795$.
## Fix
- Align the default `prior_position_loss_scale` in
`IncrementalPipelineOptions` and `IncrementalMapper::Options` with
`CeresPosePriorBundleAdjustmentOptions`
(`std::sqrt(kChiSquare95ThreeDof)`).
- Update the comments and `pycolmap` docstrings (including the stale
`CeresPosePriorBundleAdjustmentOptions` docstring) to match `2.795`.
## Tests
- `IncrementalPipelineOptions.DefaultPriorPositionLossScale`
(`src/colmap/controllers/incremental_pipeline_test.cc`) verifies that
the pipeline, mapper, and Ceres pose-prior BA defaults match
`std::sqrt(kChiSquare95ThreeDof)`.
<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 2a6f695 commit 78cc729
5 files changed
Lines changed: 23 additions & 7 deletions
File tree
- src
- colmap
- controllers
- sfm
- pycolmap
- estimators
- sfm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | | - | |
143 | | - | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
701 | 712 | | |
702 | 713 | | |
703 | 714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
127 | | - | |
| 129 | + | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
| 374 | + | |
| 375 | + | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
0 commit comments