openMVS icon indicating copy to clipboard operation
openMVS copied to clipboard

Blender Photogrammetry Addon support for OpenMVS

Open SBCV opened this issue 3 years ago • 4 comments

I thought about extending this Blender Photogrammetry Importer Addon for OpenMVS. While it is already possible to import the reconstructions using the OpenMVG/Colmap/VisualSfM/PLY importers, I guess adding support for OpenMVS's native file format is preferable.

I've seen that Interface.h contains C++ code for writing the .mvs binary file format. Since this addon uses pure python code, I was wondering, if there are maybe already some python scripts, which allow to read this format.

SBCV avatar Jul 10 '20 20:07 SBCV

Great addon! Indeed, accessing the native project will give access to all info, like camera poses and intrinsics, not only the reconstructed geometry from the PLY. However you can not use the Interface.h for this. That interface is only for exporting from SfM app to OpenMVS. All next MVS project files are stored using a more complicated serialization (Boost serialization) and contain much more information (like mesh, texture, etc). So to access any MVS file (except the first one exported from SfM) you will need to link directly to OpenMVS lib. Currently there is no python support build inside OpenMVS, and I am not a python expert, but maybe there is some way to link to it from python.

cdcseacave avatar Jul 12 '20 11:07 cdcseacave

If you are not a python expert either, the easiest way is to indeed use Interface.h to read the first MVS file so that you access the camera details and poses; and for the rest of the geometry access them like you do now, just from PLY. As far as I know nobody implemented that interface in Python.

cdcseacave avatar Jul 12 '20 11:07 cdcseacave

Thanks for the feedback. If I'm not mistaken, we would need to write a python wrapper for the corresponding c++ functions in order to use the OpenMVS lib from within Python. But that is probably an overkill. I'll dig a bit deeper in the Interface.h code in order to provide at least some support for the initial MVS file.

SBCV avatar Jul 15 '20 08:07 SBCV

look forward to any progress, would be nice to offer a python interface for the file IO like colmap, facilitating developement of the addon

jingyibo123 avatar Apr 22 '22 03:04 jingyibo123