Support input masks in panorama reconstruction - #4755
Open
trueoneplusone wants to merge 1 commit into
Open
trueoneplusone wants to merge 1 commit into
trueoneplusone wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Panorama reconstruction currently creates masks to avoid duplicate features across virtual cameras, but cannot incorporate user masks in the original panoramas. This adds per-image and shared input masks to the Python API and
panorama_sfm.py, addressing #4346.input_mask_pathandinput_camera_mask_pathtoPanoramaReconstructionOptionsand the example CLI. Per-image paths followImageReader's appended.pngconvention and replacement-extension fallback.ImageReaderOptions.Validation
30 tests pass across
python/pycolmap/panorama_test.py,python/pycolmap/panorama_mask_test.py, andpython/examples/panorama_sfm_test.py. The new API/CLI tests failed before implementation. Coverage includes both perspective layouts, exact polar pixels, longitude seams, zero/nonzero mask semantics, mask intersections, nested filenames and fallback precedence, missing/corrupt/wrong-size masks, threaded per-image processing, RGB/GPS preservation, and CLI forwarding.The integration tests run actual rendering, native CPU SIFT and database IO in all three reconstruction modes. They check that the retained keypoints and descriptors equal the exact expected subset of an unmasked extraction. Matching and mapping are bypassed; no full reconstruction accuracy claim is made.
A separate deterministic check used three synthetic textured panoramas (two 1024×512, one 2048×1024) with masks crossing the seam and excluding the lower hemisphere:
Across all cases, zero excluded features survived, no expected valid features were lost, and retained descriptors were identical.
Ruff 0.15.20 check/format, mypy on the four changed Python files, and
git diff --checkpass. These checks used the Python code from this checkout (4.3.0.dev0) with the native PyCOLMAP 4.2.0 Windows wheel, Python 3.13.5, OpenCV 4.12.0, and NumPy 2.5.3. The C++ extension was not rebuilt and the full C++/reconstruction suites were not run.AI assistance: OpenAI Codex researched the issue, implemented the changes, and ran the tests and measurements.