Skip to content

Conversation

@YanNoun
Copy link

@YanNoun YanNoun commented Jan 13, 2026

This is an attempt to reconcile OpenSfM main repository, ODM, and a few things I've added to OpenSfM, namely :

  • Better GCP handling (revamped weighting sceme in BA, and triangulation consistency)
  • Better export to GCP CS : we now use the full transformation and not a rigid approximation
  • Proper OPK angle reading
  • Rerun export for viewing the scene and quality report together
  • Speed and memory optimisations : 7K images dataset now passes in less than 2 hours on a Core Ultra 9 285K. Before it was more than 24 hours.

I've kept all ODM-specific code modifications.

mxw-meta and others added 30 commits June 22, 2022 00:45
Reviewed By: fabianschenk

Differential Revision: D37315331

fbshipit-source-id: 5016c6d45d528c2fff5d8e32d03bcf4577c27f47
Reviewed By: fabianschenk

Differential Revision: D37341649

fbshipit-source-id: d090ea5977b13ffdd61802f80cd4a412fce613d1
Summary:
This diff does the following:
- removes the unused `acceleration_` variable
- adds `const` to parameters and members in `bundle` wherever possible

Reviewed By: tobias-o

Differential Revision: D37339308

fbshipit-source-id: 69432532dd706df612004e05602bb16d53808221
Summary:
If a user selects the feature type using
lower case letters, e.g. "orb", detect_features
will cast to upper case and proceed normally.
However, when saving the features no casting
is performed, and descriptors are saved to disk
as float, leading to the wrong matcher being
selected in the next stage, silently leading
to poor matching performance.

Pull Request resolved: mapillary#805

Reviewed By: YanNoun

Differential Revision: D37379909

Pulled By: fabianschenk

fbshipit-source-id: 0c6b817bf5f88d2b736eb66c3bb42f9f8cc1e6aa
Summary: Update `*.pyi` files

Reviewed By: tobias-o

Differential Revision: D37451823

fbshipit-source-id: e3a73870358c842fbffa0468930cac5c7687572e
Summary:
Hey there ✋

When trying to reconstruct a small image set (2 or 3 images) and `matching_graph_rounds` is enabled, the pipeline will fail at the feature matching step:

```
Traceback (most recent call last):
  File "/code/SuperBuild/install/bin/opensfm/bin/opensfm_main.py", line 25, in <module>
    commands.command_runner(
  File "/code/SuperBuild/install/bin/opensfm/opensfm/commands/command_runner.py", line 37, in command_runner
    command.run(data, args)
  File "/code/SuperBuild/install/bin/opensfm/opensfm/commands/command.py", line 12, in run
    self.run_impl(data, args)
  File "/code/SuperBuild/install/bin/opensfm/opensfm/commands/match_features.py", line 11, in run_impl
    match_features.run_dataset(dataset)
  File "/code/SuperBuild/install/bin/opensfm/opensfm/actions/match_features.py", line 14, in run_dataset
    pairs_matches, preport = matching.match_images(data, {}, images, images)
  File "/code/SuperBuild/install/bin/opensfm/opensfm/matching.py", line 46, in match_images
    pairs, preport = pairs_selection.match_candidates_from_metadata(
  File "/code/SuperBuild/install/bin/opensfm/opensfm/pairs_selection.py", line 630, in match_candidates_from_metadata
    g = match_candidates_by_graph(
  File "/code/SuperBuild/install/bin/opensfm/opensfm/pairs_selection.py", line 253, in match_candidates_by_graph
    triangles = spatial.Delaunay(points).simplices
  File "qhull.pyx", line 1840, in scipy.spatial.qhull.Delaunay.__init__
  File "qhull.pyx", line 356, in scipy.spatial.qhull._Qhull.__init__
scipy.spatial.qhull.QhullError: QH6214 qhull input error: not enough points(2) to construct initial simplex (need 4)

While executing:  | qhull d Qt Qc Q12 Qbb Qz
Options selected for Qhull 2019.1.r 2019/06/21:
  run-id 521442032  delaunay  Qtriangulate  Qcoplanar-keep  Q12-allow-wide
  Qbbound-last  Qz-infinity-point  _pre-merge  _zero-centrum  Qinterior-keep
  _maxoutside  0
```

This is solved by having `match_candidates_by_graph` return early if there's less than 4 input images.

Pull Request resolved: mapillary#878

Reviewed By: YanNoun

Differential Revision: D37379926

Pulled By: fabianschenk

fbshipit-source-id: 3390446668faa5a5680b772ddeb3bda7f9cc575e
Summary:
Hello ✋

This PR adds support for exporting image masks to OpenMVS, if they are set.

Hope this can be useful to others. 🙏

Pull Request resolved: mapillary#921

Reviewed By: YanNoun

Differential Revision: D37410286

Pulled By: fabianschenk

fbshipit-source-id: 6a2ea96c95a91e0dc9f36c5ad0ab4931c02b98aa
Summary:
Fixes `ModuleNotFoundError: No module named 'cv2'` when following the [Building](https://opensfm.readthedocs.io/en/latest/building.html) instructions on Ubuntu 20.04 with virtualenv or similar.

Pull Request resolved: mapillary#910

Reviewed By: YanNoun

Differential Revision: D37346114

Pulled By: fabianschenk

fbshipit-source-id: 72e2f2d810c31945fe543bc4367ef68997e4a8df
Summary:
This Diff changes the linear motion prior from additive to multiplicative form, in order to avoid shrinking effects that could arise.

However, we need to switch back to additive from in case of coincident centers (is breaking error function continuity).

Reviewed By: fabianschenk

Differential Revision: D37345489

fbshipit-source-id: f69e763f6f797c40b181ceb576bb6ad3be6e547f
Summary:
Fix typo

Pull Request resolved: mapillary#922

Reviewed By: YanNoun

Differential Revision: D37601783

Pulled By: fabianschenk

fbshipit-source-id: df6ae866e1660238c6d41ff06025f6f38ff3eae7
Summary: The `altitude` is always set to `0`, thus can be safely removed from the `invent_reference_from_gps_and_gcp` computation.

Reviewed By: YanNoun

Differential Revision: D37453036

fbshipit-source-id: cb561dfb49505e7a2bb45799e88dbbb3f26012bd
Summary: Set `use_altitude_tag = True` by default in the `config.py`. This should also solve problems like this [github issue](mapillary#918), where images are taken several meters above ground, e.g. by a drone, and points actually on the floor are then at a negative distance.

Reviewed By: YanNoun

Differential Revision: D37481946

fbshipit-source-id: 10247e1afca8c8f0aa31d693f2e14115cf238f89
Summary: This Diff adds a synthetic logging for OpenSfM bundle which summarizes if it was GLOBAL or LOCAL and the number of optimized entities (points and shots), as well as the actual running time.

Reviewed By: Ahmed-Salama

Differential Revision: D37717627

fbshipit-source-id: f51f55c03fc83f99c6f290f22eecce51199c4fd9
Summary:
This Diff fix an edge case in global bundle :
 - We were constructing the camera from the shots, because for > 1 rig instances (with > 1 rig camera), we usually have all the cameras in any of the instance.
 - In the edge case of individual rig cameras (each instance has a different rig camera), this is not the case during the initial pair bootstrap, as we ignore one of the two shots (we adjust each shot in turn).

we fixed that by collecting all the cameras, similarly to the rig cameras collection, and instanciate them at once.

Reviewed By: Ahmed-Salama

Differential Revision: D37717624

fbshipit-source-id: 9841a4e6538b5a1f75a15756c4eeb15eac01eae7
Summary: This Diff strengthen the # of rig instances requirements for unleashing rig camera poses. In the Aria case, all rig instances have different cameras, which is over parametrized in that case.

Reviewed By: Ahmed-Salama

Differential Revision: D37717628

fbshipit-source-id: a24e7a1666af9711b131455864699c8cb7c2494e
Summary: This Diff fixes a typo in stats which was also causing failure in rig camera stats computation.

Reviewed By: fabianschenk

Differential Revision: D37717626

fbshipit-source-id: b0a1ef809f4733e8351238ae91bb7bc22b8b1ffc
Summary:
This PR is in regards to the issue mapillary#741.

As open3D does not currently support user-defined headers, the following command fails to load colors from the ply file because OpenSfM generates ply file with `diffuse_` prefix to the color headers.
```
import open3d as o3d
pcd = o3d.io.read_point_cloud('merged.ply')
print(pcd.colors)

>>pcd.colors => std::vector<Eigen::Vector3d> with 0 elements.
```

To support [official ply headers](http://paulbourke.net/dataformats/ply/), `point_cloud_to_ply` and `ply_header` functions have been modified in the `OpenSfM/opensfm/io.py`.
```
def point_cloud_to_ply(
    points: np.ndarray,
    normals: np.ndarray,
    colors: np.ndarray,
    labels: np.ndarray,
    fp: TextIO,
) -> None:
    ...
    fp.write("property uchar red\n")       # Changed from diffuse_red
    fp.write("property uchar green\n")     # Changed from diffuse_green
    fp.write("property uchar blue\n")      # Changed from diffuse_blue
    fp.write("property uchar class\n")
    fp.write("end_header\n")
    ...
```

Pull Request resolved: mapillary#932

Reviewed By: YanNoun

Differential Revision: D37817489

Pulled By: fabianschenk

fbshipit-source-id: cde2a8172a2bf2f8256c9772a6bad4decaa9de78
Summary:
Update wrong documentation:
- OpenCV Fisheye has 4 radial distortion parameters instead of the 3 mentioned in the doc
- Fisheye62 should have `theta^2`

Follow-up on two github issues:
- mapillary#930
- mapillary#929

See Fisheye62 discussion in the [github issue](mapillary#930). The distortion computation is the same as for OpenCV fisheye just with more parameters.

Reviewed By: YanNoun

Differential Revision: D37814244

fbshipit-source-id: fe999ef52b6da0865ec410175329c910dd78e331
Reviewed By: YanNoun

Differential Revision: D37609433

fbshipit-source-id: fc642902417c5e7ee9469edbb96303be0a24e471
Reviewed By: YanNoun

Differential Revision: D38146475

fbshipit-source-id: e9073bf4b237fbc0908ae40f65c224e5b8a21900
Summary:
Fix robust_match on matches which are already filtered.
Masking feature points again would cause out of bounds errors when resolving matches to features

Reviewed By: YanNoun

Differential Revision: D38146504

fbshipit-source-id: 444b21a959e4eca85b641d02ab59c03e752eb327
Differential Revision: D38448211

fbshipit-source-id: 4da716a8adcd2455c71d946fb2d0d62ffe35782a
Summary:
Add missing parenthesis in log statement

Pull Request resolved: mapillary#940

Reviewed By: YanNoun

Differential Revision: D38703078

Pulled By: fabianschenk

fbshipit-source-id: 54fe5655e724908e951bf289ae3bce9b71aad8e6
Summary: `metadata.compass_accuracy.value` is required to be float. If accuracy is set to `None`, the if condition passes, but an error is thrown at runtime

Reviewed By: fabianschenk

Differential Revision: D38703925

fbshipit-source-id: 932a3022912b0de640e04102bcd36f5a4070b320
Summary:
Added data format for the tracks.csv file in order to help other people using that file

Pull Request resolved: mapillary#938

Reviewed By: YanNoun

Differential Revision: D38908516

Pulled By: fabianschenk

fbshipit-source-id: 307207958b36f87290695503d73199e1fab8506f
Summary: Pull Request resolved: mapillary#943

Reviewed By: YanNoun

Differential Revision: D38908510

Pulled By: fabianschenk

fbshipit-source-id: d9db92186064bbfab7cd32d363d2f440343465a0
Summary: Pull Request resolved: mapillary#944

Reviewed By: YanNoun

Differential Revision: D38908509

Pulled By: fabianschenk

fbshipit-source-id: 94d9c79a615bc518564e6bc6a9ea1457ebd52859
Summary:
added zenmuse p1 (mapillary#933)

Pull Request resolved: mapillary#945

Reviewed By: paulinus

Differential Revision: D38908505

Pulled By: fabianschenk

fbshipit-source-id: e50a16f6a6c1886207ea5598a70701964b2c0ac8
Summary:
The projection_type for the Fisheye62 cameras was missing in the switch-statements.

Pull Request resolved: mapillary#957

Reviewed By: YanNoun

Differential Revision: D41580786

Pulled By: fabianschenk

fbshipit-source-id: 2bf5cf758fadd1643f289bf77e3c770de1c84691
Summary:
Pull Request resolved: mapillary#976

This is an extension to mapillary#972

- Update NUMPY, scipy requirements to make docker run again

- A few things were removed in the most recent numpy version, so minor fixes

Reviewed By: YanNoun

Differential Revision: D42605541

fbshipit-source-id: 4061bd1c705c2625c99a6b1cf2829a8ef93e3802
Yann N. added 30 commits January 12, 2026 20:55
A bit for autoformat as well
Added OPK error display
…e it anyway) + distinct storage for Observation and std::srtring in separate pool, so we stoee connections as indexes.
Conda to ease the development, especially dependencies.
…id size to balance that we have less tracks. Free formatting pass on tracks_helpers
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.