Method for Extracting Buddhist Shrines from Point Clouds of Grottoes
Through the random forest classifier and connectivity constraint filtering combined with the conditional European-K mean clustering method, the problem of mis-dividing and misdividing of Buddhist niches and walls in the cave point cloud is solved, efficient and accurate extraction of Buddhist niches is achieved, classification accuracy is improved, and technical support is provided for digital archiving and protection of grottoes.
Patent Information
- Application Number
- CN202210109005.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-01-28
AI Technical Summary
The prior art is difficult to extract Buddha niche objects from the cave point cloud data efficiently and accurately, especially due to the blurring of the edges of the Buddha niche and the wall, weathering and peeling, and the problems of misclassification and misclassification.
The random forest classifier is used to combine connectivity constraint filtering and conditional Euro-K mean clustering method to extract individual Buddhist niche objects by constructing point cloud feature sets, randomly selecting training samples, performing rough classification and fine classification.
The degree of automation and accuracy of Buddhist niche classification has been improved, the problem of mis-dividing and misalignment between Buddhist niches and walls has been solved, and the classification accuracy has been improved to 94.15%, providing technical support for the digital storage and protection of grottoes.
Smart Images

Figure CN114429537B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional laser scanning, and more specifically, to a method for extracting a Buddha niche from a cave point cloud. Background Art
[0002] Grottoes are important cultural heritage and important carriers of historical culture, with important historical, artistic, scientific and emotional values. However, as immovable cultural relics, grottoes are more susceptible to natural erosion and human damage after thousands of years. The Buddha niche is the smallest statue unit in the grottoes and the most numerous statue type in the grottoes. It is an extremely important part of grotto art. However, due to natural or human reasons, the Buddha niche is facing serious diseases. If protective measures are not taken in time, the number of Buddha niches will become fewer and fewer. How to apply new technologies to better protect grotto cultural relics and Buddha niche statues without damaging the cultural relics has become an important issue in cultural heritage protection.
[0003] Compared with historical materials, pictures and single-point coordinates, three-dimensional laser has the characteristics of non-contact, high precision and all-weather. It can quickly and losslessly retain high-fidelity three-dimensional information of grotto objects. It has been widely used in the protection of large-scale cultural heritage such as grottoes, especially in preventive protection work such as digital archiving.
[0004] There are often many niches with similar shapes and scattered throughout the caves, which have high artistic value. For this reason, after completing the digital archiving of the caves, it will be time-consuming and laborious to manually extract all the niches. At the same time, the niches have experienced thousands of years of wind and rain, and often suffer from serious weathering and peeling diseases. The edges between the niches and the walls, and between the niches are relatively blurred, and it is difficult to accurately extract them from the overall point cloud. To extract the niche data from the overall point cloud data, the following problems must be solved: first, the edges between the niches and the walls are blurred and difficult to define; second, both the niches and the walls are weathered and peeled, and the accuracy is low when classified; the niches are composed of Buddha statues and niche walls, and the niche walls are similar to the walls and are easy to misclassify. Therefore, extracting niche objects from the caves with high efficiency and high precision can provide data support for the preventive protection of cave cultural relics, provide technical support for the inheritance and revitalization of cultural heritage, and provide new ideas and methods for research in related fields. Summary of the invention
[0005] The purpose of the present invention is to solve at least the above problems and provide a method for extracting a Buddhist niche from a cave point cloud, comprising:
[0006] Step 1: Scan and obtain the cave point cloud data and perform data optimization processing to construct a point cloud feature set;
[0007] Step 2: Randomly select point cloud data to make training samples and test samples. Select random forest as the classifier, train the random forest classification model, and roughly classify the point cloud into single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data;
[0008] Step 3: Optimize and distinguish the single Buddha niche wall, double Buddha niche wall, and wall through connectivity constraint filtering, and perform fine classification to obtain single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data;
[0009] Step 4: Extract the single Buddha niche point cloud data obtained by fine classification. First, obtain multiple point cloud data composed of connected single Buddha niches through conditional Euclidean clustering, and then perform K-means clustering based on the number of points contained in a single Buddha niche as the base number to extract each individual single Buddha niche object;
[0010] Step 5: If there are multiple non-adjacent double Buddha niches, extract the double Buddha niche point cloud data obtained by fine classification, and extract each individual double Buddha niche object through conditional Euclidean clustering.
[0011] Preferably, the data optimization process in Step 1 includes point cloud data registration, denoising, and duplicate removal.
[0012] Preferably, the construction of the point cloud feature set in Step 1 includes:
[0013] S1. Construct the initial point cloud feature set:
[0014] Use the PCA algorithm to fit the spherical neighborhood near points of the point cloud into a plane, calculate the sample variance and sample covariance on this plane, construct a covariance matrix based on this, calculate the eigenvalues and eigenvectors, normalize the eigenvalues, and calculate geometric features;
[0015] S2. Screen and optimize the point cloud feature set:
[0016] Rank the feature importance in the random forest, select the feature with the lowest importance and plan to delete it. If the test accuracy improves, determine to delete this feature; otherwise, mark this feature as a positively correlated feature;
[0017] After repeating multiple times, the remaining several features are the most important features. Combine the most important features and positively correlated features to form the final feature set.
[0018] Preferably, the point cloud feature set in Step 1 includes X coordinate, Y coordinate, Z coordinate, Gaussian curvature, perpendicularity, anisotropy, and local curvature change.
[0019] Preferably, the training of the random forest classification model in step two includes: inputting the training samples and test samples into the random forest, adjusting the parameters by grid search, and determining the optimal parameters of the random forest.
[0020] Preferably, the connectivity constraint filtering in step three includes:
[0021] Set two empty sets. Randomly add a point cloud to one of the sets as the initial point. Set the neighborhood radius to search outward for single Buddha niche points or double Buddha niche points or wall points of the same type. The neighborhood radius is greater than the distance between two adjacent point clouds. If they are points of the same type, add them to the same set where the initial point is located. The points in the set continue to search outward until no more points of the same type can be found. Otherwise, add them to the other set. The points in this set are all non - same - type points on the periphery;
[0022] When the number of point clouds in the set where the initial point is located reaches the threshold, determine this set as the point cloud data set of single Buddha niche points or double Buddha niche points or wall points. Otherwise, it is a misclassification in the rough classification. Incorporate the misclassified points into the other set and correct the type of the points.
[0023] Preferably, step four includes:
[0024] Add a point cloud of single Buddha niche points obtained in step three as the initial point. Set the Euclidean distance to search outward for conditional Euclidean clustering. The Euclidean distance is less than the distance between two adjacent niches. If the number of point clouds in the neighborhood reaches the threshold, cluster them into one class, that is, the point cloud data composed of connected single Buddha niches. Continue to search outward. Otherwise, exclude them as boundary points and stop searching outward. Finally, obtain multiple point cloud data composed of connected single Buddha niches;
[0025] For each point cloud data composed of connected single Buddha niches, use the number of point clouds contained in a single Buddha niche as the base to estimate the K value in K - means clustering, and cluster and extract each individual single Buddha niche object.
[0026] The device for extracting niches from grotto point clouds includes:
[0027] A data acquisition and processing module, which receives the grotto point cloud data obtained by scanning and performs data optimization processing;
[0028] A point cloud feature set construction module, which constructs a feature set by calculating the geometric features of the point cloud;
[0029] The grotto point cloud classification module randomly selects point cloud data to make training samples and test samples, selects random forest as the classifier, trains the random forest classification model, and roughly classifies the point clouds into single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data. Through connectivity constraint filtering optimization, it distinguishes the niche walls of single Buddha niches, double Buddha niches, and walls, and performs fine classification to obtain single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data;
[0030] The niche point cloud extraction module extracts the single Buddha niche point cloud data obtained by fine classification. First, it obtains multiple point cloud data composed of connected single Buddha niches through conditional Euclidean clustering, and then performs K-means clustering with the number of point clouds contained in a single Buddha niche as the base number to extract each individual single Buddha niche object. If there are multiple non-adjacent double Buddha niches, it extracts the double Buddha niche point cloud data obtained by fine classification, and through conditional Euclidean clustering, extracts each individual double Buddha niche object.
[0031] An electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.
[0032] A storage medium stores a computer program, and when the program is executed by a processor, the method described above is implemented.
[0033] The present invention has at least the following beneficial effects:
[0034] First, the method of the present invention has a high degree of automation, identifies and preserves the three-dimensional information of each statue in the grotto, which is of great significance for the digital storage, current situation assessment, and virtual restoration of the grotto;
[0035] Second, the present invention constructs a feature set by calculating the geometric features of the point cloud, selects random forest as the classifier, trains the random forest model, and compares it with the experiment using all point cloud features. After completing the parameter adjustment, compared with the experimental accuracy of 85.43% using point cloud features, the classification accuracy is improved to 88.89%, an increase of 3.46%. After completing the connectivity constraint filtering, the classification accuracy is improved to 94.15%, an increase of 5.26% compared with the previous one;
[0036] Third, the present invention is optimized through connectivity constraint filtering, reduces misclassification and wrong classification, solves the overfitting problem during training and the problem of fragmented and discontinuous markings caused by the similar classification of the inner and outer walls of the niche, ensures the integrity of the niche, and improves the classification accuracy;
[0037] Fourthly, the present invention extracts the niche objects through the conditional Euclidean-Kmeans clustering method, solving the problem of the connection between single Buddha niches.
[0038] Other advantages, objectives and features of the present invention will be partially reflected by the following description, and partially will also be understood by those skilled in the art through the research and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of the overall point cloud data of the present invention;
[0040] Figure 2 It is a precision comparison chart before and after feature selection of the present invention when choosing random forest as the classifier;
[0041] Figure 3 It is a schematic flow chart of the connectivity constraint filtering of the present invention;
[0042] Figure 4 It is a schematic diagram of the result of the connectivity constraint filtering of the present invention;
[0043] Figure 5 It is a schematic flow chart of the conditional Euclidean-Kmeans clustering of the present invention;
[0044] Figure 6 It is a schematic diagram of the result of the conditional Euclidean-Kmeans clustering of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0045] The following further describes the present invention in detail with reference to the drawings, so that those skilled in the art can implement it according to the description in the specification.
[0046] It should be understood that the terms such as "having", "comprising" and "including" used herein do not exclude the presence or addition of one or more other elements or their combinations.
[0047] In the description of the present invention, it should be noted that unless otherwise clearly specified and limited, the terms "installed", "connected" and "set" should be understood in a broad sense. For example, it can be fixedly connected and set, or detachably connected and set, or integrally connected and set. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations. The orientation or positional relationship indicated by the terms "transverse", "longitudinal", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention.
[0048] The present invention provides a method for extracting Buddhist niches from the point cloud of a grotto. In the research, the Buddhist niche on the southwest wall of the 18th grotto of Yungang Grottoes is selected as the research object, and a data set is made, which has 391,700 points in total, including 125 small Buddhist niches (single-Buddha niches) and 1 large Buddhist niche (double-Buddha niche). The method includes:
[0049] Step 1: Scan to obtain the point cloud data of the grotto and perform data optimization processing. The overall point cloud data obtained by scanning is as Figure 1 shown, and a point cloud feature set is constructed.
[0050] Before scanning the grotto, it is necessary to conduct on-site surveys of the scanning target and the surrounding environment, understand the actual situation of the grotto, and formulate a scanning plan. Because when scanning an object, it is necessary to scan from multiple angles and viewpoints so as to completely obtain the three-dimensional spatial information of the object. This involves how to determine the placement stations of the scanner, which requires on-site surveys according to the on-site environment without occlusion, etc.
[0051] When determining the survey stations, first determine the optimal scanning distance according to the accuracy of the scanner to ensure that there is a 30% overlap between adjacent points, that is, there will be no omission or excessive overlap. After selecting the survey stations, perform coordinate transfer through consistent control points to measure the coordinates of all survey stations within the control network. Considering the complex structure in the grotto with a large number of occlusions and scanning dead ends, different types of scanners can be used to perform multi-station cross-scanning on the grotto. To ensure the accuracy of point cloud registration, attention should be paid to the position and quantity of the target balls during each scan to ensure that there are more than three same-name target balls between adjacent scanning stations.
[0052] The data optimization processing includes point cloud data registration, denoising, and duplicate removal:
[0053] Point cloud registration: First, use more than three same-name target balls to register point cloud A and point cloud B to obtain the initial rotation matrix R and translation matrix T. Then, use the initial values to search for corresponding points between the two point clouds, and obtain the updated transformation matrices R and T according to the principle of the minimum distance between corresponding points. Finally, repeat the above steps until the distance between point cloud A and B is less than the threshold to complete the point cloud registration.
[0054]
[0055] Point cloud denoising: Point cloud denoising refers to removing redundant data and noise that do not belong to the scanning target from the point cloud. After the point cloud data of the grotto is stitched, there will inevitably be noise points, which affect the data quality. The main noises in the grotto scanning point cloud are non-target points, isolated points, etc. Denoising processing can be carried out by distance threshold filtering or manual selection.
[0056] Point cloud duplicate removal: Since the scanned data is composed of mosaics, there will be duplicate problems in the same area, and it is also difficult to achieve uniform distribution of the data. Therefore, after denoising the point cloud data, it is necessary to resample the point cloud. In this study, the voxel downsampling algorithm was used to reduce the data volume and optimize the point cloud distribution.
[0057] Step 2: Randomly select point cloud data to make training samples and test samples, select random forest as the classifier, train the random forest classification model, and roughly classify the point cloud into point cloud data of single Buddha niches, point cloud data of double Buddha niches, and point cloud data of walls;
[0058] S1. Construct the initial point cloud feature set:
[0059] Use the PCA algorithm to fit the spherical neighborhood near points of the point cloud into a plane, calculate the sample variance and sample covariance on this plane, construct a covariance matrix based on this, calculate the eigenvalues and eigenvectors, normalize the eigenvalues, and calculate geometric features;
[0060] S2. Screen and optimize the point cloud feature set:
[0061] Rank the feature importance in the random forest, select the feature with the lowest importance and plan to delete it. If the test accuracy improves, determine to delete this feature; otherwise, mark this feature as a positively correlated feature;
[0062] After repeating many times, the remaining several features are the most important features, and the most important features and positively correlated features are combined to form the final feature set.
[0063] Considering the differences in the construction time, construction technology, and geographical location of the grottoes, the shapes, sizes, and arrangements of the niches in different grottoes have their own characteristics, and the grotto diseases are also different. A single training model cannot be universal. To meet the time cost requirements of digital protection of grottoes, traditional machine learning classifiers have become the primary choice. Traditional machine learning methods rely on manually designed features for learning and training. Therefore, an excellent feature set is the guarantee for the random forest to obtain high-precision results. The common feature sets of point clouds mainly include coordinates, roughness, curvature, density normal vectors, and geometric features. The common geometric features include Linearity, Planarity, Scattering, Ominvariance, Eigenentropy, Local curvature, Anisotropy, Verticality, etc.
[0064] First, perform neighborhood selection on the point cloud. The neighborhood range defines the neighborhood size of each point and the space for feature extraction, which is crucial for classification accuracy. There are three common neighborhood structures in point clouds: (1) the nearest neighbor neighborhood, (2) the cylindrical neighborhood, and (3) the spherical neighborhood. Since the point cloud is uniformly distributed, the nearest neighbor neighborhood is not suitable, and the cylindrical neighborhood will affect the feature that the grotto niche is excavated inward on the rock wall. Therefore, the spherical neighborhood is the most suitable.
[0065] The neighborhood radius r is jointly determined by the distance between the niche wall of the niche and the point cloud. It is optimal that the number of points in the r neighborhood is greater than 6 (if less than 6, geometric features cannot be calculated) and does not exceed the length of the niche wall (if greater than the niche wall length, the characteristics of the niche are difficult to reflect in the results).
[0066] Point cloud features include coordinates, density, curvature, geometric shape, etc. Use the PCA algorithm to fit the local neighboring points of the point into a plane, calculate the sample variance and sample covariance on this plane, and based on this, construct a covariance matrix, and obtain the eigenvalues λ i , i ∈ {1, 2, 3}, λ1 < λ2 < λ3, and the eigenvectors e i , i ∈ {1, 2, 3}, and normalize the eigenvalues to η i ,
[0067] Planarity:
[0068] Linearity:
[0069] Divergence:
[0070] Anisotropy:
[0071] Total variance:
[0072] Feature entropy:
[0073] Local curvature change:
[0074] Verticality: V η = 1 - |<[0 0 1], e3>|.
[0075] After calculating the features, randomly select some points from the point cloud to create a training set and a test set. According to the characteristics of the data used in this study, the data is divided into three categories: double-buddha niches, single-buddha niches, and walls.
[0076] After completing the above steps, perform feature selection to screen out the features that have a greater impact on the classification results.
[0077] The principle of feature selection by the Recursive Feature Elimination (RFE) algorithm is as follows:
[0078] First, sort the feature importances in the random forest,
[0079] then delete the feature with the lowest importance and determine whether the test accuracy improves,
[0080] if it improves, delete the feature; if it decreases, mark it as a positively correlated feature.
[0081] Then continue to delete the feature with the lowest importance and make judgments until the last three most important features are left.
[0082] Finally, the feature set consists of the three most important features and the positively correlated features.
[0083] The features of the present invention include: the point cloud feature set includes the X coordinate, Y coordinate, Z coordinate, Gaussian curvature, perpendicularity, anisotropy, and local curvature change.
[0084] The random forest consists of multiple decision trees to form a classifier. A sub-data set is constructed by sampling with replacement, and the sub-decision trees are built using the sub-data set. The judgment results output by all sub-decision trees through the data set are sorted out, and the result with the most occurrences is the result output by the random forest. In the current machine learning algorithms, the random forest has unique advantages. First, the random forest can handle large data sets and efficiently process samples with multi-dimensional features; second, the random forest has strong robustness and can obtain an unbiased estimate of the internal generated error, and still maintain accuracy in the face of a large amount of missing data; at the same time, the random forest also has advantages such as handling unbalanced classification data sets and evaluating variable importance.
[0085] As Figure 2 shown, the prepared training samples (40,000 points) and test samples (6,000 points) are input into the random forest, and then the parameters are adjusted by grid search to determine the optimal parameters of the random forest in the sample of this study. After completing the learning and training, the overall data is classified to obtain the final classification result.
[0086] Step 3: Optimize and distinguish the niche walls of single Buddha niches, the niche walls of double Buddha niches, and the walls through connectivity constraint filtering, and accurately classify to obtain the point cloud data of the niche category and the point cloud data of the wall category;
[0087] Since the inside of the niche mainly consists of the Buddha statue and the niche wall, and the features of the niche wall and the wall are similar, misclassification is likely to occur, which is one of the main sources of errors.
[0088] By observing the distribution characteristics of the niches and wall point clouds in the grotto, it is found that the wall point clouds are connected and the niche point clouds are surrounded by them. Therefore, after completing the random forest classification, optimization can be carried out according to this semantic information.
[0089] In this study, a filtering method with connectivity constraints is proposed to optimize misclassifications based on context information.
[0090] As Figure 3 shown, set two empty sets. Randomly add a point cloud to one of the sets as the initial point, set the neighborhood radius to search outward for single-buddha niche points or double-buddha niche points or wall points of the same type. The neighborhood radius is greater than the distance between two adjacent point clouds. If they are points of the same type, add them to the same set where the initial point is located, and the points in the set continue to search outward until no more points of the same type can be found. Otherwise, add them to the other set, and the points in this set are all non-homogeneous points on the periphery.
[0091] When the number of point clouds in the set where the initial point is located reaches the threshold, determine that this set is the single-buddha niche point cloud data set or the double-buddha niche point cloud data set or the wall point cloud data set. Otherwise, it is a misclassification in the rough classification. Combine the misclassified points into the other set and correct the type of the points.
[0092] Randomly select a point as the starting point.
[0093] First, set the distance R as the neighborhood radius (the distance R is set to be greater than the distance between two adjacent points, but not too large. In this study, it is set to 0.02). Form a set of points of the same type within the neighborhood, and the points in the set continue to search outward until all adjacent points of the same type are in this set.
[0094] Set the threshold N (since the misclassified points inside the niche are sporadic and fragmented, the threshold N should be less than 1 / 4 of the number of points of a niche object for the best result. In this experiment, it is set to 300). If the number of points in the set is less than the threshold, judge that the points in this area are misclassified points, and reclassify the misclassified points according to the surrounding points (that is, reclassify the points misclassified as wall type inside the niche to the niche type).
[0095] Considering that in this study, the point clouds are divided into three categories in total, namely single-buddha niche, double-buddha niche, and wall, so two sets are set. Use the first set to add the points of the same type searched, and the second set is used to add the non-homogeneous points on the periphery. If the number of points in the first set is less than the threshold and is judged as misclassified, then it can be determined which category it belongs to through the non-homogeneous points on the periphery in the second set. For example, after the points inside the niche are misclassified as the wall category, all the points in the surrounding circle should be niche points, and accordingly, they can be classified into the correct category. This method can be extended to other similar multi-classification situations.
[0096] AsFigure 4 As shown in the figure, the above method solves the overfitting problem in training and the problem of fragmentation and discontinuity of labels caused by similar classification of the inner and outer walls of the niche, ensures the integrity of the niche, and improves the classification accuracy.
[0097] The following are some examples of implementation methods:
[0098]
[0099]
[0100] Step 4: Extract the point cloud data of single Buddha niches obtained by fine classification. First, obtain multiple point cloud data consisting of connected single Buddha niches through conditional Euclidean clustering, and then perform K-means clustering based on the number of point clouds contained in a single Buddha niche as the cardinality to extract each individual single Buddha niche object.
[0101] After completing the random forest classification and connectivity constraint filtering optimization, the initial single Buddha niche object is extracted from the single Buddha niche point cloud. Due to weathering and peeling, classification accuracy and other reasons, there is a connection phenomenon between the single Buddha niches (that is, the wall point cloud between two adjacent single Buddha niches is missing or misclassified as the niche category, resulting in the niches being connected, but there is actually a gap in the middle). The conventional clustering method cannot extract a separate single Buddha niche object, and it is easy to have the phenomenon of "many in one" or "one divided into two". Figure 5 As shown, a conditional Euclidean-K-means clustering method was proposed in this study.
[0102] like Figure 5 As shown, add a single Buddha niche point cloud data obtained in step 3 as the initial point, set the Euclidean distance to search outward for conditional Euclidean clustering, and the Euclidean distance is less than the distance between two adjacent single Buddha niches. If the number of point clouds in the neighborhood reaches the threshold, they are clustered into one category, that is, point cloud data composed of connected single Buddha niches, and continue to search outward. Otherwise, they are excluded and regarded as boundary points, and no longer searched outward. Finally, multiple point cloud data composed of connected single Buddha niches are obtained;
[0103] For each point cloud data consisting of connected single Buddha niches, the number of point clouds contained in a single Buddha niche is used as the cardinality to estimate the K value in K-means clustering, and each individual single Buddha niche object is extracted by clustering.
[0104] Conditional Euclidean Clustering
[0105] First, export the shrine category point cloud from the overall point cloud as the original data for extracting the objects of single Buddha shrines. Then, set the distance D (the setting of distance D should be greater than the distance between two points within the shrine point cloud and less than the distance between shrines. After multiple screenings, D is set to 0.012.) as a parameter for conditional Euclidean clustering.
[0106] Set the threshold N (here N is considered because there are intervals and fewer points at the boundary of a single Buddha shrine, so the number of points within the neighborhood of the boundary points will not exceed the threshold. In the study, the threshold is set to 10) as the discrimination condition during clustering. If the number of points in the neighborhood with a radius of D is less than the threshold N, it is regarded as a boundary point, and the points within the neighborhood are no longer clustered into one class.
[0107] K-means clustering
[0108] After obtaining the results of conditional Euclidean clustering, perform K-means clustering on each class (with the number of points being M) among them. Using the number of points contained within a single Buddha shrine as the base (in this study, the number of points in a single Buddha shrine is approximately 1650), estimate the K value in K-means clustering (K = M / 1650). The result of this clustering is the object of a single Buddha shrine alone. The extraction results are as Figure 6 shown.
[0109] An example of the implementation method is as follows:
[0110]
[0111] Step 5: If there are multiple non-adjacent double Buddha shrines, extract the point cloud data of the double Buddha shrine class obtained through fine classification, and extract each individual double Buddha shrine object through conditional Euclidean clustering.
[0112] After completing the parameter adjustment, the experimental accuracy using point cloud features is 85.43%, and the classification accuracy is improved to 88.89%, with an increase of 3.46% compared with the previous one. After completing the connectivity constraint filtering, the classification accuracy is improved to 94.15%, with an increase of 5.26% compared with the previous one. See Table 1 for details.
[0113] Table 1
[0114]
[0115] The device for extracting shrines from the grotto point cloud includes:
[0116] A data acquisition and processing module, which receives the grotto point cloud data obtained by scanning and performs data optimization processing;
[0117] A point cloud feature set construction module, which constructs a feature set by calculating the geometric features of the point cloud;
[0118] The grotto point cloud classification module randomly selects point cloud data to make training samples and test samples, selects random forest as the classifier, trains the random forest classification model, and roughly classifies the point cloud into single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data. It uses connectivity constraint filtering to optimize the distinction between single Buddha niche wall, double Buddha niche wall and wall, and finely classifies single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data.
[0119] The Buddha niche point cloud extraction module extracts the single Buddha niche point cloud data obtained by precise classification, first obtains multiple point cloud data composed of connected single Buddha niches through conditional Euclidean clustering, and then performs K-means clustering based on the number of point clouds contained in a single single Buddha niche as the cardinality to extract each individual single Buddha niche object. If there are multiple non-adjacent double Buddha niches, the double Buddha niche point cloud data obtained by precise classification is extracted, and each individual double Buddha niche object is extracted through conditional Euclidean clustering.
[0120] Identifying and preserving the three-dimensional information of the Buddha niche objects in the grottoes is of great significance for the digital storage, value recognition, current status assessment and virtual restoration of the grottoes. As the smallest statue unit in the grottoes, the Buddha niche is also the most numerous statue type in the grottoes, and is an extremely important part of the grotto art. The Buddha niches are often numerous, similar in shape, and scattered throughout the grottoes, and have high artistic value. For this reason, after completing the digital archiving of the grottoes, it will be time-consuming and laborious to manually extract all the Buddha niches. At the same time, as a large-scale immovable cultural relic, the texture between the Buddha niches and the walls is similar and severely weathered, so it is difficult to solve the boundary problem during automated extraction, and the Buddha niche objects cannot be extracted with high precision.
[0121] In the process of extracting the Buddha niches in the caves, this study constructs a feature set. After using the random forest algorithm to select features separately, the optimal feature set is generated. Then the optimal parameters are found through grid parameter adjustment, and the random forest classification model is trained. After classifying the point cloud data, the connectivity constraint filter is used for optimization to solve the problem of misclassification of the inside and outside of the Buddha niche. The conditional Euclidean-K-means clustering method is used to extract separate Buddha niche objects from the overall Buddha niche point cloud. As an extraction method applied to connected point cloud data such as cave Buddha niches, this method can effectively separate and obtain separate Buddha niche objects.
[0122] An electronic device comprises: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the described method.
[0123] A storage medium having a computer program stored thereon, which when executed by a processor, implements the described method.
[0124] The number of devices and the scale of processing described herein are used to simplify the description of the present invention. Applications, modifications, and variations of the present invention will be apparent to those skilled in the art.
[0125] Although the embodiments of the present invention have been disclosed above, it is not limited to the applications listed in the specification and the embodiments. It can be fully applied to various fields suitable for the present invention. For those skilled in the art, additional modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and the illustrated examples described herein.
Claims
1. Method for extracting Buddhist niches from grotto point clouds, characterized in that, Including: Step 1: Scan to obtain the point cloud data of the grotto and perform data optimization processing to construct a point cloud feature set; Step 2: Randomly select the point cloud data to make training samples and test samples, select random forest as the classifier, train the random forest classification model, and roughly classify the point cloud into single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data; Step 3: Optimize and distinguish the niche walls of single Buddha niches, double Buddha niches, and walls through connectivity constraint filtering, and perform fine classification to obtain single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data; Step 4: Extract the single Buddha niche point cloud data obtained by fine classification. First, obtain multiple point cloud data composed of connected single Buddha niches through conditional Euclidean clustering, and then perform K-means clustering with the number of points contained in a single Buddha niche as the base number to extract each individual single Buddha niche object; Step 5: If there are multiple non-adjacent double Buddha niches, extract the double Buddha niche point cloud data obtained by fine classification, and extract each individual double Buddha niche object through conditional Euclidean clustering.
2. The method for extracting Buddhist niches from the grotto point cloud according to claim 1, characterized in that, The data optimization processing in Step 1 includes point cloud data registration, denoising, and duplicate removal.
3. The method for extracting Buddhist niches from the grotto point cloud according to claim 1, characterized in that, The construction of the point cloud feature set in Step 1 includes: S1. Construct an initial point cloud feature set: Use the PCA algorithm to fit the spherical neighborhood near points of the point cloud into a plane, calculate the sample variance and sample covariance on this plane, construct a covariance matrix based on this, calculate the eigenvalues and eigenvectors, normalize the eigenvalues, and calculate geometric features; S2. Screen and optimize the point cloud feature set: Sort the feature importance in the random forest, select the feature with the lowest importance and plan to delete it. If the test accuracy improves, determine to delete this feature, otherwise mark this feature as a positively correlated feature; After repeating multiple times, the remaining several features are the most important features, and the most important features and positively correlated features form the final feature set.
4. The method for extracting Buddhist niches from the grotto point cloud according to claim 3, characterized in that, The point cloud feature set in Step 1 includes X coordinate, Y coordinate, Z coordinate, Gaussian curvature, perpendicularity, anisotropy, and local curvature change.
5. The method for extracting a niche from the grotto point cloud according to claim 1, characterized in that, The training of the random forest classification model in Step 2 includes: inputting the training samples and test samples into the random forest, and adjusting the parameters by means of grid search to determine the optimal parameters of the random forest.
6. The method for extracting a niche from the grotto point cloud according to claim 1, characterized in that, The connectivity constraint filtering in Step 3 includes: Set two empty sets. Randomly add a point cloud to one of the sets as the initial point, set the neighborhood radius to search for similar single Buddha niche points or double Buddha niche points or wall points outward. If the neighborhood radius is greater than the distance between two adjacent point clouds, if it is a similar point, add it to the same set where the initial point is located, and the points in the set continue to search outward until no similar points can be found. Otherwise, add it to the other set, and the points in this set are all non-similar points on the periphery; When the number of point clouds in the set where the initial point is located reaches the threshold, determine this set as the single Buddha niche point cloud data set or double Buddha niche point cloud data set or wall point cloud data set. Otherwise, it is a misclassification in the rough classification. Merge the misclassified points into the other set and correct the type of the points.
7. The method for extracting Buddhist niches from the grotto point cloud according to claim 1, characterized in that, Step 4 includes: Add a point cloud data of a single Buddha niche obtained in step 3 as the initial point, set the Euclidean distance to search outward for conditional Euclidean clustering, and the Euclidean distance is less than the distance between two adjacent niches. If the number of point clouds in the neighborhood reaches the threshold, it is clustered into one category, that is, the point cloud data composed of connected single Buddha niches, and continue to search outward. Otherwise, it is excluded and regarded as a boundary point, and no longer searched outward. Finally, multiple point cloud data composed of connected single Buddha niches are obtained; For each point cloud data consisting of connected single Buddha niches, the number of point clouds contained in a single Buddha niche is used as the cardinality to estimate the K value in K-means clustering, and each individual single Buddha niche object is extracted by clustering.
8. Device for extracting Buddhist niches from the point cloud of a grotto, characterized in that, include: A data acquisition and processing module receives the scanned cave point cloud data and performs data optimization processing; Point cloud feature set construction module, which constructs feature sets by calculating point cloud geometric features; The grotto point cloud classification module randomly selects point cloud data to make training samples and test samples, selects random forest as the classifier, trains the random forest classification model, and roughly classifies the point cloud into single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data. It uses connectivity constraint filtering to optimize the distinction between single Buddha niche wall, double Buddha niche wall and wall, and finely classifies single Buddha niche point cloud data, double Buddha niche point cloud data, and wall point cloud data. The Buddha niche point cloud extraction module extracts the single Buddha niche point cloud data obtained by precise classification, first obtains multiple point cloud data composed of connected single Buddha niches through conditional Euclidean clustering, and then performs K-means clustering based on the number of point clouds contained in a single single Buddha niche as the cardinality to extract each individual single Buddha niche object. If there are multiple non-adjacent double Buddha niches, the double Buddha niche point cloud data obtained by precise classification is extracted, and each individual double Buddha niche object is extracted through conditional Euclidean clustering.
9. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Forest point cloud sorting method based on mode recognition
CN103324945A
Point cloud classification method based on improved random forest algorithm
CN111860359A