mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.41k stars 861 forks source link

RuntimeError: Accessing invalid LandmarkId #633

Closed vik748 closed 4 years ago

vik748 commented 4 years ago

Hi, I have a dataset that I am trying to reconstruct. The reconstruction works fine when I use default HAHOG feature detector, however when I use SIFT, it throws RuntimeError: Accessing invalid LandmarkId 6432

The console output is pasted below. Any thoughts / ideas on what might be going on?

2020-08-18 19:08:47,329 INFO: -------------------------------------------------------
2020-08-18 19:08:47,341 INFO: G0035340.JPG resection inliers: 62 / 115
2020-08-18 19:08:47,404 DEBUG: Ceres Solver Report: Iterations: 11, Initial cost: 5.172924e+02, Final cost: 5.083837e+02, Termination: NO_CONVERGENCE
2020-08-18 19:08:47,404 INFO: Adding G0035340.JPG to the reconstruction
2020-08-18 19:08:47,416 INFO: Re-triangulating
2020-08-18 19:09:04,107 DEBUG: Ceres Solver Report: Iterations: 72, Initial cost: 9.182814e+03, Final cost: 9.017194e+03, Termination: CONVERGENCE
2020-08-18 19:09:15,207 DEBUG: Ceres Solver Report: Iterations: 41, Initial cost: 1.133642e+04, Final cost: 1.043713e+04, Termination: CONVERGENCE
Traceback (most recent call last):
  File "bin/opensfm", line 34, in <module>
    command.run(args)
  File "/home/auv/apps/OpenSfM/opensfm/commands/reconstruct.py", line 23, in run
    incremental_reconstruction(data, tracks_manager)
  File "/home/auv/apps/OpenSfM/opensfm/reconstruction.py", line 1315, in incremental_reconstruction
    data, tracks_manager, reconstruction, remaining_images, camera_priors, gcp)
  File "/home/auv/apps/OpenSfM/opensfm/reconstruction.py", line 1221, in grow_reconstruction
    remove_outliers(reconstruction, config)
  File "/home/auv/apps/OpenSfM/opensfm/reconstruction.py", line 1028, in remove_outliers
    lm = reconstruction.points[track]
RuntimeError: Accessing invalid LandmarkId 6432
fabianschenk commented 4 years ago

Hi, thanks for reporting. There was an API change to throw if a non-existing landmark/point is accessed instead of returning None. That's where the error comes from. This commit should fix it. Please, try it and report back.

yuni-g commented 4 years ago

Hi, thanks for reporting. There was an API change to throw if a non-existing landmark/point is accessed instead of returning None. That's where the error comes from. This commit should fix it. Please, try it and report back.

Had a same issue also and this commit fixed it. Thanks!