VasileiosBouzas / MeshPolygonization

70 stars 17 forks source link

MeshPolygonization

Introduction

MeshPolygonization is the implementation of the MVS (Multi-view Stereo) building mesh simplification method described in the following paper:

Vasileios Bouzas, Hugo Ledoux, and  Liangliang Nan.
Structure-aware Building Mesh Polygonization. 
ISPRS Journal of Photogrammetry and Remote Sensing. 167(2020), 432-442, 2020.

Please cite the above paper if you use the code/program (or part of it).


The main characteristic of this method is structure awareness — namely, the recovery and preservation, for the input mesh, of both its primitives and the interrelationships between them (their configuration in 3D space). This awareness asserts that the resulting mesh closely follows the original and at the same time, dictates the geometric operations needed for its construction in the first place — thus providing accuracy, along with computational efficiency.

The proposed methodology consists of three main stages: (a) extracting planar primitives via mesh segmentation, (b) encoding primitive interrelationships in a structure graph, and (c) mesh polygonization. In particular, polygonization is accomplished here by approximating the primitive borders with a building scaffold, out of which a set of candidate faces is defined. The selection of faces from the candidate set to form the simplified mesh is achieved through a linear binary programming formulation, in which certain hard constraints are enforced to ensure that the result is manifold and watertight.

Structure

This repository is structured as follows:

Build

MeshPolygonization depends on CGAL. Please make sure CGAL exists on your machine before you build the program. During the development of MeshPolygonization, CGAL v4.13 was used, and later CGAL v5.1 has also been tested. Newer versions should also work.

To build MeshPolygonization, you need CMake (>= 3.1) and of course a compiler that supports C++11 (or higher).

MeshPolygonization has been tested on macOS (Xcode >= 8), Windows (MSVC >=2015), and Linux (GCC >= 4.8, Clang >= 3.3). Machines nowadays typically provide higher supports, so you should be able to build MeshPolygonization on almost all platforms.

There are many options to build MeshPolygonization. Choose one of the following (or whatever you are familiar with):

Don't have any experience with C/C++ programming? Have a look at How to build MeshPolygonization step by step.

About the parameters

The distance & importance threshold are related to our segmentation technique which dissolves the input mesh into planar segments.

Apart from the distance threshold (the program already provides a suggested value), there are not really any recommendations on the importance value. Of course, it should be in the range (0, 100) - in other words, from 0% of the total mesh area up to 100%. To get an idea on how you can play around with these parameters and how the algorithm actually works, I urge you to first run some of the examples in the data directory where each one is provided with some tested parameters.

For more theoretical details, please refer to the original paper.

About the solvers

Two solvers, namely Gurobi and SCIP (with source code), are provided in this implementation. The Gurobi solver is more efficient and reliable and should always be your first choice. To use Gurobi, you need to install it and also obtain a license (free for academic use) from here. You may also need to modify the path(s) to Gurobi in FindGUROBI.cmake, for CMake to find Gurobi. In case you want an open source solver, please try SCIP, which is slower than Gurobi but acceptable.

LICENSE

MeshPolygonization is free for academic use. If you are interested in a commercial license please contact the 3D Geoinformation group.

Copyright (C) 2019 3D Geoinformation Research Group https://3d.bk.tudelft.nl/