1 Introduction

The stability of rock masses is a key aspect to consider in safe design of engineering construction. Rock masses exhibit clear anisotropy and discontinuities, resulting in significantly different mechanical and strength characteristics compared to other materials [1]. These distinctive properties typically arise due to the pre-existence of a discontinuous system with significantly lower strength compared to the rock mass [2]. Therefore, when the rock mass is deformed or destroyed, it mainly cracks or fails along its discontinuities [3]. The study of rock mass discontinuity can thus be deduced a key part of engineering geological analysis and the key to engineering success.

Most traditional methods for obtaining geometric information about discontinuities use tools such as compass and tape measure [4, 5]. However, these tools are typically inaccurate and inefficient. It is also a challenge to collect information in complex terrain, on high and steep slopes, and where there are precarious rock masses. This affects the accuracy and reliability of engineering geological studies. An alternative method, three-dimensional (3D) laser scanning technology, which is based on laser ranging technology, can rapidly and automatically acquire the 3D data of a target surface, including the spatial coordinate information and color information, in real time [6]. Due to its advantages in data acquisition, 3D laser scanning technology has been widely used in rock engineering [7,8,20] and UAV photogrammetry [21, 22]. The manual method refers to the manual selection of three points lying on a single discontinuity in a 3D display scene [23, 24]. In recent years, numerous semi-automatic methods based on feature segmentation have also been proposed to obtain quantitative measurements of rock discontinuities [12, 25, 26]. These include the k-means method [19] and the k-nearest neighbor method [27], which can segment feature sets using the point cloud clustering algorithm. Planar fitting algorithms, such as random sample consistency [19], can fit feature sets to planes. Kernel density estimation [27], a statistical analysis algorithm, and principal component analysis [27], a planar generation algorithm, can also segment feature sets. These methods are efficient and accurate; however, several problems persist [28, 29]. For example, a geometric threshold significantly influences the extraction results, and the manual selection process is required to recognize discontinuous sets.

The basic idea of the region-growing (RG) algorithm is to combine points with similar characteristics. RG begins with a point and gradually adds the neighbors based on a certain rule until the preset conditions are satisfied. The Xu et al. combined the Hough transform with the RG algorithm to recognize planes in multi-scale point clouds [35]; each node represents an element. Because each element is in an octree structure, it is possible to rapidly locate each element with minimal complexity. In this study, an octree is used to search the neighbors of a point to create a set of neighboring points. The normal vector of a point can be estimated by analyzing the normal vectors of the neighbor set. The normal vector of a point is defined as the normal vector of the plane best filling the neighbor set, as shown in Fig. 3d.

Fig. 3
figure 3

ac Space decomposition of octree and d calculation of point cloud normal (the orange point is the calculation point, and the blue points are the neighbors of the calculation point)

2.3 Discontinuity extraction

The concept of the region-growing algorithm (RG) is to combine points with similar characteristics. Specifically, RG starts from seed point 1, whose attribute value is 10 (Fig. 4). The attribute value indicates the RG metrics, such as strength, grayscale, texture, and color. The RG “grows” in the direction of points whose attribute values are similar to those of the last point. In the figure, the attribute value of point 5 is 11, which is similar to the attribute value of point 1. Therefore, the first RG direction is 1–5.

Fig. 4
figure 4

Schematic of RG algorithm: a Label of points b attribute value of points and c RG direction

In past methods that employed on RG method, the normal vectors of points on the same plane had to be approximated. We have developed an improved RG algorithm to extract discontinuities that improves this approximation. Our method involves a criteria for region growth: the difference between the normal vectors of the point and its neighbors. The neighboring points are included in the current seed point set if this difference is below a specified threshold. A plane can be determined once there are three points in the set. This replaces traditional growth criteria, such as strength, grayscale, texture, or color. The steps of the algorithm are summarized as follows:

  1. 1)

    A point, randomly selected from the point clouds, is elected as the seed point, p. Then, point p is added to the discontinuity feature point set, \(Q\).

  2. 2)

    The properties of neighboring points of point p, denoted as n, are examined with characteristics of the discontinuity to determine whether these neighbors are also feature points of the some discontinuity. All feature points are added to \(Q,\) as shown in Fig. 5. The maximum RG angle, \(\theta\) , is defined. The difference in the normal vectors of the discontinuity between point p and its neighbors is evaluated to determine whether the difference is less than the preset maximum RG angle, \(\theta\). Table 1 lists the pseudo-code for the improved RG algorithm. In Fig. 5, \(Q_b\) and \(Q_a\) are the planes before and after adding a neighbor set to \(Q\), respectively. As shown in Fig. 6, the normal vectors of the two planes, \(Q_b\) and \(Q_a\), are fitted, then the mean square errors (MSEs) of the two normal vectors are calculated. In our test cases, the MSEs are less than the default threshold value of 0.01:

    $$MSE = \frac{1}{S}\mathop \sum \nolimits_{s = 1}^{S} \left( {\vec{f} \cdot p_{s} - d} \right)^{2}$$
    (1)

where \(S\) represents the number of points in \(Q_a\); \( \overrightarrow{f}\) is the vector normal to \(Q_a\); \(p_s\) denotes the number of points in \(Q_{a} ; d = \vec{f} \cdot m\); and m is the center of mass of \(Q_a\).

Fig. 5
figure 5

Algorithm for detecting whether neighbor of point p is a feature point of discontinuity

Table 1 Pseudo-code for improved RG algorithm
Fig. 6
figure 6

Normal vectors of \(Q\) before (\(Q_{b}\)) and after (\(Q_{a}\)) neighbor addition

  1. 3)

    The feature point set, \(Q\), is deleted from the point clouds. A point is randomly selected from the remaining point clouds as the seed point, and steps (1) and (2) are repeated until no point in the point clouds.

  2. 4)

    The minimum and maximum numbers of points on a discontinuity are \(N_{{min}}\) and \(N_{{max}}\), respectively; they are set based on actual situations.

  3. 5)

    Plane fitting is performed for each feature point set; the fitted planes are considered the final discontinuities.

2.4 Calculation of discontinuity orientation

The orientation of a discontinuity (Fig. 7) can be described by its strike, dip, and dip direction. This orientation can be determined after acquiring the normal vector to the discontinuity based on the plane equation.

Fig. 7
figure 7

Orientation of discontinuity

When a set of points representing one discontinuity is combined into one point cloud, the plane fitting that point cloud can be calculated according to the ordinary least squares method. Equation (2) is the normal to the best fit plane. The dips and dip directions of discontinuities can be obtained by Eqs. (35):

$$\begin{array}{c}N = \left({N}_{x}, {N}_{y}, {N}_{z}\right)\end{array}$$
(2)
$$\beta = \cos ^{{ - 1}} \left( {\left| {N_{z} } \right|} \right)$$
(3)

If \({N}_{x}\ge 0\),

$$\alpha = \cos^{ - 1} \frac{{N_{y} }}{{\sqrt {N_{y}^{2} + N_{z}^{2} } }}$$
(4)

If \({N}_{x}< 0\),

$$\alpha = 2\pi - \cos^{ - 1} \frac{{ - N_{y} }}{{\sqrt {N_{y}^{2} + N_{z}^{2} } }}$$
(5)

where α represents the dip direction of the discontinuity, and β denotes the dip of the discontinuity.

3 Case study

Geocloud v1.0 is a software platform used for the geological cataloging of rock slopes. The software was developed on the structure of CloudCompare (https://www.cloudcompare.org), which is a common point cloud processing software. Based on the algorithm described in Sect. 2, a plug-in named FacetDetect (FD) was developed for Geocloud v1.0 to semi-automatically recognize slope surface discontinuities (Fig. 8). It is essential to set some parameters before FD can recognize the discontinuity, as demonstrated in Fig. 9. A sensitivity test of the proposed method is presented in Sect. 3. According to the results, discontinuities can be satisfactorily recognized using different parameters, indicating this is an appropriate partially automatic method.

Fig. 8
figure 8

Box point cloud in Geocloud v1.0

Fig. 9
figure 9

Parameter settings of FD

Three practical cases were used to prove the accuracy and efficiency of FD.

  1. 1)

    Case study A: two groups of point clouds of standard geometry were computer- generated, and FD was used to recognize these point clouds. The recognition results were then compared with the theoretical values.

  2. 2)

    Case study B: a natural slope was selected for discontinuity recognition based on its raw point clouds. The recognition results were compared and analyzed using a discontinuity set extractor (DSE) [27]. The operating efficiencies of the two methods were also compared on the same computer.

  3. 3)

    Case study C: In an actual case, a natural quarry with a point cloud consisting of tens of millions of points was chosen for the recognition of discontinuities. The recognition results were compared and analyzed using the manual method.

3.1 Case study A

A standard cube model and an icosahedron model were created by Meshlab V1.3.4.0, and their point cloud models were generated using CloudCompare V2.6.1. The number of neighbors was n = 15, and the maximum RG angle was \(\theta = 20^{{^\circ }}\). These were considered the initial parameters for discontinuity recognition based on the sensitivity study. Finally, FD was used to recognize the cube surface point clouds, and the recognition results were compared with the theoretical values.

3.1.1 Cube

A 1 m × 1 m × 1 m cube model was created, and its point cloud model, which contained 1 million points, was generated (Fig. 10a). Assuming that the positive Y, X, and Z axes represent north, east, and upward directions, respectively, the dip and the dip direction of its planes can be calculated. A FD calculation was used to recognize the six planes of the cube (Fig. 10b), and the results were compared with the pre-calculated orientations. Results show that the plane orientation measured using FD was similar to the preset orientation, with an error of 0°.

Fig. 10
figure 10

a Cube point clouds b cube plane recognition c icosahedral point clouds and d icosahedral plane recognition

3.1.2 Icosahedron

An icosahedron model with 2-m long sides was created. In this model, the plane orientation can be pre-calculated via a similar process to the previous example. The icosahedron point cloud model, which contained 1 million points, was created based on the model (Fig. 10c), and FD was used to recognize 20 planes of the icosahedron (Fig. 10d). The orientations result of six planes was selected and compared with the pre-calculations (Table 2). As listed in Table 2, the plane orientations measured using FD were similar to the preset orientations, with an average error of 0.541°.

Table 2 Comparison between recognition results of icosahedral orientation and theoretical values

3.1.3 Results of case study A

These results of these two experiments demonstrate that the accuracy of FD is high when dealing with a standard geometry point cloud model. The accuracy of FD was then tested on an actual slope.

3.2 Analysis of influencing factors

Certain parameters must be set to conduct a discontinuity recognition using FD. The number of neighbors (\(n\)) and maximum RG angle (\(\theta\)) affect the results. Hence, a real highway slope (Fig. 11a) was used as an example to analyze the influence of parameters \(n\) and (\(\theta\)) on the discontinuity recognition using point cloud data developed based on the Rockbench point cloud database [36] (Fig. 11b).

Fig. 11
figure 11

a Photograph of slope b slope point clouds and c result of slope discontinuity recognition

3.2.1 Number of neighbors

The impact of changing the number of neighbors (\(n\)) on discontinuity recognition was explored in a set of case examples. In the case of maximum RG angle, \(\theta = 20^{^\circ }\), \(n\) was set to 5, 10, 15, 20, 25, and 30. The discontinuities under these six conditions were recognized (Fig. 12). In that figure, discontinuities with similar orientations were represented by the same color. The number of recognized discontinuities was found to be correlated with the change in the number of neighbors (n). The higher the number of neighbors searched, the more discontinuities are identified. When the number of neighbors changed, the orientation of each discontinuity also changed, as reflected by the color change. This occurred because the normal vectors to the fitting plane change when the number of neighbors varies, leading to the change in orientation. However, under different threshold controls, the main discontinuities could be recognized, proving the robustness of the proposed method.

Fig. 12
figure 12

Influence of different numbers of neighbors (\(n\)) on recognition results in a real highway slope (changes are marked with green circle, and these discontinuity colors are only used to distinguish different discontinuities and carry no other significance)

3.2.2 Maximum RG angle

We analyzed the influences of the maximum RG angle (\(\theta\)) on discontinuity recognition. When the number of neighbors (\(n\)) was fixed to 15, \(\theta\) was set to 5°, 10°, 15°, 20°, 25°, and 30°. The discontinuities under these six conditions were recognized (Fig. 13). The results indicate that when \(\theta\) was extremely small, the discontinuities could not be completely recognized, whereas when \(\theta = 15^{^\circ }\), the main discontinuities were recognized. As \(\theta\) increased, the number of recognizable discontinuities also increased; however, above some threshold \(\theta\), the increase in number of recognized discontinuities was sufficiently small to make it not worthwhile to perform further analysis. Thus, determining a reasonable value of \(\theta\) was important.

Fig. 13
figure 13

Influence of different maximum RG angles (\(\theta\)) on recognition results in a real highway slope (changes are marked with green circle, and these discontinuity colors are only used to distinguish different discontinuities and carry no other significance)

By analyzing the influence of the number of neighbors and the maximum RG angle, the main rock mass discontinuities could be recognized, proving the robustness of the proposed method.

3.3 Case study B

The point clouds of a real highway slope were used to verify the efficiency of FD. The project example was obtained from a slope in Colorado, USA; its point clouds are developed from the Rockbench point cloud database [36]. Table 3 summarizes the data information for the slope point cloud.

Table 3 Point cloud information of example project

3.3.1 Slope discontinuity recognition

The discontinuities of the slope were recognized using FD with the thresholds used in case study A (Fig. 11c).

3.3.2 Results of case study B

The different discontinuities were divided into five groups according to their normal vectors. Specifically, similar normal vectors typically indicate that the discontinuities share similar orientations, representing that they belong to the same group. Discontinuity set extractor (DSE) and FD randomly assign colors to identified discontinuities, and discontinuities with similar orientations are assigned the same color. Figure 14a presents the groups of DSE, and Fig. 14b shows the groups of FD. A cluster analysis indicates the groups of discontinuities determined by the two methods are similar (Table 4). Therefore, the proposed method is capable of visually representing the grou** of discontinuities through color differentiation.

Fig. 14
figure 14

a DSE and b FD groups (these discontinuity colors are only used to distinguish different discontinuities and carry no other significance)

Table 4 Cluster analysis of DSE and FD

Furthermore, in this study, the discontinuity analysis software Dips generated normal density plots of discontinuity, aiming to further validate the accuracy of discontinuity grou**. The normal density plots of discontinuities generated by DSE and FD (Fig. 15) demonstrate that FD estimates the dips and dip directions with similar accuracy as DSE. Overall, these two methods are relatively similar in terms of grou** discontinuities. The accuracy of this method in discontinuity grou** was explained.

Fig. 15
figure 15

Normal vector density plot of discontinuity poles: a DSE and b FD

To quantitatively compare the results, discontinuities recognized by FD were also compared with those obtained by the DSE method and using the compass function in CloudCompare (CCC). Figure 16 shows five groups of discontinuities (J1 to J5) that are recognized by DSE. Figure 17 displays five groups of representative discontinuities recognized by FD. However, due to different parameter settings, FD extracted 154 discontinuities, while DSE extracted 230. The unextracted small discontinuities, mostly had a point cloud count less than 500. Moreover, Table 5 provides a summary of the data concerning discontinuity orientations acquired from the three methods. The comparison between FD and DSE reveals maximum and average errors in orientations of 10.07° and 2.17°, respectively. The comparison between FD and CCC reveals maximum and average errors in orientations of 5.74° and 1.58°, respectively. Table 4 in Riquelme et al. [27] indicates that the maximum and average errors in orientations are 11° and 4.53°, respectively. In our comparison with DSE and CCC, our method demonstrates that the maximum and maximum average errors in orientations are 10.07° and 2.17°, respectively, both lower than the errors in their methods. Considering the generally acceptable range for engineering errors is 5°-10°, the overall error was within the acceptable range.

Fig. 16
figure 16

Groups of identified discontinuities using DSE

Fig. 17
figure 17

Groups of identified discontinuities using FD

Table 5 Comparison of orientation calculation results between CCC, DSE, and FD

The slope point clouds were used to compare the operating efficiencies of the DSE and FD. The calculation process time of the two methods is summarized in Table 6. Both methods were calculated on the same computer, which has a 16.0-GB RAM (AMD Ryzen 7 4800H with Radeon Graphics @2.90 GHz). The calculation time of the local curvature was the longest for the DSE method. As for FD, the process time for RG was the longest. In general, the operating efficiency of FD was considerably higher than that of DSE. Furthermore, without voxel filtering the FD required is 54 s, whereas the DSE method required is 14 min. This indicates that even without voxel filtering, the algorithm proposed still exhibits higher efficiency compared to the DSE method. When voxel filtering is applied, this advantage is further amplified. Therefore, the effectiveness of the proposed improved RG algorithm in enhancing the efficiency of discontinuity identification is demonstrated.

Table 6 Operating efficiencies of DSE and FD

3.4 Case study C

3.4.1 Project profile

The site selected in this test was a natural quarry in the suburbs of Hanchuan, Hubei, China [37]. The quarry slope bedrock was exposed, and the discontinuities were distinctly developed. The horizontal width of the rock slope was approximately 20 m, the vertical height was approximately 8 m, and the slope angle was 30°–50° (Fig. 18). A partial point cloud of the slope with 29 million points was obtained by crop** the slope point cloud model (Fig. 19). Additionally, the information on the point cloud in the natural quarry is summarized in Table 3.

Fig. 18
figure 18

Slope of natural quarry in suburbs of Hanchuan, Hubei, China

Fig. 19
figure 19

Partial point cloud of slope in Fig. 18

3.4.2 Results of discontinuity recognition

The FD method was capable of performing computations smoothly on the cropped point clouds containing 29 million points, but the DSE method caused the computer to crash. To be specific, when utilizing the FD method for discontinuity identification, the computer with an AMD Ryzen 7 4800H CPU requires 13 min, whereas the computer with an i7 13700kf CPU (central processing unit) just needs 25 s. However, the DSE method leads to computations being unable to be completed or results being unattainable. Furthermore, the FD method randomly assigns colors to recognized discontinuities and assigns the same color to discontinuities with similar orientations (Fig. 20). The results of FD identifying 15 discontinuities are compared with the manual (i.e., compass) method and summarized in Table 7. The table indicates that the maximum error of results generated by compass and FD was 6.08°; the average error was 2.74°. The comparison results prove that FD is capable of processing tens of millions of data points using the i7 processor.

Fig. 20
figure 20

Recognition results of slope point cloud in Fig. 19

Table 7 Comparison of orientation recognition results between compass method and FD

4 Discussion

This study acquired normal vector information from the point cloud and subsequently conducted research on the extraction of rock mass discontinuities using the improved RG algorithm. Experiments were carried out on the cube model, icosahedron model, highway slope, and natural quarry to evaluate the effectiveness of the proposed method.

An analysis was conducted to assess the impact of varying numbers of neighbors (n) and the maximum RG angle (\(\theta\)) on discontinuity recognition. The research results reveal that optimal parameters differed among various types of point clouds. For standard cube and icosahedron models, a choice of n = 15 and θ = 20° produced ideal recognition results. In the case of the highway slope examined in this paper, optimal results were achieved with n and θ set to 20 and 20°, respectively. This highlights that the quantity and completeness of discontinuities were influenced by the optimal values of n and θ for different point cloud data. Their optimal values depend on the morphological characteristics and spatial distribution of discontinuities and the specific requirements of engineering. Specifically, in slope engineering, discontinuities with a point cloud count less than 500 are generally not considered, suggesting optimal values for n and θ are 20 and 20°, respectively. For other engineering applications with higher requirements for the quantity and completeness of discontinuity, it is recommended to moderately increase the threshold range, suggesting that the values of n and θ be increased within the ranges of 5–10 and 5°–10°, respectively. Consequently, preliminary analysis is of importance in determining the optimal parameters.

The analysis of rock mass discontinuity orientations is one of the fundamental tasks in conducting seepage analysis and stability studies of engineering rock masses. The method proposed is capable of accurate discontinuity identification in both slope engineering and natural quarries, demonstrating its applicability in engineering. Specifically, even when the dataset consisted of more than 29 million points, the proposed method could still process this data within one minute on a sufficiently fast computer, meeting the demand for rapid construction in future large-scale construction projects. Case studies demonstrated the efficiency and accuracy of the approach in extracting discontinuities from three-dimensional point clouds, contributing to a better understanding of rock discontinuities within large geological formations.

The research outcomes of this study provide a dependable approach for efficiently measuring discontinuity information and offer substantial support for future research in three-dimensional fracture network modeling, rock stability, and seepage. Considering the constraints of point cloud recognition, the following challenges needed to be resolved:

  • 1) The results of discontinuity recognition for the proposed method in this study were only compared with those of the discontinuity set extractor (DSE) and CloudCompare (CCC). However, the results were not compared with those of the field compass method.

  • 2) The applicability of the proposed method required further improvement because vegetation may be present on some slopes, leading to missing point cloud data and affecting the integrity of discontinuity recognition. In future research, consideration can be given to repairing the point cloud data.

  • 3) The results of discontinuity recognition in this study were based on mathematical calculations. However, to improve the automation of recognition, it is necessary to consider more geological and geotechnical parameters, such as spacing, roughness, and so on.

In future research, it was imperative to conduct more profound exploration and optimization in this area to enhance the applicability, accuracy, and level of automation in discontinuity recognition.

5 Conclusion

To recognize discontinuities and acquire their orientation information from mass point clouds efficiently, this paper proposes a semi-automatic recognition method for rock mass discontinuities based on an improved RG algorithm. The proposed method improved the efficiency of point cloud calculation and discontinuity recognition. The Geocloud v1.0 software, which was developed based on the proposed method, and the commercial software CloudCompare were used for discontinuity recognition. The processing of point clouds by voxel filtering not only retained the feature points but also considerably reduced the number of points in a cloud and improved the operation efficiency. An improved RG algorithm “named Facet Detect, FD” was developed to extract the feature point sets. The algorithm considers the normal vector differences among the point clouds and the change in the fitting plane of the normal vector as metrics after RG. Thus, the improved RG algorithm can recognize discontinuities with high efficiency.

The main contributions of this study were as follows:

  1. 1)

    The proposed method semi-automatically recognizes discontinuous points based on raw point clouds. A set of standard geometric point clouds and actual slope point clouds was used to verify the accuracy of the proposed method. For standard geometric data, the error of the proposed method was virtually zero. For the real highway slope data, the average error of the proposed method is 3.4°. For the natural quarry data, the average error of the proposed method is 3.81°. The errors in these three groups of data indicated that the recognition results are acceptable, verifying the accuracy of the proposed method.

  2. 2)

    A parameter sensitivity analysis was performed to determine the influence of different numbers of neighbors (n) and the maximum RG angle (\(\theta\)) on discontinuity recognition. Results showed that the proposed method can identify discontinuities within a reasonable threshold range of n being 15–20 and \(\theta\) being 15°–20°. Accordingly, the robustness of the proposed method was demonstrated.

  3. 3)

    The operating efficiencies of the proposed method and DSE were also compared the method. For the same point clouds using the same computer, the DSE consumes 27 min and 24 s, whereas the proposed method consumes 16 s. Hence, the operating efficiency of the proposed method is considerably better than that of the DSE. Considering that the amount of point cloud data in actual projects is typically large, efficiency is the theoretical basis of future digital construction.

  4. 4)

    At the same time, FD was used to recognize discontinuities of the slope with tens of millions of points, and the results were compared with the manual method of a compass that is built into CloudCompare. Recognition results demonstrated that FD can recognize these discontinuities efficiently and quickly with the support of adequate computer performance. In general, the acceptable measurement error for discontinuities in engineering is 5°–10°, and the error of the FD method recognition results was 2.74°. The results indicate that, in comparison to the manual method, the FD method maintains an error within the 5°–10° range specified by engineering standards. Therefore, the proposed method can satisfy the precision requirements for discontinuity recognition in practical engineering.