# Automatic Point-Cloud Registration for Quality Control in Building Works
## 2 Materials and Methods
### Method
#### 2.2.3 Alignment  
Once the point clouds are pre-processed, their pre-alignment is performed based on detectors and descriptors. In the proposed methodology, the detector selected was Harris 3D [41; 42] in combination with the point feature histogram (PFH) descriptor. Finally, an ICP alignment was applied. The Harris 3D detector presents good results in construction scenarios, since its characteristics are optimal for the identification of points in pillars, vertical walls and ceilings, by its corners and edges. It is also fast and detects large sets of interest points with a good correspondence [55]. The Harris 3D detector allows for several variations depending on the evaluation of the trace and the determinant (det) of the covariance matrix (Cov) [41]. In all the variations, the response of the key points \(r(x,y,z)\) is estimated, but different criteria are applied in each case. The original Harris 3D detector is performed using Equation (1), while Harris 3D Lowe follows Equation (2) and the variant Harris 3D Noble (Figure 6) applies Equation (3), where the trace of the covariance matrix is not squared. \[r(x,y,z)=\det(Cov(x,y,z)-k(trace(Cov(x,y,z)))^{2} \tag{1}\]  
Figure 5: Passthrough filter based on the coordinate histograms. (**a**) Top view of raw scanned data with scatter. (**b**) Top view of scanned data after filter by \(X\)-coordinates histogram (**c**) Front view of raw scanned data with scatter. (**d**) Result after coordinates histogram filter. \[r(x,y,z) = \frac{\det(Cov(x,y,z))}{trace(Cov(x,y,z))^{2}} \tag{2}\] \[r(x,y,z) = \frac{\det(Cov(x,y,z))}{trace(Cov(x,y,z))} \tag{3}\]  
These changes among Harris 3D variants modify the evaluation of the relation between the determinant and the trace of the covariance matrix, which affects in the result of the point detection [42]. The Harris 3D method includes a constant \(k\) that depends on the point cloud data, while Harris 3D Lowe and Harris 3D Noble do not consider this factor, being independent of the input data [56]. This fact led to the selection of Harris 3D Noble as an optimal point detector in the methodology developed. Since the detector used (Harris 3D) focuses mainly on detecting corners and edges, and because the PFH descriptor is more robust against changes in the viewpoints and delivers reliable information between the point clouds [30; 41], the latter was chosen for this work, since it is common to have different points of view, illumination changes and good overlap between scans. The 3D PFH descriptor describes each point with its neighbours generalizing the normal vectors (\(n\)) and the mean curvature (\(\alpha\), \(\phi\), \(\theta\)), and representing these values in a histogram. The histogram will have a unique and invariant signature for each point. Providing two points, \(p\) and \(q\), a reference system can be created consisting of three unit vectors (\(u\), \(v\), \(w\)) [57]. Thus, the difference between normal vectors in points \(p\) (\(n_{p}\)) and  
Figure 6: Harris 3D Noble detector: performance mode. (\(n_{q}\)) is determined with three angular variables (Equations (4)-(6)) where \(d\) represents the distance between \(p\) and \(q\). \[\alpha=arc\cos(v\cdot n_{q}) \tag{4}\]  
\[\varnothing=arc\cos\left(u\cdot\frac{p-q}{d}\right) \tag{5}\]  
\[\theta=\ arc\tan\left(w\cdot n_{p},\ u\cdot n_{p}\right) \tag{6}\]  
Being:  
\(u\) the surface normal at \(p\)  
\(v=u\ \times\ \frac{p-q}{d}\)  
\(w=u\ \times\ v\)  
\(d=\ \left\|\ p-q\ \right\|_{2}\)  
The three angles are coded with distance, and together they form the final descriptor, with the concatenation of the histograms of the four variables. The 3D PFH descriptor is applied to all points identified as feature points with the Harris 3D Noble detector, in such way that each point is associated with a description, and the coincidence of descriptions is used for the determination of correspondences between points from different point clouds.