# Automatic Point-Cloud Registration for Quality Control in Building Works
## 2 Materials and Methods
### Method
#### 2.2.3 Alignment
The identification of corresponding points allows the computation of the transformation between point clouds to the same coordinate reference system. In addition, the description of each point allows its classification into the different primitives such as edges, corners or planes. The invariance to rotation, scale, variations in luminosity and presence of noise is the reason for the selection of the couple Harris 3D-PFH for the study of indoor building scenes. This results in the efficient detection of points of interest in corners and borders and the assignment of correspondences between feature points of different point clouds. However, for those cases with repetitive elements such as pillars, some erroneous correspondences can appear. In order to minimize this effect, the methodology proposed includes a restriction of maximum distance between corresponding points. This restriction avoids the determination of erroneous points correspondences produced by the similarity between different zones. The filter that discriminates according to the distance between points is graphically explained in Figure 7a. Its performance is as follows: Corresponding points for each point of interest are searched within a distance threshold. This search, together with the initial results of the detector/descriptor combination, allows us to refine the registration between point clouds, thus improving the results. This step is reiterated until the root mean square error (RMSE) is below a threshold established according to the criteria for quality control in the works. The purpose of this study is to check and validate sections of the building based on variations and translations of the built elements. For the first case, the tolerances allowed are \(\pm 10\) mm and for the second case \(\pm 24\) mm [26]. To ensure that all the data meet these tolerances, the quality threshold is set to 5 mm. Once the Harris 3D detector and PFH descriptor have been computed and a first coarse alignment based on features has been applied to all the point clouds, some of them are correctly aligned, but some others are not. This is due to the similarity between scans, which can cause imperfections in the final alignment. However, the point clouds are approximated to their real positions and the generation of one unique 3D point cloud formed by all the point clouds can be completed with the final adjustment of the registration, which eliminates the errors. The final adjustment is performed using the ICP algorithm [58]. ICP consists of an iterative process in which the distance error between point clouds is minimized until the point clouds are perfectly aligned. Each iteration consists of three steps: (i) finding pairs of corresponding points; (ii) estimation of the transformation that minimizes the distance between corresponding points; (iii) application of the transformation to the point clouds. Since ICP is an iterative algorithm, it is mandatory to have a good initial transformation to make its convergence possible [59]. This initial estimation comes from the coarse alignment, which already makes a good estimation of the point clouds positions. It should be highlighted that the registration method based on the compatibility between normal vectors (Figure 7b) is not applicable in these scenarios, due to the presence of repetitive structures with similar characteristics (squared pillars, vertical walls, doors, among others) that resulted in similar descriptions based on the normal vector in spite of their difference. This invalidity of the normal vector method was analysed through its application to the cases of study and shown through the lack of convergence regarding the ICP algorithm. The ICP algorithm can be applied in a point-to-point or in a point-to-plane mode. The first performs the adjustment between point clouds by minimizing the distance between one point in the point cloud of reference and its corresponding point in the point cloud to register.