This repository is designed to segment a fresco fragment into meaningful surfaces, including the painted (intact) surface, the opposite surface, and the "sidewalls" surfaces.
This project employs a region-growing algorithm based on the curvedness values of the vertices of the mesh, leveraging differential geometry principles. The algorithm processes a 3D mesh or point cloud of a fresco fragment to identify and segment these distinct surfaces.
This project was developed on a Windows machine using CMake and Visual Studio compiler. The project heavily dependent on libigl library.
- Please clone the project
git clone https://github.com/RePAIRProject/segment_3Dfragment.git
cd segment_3Dfragment
- Compile and build using cmake
mkdir build
cd build
cmake ..
cmake --build . # or 'make' if you're using Makefiles as the generator
sudo cmake --install . # Use sudo if you need superuser permissions to install
To run the segmentation algorithm to extract the intact surface, use the following command:
./segment_3Dfragment --input-File <PATH>
Where --input-File
specifies the path to the OBJ file of the fragment to be segemented.
The output file would be save in the same directory of the inputted file, using its name and the postfix intact.
Other optional parameters are the following:
--script
: and then specifyopposite-surface
orsidewalls-surface
--disable-save
: if used, then the segmented mesh won't be outputted, and in particular, a new obj file would not be saved.--enable-debug
: if used, a visualization of the fragemnts and the segmentation process would popped out to the screen. Press 1 for detecting the results of the region-growing process, press 2 for the outputted segment (the only one with color, the rest would be white), and press 3 for viewing the sufficiently large enough segments.--intact-Normal-Std-Thershold
: Choose this value in the range (0,0.3) (you can exceed 0.3 in extreme cases). It indicates the maximum std of the normals of the desired surface. Higher value means that the surface is accepped as less smooth.--intact-Similarity-Fracture
: Choose this value roughly in the range (0.4,0.85). Lower values would lead to faster spread of a segment in the region growing process.
Bug descriptions.
Some publications.