mapillary / OpenSfM

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

Try reconstruction with dynamic focal length #837

Open Fryman420 opened 2 years ago

Fryman420 commented 2 years ago

Hello! I am currently try to put AR on a video. For that I am parsing "reconstruction.json" file for camera Tvec and Rvec. But this approach only works good when the focal length is constant. How can I get reconstruction with dynamic focal length?

YanNoun commented 2 years ago

Hi @Fryman420,

In order to support such cases, you would need to have one different camera model for each image. You can enforce that with the option unknown_camera_models_are_different: True and making sure/hacking your EXIFs, such that you camera model is unknown unknown (see https://github.com/mapillary/OpenSfM/blob/7b455d9c424c82d96fc60d57a9c1dbf024aa8b3b/opensfm/actions/extract_metadata.py#L61).

However, be aware that OpenSfM SfM algorithms are not well tailored for such case.

Let me know if that helps,

Yann