Blender-Addon-Photogrammetry-Importer icon indicating copy to clipboard operation
Blender-Addon-Photogrammetry-Importer copied to clipboard

Support for additional Libraries

Open SBCV opened this issue 4 years ago • 20 comments

This issue is considered as a living document.

The following libraries will be probably supported in the near future: OpenSfM (https://github.com/mapillary/OpenSfM)

Feel free suggest other libraries as well. If these are proprietary, please provide a reconstruction of the sceaux castle in a file format that can be reasonably parsed with python. Or even better: provide a pull request ;)

Side note: Here is nice summary (unfortunately in german) of many different SfM tools

SBCV avatar Jun 02 '20 08:06 SBCV

I'd like to suggest the following point cloud formats: .asc /.pts /.csv - These are simple text files with delimited numbers (delimiters can be space, comma, tab, semicolon). There's a simple spec for pts here but it'd be useful to look at what CloudCompare and MeshLab import and export as they can include colours and reflectance as floats and sometimes include normals. e57 - http://www.libe57.org/ - has a python wrapper library but development seem to have stopped with that link. pcd - the PCL file format - has a pure python library link

LuAPi avatar Jul 28 '20 17:07 LuAPi

Hey, thanks for pointing out these data formats. Could you share an example reconstruction for the file formats you need support for?

SBCV avatar Jul 29 '20 11:07 SBCV

My use case is importing point clouds from LIDAR scans. I've converted the https://github.com/SBCV/Blender-Addon-Photogrammetry-Importer/blob/master/examples/Example.ply into the formats I mentioned. The example file didn't have any reflectance data so I added a dummy value of 15 to every point. The reflectance value is quite often an integer value larger than 8 bits. I included two versions of the asc and pts files, one with a header naming the columns and with float RGB values, the other without the header and with integer RGB values. Example.zip

LuAPi avatar Aug 07 '20 10:08 LuAPi

The latest commit adds support for asc, pts and csv files. If no header is provided, the addon tries to guess the data semantics. Regarding the other file formats, I'll need to check how to handle the external dependencies. (Since I want to keep this addon as lightweight as possible)

SBCV avatar Aug 10 '20 09:08 SBCV

Unfortunately pypcd does not support python 3. I'll have a look for some alternatives

SBCV avatar Sep 27 '20 19:09 SBCV

Maybe we should consider to add the pyntcloud library as optional dependency. It adds support for several file formats such as .ply / .pcd / .asc / .pts / .txt / .csv / .xyz ...

SBCV avatar Sep 27 '20 19:09 SBCV

The addon uses now pyntcloud for point parsing

SBCV avatar Sep 29 '20 22:09 SBCV

Is it possible to add .abc (Alembic) import? - thanks

PLAN8VR avatar Nov 22 '20 17:11 PLAN8VR

I am not aware of any python 3 library that allows to parse this .abc files. A few month ago I opened an issue for the alembic library. But as far as I can see, I supports only python 2.7 (and we need a library that is compatible with python 3). If you know any library that has the corresponding capabilities let me know.

SBCV avatar Nov 22 '20 18:11 SBCV

I am not aware of any python 3 library that allows to parse this .abc files. A few month ago I opened an issue for the alembic library. But as far as I can see, I supports only python 2.7 (and we need a library that is compatible with python 3). If you know any library that has the corresponding capabilities let me know.

Blender has a native Alembic importer anyway - is it possible to hook into this? It would be nice to be able to import abc cameras using your animated camera options. - Thanks!

Attached is an Alembic Export from Metashape (very low res build for time and file save)

Sceaux_Castle.zip

PLAN8VR avatar Nov 23 '20 09:11 PLAN8VR

I think this is the python abc importer I found in the Blender lib folder...

abc.py.txt

PLAN8VR avatar Nov 23 '20 09:11 PLAN8VR

I'm aware of Blender's built-in alembic importer, but the problem here is that not the full interface is available for python. Therefore, the only way to use this function is to call bpy.ops.wm.alembic_import(). Afaik, this will directly add the objects in the abc file to the scene - which makes it difficult/impossible to integrate this behavior into the current pipeline. (please correct me, if I am mistaken with any of these statements)

SBCV avatar Nov 24 '20 21:11 SBCV

That's a pity. Might the Blender Dev team allow access to the raw python scripting? (PS, I'm not a coder, so please tell me to be quiet when I'm talking nonsense!)

PLAN8VR avatar Nov 25 '20 09:11 PLAN8VR

No worries! Theoretically, you could open an issue at the blender git repository and ask for such functionality. However, I'm pretty sure that nobody would start working on that - my impression is that the Blender developers are too busy to fix bugs and improve the core functionality.

SBCV avatar Nov 25 '20 09:11 SBCV

see #30

SBCV avatar Nov 25 '20 10:11 SBCV

First of all thank you for your great work on this plugin.

I would like to propose Apple Object Capture support. it is a free alternative (with a mac) and it now supports output of Poses (https://developer.apple.com/documentation/realitykit/photogrammetrysession/poses/).

lanxinger avatar Sep 04 '23 06:09 lanxinger

Hey, thank you for mentioning this library. Since I do not own a Mac system, it will be difficult for me to add support for this library. However, I could provide some guidance if you want to provide a pull request. Another option could be that you create an example for the sceaux dataset (see here and here) and upload it somewhere.

SBCV avatar Sep 04 '23 14:09 SBCV

Hello, I'd like to suggest OPF https://www.pix4d.com/open-photogrammetry-format/ They have the specs (based on some json schema) and some python based tools as well. Found it while looking for photogrammetry https://www.rerun.io/examples/real-data/open_photogrammetry_format

deeplyarnab avatar Feb 25 '24 19:02 deeplyarnab

Thank you for pointing this out! Can you share some example file (ideally for the sceaux dataset)?

SBCV avatar Feb 26 '24 09:02 SBCV

I still haven't found any, sorry for late reply. I'll try to keep searching.

deeplyarnab avatar Mar 03 '24 07:03 deeplyarnab