Skip to content

Preserve WebODM ODX geocoords export contract#2

Closed
lupionpe wants to merge 2 commits into
WebODM:mainfrom
lupionpe:codex/odx-geocoords-contract
Closed

Preserve WebODM ODX geocoords export contract#2
lupionpe wants to merge 2 commits into
WebODM:mainfrom
lupionpe:codex/odx-geocoords-contract

Conversation

@lupionpe

@lupionpe lupionpe commented May 17, 2026

Copy link
Copy Markdown

This adapts the projected geocoordinates reconstruction export for WebODM's ODX integration.

Credit: this is based on Yann N.'s projection-conversion work in YanNoun/OpenSfM@446a4b0: YanNoun@446a4b0

Why:
Yan's change fixes the projection conversion path for default OpenSfM. WebODM's OpenSfM version is used through ODX, and ODX has an extra contract around reconstruction.geocoords.json: it needs projected coordinates with the ODX offset handling preserved, and the exported shot poses need to serialize/reload with the same projected origins.

What:

  • Commit 1 ports Yan's projection-transformer reconstruction export to WebODM's OpenSfM tree.
  • Commit 2 keeps WebODM/ODX's contract by threading the existing XY offset into projected reconstruction export and deriving pose translation from the serialized Rodrigues rotation.
  • Image-position and dense point-cloud exports stay on the existing affine matrix path.

Validation:

  • Applied and tested as a patch in the WebODM/ODX build path used by NodeODX.
  • Ran the dev-ops patch contract tests with python3 -m unittest -q.
  • Ran python3 -m compileall -q opensfm/actions/export_geocoords.py opensfm/geo.py opensfm/io.py in this OpenSfM checkout.

Reviewer focus:
Please review this as a two-step change: first the Yan projection implementation, then the WebODM/ODX-specific contract preservation. The intent is not to replace Yan's work, but to keep that projection fix compatible with the WebODM OpenSfM version and ODX's expected exported reconstruction contract.

lupionpe added 2 commits May 17, 2026 10:09
Why: YanNoun/OpenSfM@446a4b0 replaces the affine-only reconstruction export with projection-aware coordinate conversion.

What: Add projection transformer helpers, use them for reconstruction.geocoords.json export, and keep GCP projection parsing as a reusable projection string before constructing the transformer.
Why: WebODM's ODX path expects reconstruction.geocoords.json to contain projected coordinates minus the requested ODX XY offset, and saved shot poses must reload with the same projected origins.

What: Thread the existing export offset through the projection helpers, subtract that offset from projected shots and points, and derive pose translation from the serialized Rodrigues rotation before saving the projected reconstruction.
@pierotofy

Copy link
Copy Markdown
Member

@lupionpe I appreciate the PR, but this is not going to work 🙏 (did you use AI?)

@lupionpe

Copy link
Copy Markdown
Author

I did use Yan's solution as the base here, plus some AI assistance to adapt it to the current WebODM/ODX reconstruction contract.

I also tested this on two datasets where I was consistently seeing the issue before: both were large-area RTK + GCP projects with GCPs distributed near the borders. In both cases the results looked significantly better.

That’s unfortunate to hear that this approach is not going to work. My main goal here was to leverage Yan’s projection-aware solution and existing work/knowledge to improve the large-area georeferencing accuracy without requiring changes in ODX itself.

As far as I understood Yan’s approach, the core issue is that the current affine/average transformation approximation starts propagating distortion over large areas. By using the projection-aware transformation while still preserving the existing ODX export contract, my understanding was that we could propagate that improved coordinate accuracy downstream into OpenMVS and then into the generated point clouds and orthophotos.

@pierotofy

pierotofy commented May 18, 2026

Copy link
Copy Markdown
Member

Yeah unfortunately it won't work well because it warps the scene (which is not what you want to do before MVS). Please don't trust AI on this one. 🙏

We'll continue tracking this on WebODM/ODX#14

@pierotofy pierotofy closed this May 18, 2026
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.

2 participants