Skip to content

Fix Metashape tangential distortion import - #3779

Open
tianrking wants to merge 1 commit into
nerfstudio-project:mainfrom
tianrking:codex/fix-metashape-tangential-distortion
Open

Fix Metashape tangential distortion import#3779
tianrking wants to merge 1 commit into
nerfstudio-project:mainfrom
tianrking:codex/fix-metashape-tangential-distortion

Conversation

@tianrking

Copy link
Copy Markdown

Summary

  • Convert Metashape's tangential distortion coefficient names to Nerfstudio's OpenCV convention by swapping p1 and p2 during XML import.
  • Add an end-to-end XML-to-transforms.json regression test with distinct coefficients.

Closes #3714

Why

Metashape assigns P1 to the (r^2 + 2x^2) term and P2 to the 2xy term, while OpenCV assigns those terms to p2 and p1, respectively. Copying the names directly therefore changes the imported camera distortion.

References: Agisoft Metashape 2.3 manual, Camera models and OpenCV camera calibration.

Validation

  • Confirmed the new regression fails on main with 0.001 != -0.002, then passes with this change.
  • Target regression plus tests/process_data/test_misc.py: 3 passed.
  • Pre-commit trailing-whitespace, end-of-file, Ruff lint, and Ruff format hooks passed for both changed files.
  • License-header check passed.
  • Targeted Pyright: 0 errors (one local missing-open3d environment warning).

The local test environment did not have Open3D installed, so the unused import was stubbed for these no-point-cloud test paths; CI installs the project dependency set.

AI assistance

AI-assisted repository analysis and test planning were used. I reviewed the final diff and ran the validations above locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect tangential distortion parameter mapping in Metashape import

1 participant