mapillary / OpenSfM

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

GPS position prior #72

Closed waps101 closed 7 years ago

waps101 commented 8 years ago

OpenSfM seems to load GPS DOP values but as far as I can see, it never actually uses them. In bundle.h the lines that add a GPS position prior to the bundle adjustment objective function are commented out. Here, the DOP is used as the standard deviation which makes sense (lower DOP value -> more reliable GPS -> penalise deviation from GPS more heavily).

Is there any reason why the GPS position prior is commented out? On a dataset with reliable GPS, is it a good idea to uncomment these lines and add the GPS DOP values to the image EXIF data?

paulinus commented 8 years ago

As you have seen, GPS accuracy is currently not used in OpenSfM. The EXIF reader extracts the DOP value if present, and it is stored together with the GPS position, but not used in any calculation.

The commented lines in bundle.h come from and old test and need some work to be usable. For example, as you mention, the conversion from DOP to standard deviation is missing. Also the altitude tag has to be handled better.

In datasets where SfM works well, SfM should give better precision than GPS, and using GPS for post-alignment gives good results. But optimizing for both at the same time will help in some situations where SfM alone yields globally distorted results.

paulinus commented 7 years ago

GPS can now be used during bundle setting the option bundle_use_gps: yes in config.yaml