Skip to content

370 - Bringing OpenSfM V1 and porting changes from 360 - #50

Draft
DodgySpaniard wants to merge 28 commits into
mainfrom
370
Draft

370 - Bringing OpenSfM V1 and porting changes from 360#50
DodgySpaniard wants to merge 28 commits into
mainfrom
370

Conversation

@DodgySpaniard

Copy link
Copy Markdown
Member

Main is now synced with OpenSfM/OpenSfM:Master.

Started a new branch from the main, manually picked and ported all changes from 360 branch that were required.
Where it was sensible cherry-pick was used; however, in many cases, due to many changes and moving files in OpenSfM upstream, some changes were manually ported. Attribution from the original commit is reflected in the message, albeit 95% of the custom changes were from Piero.

We went from +200 commits on our branches to 26. This was possible mostly due to 3 reasons:

  • OpenSfM moved over the years, fixing some bugs or making patches no longer required.
  • Some of the fixes and features were ported upstream (OpenSfM/OpenSfM). Notable mention to Piero as he did some work in the last months to add several important features to OpenSfM/OpenSfM:V1
  • Many of the commits were accumulated on the same files, the most obvious case being the report/stats. By porting the changes by hand, those several commits become 1.

As it was mentioned, the changes have been brought as is, just adapting where it must be done, and adding some unit tests here and there.

NOTE: We are still missing the "glue code and CMake files", if we adopt pixi this would be minimal.

Disclaimer: AI tools were used to aid this work: Kimi3, Gemini 3.1 pro and Copilot. They were used for research and to triple-check the code changes to make sure we did not leave anything behind. Worth noting, this work would have been much more error-prone and extra laborious without them.

pierotofy and others added 26 commits July 30, 2026 10:06
- Upstream OpenSfM V1 already has rolling shutter support
- Porting the missing plot binary
Bringing changes by hand to exif.py diffs:
 37d24d2, 955e727, dbe2215, 9254b83

As the changes cannot be easily cherry-picked, we arejust bringing
the code and adapting it to the new changes.

- Brough XML parsing fixes Pix4D projection and malformed XMP.
- Updated Brown as default camera using new config.
- Ptached export with the updated brown camera model params (patching).
- Updated pyproject with beautifulsoup4 and lxml.
Last changes to port into features.py this changes come
 from cojosef96 and piero ed7c8fb, c90b034

 - Added SIFT_GPU through injection of pypopsift from ODM.
 - Added unit test to check the glue code.
 - Added optimization for load/save directly from kiles
   (skipping io_handler): 6d85093
 - Added space free undistorted images (for OpenMVS):c39b32cf & 7fa8192
 - Skipping other changes as they are already in or not needed.
Original commits from Piero 4a92cf3, ec966e1, ad19428, 0566229

Updated imread/imwrite to suppor borather formats:
 .tif/.tiff/.dng/.raw/.nef
pyproject: declare rasterio + rawpy

NOTE: This new changes add a new dimensions which would break masking,
but 50053ee disables it.
 - Moving offset functionality, now using existing opensfm transform.
 - Added export_geocord to unit tests.
Move call of reconstruction.shots.keys() outside of the loop through all
points. This gives significant speed-up especially on large datasets.

For instance, I have got a 4 times speed boost at my dataset (1018152 points,
296 shots):

Before:
$ time /code/SuperBuild/install/bin/opensfm/bin/opensfm export_visualsfm \
 --points /var/www/data/f267df83-f8f8-4bf0-b2e1-41ae16c805e5/opensfm

real    8m46.180s
user    8m41.184s
sys     0m12.073s

After:
$ time /code/SuperBuild/install/bin/opensfm/bin/opensfm export_visualsfm \
 --points /var/www/data/f267df83-f8f8-4bf0-b2e1-41ae16c805e5/opensfm

real    2m10.472s
user    2m7.576s
sys     0m9.789s
 - Added custom flag to override camera_projection_type
 - Added unit tests.
 - Reimplemented the injection of reconstruction algorihm from config.
 - Slight deviation from the original, the actual command line arg
   is still enabled.
 - Added unit test.
 - Added imageFilter (injected from ODM)
 - Implemented camera_mappings.npz dump with compressed caching.
 - Reimplements cache, we use now a local cache and sort batches
  by Camera ID.

The code has been brought in bulk and adapted. Original commits:
e6f04e4, 3b28c3b, 5c9fe5b, 9a0e2f0, 1750fb2, 792b387
The original commits had too many conflict and changed code.

Manually bringing the changes from the following commits:
7041ce1, 81f6d47, 1fccc49, aa0faa3, 78b67c0, 7267773, 04f1d8c

- Added Planar reconstruction
- Updated viewer
- Added dedicated unit test and expanded the synthetic dataset gen.
- Added patches to work with the upstream OpenSfM codebase
Code original done by 564ff2c, f1bfff6, 37ff7a8, e19573a

Due to mapping and moving pieces, cherry-picking was not reasoable.

Changed lines from 360 branch have ben brought verbatim.
Lots of changes were already done in upstream, adapted most of the
requirements changes. To name some commits: 2f8baf5, dd2c985, e78321d,
d0676a8, c07c14a, eaff01d, 86920b0, 7eb1f79, 02534f5, 8fda902,
51c2e85...
- Inyecting dirs from ODM.
- Minor CERES required (so it complains if missing)
- Added flag for ARM to disable vlfeat SSE2.
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.

4 participants