CN111986223A - Method for extracting trees in outdoor point cloud scene based on energy function - Google Patents
Method for extracting trees in outdoor point cloud scene based on energy function Download PDFInfo
- Publication number
- CN111986223A CN111986223A CN202010680646.4A CN202010680646A CN111986223A CN 111986223 A CN111986223 A CN 111986223A CN 202010680646 A CN202010680646 A CN 202010680646A CN 111986223 A CN111986223 A CN 111986223A
- Authority
- CN
- China
- Prior art keywords
- cluster
- points
- energy function
- point cloud
- clusters
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 239000011159 matrix material Substances 0.000 claims abstract description 46
- 238000000605 extraction Methods 0.000 claims abstract description 21
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 9
- 238000004364 calculation method Methods 0.000 claims abstract description 7
- 238000012216 screening Methods 0.000 claims abstract description 4
- 230000008520 organization Effects 0.000 claims description 9
- 239000013598 vector Substances 0.000 claims description 8
- 238000010845 search algorithm Methods 0.000 claims description 3
- 230000006870 function Effects 0.000 description 33
- 230000011218 segmentation Effects 0.000 description 10
- 238000005457 optimization Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
-
- G06T5/70—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Abstract
The invention discloses a method for extracting trees in an outdoor point cloud scene based on an energy function, which comprises the steps of selecting LiDAR point cloud data and removing plane points in the LiDAR point cloud data to obtain candidate tree points; clustering by using an Euclidean clustering algorithm, and storing all clusters obtained by clustering in a cluster set C; performing similarity matrix calculation, then calculating an energy function of the cluster set C, and merging the clusters in the cluster set C according to the energy function; and (4) screening and optimizing the merged cluster, and finishing the extraction. According to the method for extracting the trees in the outdoor point cloud scene based on the energy function, the problem of insufficient clustering is solved by effectively combining clusters; the clusters which are not enough to become a tree after the clustering is finished are taken as noise points to be removed, so that the removal of non-tree objects is finished, the accuracy of single tree extraction is improved, the calculation process is fast, and the method has good practical value.
Description
Technical Field
The invention belongs to the technical field of artificial intelligence calculation methods, and particularly relates to an energy function-based tree extraction method in an outdoor point cloud scene.
Background
With the development of virtual reality, artificial intelligence and computer vision technology, the analysis of various three-dimensional outdoor scenes has become a research topic with important research significance and application value. Trees are one of important elements in urban scenes, and are widely applied to the fields of urban planning and construction, 3D tree modeling, urban tree detection and the like. In recent years, researchers have proposed many different methods to extract trees from LiDAR data, primarily a segmentation and classification process, based on which most algorithms are implemented. At present, tree extraction methods based on segmentation and classification are mainly classified into six categories:
(1) tree extraction based on region growing: including segmented building structures and a single tree. The single tree extracted by the method has high precision and shows good performance in a relatively simple outdoor environment. Region-based methods fall into two categories: a seeded zone (or bottom-up) approach and a non-seeded zone (or top-down) approach. The region segmentation based on the seeds starts to segment by selecting a plurality of seed points, and a point cloud region is gradually formed by adding seed neighborhood points from the seed points as starting points. This method has a long processing time and is easily affected by noise points. A new improved method for detecting point cloud by taking the characteristics of gradient, normal vector, curvature and the like as growth criteria is provided subsequently, the method improves the robustness of segmentation and is insensitive to outliers and noise points, but if the initial seed points and the growth rules are not properly selected, the problems of over-segmentation or under-segmentation and the like can also be caused. The non-seed region method is a top-down method, firstly all points are classified in the same region, then the points in the region are thinned and segmented into small regions step by step until the segmentation is completed, the segmentation result of the non-seed region method depends on the position and the mode of segmentation, and the use of the method is greatly limited due to the need of a large amount of prior knowledge such as an object model, the number of regions and the like.
(2) Tree extraction based on attribute features: the method is used for segmenting based on the attributes of the point cloud data, and has good robustness. The method comprises the steps of firstly calculating attributes of point cloud data, including texture features, normal vectors, color information and the like, then clustering the features, and finally segmenting the point cloud with different features. The method depends on the definition of neighborhoods among points and the point density of the point cloud data, so that the defects of high time complexity and low processing efficiency exist along with the increase of the point cloud data density, and the method is not suitable for processing the point cloud data with larger scale.
(3) And (3) extracting trees based on graph optimization: the method based on graph optimization is to use point cloud data as a vertex, construct edges by using the spatial neighborhood relationship of points, weight connecting edges by using the similarity of neighborhood points to construct a graph, and realize the segmentation of the point cloud by using a graph cutting method. A well-known graph optimization method is a graph-based partitioning algorithm (FH algorithm) that is simple and efficient for finding the smallest spanning tree in a graph. The method based on graph optimization usually adopts a strategy of global optimization to solve, can obtain a global optimization result, and is not influenced by scene complexity and a mathematical model. However, due to the complex process of constructing the map, the optimization process cannot be usually run in real time when the point cloud data is large in size.
(4) Extracting trees based on model fitting: the method is mainly used for extracting objects with specific shapes, including planes, cylinders and spheres, the fitting degree of point cloud to model parameters needs to be detected, data belonging to a target object in object data with specific shapes are reserved, and then a complete tree is presented through combination. When using a model-based fitting approach, a refinement process is required for each extracted tree cluster. This method has a purely mathematical principle, is fast and powerful. The method has the limitation that the method is sensitive to noise, so that the experimental result is not ideal under the conditions of huge data and complex scene.
(5) Clustering-based tree extraction: a cluster is considered to be a high density region in the data space divided by a low density region. The guiding idea is as follows: whenever the density of points in a region exceeds a certain threshold, it is added to the clusters that are close to it. The method is widely applied to extracting individual trees from MLS data, can quickly and successfully separate single trees, but often has the problem of insufficient clustering or over clustering, so that the tree extraction is not complete.
(6) Voxel-based tree extraction: the method comprises the steps of converting point cloud data into a voxel format when preprocessing the point cloud data, performing neighborhood judgment by taking a voxel as a unit, realizing point cloud series segmentation by comparing colors, intensity and spatial positions of points, and extracting candidate trees; although good results are obtained, the performance of the method is severely limited by voxel granularity and boundary blurring caused by different point cloud partitions, and the segmentation precision is lost.
Disclosure of Invention
The invention aims to provide an energy function-based tree extraction method in an outdoor point cloud scene, and solves the problems of low separation accuracy, huge data and slow operation in the existing extraction method.
The invention adopts the technical scheme that a method for extracting trees in an outdoor point cloud scene based on an energy function comprises the following steps:
step 1, LiDAR point cloud data is selected, and plane points in the LiDAR point cloud data are removed to obtain candidate tree points;
step 2, clustering the candidate tree points in the step 1 by using an Euclidean clustering algorithm, and storing all clusters obtained by clustering in a cluster set C;
step 3, performing similarity matrix calculation on the cluster C obtained in the step 2; adding uniqueness constraint and conditional constraint, then calculating an energy function of the cluster C, and merging the clusters in the cluster C according to the energy function;
and 4, screening and optimizing the cluster sets combined in the step 3, judging the point number of each cluster, deleting the clusters with the point number not greater than 1000, and finishing extraction.
The present invention is also characterized in that,
the step 1 specifically comprises the following steps:
step 1.1, at least three non-collinear points are randomly selected from LiDAR point cloud data, a plane is fitted, and four coefficients of the plane are calculated through a normal vector;
step 1.2, calculating the distance from each remaining point in LiDAR point cloud data to the plane in the step 1.1, judging a point close to the plane according to a threshold value, marking the point as a local point of the model, and recording the quantity of the local points of the model;
step 1.3, repeating iteration, and when an iteration exit condition is met, exiting the loop to obtain the most reasonable solution in the whole iteration process, namely a plane point set;
and step 1.4, removing the plane point set in the step 1.3 to obtain candidate tree points.
The iteration exit condition in step 1.3 is specifically as follows:
step 1.3.1, setting W as the probability of randomly drawing the local interior points, and representing the number of data to be selected for calculating the model parameters by n 'to obtain the probability W that the randomly drawn n' points are all local interior pointsn′(ii) a Calculating the probability of the existence of at least one outlier, denoted 1-Wn′(ii) a Calculating the probability (1-W) that at least one outlier exists for each of k' iterationsn′)k′(ii) a The probability that at least one set of correct model parameters can be obtained k' times for the iteration is recorded as 1- (1-W)n′)k′;
Step 1.3.2, calculate confidence P ═ 1- (1-W)n′)k′;
Step 1.3.3, logarithm is taken on the confidence level P in step 1.3.2, and k' ═ log (1-P)/log (1-W) is obtained by reverse deductionn′) And the value of k 'is an iteration termination condition, and when the actual iteration number is not less than k', the loop is exited.
The step 2 specifically comprises the following steps:
step 2.1, establishing a topological organization structure for the candidate tree points in the step 1 by using a kd-tree;
2.2, selecting any point p in the topological organization structure in the step 2.1, finding k points nearest to the point p by a kd-tree neighbor search algorithm, and clustering the points with the distance smaller than a set threshold value into a set Q;
step 2.3, selecting other point points except for the p points in the set Q, searching k neighbors through a kd-tree, continuing to add the k neighbors to the set Q aiming at the points smaller than the distance threshold, repeating until the number of elements in the Q is not increased, and dividing to finish a cluster;
and 2.4, continuously selecting points out of the set Q, repeating the step 2.2 and the step 2.3 until all the points in the topological organization structure are divided into a certain cluster, and storing all the clusters obtained by clustering in a cluster set C.
The step 3 specifically comprises the following steps:
step 3.1, set the ith row jth element of the adjacent matrix, cluster ciThe centroid of is denoted as piCluster cjThe centroid of is denoted as pjCalculating the Euclidean distance dis (p)i,pj,ci,cj) Direction difference dir (p)i,pj,ci,cj) A similar value W (c)i,cj) As shown in formulas (1) to (3):
dis(pi,pj,ci,cj)=||pi-pj|| (1)
W(ci,cj)=λdis(pi,pj,ci,cj)+βdir(pi,pj,ci,cj) (3)
in the formulae (1) to (3), the parameter V represents piOr pjBy least squares linear fitting of piOr pjLocally fitting a plane, and then solving a direction vector corresponding to the maximum characteristic value as a main direction; where the parameter λ + β is 1, λ is between 0 and 1 and the value of λ depends on the cluster ciThe density of (a), wherein,parameter p*Belong to cluster ciAt any point inK' represents a cluster ciCounting the total points;
and 3.2, setting that the cluster set C in the step 2 comprises n clusters, wherein the two-dimensional matrix M represents the relation between each cluster and is a symmetric matrix, the value is 0 or 1, and the merging principle is to merge the clusters with the median value of 1 in the two-dimensional matrix M.
The step 3.2 is specifically as follows:
step 3.2.1, initializing elements in the two-dimensional matrix M based on the Euclidean distance, if the distance is not more than 0.2M, initializing the data in the corresponding two-dimensional matrix M to 1, otherwise, initializing the data in the two-dimensional matrix M to 0;
step 3.2.2, adding a uniqueness constraint such as a formula (4), wherein the uniqueness constraint represents that only one element of each row in the two-dimensional matrix M is assigned with 1 after the two-dimensional matrix M is updated through an energy function formula; using MijTo represent the value of (i, j) in the two-dimensional matrix M, if the energy function is updated then MijWhen 1, then Mji1, represents the corresponding cluster ciAnd cjMerging the two;
step 3.2.3, adding conditional constraint as formula (5), wherein the conditional constraint represents that the most suitable cluster for combination is found by the maximum similarity value according to the similarity matrix of the two clusters;
wherein the parameter Sij,isIs a matrix in which Sij,isWhere "ij" represents the current ith row and jth column, and "is" represents the cluster ciValue from other clusters, Sij,isIndicate a cluster ciAnd cjThe weight of (d) is then:
wherein if j is s, γ is 0, otherwise γ is 1;
step 3.2.4, combining the uniqueness constraint of step 3.2.2 and the conditional constraint of step 3.2.3, can derive an energy function, as shown in equation (7),
after the uniqueness constraint formula is simplified, the energy function PE' before updating is a formula (12),
step 3.2.5, energy function PE after updateOAnd the energy function PE' before updating is as shown in equation (13):
ED=PEO-PE' (13)
if j is S, then S'pq,pqWhen 0, we get:
substituting equation (15) into equation (14) yields:
since ED ≦ 0, the rule for which the update is proposed is shown in equation (17):
step 3.2.6, updating the two-dimensional symmetric matrix M through a formula (17) in the step 3.2.5, and merging according to the updated result;
and 3.2.7, merging the clusters with the median value of 1 in the two-dimensional matrix processed in the step 3.2.6, and repeatedly executing the steps until no cluster which can be merged exists.
The invention has the beneficial effects that: according to the method for extracting the trees in the outdoor point cloud scene based on the energy function, the problem of insufficient clustering is solved by effectively combining clusters; clusters which are not enough to become a tree after clustering is finished are taken as noise points to be removed, the removal of non-tree objects is finished, the accuracy of single tree extraction is improved, the calculation process is fast, and the method has good practical value.
Drawings
FIG. 1 is a flow chart of a method for extracting trees in an outdoor point cloud scene based on an energy function according to the present invention;
FIG. 2 is a schematic diagram of mapping the original data to a two-dimensional plane according to the tree extraction method of the present invention;
FIG. 3 is a schematic diagram of Euclidean clustering results in the tree extraction method of the present invention;
FIG. 4 is a schematic diagram of the clustering primary result of the energy function method in the tree extraction method of the present invention;
FIG. 5 is a schematic diagram of the final clustering result of the energy function method in the tree extraction method of the present invention;
fig. 6 is a schematic diagram of an optimization processing result in the tree extraction method of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
The invention relates to a method for extracting trees in an outdoor point cloud scene based on an energy function, which comprises the following steps as shown in figure 1:
step 1, as shown in fig. 2, LiDAR point cloud data is selected and projected on a two-dimensional plane, and plane points in the LiDAR point cloud data are removed to obtain candidate tree points. The initial LiDAR point cloud data is divided into ground points and non-ground points, and specifically comprises the following steps:
step 1.1, at least three non-collinear points are randomly selected from LiDAR point cloud data, a plane is fitted, and four coefficients of the plane are calculated through a normal vector; the number of points forming a plane is selected to be determined according to a model, generally, the minimum data number suitable for the model is selected, and because a plane is to be fitted, at least three points are selected and are not collinear;
step 1.2, calculating the distance from each remaining point in LiDAR point cloud data to the plane in the step 1.1, judging a point close to the plane according to a threshold value, marking the point as a local point of the model, and recording the quantity of the local points of the model;
step 1.3, repeating iteration, and when an iteration exit condition is met, exiting the loop to obtain the most reasonable solution in the whole iteration process, namely the plane point set capable of fitting the model to the maximum extent; the iteration exit condition is specifically as follows:
step 1.3.1, setting W to represent the probability of randomly drawing the local interior points, and n 'to represent the number of data to be selected for calculating the model parameters, and calculating the probability W that the randomly drawn n' points are all local interior pointsn′(ii) a Calculating the probability of the existence of at least one outlier, denoted 1-Wn′(ii) a Calculating the probability (1-W) that at least one outlier exists for each of k' iterationsn′)k′When k' is sufficiently large, the probability is (1-W)n′)k′Will be small, meaning the higher the model confidence; the probability that at least one set of correct model parameters can be obtained k' times for the iteration is recorded as 1- (1-W)n′)k′;
Step 1.3.2, calculate confidence P ═ 1- (1-W)n′)k′Represents the expected probability that the RANSAC algorithm provides a useful result after running;
step 1.3.3, logarithm of confidence P is taken, and k' ═ log (1-P)/log (1-W) is back-inferredn′) And the value of k 'is an iteration termination condition, and when the actual iteration number is not less than k', the loop is exited.
And step 1.4, removing the plane point set in the step 1.3 to obtain candidate tree points.
And 2, assuming that any one candidate tree point in the step 1 represents a cluster, clustering the candidate trees by using the Euclidean clustering algorithm, and storing all clusters obtained by clustering in a cluster set C.
If each candidate tree point represents a cluster, the candidate trees are directly subjected to clustering solution through an energy function, so that the condition of insufficient memory is easily caused when similarity data between each data point and other data points are stored. Therefore, the Euclidean clustering algorithm is utilized to perform clustering processing on the candidate trees, the candidate tree points are divided into a plurality of clusters, and the initial cluster number is reduced.
Step 2.1, establishing a topological organization structure for the candidate tree points in the step 1 by using a kd-tree; the method specifically comprises the following steps:
firstly, dividing dimensions, calculating variance for all dimension values, and selecting dimension d with maximum variance0(ii) a Subsequently, the data items of the cutting standard are selected to find the dimension d0Dividing the median m of all the data items into data sets according to m, dividing the data sets into two, and recording two data subsets as DlAnd DrEstablishing tree nodes and storing the division; again, for both subsets of data DlAnd DrRepeating the division, and setting newly generated tree nodes as left and right children of the last division; and finally, fully dividing the data until the data cannot be divided any more, and storing the corresponding data into a final node, wherein the final node is a leaf node.
2.2, randomly selecting any point p in the topological organization structure in the step 2.1, finding k points nearest to the point p by a kd-tree neighbor search algorithm, and clustering the points with the distance smaller than a set threshold value into a set Q;
step 2.3, selecting points except for the p points in the set Q, searching k neighbors through a kd-tree, adding the k neighbors to the set Q for the points smaller than the distance threshold, repeating the process until the number of elements in the Q is not increased, and completing the division of one cluster;
and 2.4, continuously selecting points out of the set Q, repeating the step 2.2 and the step 2.3 until all the points in the topological organization structure are divided into a certain cluster, and storing all the clusters obtained by clustering in a cluster set C.
As shown in FIG. 3, the points in FIG. 2 are divided into 11 total parts of AA \ BB \ CC \ DD \ EE \ FF \ HH \ II \ JJ \ GG \ KK by Euclidean clustering.
Step 3, performing similarity matrix calculation on the cluster C obtained in the step 2; and then, calculating an energy function of the cluster C, and merging the clusters in the cluster C according to the energy function.
The method comprises the steps of clustering the point cloud data of the outdoor scene by Euclidean distance to obtain a cluster set C, combining similar data samples together, and then finding out two most similar clusters by calculating the value of a similarity matrix and combining the two most similar clusters to form a new cluster. However, when the above method is used to find the cluster with the best combination, only the locally best combination situation can be shown. Therefore, when solving the similarity, the uniqueness constraint and the conditional constraint are added to form an energy function, and whether the two clusters need to be merged or not is analyzed through the energy function. Based on the principle of minimizing the energy function, when a tree is clustered into a plurality of clusters, the combination of the clusters can be effectively carried out.
Step 3.1, set the ith row jth element of the adjacent matrix, cluster ciThe centroid of is denoted as piCluster cjThe centroid of is denoted as pjCalculating the Euclidean distance dis (p)i,pj,ci,cj) Direction difference dir (p)i,pj,ci,cj) A similar value W (c)i,cj) As shown in formulas (1) to (3):
dis(pi,pj,ci,cj)=||pi-pj|| (1)
W(ci,cj)=λdis(pi,pj,ci,cj)+βdir(pi,pj,ci,cj) (3)
in the formulae (1) to (3), the parameter V represents piOr pjBy least squares linear fitting of piOr pjLocally fitting a plane, and then solving a direction vector corresponding to the maximum characteristic value as a main direction; where the parameter λ + β is 1, λ is between 0 and 1 and the value of λ depends on the cluster ciThe density of (a) of (b),wherein the content of the first and second substances,parameter p*Belong to cluster ciAt any point in (a), k' represents the cluster ciThe total number of points in the table.
And 3.2, setting that the cluster set C in the step 2 comprises n clusters, wherein the two-dimensional matrix M represents the relation between each cluster and is a symmetric matrix, the value is 0 or 1, and the merging principle is to merge the clusters with the median value of 1 in the two-dimensional matrix M. The method specifically comprises the following steps:
step 3.2.1, initializing elements in the two-dimensional matrix M based on the Euclidean distance, if the distance is not more than 0.2M, initializing the data in the corresponding two-dimensional matrix M to 1, otherwise, initializing the data in the two-dimensional matrix M to 0;
step 3.2.2, adding a uniqueness constraint, such as a formula (4), wherein the uniqueness constraint represents that only one element in each row of the two-dimensional matrix M is assigned with 1 after being updated by an energy function formula, and specifically, only one-to-one relation appears in each iterative clustering process; using MijTo represent the value of (i, j) in the two-dimensional matrix M, if the energy function is updated then MijWhen 1, then Mji1, represents the corresponding cluster ciAnd cjMerging the two;
step 3.2.3, adding conditional constraint, such as formula (5), wherein the conditional constraint represents that the most suitable cluster for combination is found by the maximum similarity value according to the similarity matrix of the two clusters;
wherein the parameter Sij,isIs a matrix, because the ith row and the cluster c are required to be takeniAnother cluster that is most similar, so the current cluster c is addediComputing clusters c with other clustersiAnd cjThe value of the effect of time; wherein Sij,isWhere "ij" represents the current ith row and jth column, and "is" represents the cluster ciValue from other clusters, Sij,isIndicate a cluster ciAnd cjThe weight of (d) is then:
wherein if j is s, γ is 0, otherwise γ is 1;
step 3.2.4, combining the uniqueness constraint of step 3.2.2 and the conditional constraint of step 3.2.3, can derive an energy function, as shown in equation (7),
in order to more conveniently and intuitively solve the value of the energy function, formulas of uniqueness constraint and conditional constraint are simplified respectively.
Simplifying the uniqueness constraint formula:
after the reduction, the energy function PE is shown in equation (10):
the energy function PE' before updating is equation (11),
substituting the formula (10) into the formula (11) to obtain
In order to minimize the energy function, step 3.2.5, the energy function PE needs to be updatedOAnd updating the previous energy function PE' for analysis as shown in equation (13):
ED=PEO-PE' (13)
based on the analysis of the energy changes of the update process, the energy from M will be used in the formulapqBecome M'pqAs shown in formula (14):
s 'since j is S'pq,pqWhen 0, we get:
from the formula (14), it can be found that
Since ED ≦ 0 is always maintained, the updated rule is proposed on this basis as shown in equation (17):
step 3.2.6, the two-dimensional symmetric matrix M is updated by the formula (17) in step 3.2.5, and merging is performed according to the updated result(ii) a If the calculated value of equation (17) is greater than 0, cluster c will be formediAnd cluster cjThe corresponding value in the two-dimensional array is marked as 0; if the calculated value of equation (17) is equal to 0, cluster c will be formediAnd cluster cjThe corresponding value in the two-dimensional array is marked as 1; if the calculated value of equation (17) is less than 0, cluster c is formediAnd cluster cjThe corresponding value in the two-dimensional array is unchanged;
and 3.2.7, merging the clusters with the median value of 1 in the two-dimensional matrix processed in the step 3.2.6, and repeatedly executing the steps until no cluster which can be merged exists.
As shown in fig. 4, the clustering by the energy function method in fig. 3 is performed once to obtain six parts in total, namely, a-B (combining AA and BB), C-D (combining CC and DD), E-F (combining FF and EE), HH, I-J (combining II and JJ), and G-K (combining GG and KK); after repeated combination, the final combination result is shown in FIG. 5, which is divided into four parts, namely, A-B, C-D-E-F (combination of C-D and E-F), HH, I-J-G-K (combination of I-J and G-K).
And 4, screening and optimizing the cluster sets combined in the step 3, judging the point number of each cluster, deleting the clusters with the point number not greater than 1000, and finishing extraction. As shown in FIG. 6, clusters not greater than 1000 in FIG. 5 are eliminated, and the remaining C-D-E-F and I-J-G-K are the final extraction results.
Claims (6)
1. A method for extracting trees in an outdoor point cloud scene based on an energy function is characterized by comprising the following steps:
step 1, LiDAR point cloud data is selected, and plane points in the LiDAR point cloud data are removed to obtain candidate tree points;
step 2, clustering the candidate tree points in the step 1 by using an Euclidean clustering algorithm, and storing all clusters obtained by clustering in a cluster set C;
step 3, performing similarity matrix calculation on the cluster C obtained in the step 2; adding uniqueness constraint and conditional constraint, then calculating an energy function of the cluster C, and merging the clusters in the cluster C according to the energy function;
and 4, screening and optimizing the cluster sets combined in the step 3, judging the point number of each cluster, deleting the clusters with the point number not greater than 1000, and finishing extraction.
2. The method for extracting trees in the outdoor point cloud scene based on the energy function as claimed in claim 1, wherein the step 1 is specifically as follows:
step 1.1, at least three non-collinear points are randomly selected from LiDAR point cloud data, a plane is fitted, and four coefficients of the plane are calculated through a normal vector;
step 1.2, calculating the distance from each remaining point in LiDAR point cloud data to the plane in the step 1.1, judging a point close to the plane according to a threshold value, marking the point as a local point of the model, and recording the quantity of the local points of the model;
step 1.3, repeating iteration, and when an iteration exit condition is met, exiting the loop to obtain the most reasonable solution in the whole iteration process, namely a plane point set;
and step 1.4, removing the plane point set in the step 1.3 to obtain candidate tree points.
3. The method for extracting trees in the outdoor point cloud scene based on the energy function as claimed in claim 2, wherein the iteration exiting condition in the step 1.3 is specifically:
step 1.3.1, setting W as the probability of randomly drawing the local interior points, and representing the number of data to be selected for calculating the model parameters by n 'to obtain the probability W that the randomly drawn n' points are all local interior pointsn′(ii) a Calculating the probability of the existence of at least one outlier, denoted 1-Wn′(ii) a Calculating the probability (1-W) that at least one outlier exists for each of k' iterationsn′)k′(ii) a The probability that at least one set of correct model parameters can be obtained k' times for the iteration is recorded as 1- (1-W)n′)k′;
Step 1.3.2, calculate confidence P ═ 1- (1-W)n′)k′;
Step 1.3.3, logarithm is taken on the confidence level P in step 1.3.2, and k' ═ log (1-P)/log (1-W) is obtained by reverse deductionn′) K' is the value of the overlapAnd (4) when the actual iteration number is not less than k', exiting the loop.
4. The method for extracting trees in the outdoor point cloud scene based on the energy function as claimed in claim 1, wherein the step 2 is specifically as follows:
step 2.1, establishing a topological organization structure for the candidate tree points in the step 1 by using a kd-tree;
2.2, selecting any point p in the topological organization structure in the step 2.1, finding k points nearest to the point p by a kd-tree neighbor search algorithm, and clustering the points with the distance smaller than a set threshold value into a set Q;
step 2.3, selecting other point points except for the p points in the set Q, searching k neighbors through a kd-tree, continuing to add the k neighbors to the set Q aiming at the points smaller than the distance threshold, repeating until the number of elements in the Q is not increased, and dividing to finish a cluster;
and 2.4, continuously selecting points out of the set Q, repeating the step 2.2 and the step 2.3 until all the points in the topological organization structure are divided into a certain cluster, and storing all the clusters obtained by clustering in a cluster set C.
5. The method for extracting trees in the outdoor point cloud scene based on the energy function as claimed in claim 1, wherein the step 3 is specifically as follows:
step 3.1, set the ith row jth element of the adjacent matrix, cluster ciThe centroid of is denoted as piCluster cjThe centroid of is denoted as pjCalculating the Euclidean distance dis (p)i,pj,ci,cj) Direction difference dir (p)i,pj,ci,cj) A similar value W (c)i,cj) As shown in formulas (1) to (3):
dis(pi,pj,ci,cj)=||pi-pj|| (1)
W(ci,cj)=λdis(pi,pj,ci,cj)+βdir(pi,pj,ci,cj) (3)
in the formulae (1) to (3), the parameter V represents piOr pjBy least squares linear fitting of piOr pjLocally fitting a plane, and then solving a direction vector corresponding to the maximum characteristic value as a main direction; where the parameter λ + β is 1, λ is between 0 and 1 and the value of λ depends on the cluster ciThe density of (a), wherein,parameter p*Belong to cluster ciAt any point in (a), k' represents the cluster ciCounting the total points;
and 3.2, setting that the cluster set C in the step 2 comprises n clusters, wherein the two-dimensional matrix M represents the relation between each cluster and is a symmetric matrix, the value is 0 or 1, and the merging principle is to merge the clusters with the median value of 1 in the two-dimensional matrix M.
6. The method for extracting trees in the outdoor point cloud scene based on the energy function as claimed in claim 5, wherein the step 3.2 is specifically as follows:
step 3.2.1, initializing elements in the two-dimensional matrix M based on the Euclidean distance, if the distance is not more than 0.2M, initializing the data in the corresponding two-dimensional matrix M to 1, otherwise, initializing the data in the two-dimensional matrix M to 0;
step 3.2.2, adding a uniqueness constraint such as a formula (4), wherein the uniqueness constraint represents that only one element of each row in the two-dimensional matrix M is assigned with 1 after the two-dimensional matrix M is updated through an energy function formula; using MijTo represent the value of (i, j) in the two-dimensional matrix M, if the energy function is updated then MijWhen 1, then Mji1, represents the corresponding cluster ciAnd cjMerging the two;
step 3.2.3, adding conditional constraint as formula (5), wherein the conditional constraint represents that the most suitable cluster for combination is found by the maximum similarity value according to the similarity matrix of the two clusters;
wherein the parameter Sij,isIs a matrix in which Sij,isWhere "ij" represents the current ith row and jth column, and "is" represents the cluster ciValue from other clusters, Sij,isIndicate a cluster ciAnd cjThe weight of (d) is then:
wherein if j is s, γ is 0, otherwise γ is 1;
step 3.2.4, combining the uniqueness constraint of step 3.2.2 and the conditional constraint of step 3.2.3, can derive an energy function, as shown in equation (7),
after the uniqueness constraint formula is simplified, the energy function PE' before updating is a formula (12),
step 3.2.5, energy function PE after updateOAnd the energy function PE' before updating is as shown in equation (13):
ED=PEO-PE' (13)
if j is S, then S'pq,pqWhen 0, we get:
substituting equation (15) into equation (14) yields:
since ED ≦ 0, the rule for which the update is proposed is shown in equation (17):
step 3.2.6, updating the two-dimensional symmetric matrix M through a formula (17) in the step 3.2.5, and merging according to the updated result;
and 3.2.7, merging the clusters with the median value of 1 in the two-dimensional matrix processed in the step 3.2.6, and repeatedly executing the steps until no cluster which can be merged exists.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010680646.4A CN111986223B (en) | 2020-07-15 | 2020-07-15 | Method for extracting trees in outdoor point cloud scene based on energy function |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010680646.4A CN111986223B (en) | 2020-07-15 | 2020-07-15 | Method for extracting trees in outdoor point cloud scene based on energy function |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111986223A true CN111986223A (en) | 2020-11-24 |
CN111986223B CN111986223B (en) | 2024-02-06 |
Family
ID=73438654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010680646.4A Active CN111986223B (en) | 2020-07-15 | 2020-07-15 | Method for extracting trees in outdoor point cloud scene based on energy function |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111986223B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112907546A (en) * | 2021-02-25 | 2021-06-04 | 北京农业信息技术研究中心 | Beef body ruler non-contact measuring device and method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8195734B1 (en) * | 2006-11-27 | 2012-06-05 | The Research Foundation Of State University Of New York | Combining multiple clusterings by soft correspondence |
US20180276885A1 (en) * | 2017-03-27 | 2018-09-27 | 3Dflow Srl | Method for 3D modelling based on structure from motion processing of sparse 2D images |
CN110110802A (en) * | 2019-05-14 | 2019-08-09 | 南京林业大学 | Airborne laser point cloud classification method based on high-order condition random field |
CN110348478A (en) * | 2019-06-04 | 2019-10-18 | 西安理工大学 | It is a kind of based on Shape Classification and trees extracting method in the outdoor point cloud scene combined |
US20200111251A1 (en) * | 2018-10-08 | 2020-04-09 | The Hong Kong Polytechnic University | 3d indoor modeling method, system and device based on point cloud data |
CN111091062A (en) * | 2019-11-21 | 2020-05-01 | 东南大学 | Robot out-of-order target sorting method based on 3D visual clustering and matching |
-
2020
- 2020-07-15 CN CN202010680646.4A patent/CN111986223B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8195734B1 (en) * | 2006-11-27 | 2012-06-05 | The Research Foundation Of State University Of New York | Combining multiple clusterings by soft correspondence |
US20180276885A1 (en) * | 2017-03-27 | 2018-09-27 | 3Dflow Srl | Method for 3D modelling based on structure from motion processing of sparse 2D images |
US20200111251A1 (en) * | 2018-10-08 | 2020-04-09 | The Hong Kong Polytechnic University | 3d indoor modeling method, system and device based on point cloud data |
CN110110802A (en) * | 2019-05-14 | 2019-08-09 | 南京林业大学 | Airborne laser point cloud classification method based on high-order condition random field |
CN110348478A (en) * | 2019-06-04 | 2019-10-18 | 西安理工大学 | It is a kind of based on Shape Classification and trees extracting method in the outdoor point cloud scene combined |
CN111091062A (en) * | 2019-11-21 | 2020-05-01 | 东南大学 | Robot out-of-order target sorting method based on 3D visual clustering and matching |
Non-Patent Citations (2)
Title |
---|
曾碧;黄文;: "一种融合多特征聚类集成的室内点云分割方法", 计算机工程, no. 03 * |
陈逍遥;任小玲;夏邢;史政坤;: "基于标记的多状态离群点去除算法", 国外电子测量技术, no. 01 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112907546A (en) * | 2021-02-25 | 2021-06-04 | 北京农业信息技术研究中心 | Beef body ruler non-contact measuring device and method |
CN112907546B (en) * | 2021-02-25 | 2024-04-05 | 北京农业信息技术研究中心 | Non-contact measuring device and method for beef scale |
Also Published As
Publication number | Publication date |
---|---|
CN111986223B (en) | 2024-02-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wei et al. | Superpixel hierarchy | |
CN107563381B (en) | Multi-feature fusion target detection method based on full convolution network | |
CN112184752A (en) | Video target tracking method based on pyramid convolution | |
CN112288857A (en) | Robot semantic map object recognition method based on deep learning | |
CN111986322B (en) | Point cloud indoor scene layout reconstruction method based on structural analysis | |
Cheng et al. | Exploiting nonlocal spatiotemporal structure for video segmentation | |
CN110188763B (en) | Image significance detection method based on improved graph model | |
CN109034035A (en) | Pedestrian's recognition methods again based on conspicuousness detection and Fusion Features | |
Mohan et al. | Environment selection and hierarchical place recognition | |
CN109559328A (en) | A kind of Fast image segmentation method and device based on Bayesian Estimation and level set | |
He et al. | A Method of Identifying Thunderstorm Clouds in Satellite Cloud Image Based on Clustering. | |
CN114581451A (en) | Scattering map neural network-based brain magnetic resonance image segmentation method | |
Zhang et al. | A graph-voxel joint convolution neural network for ALS point cloud segmentation | |
CN112241676A (en) | Method for automatically identifying terrain sundries | |
CN110348478B (en) | Method for extracting trees in outdoor point cloud scene based on shape classification and combination | |
CN111524140A (en) | Medical image semantic segmentation method based on CNN and random forest method | |
Yin et al. | A new apple segmentation and recognition method based on modified fuzzy C-means and hough transform | |
CN112070787B (en) | Aviation three-dimensional point cloud plane segmentation method based on opponent reasoning theory | |
CN111986223B (en) | Method for extracting trees in outdoor point cloud scene based on energy function | |
Yang et al. | A surface graph based deep learning framework for large-scale urban mesh semantic segmentation | |
Triebel et al. | Parsing outdoor scenes from streamed 3d laser data using online clustering and incremental belief updates | |
CN112200248A (en) | Point cloud semantic segmentation method, system and storage medium under urban road environment based on DBSCAN clustering | |
CN109241628B (en) | Three-dimensional CAD model segmentation method based on graph theory and clustering | |
CN106611418A (en) | Image segmentation algorithm | |
Saglam et al. | An efficient object extraction with graph-based image segmentation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |