Preserve WebODM ODX geocoords export contract#2
Conversation
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.
cf7db39 to
d33c148
Compare
|
@lupionpe I appreciate the PR, but this is not going to work 🙏 (did you use AI?) |
|
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. |
|
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 |
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:
Validation:
python3 -m unittest -q.python3 -m compileall -q opensfm/actions/export_geocoords.py opensfm/geo.py opensfm/io.pyin 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.