## 4 The M_HERACLES Toolbox
### Step 2 (1): Automatic Segmentation and Classification of Structural Supports
#### 4.2.1 Rationale and Algorithm Description  
Pillars or structural supports in a historical setting are often interesting architectural elements, since they showcase both the engineering know-how and the architectural taste of the builders It is with this reason in mind that the first function was developed to segment structural supports automatically. Additionally, simple geometric rules were implemented in order to be able to identify a column from other types of structural supports. Indeed, this kind of development has been addressed before in the scope of simple pillars, often in an industrial setting [45; 68]. In the field of heritage, pillars or supports can be very variable depending on the architectural style and geographical situation, hence making this operation more difficult. Some authors solved this problem by creating a dedicated library of parametric objects [12], while the most common solution remains a manual segmentation [33].  
In this paper, geometric characteristics (also called hard-coded knowledge, as exemplified in [25]) were used to help identify the class of the segmented point cloud cluster. In particular, the circular cross-section characteristic of most columns will be used as the main rule in determining if a segmented point cloud is column or not. This approach has been used in several other research works, for example [44], for the creation of as-built BIM elements or [45] for engineering purposes. The authors in [68] also developed a similar approach to the one presented in this paper, albeit implemented for modern columns and without semantic labeling.  
The proposed method was described in detail in a previous publication [67]. The main idea behind the implementation of the algorithm includes a preliminary segmentation of the building body from its attic part. This part was done automatically by comparing the surface area of horizontal cross-sections of the building; a significant shift in the cross-section's bounding box's surface means that the limit between the body and the attic has been attained.  
In the main Algorithm 2, the input of the algorithm is the building's body as previously segmented, whether automatically or manually. The function then operates the following steps:  
* The function first creates slices of horizontal cross-sections of this point cloud, whereas the middle slice was taken. In this regard, the 3D problem was reduced to a 2D problem; a similar approach was undertaken in [44].
* A Euclidean-distance based region growing is performed on this middle slice, thereby creating \"islands\" of candidate pillars.
* A point cloud filtering is performed using the convex hull area criterion to distinguish the \"islands\" into potential pillars, walls, or noise.
* From the list of potential pillars, a further division was made between \"columns\" and \"non-columns\", depending on the circularity of its cross-section. A circular cross-section was classified as potential columns, while the rest are identified as non-columns.
* A \"cookie-cutter\"-like method similar to the one explained in Section 4.1 is then implemented using the cross-section of each candidate pillar to segment the 3D point cloud. All points located within the buffer area are considered as part of the entity.
* In the aftermath of the cookie-cutter segmentation, some horizontally planar elements such as floors and/or clings might still linger in the cluster; a RANSAC plane fitting function was therefore implemented to identify these horizontal planes and suppress them.
* A final distance-based region growing was performed to eliminate any remaining noise. Thus, the output of the function is a structure of point cloud clusters, labeled as columns or non-columns.