mapillary / OpenSfM

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

Blender Addon to import OpenSfM Reconstructions #609

Open SBCV opened 4 years ago

SBCV commented 4 years ago

I've recently added support for OpenSfM JSON files for a Blender-Addon that allows to import different photogrammetry formats into Blender.

Here is an example reconstruction shown in Blender. import_result

It automatically computes a camera animation using the input images as shown in the following image. Of course, one can use Blender's tools to generate other camera trajectories as well. camera_animation

I share this information here, since it is probably useful for other OpenSfM users as well. If you have any questions let me know. Feel free to close this issue.

Side note: Parsing the mesh data contained in the JSON file is not performed yet, I'll have a look when I got some more spare time.

luisEMEBA commented 4 years ago

Thanks, awesome work!

YanNoun commented 4 years ago

That's great, thanks !

Ademord commented 3 years ago

@SBCV do you know how could i use opensfM in unity? I am completely lost in the documentation.

SBCV commented 3 years ago

Sorry, I've no experience with unity :/

Ademord commented 3 years ago

@SBCV but the general pipeline/steps? If you could provide any info, i think it shouldnt be too far away from how to import it to blender :/

SBCV commented 3 years ago

I'm not sure what you are asking for? OpenSfM (like any other Structure-From-Motion tool) takes a set of input images and computes a set of cameras and a point cloud. So you would need to figure out how you can import those entities into unity (i.e. how to write a custom importer for unity that can add cameras with custom properties such as rotation, focal length, principal point and so on. Side note: presumably it is easier to import the reconstructed results, than executing OpenSfM from within unity (since in the latter case you would need to delegate all the OpenSfM-options from Unity to OpenSfM, capture the progress of OpenSfM within Unity, and so on).

SBCV commented 3 years ago

Btw: Reading the data format of opensfm is relatively straight forward, see this script