Repository navigation
Commit f664d5d
Clamp visibility coordinates before unsigned conversion (colmap#4943)
`VisibilityPyramid::CellForPoint` converts normalized coordinates to
`size_t` before clamping. A point left of or above the image can
therefore occupy the opposite edge, increasing the visibility score
instead of sharing the nearest boundary cell. Cropped undistortion can
retain observations outside the output image bounds.
I clamp both coordinates as doubles before conversion. The same helper
handles insertion and removal, and existing nonnegative coordinate bins
and score weights stay unchanged. No API, saved model or allocation
changes.
The native regression fails on pristine main: a left-boundary point and
its negative-coordinate counterpart produce score 10920 instead of 5460.
All three native visibility tests and all 28 independent cell-oracle
cases pass after the fix. All 4,800 nonnegative update scores match
pristine exactly. MSVC Release, clang-format and whitespace checks pass.
Local Clang-Tidy reports the same nine pre-existing source/header
diagnostics on base and patch.
---------
Co-authored-by: Paul-Edouard Sarlin <[email protected]>1 parent e8f3522 commit f664d5d
2 files changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | | - | |
| 77 | + | |
| 78 | + | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
63 | 83 | | |
64 | 84 | | |
0 commit comments