Point cloud tree single - body segmentation method, device, electronic device and storage medium
By highly partitioning and clustering the tree point cloud data, the problem of insufficient classification and difficulty in eliminating noise points during the tree monomer segmentation process in point cloud data is solved, and a more accurate result of point cloud tree monomer segmentation is achieved.
Patent Information
- Application Number
- CN202110982203.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-25
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-08-25
AI Technical Summary
In the prior art, in the process of tree monomer segmentation in point cloud data, point classification is not accurate enough and noise points are difficult to eliminate, resulting in inaccurate segmentation results.
By dividing the original tree point cloud data into two parts according to the preset height, the preset clustering algorithm is used to cluster the trunk layer point cloud data, obtain the seed point set of trees, and then the canopy layer point cloud data is divided according to the cluster set of points on the trunk.
Accurate classification of tree point cloud data is achieved, noise points are effectively eliminated, and the accuracy of point cloud tree monomer segmentation is improved.
Smart Images

Figure CN113658338B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of point cloud data processing. Specifically, it relates to a method, device, electronic device, and storage medium for segmenting individual tree objects in point clouds. Background Art
[0002] Point cloud data refers to a set of vectors in a three-dimensional coordinate system, which are usually represented in the form of three-dimensional coordinates X, Y, and Z, and are generally mainly used to represent the outer surface shape of an object. In addition to representing the position information of points on an object, point cloud data can also represent the RGB color, grayscale value, depth, and segmentation results of points. LiDAR point cloud data is obtained by scanning with Light Detection And Ranging (LiDAR for short), that is, lidar. LiDAR point cloud data can be used to establish a three-dimensional tree model. Generally, the point cloud data of trees obtained by lidar is the point cloud data of a group of trees or a forest area. How to accurately identify and extract individual tree objects in the point cloud data is the basis for subsequent individual tree modeling.
[0003] In the existing process of segmenting individual tree objects, the nearest neighbor search algorithm or region growing algorithm is usually adopted. That is, starting from a random point, its surrounding points are searched and compared with it. Whether to classify them is determined by judging the distance or whether the normal directions are similar, and whether to be used as a seed point is determined by judging the curvature value. Then, the points around the seed point are searched for repeated judgment until the seed point no longer appears, and the segmentation of a group of point cloud data is completed.
[0004] However, for some characteristics of the point cloud data of trees, such as the overlapping and crossing of branches and leaves in the canopy layer of trees with a long tree age, and the existence of many noise points at the bottom of the trunk layer, etc., it will lead to inaccurate point classification and difficulty in excluding noise points, resulting in inaccurate final segmentation results. Summary of the Invention
[0005] In view of this, the purpose of the present application is to provide a method, device, electronic device, and storage medium for segmenting individual tree objects in point clouds to solve the problem in the existing technology that in the process of segmenting individual tree objects based on point cloud data, the point classification is not accurate enough, the noise points are difficult to exclude, resulting in inaccurate final segmentation results.
[0006] To achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for segmenting individual tree objects in point clouds, the method including:
[0008] Divide the original tree point cloud data into a first point set and a second point set according to a preset height. The z - coordinate values of the points in the first point set are greater than the preset height, and the z - coordinate values of the points in the second point set are less than the preset height;
[0009] Use a preset clustering algorithm to process the second point set to obtain n clustering point sets, where n is an integer greater than 0, and n is used to identify the number of trees included in the original tree point cloud data;
[0010] Compare the first point in each of the clustering point sets with the points in the first point set respectively, and divide the points in the first point set according to the comparison results to obtain n target segmentation results. Among them, the first point is the point with the largest z - coordinate value in each of the clustering point sets.
[0011] As a possible implementation, the step of using a preset clustering algorithm to process the second point set to obtain n clustering point sets includes:
[0012] Use a preset clustering algorithm to process the second point set to obtain m initial clustering point sets, where m is an integer greater than 0;
[0013] Remove the sets in the initial clustering point sets whose total number of points is less than a first preset threshold to obtain the n clustering point sets.
[0014] As a possible implementation, the step of comparing the first point in each of the clustering point sets with the points in the first point set respectively, and dividing the points in the first point set according to the comparison results to obtain n target segmentation results includes:
[0015] Compare the first point in each of the clustering point sets with the points in the first point set respectively to determine two to - be - classified sets that are closest to each point in the first point set. Among them, the to - be - classified sets belong to the n clustering point sets;
[0016] Compare each point in the first point set with the points within the target range in the corresponding to - be - classified set to determine the finally divided sets and obtain n target segmentation results. Among them, the points within the target range in the to - be - classified set include: the points whose z - coordinate values differ from the z - coordinate value of the highest point in the two to - be - classified sets by a second preset threshold. Among them, the highest point is the point with the largest z - coordinate value in the to - be - classified set.
[0017] As a possible implementation, the step of comparing the first point in each of the clustering point sets with the points in the first point set respectively to determine two to - be - classified sets that are closest to each point in the first point set includes:
[0018] Calculate the distances between each point in the first point set and the first point in the cluster point set based on the projection of the first point in each cluster point set along the z-axis direction and the projections of the points in the first point set along the z-axis direction;
[0019] Determine the two closest to-be-classified sets for each point in the first point set according to the distances between each point in the first point set and the first point in the cluster point set.
[0020] As a possible implementation, the step of using a preset clustering algorithm to process the second point set to obtain m initial cluster point sets includes:
[0021] Use a preset clustering algorithm to calculate the distances between the points in the second point set;
[0022] Cluster the points that meet the preset conditions into the same initial cluster point set according to the distances between the points in the second point set, and obtain m initial cluster point sets.
[0023] As a possible implementation, before the step of comparing the first point in each cluster point set with the points in the first point set respectively and dividing the points in the first point set according to the comparison results to obtain n target segmentation results, it further includes:
[0024] Sort the points in the first point set and the second point set in ascending order of the z coordinate values.
[0025] In a second aspect, an embodiment of the present application further provides a point cloud tree individual segmentation device, and the device includes:
[0026] A division module, configured to divide the original tree point cloud data into a first point set and a second point set according to a preset height, where the z coordinate values of the points in the first point set are greater than the preset height, and the z coordinate values of the points in the second point set are less than the preset height;
[0027] A processing module, configured to use a preset clustering algorithm to process the second point set to obtain n cluster point sets, where n is an integer greater than 0, and n is used to identify the number of trees included in the original tree point cloud data;
[0028] An acquisition module, configured to compare the first point in each cluster point set with the points in the first point set respectively, and divide the points in the first point set according to the comparison results to obtain n target segmentation results, where the first point is the point with the largest z coordinate value in each cluster point set.
[0029] As a possible implementation manner, the processing module is specifically used for:
[0030] The second point set is processed using a preset clustering algorithm to obtain m initial clustering point sets, where m is an integer greater than 0; the sets whose total number of points in the initial clustering point sets is less than a first preset threshold are eliminated to obtain the n clustering point sets.
[0031] As a possible implementation manner, the acquisition module is specifically used for:
[0032] The first point in each of the cluster point sets is compared with the points in the first point set respectively to determine the two sets to be classified that are closest to each point in the first point set, wherein the sets to be classified belong to the n cluster point sets; each point in the first point set is compared with the corresponding point in the target range in the set to be classified to determine the final divided set, and n target segmentation results are obtained, wherein the point in the target range in the set to be classified includes: a point whose z coordinate value differs from the highest point in the two sets to be classified by a second preset threshold, wherein the highest point is the point with the largest z coordinate value in the set to be classified.
[0033] The beneficial effects of this application are:
[0034] The embodiment of the present application provides a method, device, electronic device and storage medium for point cloud tree monomer segmentation, the method comprising: dividing the original tree point cloud data into a first point set and a second point set according to a preset height, wherein the z coordinate value of the points in the first point set is greater than the preset height, and the z coordinate value of the points in the second point set is less than the preset height; using a preset clustering algorithm to process the second point set to obtain n cluster point sets; comparing the first point in each cluster point set with the points in the first point set, dividing the points in the first point set according to the comparison result, and obtaining n target segmentation results, wherein the first point is the point with the largest z coordinate value in each cluster point set. Through the above steps, the seed point set of each tree can be found by aggregating and classifying the points on the trunk, and the number of trees can be determined, and then the point cloud data of the canopy layer can be segmented according to the cluster set of points on the trunk, so that it can fully adapt to the growth characteristics of the tree, so that the classification of the points is sufficiently accurate, thereby making the point cloud tree monomer segmentation result more accurate.
[0035] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0037] Figure 1 Schematic flowchart of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0038] Figure 2 Another schematic flowchart of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0039] Figure 3 Another schematic flowchart of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0040] Figure 4 Another schematic flowchart of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0041] Figure 5 Another schematic flowchart of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0042] Figure 6 Visualization effect diagram of two point sets after classifying the point cloud data of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0043] Figure 7 Visualization effect of the overall segmentation steps of a method for segmenting individual tree point clouds provided by an embodiment of the present application;
[0044] Figure 8 Schematic structural diagram of a device for segmenting individual tree point clouds provided by an embodiment of the present application;
[0045] Figure 9 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. It should be understood that the accompanying drawings in this application are only for the purposes of illustration and description, and are not used to limit the protection scope of this application. Additionally, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of this application. It should be understood that the operations in the flowchart may not be implemented in sequence, and steps without a logical context relationship may be reversed or implemented simultaneously. Furthermore, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of this application.
[0047] In addition, the described embodiments are only some embodiments of this application, rather than all embodiments. The components of the embodiments of this application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of this application claimed, but merely represents the selected embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of this application.
[0048] It should be noted that the term "including" will be used in the embodiments of this application to indicate the existence of the features stated thereafter, but does not exclude adding other features.
[0049] Currently, in the process of performing individual tree segmentation based on point cloud data, proximity search or region growing algorithms are generally used. However, due to the overlapping and crossing of branches and leaves in the canopy layer of trees with a relatively long tree age in the point cloud data of trees, and there are often many noise points at the bottom layer of the tree trunk. Therefore, when using the existing technology in the process of individual tree segmentation, there will be problems such as inaccurate point classification and difficulty in excluding noise points, resulting in inaccurate final segmentation results.
[0050] Based on this, the embodiments of this application propose a method for individual tree segmentation of point clouds, abandoning the method in the existing technology of classifying by making judgments on various parameters starting from random points, and instead using multiple points to perform individual tree segmentation according to the growth regions of trees from bottom to top. That is, first, cluster the points on the tree trunk to find the set of seed points for each tree, and then segment the point cloud data of the canopy layer according to the clustering set of the points on the tree trunk.
[0051] Please refer to Figure 1 , which is a schematic flowchart of a method for individual tree segmentation of point clouds provided by the embodiments of this application. As Figure 1 shown, this method includes:
[0052] Step S101: Divide the original tree point cloud data into a first point set and a second point set according to a preset height.
[0053] Among them, the z - coordinate values of the points in the first point set are greater than the preset height, and the z - coordinate values of the points in the second point set are less than or equal to the preset height. Here, the original tree point cloud data can refer to the point cloud data corresponding to the tree to be segmented. The first preset height can be 1 meter, 1.5 meters, 2 meters, 3 meters, 5 meters, etc. In practice, it can be set according to the growth situation of the tree to be segmented. The main purpose is to determine an independent tree trunk to avoid the situation of upper - layer forking of the tree, so as to accurately determine the number of trees. First, an independent tree trunk is divided. This application does not make specific restrictions here.
[0054] For example, the point cloud data set corresponding to the tree to be segmented is called p, and it is assumed that the preset height is 1 meter. Then, according to the magnitude of the z - coordinate values of each point in the set p, the set p can be divided into a first point set p1 and a second point set p2. Among them, the z - coordinate values of the points in the first point set p1 are greater than 1 meter, and the z - coordinate values of the points in the second point set p2 are less than or equal to 1 meter.
[0055] Step S102: Use a preset clustering algorithm to process the second point set to obtain n clustering point sets.
[0056] Among them, the preset clustering algorithm can be the Dbscane density clustering algorithm based on KDtree. Using this clustering algorithm, classify the second point set by the clustering algorithm. Finally, n clustering point sets are obtained. Here, n is an integer greater than 0, and n is used to identify the number of trees contained in the original tree point cloud data.
[0057] Continuing with the above example, assume that after classifying the second point set p2 by the clustering algorithm, 5 clustering point sets are obtained. This means that in the original tree point cloud data, that is, in the point cloud data corresponding to the tree to be segmented, there are 5 trees.
[0058] Step S103: Compare the first point in each clustering point set with the points in the first point set respectively, and divide the points in the first point set according to the comparison results to obtain n target segmentation results. Among them, the first point in each clustering point set is the point with the largest z - coordinate value in each clustering point set.
[0059] Specifically, the points with the largest z - coordinate value in each set of clustering points are respectively compared with each point in the first point set, and the points in the first point set are divided according to the comparison results. That is, according to the comparison results, each point in the first point set is divided into each set of clustering points in the n sets of clustering points, obtaining n target segmentation results.
[0060] Continuing with the above example, assume that 5 sets of clustering points n1, n2, n3, n4, n5 are obtained through the clustering algorithm. The first point in set n1 is Pn1, the first point in set n2 is Pn2, the first point in set n3 is Pn3, the first point in set n4 is Pn4, and the first point in set n5 is Pn5. Pn1, Pn2, Pn3, Pn4, and Pn5 are respectively compared with each point in the first point set p1. According to the comparison results, each point in p1 is respectively divided into n1, n2, n3, n4, and n5, obtaining 5 target segmentation results.
[0061] In summary, a method for segmenting individual tree point clouds provided by an embodiment of the present application includes: dividing the original tree point cloud data into a first point set and a second point set according to a preset height, where the z - coordinate values of the points in the first point set are greater than the preset height, and the z - coordinate values of the points in the second point set are less than the preset height; using a preset clustering algorithm to process the second point set to obtain n sets of clustering points; comparing the first points in each set of clustering points with the points in the first point set respectively, and dividing the points in the first point set according to the comparison results to obtain n target segmentation results, where the first point is the point with the largest z - coordinate value in each set of clustering points. Through the above steps, it is possible to first aggregate and classify the points on the tree trunk to find the set of seed points for each tree, and thus determine the number of trees. Then, the point cloud data of the crown layer is segmented according to the clustering set of the points on the tree trunk. In this way, it is possible to fully adapt to the growth characteristics of the trees, make the classification of points accurate enough, and thus make the result of segmenting individual tree point clouds more accurate.
[0062] To remove noise points, the clustering point sets obtained by the clustering algorithm can be pre - processed. Please refer to Figure 2 , which is another flowchart of a method for segmenting individual tree point clouds provided by an embodiment of the present application. As Figure 2 shown, the above step S102 includes:
[0063] Step S201: Using a preset clustering algorithm to process the second point set to obtain m initial clustering point sets, where m is an integer greater than 0.
[0064] Step S202: Removing the sets with the total number of points less than the first preset threshold in the initial clustering point sets to obtain n sets of clustering points.
[0065] Specifically, after processing the second point set using a preset clustering algorithm to obtain m initial clustering point sets, sets with the total number of points less than the first preset threshold in each initial clustering point set are discarded. It can be assumed that the first preset threshold is 100, that is, sets with the total number of points less than 100 in each of the m initial clustering point sets are discarded, and finally n effective clustering point sets are obtained. It can be understood that n is less than or equal to m. It should be noted that the first preset threshold can be set according to the actual situation, and the present application does not make specific limitations here.
[0066] By removing sets with the total number of points less than the first preset threshold in the initial clustering set, noise points can be removed, thereby reducing the influence of noise points on the final classification result.
[0067] Please refer to Figure 3 , which is another schematic flowchart of a point cloud tree single body segmentation method provided by an embodiment of the present application. As Figure 3 shown, the above step S103 includes:
[0068] Step S301: Compare the first points in each clustering point set with the points in the first point set respectively to determine two to-be-classified sets that are closest to each point in the first point set. Among them, the to-be-classified sets belong to the n clustering point sets.
[0069] Specifically, compare the first points in the n clustering point sets with each point in the first point set respectively to determine two to-be-classified sets that are closest to each point in the first point set. Among them, the to-be-classified sets can refer to the clustering point sets to which each point in the first point set is divided and are the clustering point sets closest to each point in the first point set.
[0070] Continuing with the example of the above steps, assume that the first point in the first point set p1 is p1_a, where p1_a is a point taken from the first point set p1 according to a certain rule, and this rule only needs to ensure that all points in the first point set p1 can be taken out.
[0071] Further, compare the first points in the 5 clustering point sets n1, n2, n3, n4, n5 with p1_a respectively to determine two to-be-classified sets that are closest to p1_a. Assume they are n2 and n3 respectively, that is, it means that p1_a is most likely to be divided into n2 or n3.
[0072] Repeat the above operation, continuously take out each point in the first point set p1, and compare the first points in the 5 clustering point sets n1, n2, n3, n4, n5 with the points taken out each time to determine two to-be-classified sets that are closest to each point in the first point set p1.
[0073] In step S302, compare each point in the first point set with the points within the target range in the corresponding set to be classified, determine the finally divided sets, and obtain n target segmentation results.
[0074] Specifically, compare each point in the first point set with the points within the target range in the corresponding set to be classified, determine the clustering sets to which each point in the first point set is finally divided, and obtain n target segmentation results. Among them, the points within the target range in the set to be classified include: the points whose z - coordinate values differ from the z - coordinate value of the highest point in the two sets to be classified by a second preset threshold. Here, the highest point is the point with the largest z - coordinate value in the set to be classified.
[0075] Continuing with the example in step S301, after obtaining the two sets to be classified n2 and n3 for the point p1_a in the first point set p1, that is, after determining that the point p1_a is most likely to be divided into the clustering sets n2 and n3, it is necessary to further determine whether to finally divide p1_a into n2 or n3. This can be achieved by comparing p1_a with the points within the target range in n2 and n3, and finally determining whether to divide p1_a into n2 or n3. Among them, the points within the target range can refer to the points whose z - coordinate values differ from the z - coordinate value of the highest point in the sets to be classified n2 and n3 by a second preset threshold. Here, the highest point in n2 and n3 is the point with the largest z - coordinate value in n2 or n3. The second preset threshold can be set according to the actual situation. For example, it can be 0.2 meters. For the purpose of achieving a more accurate classification result, the present application does not make specific limitations here.
[0076] Please refer to Figure 4 , which is another process schematic diagram of a point - cloud tree single - body segmentation method provided by an embodiment of the present application. As Figure 4 shown, the above - mentioned step S301 includes:
[0077] In step S401, calculate the distances between each point in the first point set and the first point in the clustering point set according to the projections of the first points in each clustering point set along the z - axis direction and the projections of each point in the first point set along the z - axis direction.
[0078] Specifically, project the first points in each clustering point set and each point in the first point set along the z - axis direction, and calculate the distances between each point in the first point set and the first points in each clustering point set on a plane.
[0079] In step S402, determine the two sets to be classified that each point in the first point set is closest to according to the distances between each point in the first point set and the first point in the clustering point set.
[0080] Specifically, according to the distances between the points in the first point set and the first point in the cluster point set, find the two first points closest to the points in the first point set. The two cluster point sets where the two closest first points are located are the two to-be-classified sets closest to the points in the first point set.
[0081] Continuing with the above example, project the point p1_a in the first point set p1 and the first points in each of the cluster point sets n1, n2, n3, n4, n5, assumed to be n1_p1, n2_p1, n3_p1, n4_p1, n5_p1 respectively, along the z-axis direction. Calculate the distances between p1_a and n1_p1, p1_a and n2_p1, p1_a and n3_p1, p1_a and n4_p1, p1_a and n5_p1 respectively on the plane. Assume that the calculated result shows that the distance between p1_a and n2_p1 is the smallest, and the distance between p1_a and n3_p1 is the second smallest. Then, the cluster set n2 where n2_p1 is located and the cluster set n3 where n3_p1 is located are used as the two to-be-classified sets closest to p1_a.
[0082] Repeat the above operation to find the two to-be-classified sets closest to each point in the first point set p1.
[0083] Please refer to Figure 5 , which is another process schematic diagram of a point cloud tree single body segmentation method provided by an embodiment of the present application. As Figure 5 shown, the above step S201 includes:
[0084] Step S501, using a preset clustering algorithm, calculate the distances between the points in the second point set.
[0085] Specifically, use a preset clustering algorithm to calculate the distances between the points in the second point set, and then perform clustering.
[0086] Step S502, according to the distances between the points in the second point set, cluster the points that meet the preset conditions into the same initial cluster point set to obtain m initial cluster point sets.
[0087] Specifically, according to the distances between the points in the second point set, use a preset clustering algorithm to cluster the points that meet the preset conditions into the same initial cluster point set to obtain m initial cluster point sets.
[0088] The preset clustering algorithm can be a density clustering algorithm based on k-d Tree. The algorithm first constructs a k-d Tree for the point set to be clustered to efficiently calculate the distances between points, and then uses the density clustering algorithm for clustering to find n subsets with similar inter-cluster distances. The specific steps of the clustering algorithm are as follows:
[0089] Specifically, the input of the clustering algorithm is: the sample set D = (x 1 , x 2 , …, x z ), and the neighborhood parameters (∈, MinPts). Among them, D is a data set containing z objects, and x 1 , x 2 , …, x z are the samples in D. In the embodiments of the present application, since the second point set is to be clustered, the sample set D in the embodiments of the present application is the second point set.
[0090] The neighborhood parameters (∈, MinPts) are used to describe the distribution tightness of neighborhood samples. ∈ describes the neighborhood distance threshold of a certain sample, and MinPts describes the threshold of the number of samples in the neighborhood with a distance of ∈ from a certain sample, which is called the neighborhood density threshold.
[0091] The output of the clustering algorithm is: the density-based cluster partition C.
[0092] Step (1), initialize the core object set Initialize the number of clustering clusters k = 0, initialize the set of unvisited samples Γ = D, and the cluster partition Among them, the core object set is the combination composed of all core objects, and a core object can be, for any sample x j ∈ D, if its ∈-neighborhood corresponding N∈(x j ) contains at least MinPts samples, then x j is a core object.
[0093] Step (2), for j = 1, 2,..., z, find all core objects according to the following steps:
[0094] a) Through the distance measurement method, find the ∈-neighborhood subsample set N∈(x j ) of the sample x j ;
[0095] b) If the number of samples in the subsample set satisfies |N∈(x j )| ≥ MinPts, add the sample x j to the core object sample set: Ω = Ω ∪ {x j}.
[0096] Step (3), if the core object set then the algorithm ends, otherwise go to step (4).
[0097] Step (4), in the core object set Ω, randomly select a core object o, and initialize the current cluster core object queue Ω cur={o}, initialize the category serial number k = k + 1, initialize the current cluster sample set C k ={o}, update the unvisited sample set Γ = Γ - {o}.
[0098] Step (5), if the current cluster core object queue then the current clustering cluster C k is generated, update the cluster partition C = {C 1 , C 2 ,..., C k}, update the core object set Ω = Ω - C k , transfer to step (3), otherwise update the core object set Ω = Ω - C k .
[0099] Step (6), take out a core object o' from the current cluster core object queue Ω cur , find all ∈-neighborhood sub-sample sets N∈(o') through the neighborhood distance threshold ∈, let Δ = N∈(o') ∩ Γ, update the current cluster sample set C k = C k ∪Δ, update the unvisited sample set Γ = Γ - Δ, update Ω cur = Ω cur ∪(Δ ∩ Ω) - o', transfer to step (5).
[0100] The output result is: the cluster partition C = {C 1 , C 2 ,..., C k}.
[0101] It can be understood that in the embodiment of the present application, after the second point set is partitioned by the clustering algorithm, the obtained m initial clustering point sets, that is, corresponding to the above cluster partition C, where the value of k is m in the embodiment of the present application.
[0102] Optionally, before the above step S103, the method further includes: sorting the points in the first point set and the second point set in ascending order of the z coordinate value.
[0103] Please refer to Figure 6 , which is a visualization effect diagram of two point sets after classifying the point cloud data in a point cloud tree single body segmentation method provided by an embodiment of the present application. As Figure 6 shown, p1 is the first point set, p2 is the second point set, where the z coordinate values of the points in the first point set p1 are greater than the preset height, and the z coordinate values of the points in the second point set p2 are less than or equal to the preset height.
[0104] Please refer to Figure 7, is a visualization effect of the overall segmentation step of a point cloud tree monomer segmentation method provided in an embodiment of the present application, such as Figure 7 As shown, the trunk is obtained first, then the bottom of the crown is obtained, then the middle of the crown is obtained, and finally the cluster segmentation map of the top of the crown is obtained.
[0105] Based on the same inventive concept, the embodiment of the present application also provides a point cloud tree monomer segmentation device corresponding to the point cloud tree monomer segmentation method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned point cloud tree monomer segmentation method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0106] See also Figure 8 , is a schematic diagram of the structure of a point cloud tree monomer segmentation device provided in an embodiment of the present application, such as Figure 8 As shown, the device comprises:
[0107] The division module 801 is used to divide the original tree point cloud data into a first point set and a second point set according to a preset height, wherein the z coordinate values of the points in the first point set are greater than the preset height, and the z coordinate values of the points in the second point set are less than the preset height.
[0108] The processing module 802 is used to process the second point set using a preset clustering algorithm to obtain n cluster point sets, where n is an integer greater than 0, and n is used to identify the number of trees included in the original tree point cloud data.
[0109] Acquisition module 803 is used to compare the first point in each cluster point set with the points in the first point set, divide the points in the first point set according to the comparison results, and obtain n target segmentation results, where the first point is the point with the largest z coordinate value in each cluster point set.
[0110] In a possible implementation, the processing module 802 is specifically configured to:
[0111] The second point set is processed using a preset clustering algorithm to obtain m initial clustering point sets, where m is an integer greater than 0; the sets whose total number of points in the initial clustering point sets is less than a first preset threshold are eliminated to obtain n clustering point sets.
[0112] In a possible implementation, the acquisition module 803 is specifically used to:
[0113] Compare the first point in each set of clustering points with the points in the first point set respectively to determine the two sets to be classified that are closest to each point in the first point set, where the sets to be classified belong to n sets of clustering points; compare each point in the first point set with the points within the target range in the corresponding set to be classified to determine the finally divided sets, and obtain n target segmentation results. The points within the target range in the set to be classified include: the points whose z - coordinate values differ from the z - coordinate value of the highest point in the two sets to be classified by a second preset threshold, where the highest point is the point with the largest z - coordinate value in the set to be classified.
[0114] In a possible implementation manner, the obtaining module 803 is further specifically configured to:
[0115] Calculate the distances between each point in the first point set and the first point in the set of clustering points according to the projections of the first point in each set of clustering points in the z - axis direction and the projections of each point in the first point set in the z - axis direction; determine the two sets to be classified that are closest to each point in the first point set according to the distances between each point in the first point set and the first point in the set of clustering points.
[0116] In a possible implementation manner, the processing module 802 is further specifically configured to:
[0117] Use a preset clustering algorithm to calculate the distances between the points in the second point set; cluster the points that meet the preset conditions into the same initial clustering point set according to the distances between the points in the second point set, and obtain m initial clustering point sets.
[0118] The above - mentioned device is used to execute the method provided in the foregoing embodiment. For the processing flow of each module in the device and the interaction flow between the modules, reference can be made to the relevant descriptions in the method embodiment above, which will not be elaborated here.
[0119] The above-mentioned modules may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when a certain module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0120] Embodiments of the present application also provide an electronic device 900, as Figure 9 shown, which is a schematic structural diagram of the electronic device 900 provided by the embodiments of the present application, including: a processor 901, a memory 902, and a bus 903. The memory 902 stores machine-readable instructions executable by the processor 901. When the electronic device 900 runs, the processor 901 communicates with the memory 902 through the bus 903. When the machine-readable instructions are executed by the processor 901, the method steps in the method embodiments of the above-mentioned point cloud tree single-body segmentation method are executed.
[0121] Embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps in the method embodiments of the above-mentioned point cloud tree single-body segmentation method are executed.
[0122] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the method embodiments of the above-mentioned point cloud tree single-body segmentation method can be executed.
[0123] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0124] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] In addition, each functional unit in various embodiments of the present application may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a hardware plus software functional unit.
[0126] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit stored in a storage medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk, or an optical disc that can store program codes.
Claims
1. A method for segmenting individual tree points in a point cloud, characterized in that, the method includes: Dividing the original tree point cloud data into a first point set and a second point set according to a preset height, where the z - coordinate value of the points in the first point set is greater than the preset height, and the z - coordinate value of the points in the second point set is less than the preset height; Using a preset clustering algorithm to process the second point set to obtain n clustering point sets, where n is an integer greater than 0, and n is used to identify the number of trees contained in the original tree point cloud data; Comparing the first point in each of the clustering point sets with the points in the first point set respectively, and dividing the points in the first point set according to the comparison results to obtain n target segmentation results, where the first point is the point with the largest z - coordinate value in each of the clustering point sets; Among them, the step of comparing the first point in each of the clustering point sets with the points in the first point set respectively, dividing the points in the first point set according to the comparison results, and obtaining n target segmentation results includes: Comparing the first point in each of the clustering point sets with the points in the first point set respectively to determine two to - be - classified sets that are closest to each point in the first point set, where the to - be - classified sets belong to the n clustering point sets; Comparing each point in the first point set with the points within the target range in the corresponding to - be - classified set to determine the finally divided set and obtain n target segmentation results, where the points within the target range in the to - be - classified set include: points whose z - coordinate values differ from the z - coordinate value of the highest point in the two to - be - classified sets by a second preset threshold, where the highest point is the point with the largest z - coordinate value in the to - be - classified set; Among them, the step of comparing the first point in each of the clustering point sets with the points in the first point set respectively to determine two to - be - classified sets that are closest to each point in the first point set includes: Calculating the distance between each point in the first point set and the first point in the clustering point set according to the projection of the first point in each of the clustering point sets along the z - axis direction and the projection of each point in the first point set along the z - axis direction; Determining two to - be - classified sets that are closest to each point in the first point set according to the distance between each point in the first point set and the first point in the clustering point set.
2. The method according to claim 1, characterized in that, the step of using a preset clustering algorithm to process the second point set to obtain n clustering point sets includes: Using a preset clustering algorithm to process the second point set to obtain m initial clustering point sets, where m is an integer greater than 0; Removing the sets in the initial clustering point sets whose total number of points is less than a first preset threshold to obtain the n clustering point sets.
3. The method according to claim 2, characterized in that, the step of using a preset clustering algorithm to process the second point set to obtain m initial clustering point sets includes: Using a preset clustering algorithm to calculate the distance between each point in the second point set. Cluster the points that meet the preset conditions into the same set of initial clustering points according to the distances between the points in the second point set, and obtain m sets of initial clustering points.
4. The method according to any one of claims 1-3, wherein, before the step of comparing the first points in each of the clustering point sets with the points in the first point set respectively and dividing the points in the first point set according to the comparison results to obtain n target segmentation results, it further includes: Sorting the points in the first point set and the second point set in ascending order of the z coordinate value.
5. A point cloud tree single body segmentation device, wherein, the device includes: a dividing module, configured to divide the original tree point cloud data into a first point set and a second point set according to a preset height, wherein the z coordinate values of the points in the first point set are greater than the preset height, and the z coordinate values of the points in the second point set are less than the preset height; a processing module, configured to process the second point set by using a preset clustering algorithm to obtain n clustering point sets, where n is an integer greater than 0, and n is used to identify the number of trees included in the original tree point cloud data; an obtaining module, configured to compare the first points in each of the clustering point sets with the points in the first point set respectively, and divide the points in the first point set according to the comparison results to obtain n target segmentation results, wherein the first point is the point with the largest z coordinate value in each of the clustering point sets; wherein, the obtaining module is specifically configured to: compare the first points in each of the clustering point sets with the points in the first point set respectively, and determine two to-be-classified sets that are closest to each point in the first point set, wherein the to-be-classified sets belong to the n clustering point sets; compare each point in the first point set with the points in the target range in the corresponding to-be-classified set to determine the finally divided set, and obtain n target segmentation results, wherein the points in the target range in the to-be-classified set include: the points whose z coordinate values differ from the z coordinate values of the highest points in the two to-be-classified sets by a second preset threshold, wherein the highest point is the point with the largest z coordinate value in the to-be-classified set; wherein, the obtaining module is specifically configured to: calculate the distances between each point in the first point set and the first point in the clustering point set according to the projections of the first points in each of the clustering point sets in the z-axis direction and the projections of each point in the first point set in the z-axis direction; determine two to-be-classified sets that are closest to each point in the first point set according to the distances between each point in the first point set and the first point in the clustering point set.
6. The device according to claim 5, wherein, the processing module is specifically configured to: process the second point set by using a preset clustering algorithm to obtain m sets of initial clustering points, where m is an integer greater than 0; and remove the sets with the total number of points less than a first preset threshold in the initial clustering point sets to obtain the n clustering point sets.
7. An electronic device, wherein, it includes: A processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus. The processor executes the program instructions to perform the steps of the point cloud tree single body segmentation method according to any one of claims 1-4 when executed.
8. A computer-readable storage medium, characterized in that, a computer program is stored on the storage medium, and when the computer program is run by a processor, it performs the steps of the point cloud tree single body segmentation method according to any one of claims 1-4.
Citation Information
Patent Citations
Single-tree segmentation method and device
CN106408578A
Robust segmentation method for determining deciduous forest tree-level parameters by adopting airborne laser radar
CN111428784A