# Indoor Building Reconstruction from Occluded Point Clouds Using Graph-Cut and Ray-Tracing
## 3 Indoor Reconstruction Methodology
### Point Cloud Consolidation  
Raw indoor MLS point clouds often contain noise, and outliers especially near the openings (e.g., opened doors) and transparent regions (e.g., windows). This is mainly due to the fact that the laser scanner beam can pass through such regions causing sparse 3D points. In addition, MLS data presents generally much more noise than traditional static Terrestrial Laser Scanning (TLS) data that may arise in the wrong segmentation of the point cloud causing the generation of artifacts. To reduce the interference of subsequent planar primitive extraction the point cloud is first preprocessed with consolidated trough noise smoothing and outlier removal. The noise smoothing is carried out by a statistical analysis of the point cloud. Since the raw data may contain outliers due to random measurement errors, for each point \(\mathrm{p_{i}}\) the average distance (\(d_{i}\)) to its nearest k neighbors is computed. Assuming that the result of average distances has a Gauss distribution, points falling outside a confidence interval \([\mu_{di}-2\delta_{di},\,\mu_{di}+2\delta_{di}]\) are discarded. Parameters \(\mu_{di}\) and \(\delta_{di}\), represent the mean value and the standard deviation of the distances, respectively. A second removal filter is applied to remove isolated points. This filter uses both mathematical morphological opening operations and connected component analysis. In particular, stating from the point cloud, a volumetric voxel representation is created with a grid resolution \(V_{R}\). Then, the occupancy of each voxel is evaluated. In particular, a binary representation of the space is provided:  
\[B(x,y)=\left\{\begin{array}{ll}0,\;n_{c}=0\\ 1,\;n_{c}>0\end{array}\right. \tag{1}\]  
where \(n_{c}\) is the number of points in each voxel. Morphological opening operations are then employed to filter out isolated points. Indeed, a connected component analysis is used to detect the connected component in the voxel space. Making again the assumption that the size of the different connected component features a Gaussian distribution, the components whose size falls outside the interval \([\mu_{Si}-2\delta_{di},\,\mu_{Si}+2\delta_{Si}]\) are filtered out as isolated elements, while points belonging to those voxels are discarded. Parameters \(\mu_{Si}\) and \(\delta_{Si}\), represent the mean value and the standard deviation of the size of connected components, respectively. This voxel space is also used for the ray-tracing algorithm (see also Section 2).  
Finally, starting from the point cloud after preliminary filtering, the local normal is estimated for each point. This task is operated by using the method proposed in [32]. For each point a plan is locally fitted considering a certain number of neighboring points, the number of considered points is iteratively increased until the estimated normal and the eigenvalues of the weighted covariance matrix \(C\left(N_{k}\left(p\right)\right)\) reach stabilization:  
\[C(N_{k}(p))=\sum_{j\in N_{k}\left(p\right)}\left(p_{j}-\mu_{k}\right)\left(p_ {j}-\mu_{k}\right)^{T}\phi\left(\|p_{j}-p\|/h_{k}\right) \tag{2}\]  
where \(\mu_{k}\) is the weighted average of all points in \(N_{k}\left(p\right)\), \(h_{k}\) is the radius of the smallest sphere containing \(N_{k}\left(p\right)\) centered at \(p\), and \(\phi\) is a positive monotonously decreasing weighting function.