Down-Sampling of Point Clouds for the Technical Diagnostics of Buildings and Structures

: Terrestrial laser scanning (TLS) is a non-destructive testing method for the technical assessment of existing structures. TLS has been successfully harnessed for monitoring technical surface conditions and morphological characteristics of historical buildings (e.g., the detection of cracks and cavities). TLS measurements with very high resolution should be taken to detect minor defects on the walls of buildings. High-resolution measurements are mostly needed in certain areas of interest, e.g., cracks and cavities. Therefore, reducing redundant information on ﬂat areas without cracks and cavities is very important. In this case, automatic down-sampling of datasets according to the aforementioned criterion is required. This paper presents the use of the Optimum Dataset (OptD) method to optimize TLS dataset. A Leica ScanStation C10 time-of-ﬂight scanner and a Z+F IMAGER 5016 phase-shift scanner were used during the research. The research was conducted on a specially prepared concrete sample and real object, i.e., a brick citadel located on the Ko´sciuszko Mound in Cracow. The reduction of dataset by the OptD method and random method from TLS measurements were compared and discussed. The results prove that the large datasets from TLS diagnostic measurements of buildings and structures can be successfully optimized using the OptD method.


Introduction
Terrestrial laser scanning (TLS) is a remote sensing technique mainly used in geodesy and civil and structural engineering. TLS is successfully applied in numerous fields, e.g., survey geotechnical displacements [1][2][3][4], technical diagnostics of structures and buildings [5][6][7][8][9][10], roads and motorways [11,12], archaeological and cultural heritage sites [13][14][15], and many others. The product of TLS measurements is a 3D high-density point cloud. Additionally, TLS can register the intensity of the laser beam for each point simultaneously. It should also be noted that by classifying the point cloud by the intensity value one can detect surface wall discontinuities, e.g., defects and cracks [16,17], or saturation and moisture movement in buildings [18,19]. Most of the old buildings and structures in Central Europe are made of brick and mortar or concrete. Many of these buildings require technical inspection. Remote data acquisition without physical access to the building is of special interest in diagnostics of buildings and structures. TLS is a non-destructive testing (NDT) method for the health analysis of structures such as buildings, bridges, and other large and small structures [20][21][22]. A symptom of the poor condition of a building or other structure is usually the presence of cracks and cavities. The deterioration of the technical condition of historical buildings is caused by environmental factors, meteorological conditions, and atmospheric pollution [23]. The point clouds obtained from the

Motivation
In order to register cracks and cavities in the surface of buildings and structures, a very high-resolution scan should be utilized. Currently, the TLS technique allows measurements to be made with millimeter scan resolution. A high scan resolution provides more detailed data that allows the detection of small cracks and cavities. However, these datasets are very large and very difficult to process. In such cases, automatic down-sampling of point clouds is required. Different commercial software allows the reduction of datasets, usually in a random way or spatial way (minimum space between points), e.g., down-sampling point clouds using Leica Cyclone and Z+F Laser Control software [34]. However, this results in the loss of important data, such as points on cracks and cavities. The best solution is to reduce the dataset on the flat areas (which lack cavities and cracks) and leave the data in the recesses. It should also be noted that there are software packages, such as Autodesk and Geomagic Suite, which consider the analysis of physical surface characteristics in down-sampling. The software uses a curvature method to reduce the point clouds. In this work, the OptD reduction method is used. This method was developed to reduce datasets from the Light Detection and Ranging (LIDAR) measurement for building Digital Terrain Models (DTMs) [35]. The goal of the current study is to carry out tests and check the suitability of the OptD method in the reduction of dataset from the scanning of building objects. In the authors' opinion, harnessing the OptD method for the reduction of datasets from diagnostic measurements of building objects using TLS can be a good solution.

Optimization of Large Datasets Based on Using OptD Single Method
The OptD method is a reduction method that is fully automated and gives an optimal result due to the optimization criteria. The OptD method can be conducted in two ways: Option 1: OptD method with single-objective optimization (OptD-single) [35]; Option 2: OptD method with multi-objective optimization (OptD-multi) [36]. These methods differ in the number of optimization criteria and the time needed to perform the reduction. Furthermore, several solutions can be obtained in the OptD-multi method. In this paper, we decided to use the OptD-single option. The number of points in datasets was important during processing, and therefore one criterion in the form of percentage points was used. The steps and scheme of this method were presented in detail in [36]. In that paper, the OptD-single method was tested on data from Airborne Laser Scanning (ALS). The results showed that, with the OptD-single method, the preparation of the data for DTM construction is less time-consuming. The time required for the implementation of the OptD method can be considered as negligible in the whole process of preparing the data for the DTM construction. For a file size of 682,344 KB (about 20 million points), the OptD method lasted for about 72 s (for 50% reduction) and 105 s (for 90% reduction) [37]. It allows for effective DTM generation and reducing the time and cost of LIDAR point cloud processing, which in turn enables the conduction of efficient analyses of acquired information resource.
The OptD method was developed in such a way that it takes into account different levels of reduction in the individual parts of the processing area. As a result, there are more points in detailed parts of the scanned object. In the case of uncomplicated structures or areas, the number of points is much smaller. Only those points that are significant will remain. A very important advantage of the method is the fact that during the processing the user has total control over the number of points in the dataset. Such advantages of the method can be very useful during the technical inspection of buildings, especially during the detection of defects and cracks.
The OptD method is a reduction method, which means that the real measurement points will remain in the dataset. This is important, since in the case of reducing the size of the dataset by the generation method, in the resulting dataset one obtains interpolated coordinates [38,39].
The OptD method uses linear object generalization methods, however the calculations are performed in a vertical plane, which allows the elevation component to be accurately controlled. The generalization approach used in the OptD method are the Douglas-Peucker [40], Visvalingam-Whyatt [41], and Opheim [42] methods.
During the operation of the method, the following parameters are selected: width of the measuring strip and tolerance used in the generalization method. The values of these parameters are calculated without user intervention and changed in the iterative process in such a way that the optimization criterion is met.
The assumption of using the OptD-single method was that reducing the dataset would not disturb the nature of the object, and, in particular, leaves more points in the cracks, crevices, and cavities. To this point, a methodology for the down-sampling of TLS data taking into account the OptD-single method was developed. The simplified diagram of the OptD-single methods is presented in Figure 1. The OptD-single procedure has been used in original software, and proceeds in the following stages: step 1: Input TLS data with cracks, crevices, and cavities. step 2: Determination of the optimization criterion (f), here: percentage of points in dataset after reduction. This is the only step that requires input from the user.  The OptD-single procedure has been used in original software, and proceeds in the following stages: step 1: Input TLS data with cracks, crevices, and cavities. step 2: Determination of the optimization criterion (f), here: percentage of points in dataset after reduction. This is the only step that requires input from the user. step 3: Determination of the initial width of the measuring strip (L). The measuring strips are the narrow parts of the point cloud on the wall of building. The number of points that will be included in one strip depends on the width of the strip and scan density. Parameter L does not depend on the user, but rather, on optimization criterion. Successive values of the measuring strip are determined in the iterative process and are changed with a fixed interval. The division of the area covered by points into measurement strips (nL) in X0Y horizontal plane (in the wall coordinate system). in the iterative process and are changed with a fixed interval. The division of the area covered by points into measurement strips (nL) in X0Y horizontal plane (in the wall coordinate system).
step 4: Selection of points for each measuring strip. step 5: Selection of the cartographic generalization method, here: Douglas-Peucker (D-P) method.
The scheme of the D-P method is presented in Figure 2. The result of the reduction in the example strip is presented in Figure 3. This is only a general example to show the algorithm operation. If so, the reduction process is completed, and the obtained dataset from step 7 is optimal. If not, steps step 6: Determination of the distance of tolerance range value (t) in the D-P method. The t value is determined in the iterative process and increases or decreases at every fixed interval. step 7: Application of the selected method of generalization in the Y0Z vertical plane. Each measuring strip is processed separately. Points in the measuring strip are projected onto the Y0Z plane. In this way, a 2D image of the points is obtained and the line generalization method is possible. The result of the reduction in the example strip is presented in Figure 3. This is only a general example to show the algorithm operation. in the iterative process and are changed with a fixed interval. The division of the area covered by points into measurement strips (nL) in X0Y horizontal plane (in the wall coordinate system).
step 4: Selection of points for each measuring strip. step 5: Selection of the cartographic generalization method, here: Douglas-Peucker (D-P) method.
The scheme of the D-P method is presented in Figure 2. The result of the reduction in the example strip is presented in Figure 3. This is only a general example to show the algorithm operation. If so, the reduction process is completed, and the obtained dataset from step 7 is optimal. If not, steps step 8: Verification, whether obtained in the step 7 dataset, fits the specified criterion optimization. If so, the reduction process is completed, and the obtained dataset from step 7 is optimal. If not, Geosciences 2019, 9, 70 6 of 14 steps 6-8 are repeated, wherein in step 6 the value of tolerance parameter is changed. If repeating steps 6-8 does not give a solution, go back to step 3 and change the width of the measuring strip. step 9: Output the obtained result as an optimal dataset. The algorithms of the OptD-single method were implemented in the Java programming language (v.9). The application was tested with both Oracle and OpenJDK runtime environment.

Equipment
In this investigation, two types of terrestrial laser scanner system with different specifications were used. The first was a Leica ScanStation C10. This scanner is based on the time of flight principle, and its laser source emits visible impulses at a wavelength of 532 nm. The maximum instantaneous scan rate is up to 50,000 points per second. The laser spot size is equal to 4.5 mm for FWHH-based model (Full Width at Half Height) and 7 mm for Gaussian-based model for the range 0-50 m. The maximum measuring range is 300 m at 90% albedo and 134 m at 18% albedo, respectively. The second scanner used in this study was a Z+F IMAGER 5016. This scanner uses the phase-shift technique to achieve distance measurement. The maximum measurement range is 365 m. The maximum scan rate is up to 1.1 million points per second. The laser spot size is equal to 3.5 mm for Gaussian-based model and the laser beam divergence is equal to 0.3 mrad.

Data Acquisition
The research program covered experiments on two different samples. The first experiment was to scan a specially prepared concrete specimen with a crack (Figure 4). The crack width was approximately 5 mm. The measurement was made with the Leica ScanStation C10 impulse scanner from a distance of 10 m. During the research, the maximum scanning resolution was set. The second phase of the research program consisted of measurements of a real object-the Kościuszko Mound in Cracow, Poland. The location of the monument is the natural Blessed Bronisława Hill. A brick citadel around the Mound was built between 1850 and 1854. Currently, some parts of the citadel are characterized by poor technical condition ( Figure 4). The Z+F IMAGER 5016 scanner was used for the second phase of the research. The measurement was made from a short distance of 7 m, and a super high resolution was set in the scanner. The algorithms of the OptD-single method were implemented in the Java programming language (v.9). The application was tested with both Oracle and OpenJDK runtime environment.

Equipment
In this investigation, two types of terrestrial laser scanner system with different specifications were used. The first was a Leica ScanStation C10. This scanner is based on the time of flight principle, and its laser source emits visible impulses at a wavelength of 532 nm. The maximum instantaneous scan rate is up to 50,000 points per second. The laser spot size is equal to 4.5 mm for FWHH-based model (Full Width at Half Height) and 7 mm for Gaussian-based model for the range 0-50 m. The maximum measuring range is 300 m at 90% albedo and 134 m at 18% albedo, respectively. The second scanner used in this study was a Z+F IMAGER 5016. This scanner uses the phase-shift technique to achieve distance measurement. The maximum measurement range is 365 m. The maximum scan rate is up to 1.1 million points per second. The laser spot size is equal to 3.5 mm for Gaussian-based model and the laser beam divergence is equal to 0.3 mrad.

Data Acquisition
The research program covered experiments on two different samples. The first experiment was to scan a specially prepared concrete specimen with a crack (Figure 4). The crack width was approximately 5 mm. The measurement was made with the Leica ScanStation C10 impulse scanner from a distance of 10 m. During the research, the maximum scanning resolution was set. The second phase of the research program consisted of measurements of a real object-the Kościuszko Mound in Cracow, Poland. The location of the monument is the natural Blessed Bronisława Hill. A brick citadel around the Mound was built between 1850 and 1854. Currently, some parts of the citadel are characterized by poor technical condition (Figure 4). The Z+F IMAGER 5016 scanner was used for the second phase of the research. The measurement was made from a short distance of 7 m, and a super high resolution was set in the scanner.

Data Processing
The Leica Cyclone and Z+F Laser Control software were used for the pre-processing of data. The optimization of the dataset was carried out in original program implemented in the Java (v.9) programming language. The CloudCompare software was used to visualize and present the reduced

Data Processing
The Leica Cyclone and Z+F Laser Control software were used for the pre-processing of data. The optimization of the dataset was carried out in original program implemented in the Java (v.9) programming language. The CloudCompare software was used to visualize and present the reduced dataset. The dataset from the TLS measurement of the concrete sample was processed in two ways.
In the first approach, the OptD method was applied. The optimization criterion was the percentage of points left in the resulting dataset. Each reduced dataset was called "i dataset", where i is the percentage of points that are left in the dataset after optimization. Ultimately, in addition to the original dataset, five reduced datasets were obtained (50%, 20%, 10%, 5%, and 2% datasets). In the second approach, the random way to reduce the dataset was applied. In the random way, the CloudCompare simply picks the specified number of points in a random manner [43]. Similarly, as in the case of the OptD method, a reduction was made to create five new datasets.
The purpose of analyzing TLS data from building diagnostic measurements is to identify defective parts in the building wall. For the automatic detection of defects on flat surfaces, the Mean Sum Error (MSE) method can be used [32]. The MSE method uses the distance of each point (d i ) from the reference plane (π) as the criterion to identify the cavities and cracks. In order to find an aforementioned optimal reference plane, the regression of three variables is used. Next, a predetermined tolerance value (ε) needs to be manually assigned for the research area. The tolerance value mainly depends on the tested object (object properties) and the used TLS (the scanner mechanism). Ultimately, the detection of defects on the flat surfaces is carried out by comparing the determined distance of each point with the tolerance value (d i > ε).
In this research, the reference plane was determined based on the original dataset, i.e., the point cloud of the research area. The tolerance value ε for the concrete sample was taken as 5 mm. The data processing was performed separately for each dataset. The locations of cracks were determined by analyzing the distance (d i > 5 mm). The results of the analysis for the OptD method and random method are presented in Figures 5 and 6, respectively. The red colour indicates a separate dataset on the crack. The quantitative comparisons between the original and reduced point clouds are presented in Tables 1 and 2. dataset. The dataset from the TLS measurement of the concrete sample was processed in two ways.
In the first approach, the OptD method was applied. The optimization criterion was the percentage of points left in the resulting dataset. Each reduced dataset was called "i dataset", where i is the percentage of points that are left in the dataset after optimization. Ultimately, in addition to the original dataset, five reduced datasets were obtained (50%, 20%, 10%, 5%, and 2% datasets). In the second approach, the random way to reduce the dataset was applied. In the random way, the CloudCompare simply picks the specified number of points in a random manner [43]. Similarly, as in the case of the OptD method, a reduction was made to create five new datasets. The purpose of analyzing TLS data from building diagnostic measurements is to identify defective parts in the building wall. For the automatic detection of defects on flat surfaces, the Mean Sum Error (MSE) method can be used [32]. The MSE method uses the distance of each point (di) from the reference plane (π) as the criterion to identify the cavities and cracks. In order to find an aforementioned optimal reference plane, the regression of three variables is used. Next, a predetermined tolerance value (ε) needs to be manually assigned for the research area. The tolerance value mainly depends on the tested object (object properties) and the used TLS (the scanner mechanism). Ultimately, the detection of defects on the flat surfaces is carried out by comparing the determined distance of each point with the tolerance value (di > ε).
In this research, the reference plane was determined based on the original dataset, i.e., the point cloud of the research area. The tolerance value ε for the concrete sample was taken as 5 mm. The data processing was performed separately for each dataset. The locations of cracks were determined by analyzing the distance (di > 5 mm). The results of the analysis for the OptD method and random method are presented in Figures 5 and 6, respectively. The red colour indicates a separate dataset on the crack. The quantitative comparisons between the original and reduced point clouds are presented in Tables 1 and 2.   The analyses of all datasets from the TLS measurement of the brick wall were carried out in the same way as for the concrete sample. The tolerance value ε for the brick wall was taken as 15 mm.   Table 2. Results of processing with the random method-concrete sample. The analyses of all datasets from the TLS measurement of the brick wall were carried out in the same way as for the concrete sample. The tolerance value ε for the brick wall was taken as 15 mm. The tolerance value ε increased in this case, as the brick wall fits the flat surface worse than a concrete element. Figures 7 and 8  The tolerance value ε increased in this case, as the brick wall fits the flat surface worse than a concrete element. Figures 7 and 8 present images of the distribution of points for the OptD method and the random method, respectively. The red colour indicates a separate dataset on the damage area. Additionally, Tables 3 and 4

Results and Discussion
Usually, when the number of points in a dataset decreases evenly, then the details achieved from the data are significantly reduced. Thus, excessively low resolution of the point cloud does not allow the correct identification of wall damages (cavities and cracks). Such a situation can be seen in the reduction of data by the random method.
As shown in Figure 5, e.g., 10% regarding concrete sample reduction of the dataset by the OptD method, a significantly greater number of points are left in the recesses. In the case of reduction of the dataset by the random method, the dataset lost too many points in the crack to provide reliable interpretation of data ( Figure 6). By visually evaluating the 10% dataset, it can be concluded that a reliable interpretation of the crack is possible. By comparing the results of two different reduced 10% dataset (Tables 1 and 2), one can see the number of points on the crack. The OptD method preserved 1115 points, while the random method only preserved 212 points, i.e., approximately five times more points on the crack. For the 10% dataset (Table 1), only around 50% of the points on the crack were reduced. Therefore, the OptD method provides significant benefits for this case.
Similar to the previous example, the 10% reduced dataset on the brick wall was analyzed. By making a visual evaluation of this dataset (Figures 6 and 7), it can be concluded that the OptD method left more points on the defects of wall than the random method. The obtained results, shown in Tables 3 and 4, show the number of points that were left on the wall defects for the OptD method and random method, respectively. The OptD method preserved 7091 points, while the random method only preserved 1257 points. This is approximately five times more points on the wall defects. The difference for the 20% dataset is about three times more, and for the 5% dataset is about 10 times more. In the authors' opinion, the 2% dataset was excessively reduced.
The overarching goal of the conducted research was to indicate the usefulness of the OptD method for the reduction of large datasets from TLS measurements of the technical condition of buildings and structures. The conducted research proved the benefits of using the OptD method to reduce point clouds. In the analyzed examples, the number of points on the defects for the OptD method is always significant greater than for the random method (see Figure 9). By comparing the values of the OptD method (blue line) and the values of the random method (red line), one can see the differences in the number of points related to the cracks and cavities for each reduced dataset. buildings and structures. The conducted research proved the benefits of using the OptD method to reduce point clouds. In the analyzed examples, the number of points on the defects for the OptD method is always significant greater than for the random method (see Figure 9). By comparing the values of the OptD method (blue line) and the values of the random method (red line), one can see the differences in the number of points related to the cracks and cavities for each reduced dataset. Using the OptD method to reduce the dataset allows much better diagnostics of buildings and structures compared to the random method. It should be noted that the various software for processing point clouds do not have such an approach to reduce the datasets. Some software exists with reduction strategies based on different criteria, such as a curvature method, random method, space method, octree method (see software such as Leica Cyclone, CloudCompare, Z+F Laser Control, Geomagic Suite). The OptD method is fully automatic; the user only needs to specify the optimization criterion on the basis of point cloud resolution. Down-sampling of the OptD method allows different degrees of reduction declared by the user. The results show that more points remained where there were cracks and cavities, and less where there was a regular wall structure. Thanks to this, the process of automatic crack and defect detection can be improved. It should be noted that the effective crack detection on the building wall also depends on the type of scanner (PS or TOF) and its technical specifications, such as maximum scan resolution, laser spot size, laser beam divergence, and measurement noise. The measurement noise and so-called "edge effect" make data analysis difficult.

Conclusions
In this paper, the OptD method for the TLS point cloud down-sampling was proposed in the context of detecting defects in a building wall. Based on the conducted research, the following conclusions can be drawn: • The results prove that the proposed OptD method is appropriate for reducing the TLS dataset in the diagnostics of buildings and structures; • The down-sampling of the point clouds from the wall measurement using the OptD method allows more points to be left in the detailed part of the scanned object (crack or cavity) than in uncomplicated structures or areas (even surface); • The OptD method allows total control over the number of points in the dataset after reduction; • The disadvantage of the proposed OptD method is that it leaves a large number of points at the border research area. Authors have been working to implement the OptD method in practical applications by implementing an algorithm in point cloud data processing software. By reducing the dataset with the OptD method, points are generally left on wall defects. Keeping this fact in mind, in the future the Using the OptD method to reduce the dataset allows much better diagnostics of buildings and structures compared to the random method. It should be noted that the various software for processing point clouds do not have such an approach to reduce the datasets. Some software exists with reduction strategies based on different criteria, such as a curvature method, random method, space method, octree method (see software such as Leica Cyclone, CloudCompare, Z+F Laser Control, Geomagic Suite). The OptD method is fully automatic; the user only needs to specify the optimization criterion on the basis of point cloud resolution. Down-sampling of the OptD method allows different degrees of reduction declared by the user. The results show that more points remained where there were cracks and cavities, and less where there was a regular wall structure. Thanks to this, the process of automatic crack and defect detection can be improved. It should be noted that the effective crack detection on the building wall also depends on the type of scanner (PS or TOF) and its technical specifications, such as maximum scan resolution, laser spot size, laser beam divergence, and measurement noise. The measurement noise and so-called "edge effect" make data analysis difficult.

Conclusions
In this paper, the OptD method for the TLS point cloud down-sampling was proposed in the context of detecting defects in a building wall. Based on the conducted research, the following conclusions can be drawn:

•
The results prove that the proposed OptD method is appropriate for reducing the TLS dataset in the diagnostics of buildings and structures; • The down-sampling of the point clouds from the wall measurement using the OptD method allows more points to be left in the detailed part of the scanned object (crack or cavity) than in uncomplicated structures or areas (even surface); • The OptD method allows total control over the number of points in the dataset after reduction; • The disadvantage of the proposed OptD method is that it leaves a large number of points at the border research area.