The following code has been developed, starting from the scikit-learn libraries, in order to supervisly classify 3D point clouds.
Grilli, E., Farella, E. M., Torresani, A., and Remondino, F.: GEOMETRIC FEATURES ANALYSIS FOR THE CLASSIFICATION OF CULTURAL HERITAGE POINT CLOUDS, Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci., XLII-2/W15, 541–548, https://doi.org/10.5194/isprs-archives-XLII-2-W15-541-2019, 2019.
Grilli, E.; Remondino, F. Machine Learning Generalisation across Different 3D Architectural Heritage. ISPRS Int. J. Geo-Inf. 2020, 9, 379. https://doi.org/10.3390/ijgi9060379
Python3 and Scikit-learn
For example, considering the following distribution of the point cloud columns
Line_1: 6 7 8
Line_2: 9
All the files have to be save in .txt format, and without header (Training, Evaluation and Test set)
After you have prepared the aforementioned files, collect them in a folder together with the train.py and classify.py files.
At a command prompt run:
$ python train.py feature_path training_path evaluation_path n_core file_to_save_name
This should result in the creation of:
To extend the classification to the test dataset at a command prompt run:
$ python classify.py feature_path classifier_path test_path file_to_save_name
This should result in the creation of your test file classified (the predicted classes are saved as the last column after the features)
If you want to rapidly test our classification code on a heritage case study you can download the four aforementioned datasets from this Google Drive folder
Referring to the following article:
Grilli, E.; Remondino, F. Machine Learning Generalisation across Different 3D Architectural Heritage. ISPRS Int. J. Geo-Inf. 2020, 9, 379. https://doi.org/10.3390/ijgi9060379
you can find and try our pre-trained models for architectural classification at this Google Drive folder
If you decide to try our code or trained models we would be pleased if you cite us:
Grilli, E.; Remondino, F. Machine Learning Generalisation across Different 3D Architectural Heritage. ISPRS Int. J. Geo-Inf. 2020, 9, 379.