A tree branch skeleton extraction method and system for unmanned aerial vehicle point cloud data collection

By combining regional point cloud aggregation and octree algorithm with spherical shrinkage topology connection, the accuracy problem of extracting fruit tree branch skeletons from sparse RGB point clouds collected by UAVs was solved, realizing accurate calculation of fruit tree growth parameters and effective evaluation of the algorithm.

CN116843693BActive Publication Date: 2025-12-05BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211664071.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-22
Publication Date
2025-12-05
Estimated Expiration
2042-12-22

AI Technical Summary

Technical Problem

In existing technologies, sparse RGB point clouds collected by drones are difficult to accurately extract the tree trunk and branch skeleton of fruit trees, resulting in inaccurate parameter calculations in fruit tree growth management and a lack of effective evaluation indicators to verify the effectiveness of the algorithm.

Method used

A regional point cloud aggregation algorithm is used to improve point cloud density. The tree branch skeleton is extracted by combining the octree algorithm and the spherical shrinkage skeleton topology connection method. The skeleton extraction effect is evaluated by BPF, EPF and HD indexes.

Benefits of technology

It improves the accuracy of extracting the tree trunk and skeletal structure of fruit trees from sparse point clouds, avoids broken branches and self-loop phenomena, provides objective evaluation indicators to verify the effectiveness of the algorithm, and supports the refinement of fruit tree growth management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116843693B_ABST
    Figure CN116843693B_ABST
Patent Text Reader

Abstract

The application discloses a tree branch skeleton extraction method for unmanned aerial vehicle collected point cloud data, and comprises the following steps: S1, acquiring tree branch point cloud data collected by an unmanned aerial vehicle; S2, preprocessing the tree branch point cloud data, wherein the preprocessing comprises point cloud denoising and improving the density of the tree branch point cloud; S3, based on an octree algorithm, performing spatial division on the gathered point cloud, and extracting branch skeleton points from the point cloud data subjected to data preprocessing in the divided subspace; S4, based on the extracted skeleton points, using a spherical contraction skeleton topology connection mode to construct a rough skeleton of the tree branch and performing fine adjustment; and S5, performing curve smoothing on the rough skeleton subjected to fine adjustment, optimizing the three-dimensional morphology of the rough skeleton, so that a fine skeleton is obtained as a final tree branch skeleton. Corresponding model construction systems, electronic devices and computer readable storage media are also disclosed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing and intelligent information extraction, and particularly relates to a tree branch skeleton extraction method and system for unmanned aerial vehicle collected point cloud data. BACKGROUND

[0002] Point cloud, as a common data for describing the three-dimensional structure of an object, has important applications in three-dimensional reconstruction, engineering surveying, morphological analysis, etc. With the improvement of agricultural automation level, the demand for point cloud data in the agricultural field is gradually increasing, and point cloud data is widely used in crop phenotype high-throughput calculation, growth morphological analysis and prediction, etc. Scientific management of fruit trees needs to pay attention to information such as tree height and trunk branches, but the way to extract the tree skeleton from the point cloud scanned by devices such as laser radar is too costly to be widely used in actual agricultural production. The point cloud skeleton extraction technology can obtain the three-dimensional skeleton of the fruit tree point cloud, calculate the tree height, branch length and branch angle, etc. from the skeleton, and assist in the analysis of the growth state of the fruit tree, pruning and other work, which is of great significance to the growth management of the fruit tree.

[0003] In the research status of the skeleton extraction task of tree point cloud, the common tree skeleton extraction algorithm usually contains two stages: first, extract the skeleton points from the point cloud, and then connect the skeleton points to form the skeleton topology. Skeleton point extraction is to obtain a point set from the original tree branch point cloud for describing the branch skeleton morphology, so the accuracy of skeleton point extraction directly affects the extraction effect of the tree branch skeleton; skeleton topology connection is to connect the extracted skeleton points to form a skeleton topology for describing the three-dimensional morphology of the tree branch. The current research methods are roughly divided into graph structure based and general point cloud skeleton extraction algorithm based, and there are also some other point cloud skeleton extraction algorithms. Among them, in the graph structure skeleton extraction method, the graph structure is a discrete structure composed of vertices and edges connecting the vertices, and the tree point cloud skeleton can be regarded as the combination of vertices and edges in the graph structure, and the tree branch skeleton is a common way to process the tree point cloud skeleton as a graph structure; in the general point cloud skeleton extraction method, the general point cloud skeleton extraction algorithm is used to complete the skeleton extraction of the tree point cloud, and this kind of algorithm does not have specific requirements for the structure of the point cloud object, and can be used as the basis of the tree skeleton extraction algorithm. Common algorithms include generalized rotational symmetry axis algorithm (Rotational Symmetry Axis, ROSA), L1 median algorithm (L1-Medial) and Laplacian based contraction algorithm (Laplacian Based Contraction, LBC), etc.; other tree skeleton extraction works based on classification and clustering realize the skeleton extraction task of the tree point cloud.

[0004] In the present research work, the acquisition of point cloud data for branch skeleton extraction uses laser scanning, multi-view reconstruction and virtual model construction and other methods. In recent years, with the development of unmanned aerial vehicle aerial photography technology, the method of using unmanned aerial vehicles equipped with RGB cameras to collect point clouds has been widely used. This method has the advantages of ALS, and greatly reduces the cost of point cloud collection equipment. However, due to the limitation of flight height, the point cloud collected by this method is sparse and irregular in space distribution, which brings challenges to the task of extracting the branch skeleton of the fruit tree point cloud. Therefore, how to extract the branch skeleton of the fruit tree from the sparse RGB point cloud becomes a problem to be solved, and the completion of the branch skeleton extraction task of the fruit tree is of great significance for the fine management of the orchard.

[0005] At the same time, a reasonable evaluation index is an important basis for verifying the effectiveness of the tree point cloud skeleton extraction algorithm. In the growth management process of fruit trees, it is necessary to accurately calculate parameters such as tree height, branch length and branch angle, and the fruit tree branch skeleton is an important basis for calculating these parameters. Therefore, setting a reasonable evaluation index for the fruit tree branch skeleton and scientifically evaluating the effectiveness of the algorithm are of great significance for the popularization and use of the tree point cloud branch skeleton extraction algorithm in orchard and other scenes. SUMMARY

[0006] In order to solve the problems existing in the prior art, the present application provides a tree branch skeleton extraction method and system for unmanned aerial vehicle collected point cloud data. For the skeleton extraction algorithm of the sparse RGB tree branch point cloud collected by the unmanned aerial vehicle, the algorithm first uses a regional point cloud aggregation algorithm to improve the density of the original tree point cloud. On this basis, the space octree algorithm is used to extract the skeleton points of the tree branch, and then a spherical contraction skeleton topology connection method is used to construct the rough skeleton of the tree branch, and the three-dimensional morphology of the rough skeleton is optimized to obtain the final fruit tree branch skeleton. At the same time, in the evaluation of the skeleton extraction effect, the application proposes the indexes BPF, EPF and HD for evaluating the skeleton extraction effect, and conducts comparative experiments on the basis to verify the effectiveness of the algorithm proposed in the embodiment.

[0007] The first aspect of the present application provides a tree branch skeleton extraction method for unmanned aerial vehicle collected point cloud data, comprising:

[0008] S1, acquiring tree branch point cloud data collected by an unmanned aerial vehicle;

[0009] S2, preprocessing the tree branch point cloud data, the preprocessing including point cloud denoising and tree branch point cloud density improvement;

[0010] S3, based on the octree algorithm, the spatial division is performed on the aggregated point cloud, and the branch skeleton points are extracted from the point cloud data subjected to the preprocessing in the divided subspace;

[0011] S4, constructing a rough skeleton of the tree branch using a spherical contracted skeleton topology connection method based on the extracted skeleton points and performing fine adjustment;

[0012] S5, performing curve smoothing on the fine-adjusted rough skeleton, optimizing the three-dimensional morphology of the rough skeleton, thereby obtaining a fine skeleton as a final tree branch skeleton.

[0013] Preferably, it further comprises:

[0014] S6, setting an index BPF (Bifurcation Point F1-score, bifurcation point F1 score) and EPF (End Point F1-score, end point F1 score) for evaluating the correctness of the skeleton morphology and an index HD (Hausdorff Distance, Hausdorff distance) for evaluating the correctness of the skeleton topology, thereby evaluating the correctness of the extracted final tree branch skeleton in topology and morphology.

[0015] Preferably, the S2, the preprocessing of the tree branch point cloud data is better for extracting skeleton points from the original tree branch point cloud, comprising:

[0016] S21, denoising the original tree branch point cloud data; comprising: using DBSCAN algorithm (Density-Based Spatial Clustering of Applications with Noise, Density-Based Spatial Clustering of Applications with Noise) to denoise the original tree branch point cloud data, taking the original tree branch point cloud as the sample to be clustered, setting appropriate neighborhood radius eps and minimum number of points in the neighborhood MinPts to cluster the branch point cloud, taking the cluster with the most samples after clustering as the branch point cloud, and removing other clusters as noise, thereby retaining the branch point cloud X with higher density;

[0017] S22, using a regional point cloud aggregation algorithm to aggregate the denoised tree branch point cloud to form a dense point cloud that can roughly describe the morphology of the tree branch skeleton; the regional point cloud aggregation algorithm comprises:

[0018] (1) setting the denoised tree branch point cloud as X={x1,2…x i …x n |∈R 3}, setting a regional aggregation radius r, as shown in formula (1):

[0019]

[0020] where k i is x iThe k-th nearest neighbor is determined based on the empirical value of the preliminary experiment and adjusted according to different tree species;

[0021] (2) Traverse each point x in the point cloud i , in x i A search region of radius r is defined around the perimeter, and the set of points contained within this search region is denoted as O. i ={x1,x2…x j …x m ∈R 3}, take the point set O i centroid c i As shown in equation (2):

[0022]

[0023] As x u The target location to be moved, and the new point cloud set C = {c1, c2, ..., c3} obtained after traversing the point cloud. j …c n ∈R 3};

[0024] (3) Keeping the search radius r constant, perform n iterations on step (2) to finally obtain the aggregated branch point cloud X. t .

[0025] Preferably, S3 includes:

[0026] (1) Determine the spatial range of the initial octree: Let the three-dimensional scale of the aggregated tree branch point cloud C be: L_x, L_y, L_z = [x_-x_min, y_-y_, z_-z_]. Select the maximum scale of L, L_max = Max{L_x, L_y, L_z}, and add an expansion amount off_set_set = 0.01*L_max) on the maximum scale L_max. This prevents the point cloud located at the edge from being ignored when the octree space is initialized when using the maximum scale L_ as the initial parent space for octree partitioning. Set the maximum recursion depth n of the octree and the skeleton point calculation threshold t = 2.

[0027] (2) Divide the initial parent space (size_f = [l,,]) into eight subspaces, each subspace having a size of [l,,] Iterate through the point sets in each subspace and calculate the number of point sets m contained in each subspace;

[0028] (3) If m < t, then the subspace will no longer be recursively processed. At this time, the centroid of the set of points contained in the subspace is taken as the skeleton point.

[0029] (4) If m≥t, judge the current recursion depth, if the current recursion depth does not reach n, take the subspace as the parent space of next iteration, continue step (2); if the current recursion depth reaches n, the subspace no longer recurs, at this time take the centroid of the point set contained in the subspace as the skeleton point.

[0030] Preferably, the S4 comprises:

[0031] S41, forming a rough skeleton of tree branches based on the topology connection mode of spherical contraction skeleton; comprising:

[0032] (1) starting from the farthest skeleton point p1, making a sphere with the point and the root node as the radius, connecting the point p3 closest to the inside of the sphere shell to the point;

[0033] (2) selecting the second farthest point p2 as the starting point, making a sphere with the point and the root node as the radius, selecting the closest skeleton point p5 inside the sphere shell to connect, and iterating the above process to traverse all skeleton points;

[0034] (3) after traversing all skeleton points, calculating the connection number of each skeleton point and other skeleton points around, extracting the end points and branch points of the skeleton points, and calculating the branch skeleton segments according to the connection state between the skeleton points;

[0035] (4) for the skeleton segments with less skeleton points contained in the topologically connected skeleton, setting a threshold value l, if the number of skeleton points contained in the skeleton segment is greater than l, retaining the skeleton segment, otherwise removing the skeleton segment;

[0036] S42, positioning and fine adjusting the key points in the rough skeleton of tree branches, the key points including skeleton end points and branch points; comprising:

[0037] (1) skeleton branch point adjustment, including: setting the preliminary extracted rough skeleton branch point as bp, the adjacent skeleton points of sp_1 and sp_2 of bp, and the parent branch skeleton point as sp_, setting the line connecting sp_1 and sp_ as L1, the line connecting sp_2 and sp_ as L2, and the line connecting bp and sp_ as L f , calculating the projection points f11 and f2 of bp on L1 and L2, then calculating the midpoint of the projection points of f1 and f2 on L f , as the new skeleton branch point bp, and updating the skeleton segment where it is located;

[0038] (2) skeleton end point adjustment, including: setting a spherical region with a radius of r at the center of the end point ep E , searching for the point set C ETake the line containing the skeleton point sp connected to endpoint ep as the normal l, calculate the plane α perpendicular to l and containing endpoint ep, and use plane α to define C. E Segmentation, separation of C E The point set A that is opposite to sp E Choose A E The point furthest from ep in the middle is the adjusted skeleton endpoint ep, and connecting ep and ep is an extension of this skeleton segment.

[0039] Preferably, in step S5, smoothing the curves of the refined rough skeleton and optimizing its three-dimensional shape to obtain a refined skeleton as the final tree branch and trunk skeleton includes:

[0040] In the extracted tree branch and trunk skeleton, let a certain skeleton segment be BH = [P0, p1, p2, ..., p n ], where n is the number of skeleton points contained in the skeleton segment, P0 is the endpoint or bifurcation point of the skeleton segment, P n As the bifurcation points of this skeleton segment, P0 and P... n As the starting and ending points of the Bézier curve, P1, p2, ..., p n-1 As control points for the Bézier curve, the skeleton segment is smoothed using an m-order spatial Bézier curve, where m = n-1, to obtain the smoothed curve B(t) of the skeleton segment. The definition of B(t) is shown in formula (3):

[0041]

[0042] In the formula:

[0043]

[0044] Preferably, in step S6, the evaluation metrics for the correctness of the skeleton morphology are the bifurcation point F1 score (BPF), the endpoint F1 score (EPF), and the evaluation metric for the correctness of the skeleton topology is the Hausdorff distance (HD). This evaluation assesses the topological and morphological correctness of the extracted final tree branch skeleton, including:

[0045] S61, set the indicators BPF (Bifurcation Point F1 Score) and EPF (Endpoint F1 Score) for evaluating the correctness of the skeleton morphology, and the indicator HD (Hausdorff Distance) for evaluating the correctness of the skeleton topology.

[0046] S62, calculated based on the indicators for evaluating the correctness of the skeleton's morphology and the indicators for evaluating the correctness of the skeleton's topology, includes:

[0047] (1) Before calculating the evaluation indicators, the spatial range of the real fruit tree point cloud and its extracted skeleton is normalized. Let the spatial range of the real fruit tree branch point cloud be: [xmin : max ,y min :y max ,z min :z max Then the normalized coordinates of a point P = (x, y, z) in space are shown in formula (4):

[0048]

[0049] The original fruit tree branch point cloud and the extracted branch skeleton were converted into a normalized three-dimensional space.

[0050] (2) Calculate the skeleton topology correctness indices BPF and EPF.

[0051] The spatial coordinates of the endpoints and bifurcation points in the real branch point cloud obtained by manual labeling are used as the true values.

[0052] The Bifurcation Point F1-score (BPF) is used to evaluate the extraction performance of the skeleton bifurcation points. The definition of BPF is shown in Equation (5):

[0053]

[0054] In the formula:

[0055]

[0056]

[0057] Where BP is the number of accurately located skeleton branching points extracted by the algorithm. Let d be the Euclidean distance between the skeleton branching point extracted by the algorithm and its nearest real skeleton branching point. If d is less than the set threshold t, the skeleton branching point is considered to be accurately located. BN is the total number of skeleton branching points extracted by the algorithm, and BT is the total number of real branch skeleton branching points.

[0058] The EPF (End Point F1-score) is used to evaluate the extraction performance of the skeleton endpoints. The definition of EPF is shown in Equation (6):

[0059]

[0060] In the formula:

[0061]

[0062]

[0063] Where EP is the number of accurately located skeleton endpoints extracted by the algorithm, and let d be the Euclidean distance between the skeleton endpoint extracted by the algorithm and its nearest real skeleton endpoint. If d is less than the set threshold t, the skeleton endpoint is considered to be accurately located. EN is the total number of skeleton endpoints extracted by the algorithm, and ET is the total number of real branch skeleton endpoints.

[0064] (3) The Hausdorff distance (HD) is calculated as an indicator of the correctness of the skeleton morphology, including: Let the true branch point cloud after denoising be C. s Point cloud C is generated around the tree trunk and branch framework using random sampling. g Calculate C n times s and C g The average of the Hausdorff Distances between them is taken as the final C. s and C g The Hausdorff Distance between C s and C g Hausdorff Distance between: (C,C) g The calculation is shown in equation (7):

[0065]

[0066] In the formula:

[0067]

[0068]

[0069] The second aspect of the present application provides a tree branch skeleton extraction system for unmanned aerial vehicle collected point cloud data, comprising: a data acquisition module for acquiring tree branch point cloud data collected by an unmanned aerial vehicle; a point cloud data preprocessing module for preprocessing the tree branch point cloud data, including a point cloud denoising module and a tree branch point cloud density enhancement module, wherein the point cloud denoising module is formed based on a DBSCAN algorithm and is used for denoising the original branch point cloud data to reduce the influence of noise points on subsequent skeleton extraction work; the branch point cloud density enhancement module is formed based on a regional point cloud aggregation algorithm and uses a regional point cloud aggregation method to aggregate the denoised tree branch point cloud to form a dense point cloud that can roughly describe the skeleton morphology of the tree branch, preparing for subsequent skeleton point extraction; a skeleton point extraction module for spatially dividing the aggregated point cloud based on an octree algorithm and extracting branch skeleton points from the point cloud data after data preprocessing in the divided subspace; a skeleton construction module for constructing a rough skeleton of the tree branch using a spherical contraction skeleton topology connection method based on the extracted skeleton points and performing fine adjustment; the skeleton construction module includes a skeleton topology connection submodule and a key point adjustment submodule, the skeleton topology connection submodule is used to form a rough skeleton of the tree branch based on a spherical contraction skeleton topology connection method; the key point adjustment submodule is used to locate and fine-tune the key points in the rough skeleton of the tree branch, the key points including end points and branch points; a skeleton morphology optimization module for performing curve smoothing on the fine-tuned rough skeleton and optimizing the three-dimensional morphology of the rough skeleton to obtain a fine skeleton as the final tree branch skeleton.

[0070] The third aspect of the present application provides an electronic device comprising a processor and a memory, the memory storing a plurality of instructions, the processor being configured to read the instructions and perform the method of the first aspect.

[0071] The tree branch skeleton extraction method for unmanned aerial vehicle collected point cloud data provided by the application has the following beneficial technical effects: (1) The region point cloud aggregation algorithm based on spatial density is used to aggregate the sparse branch point cloud before extracting the skeleton points, and the aggregated point cloud can describe the three-dimensional skeleton morphology of the branch, which can effectively improve the accuracy of the later skeleton point extraction; (2) The skeleton topology connection mode of spherical contraction from the outside to the root node is proposed, which can better adapt to the bifurcated structure of the tree and effectively avoid the appearance of non-tree branch structure, and can effectively extract the initial skeleton of the tree branch; (3) In order to objectively evaluate the skeleton extraction algorithm and verify the effectiveness of the skeleton extraction algorithm on the real tree branch point cloud, the indexes BPF (Bifurcation Point F1-score) and EPF (End Point F1-score) for evaluating the correctness of the skeleton morphology and the index HD (Hausdorff Distance) for evaluating the correctness of the skeleton topology are designed based on the consideration of the morphological characteristics of the tree branch structure, which can reasonably evaluate the correctness of the branch skeleton extracted by the algorithm in topology and morphology. BRIEF DESCRIPTION OF DRAWINGS

[0072] Figure 1 The flowchart of the tree branch skeleton extraction method for unmanned aerial vehicle collected point cloud data.

[0073] Figure 2 (a) and Figure 2 (b) are the branch point clouds of a fruit tree before and after denoising by the DBSCAN accumulation algorithm.

[0074] Figure 3 (a) is the denoised branch point cloud of the fruit tree, Figure 3 (b) is the branch point cloud of the fruit tree after three times of region point cloud aggregation, Figure 3 (c) is the branch point cloud of the fruit tree after five times of region point cloud aggregation, Figure 3 (d) is the branch point cloud of the fruit tree after eight times of region point cloud aggregation.

[0075] Figure 4 (a) is the effect of spatial division of the aggregated branch point cloud using the octree algorithm; Figure 4 (b) is the extracted branch skeleton point of the fruit tree.

[0076] Figure 5Figure 1 is a schematic diagram of a local skeleton of a fruit tree branch, wherein Figure 5 (a) is a schematic diagram of a local skeleton of a fruit tree branch of the present application; Figure 5 (b) is a schematic diagram of a spherically contracted topological connection of a local skeleton of the present application.

[0077] Figure 6 Figure 2 is a schematic diagram of a coarse skeleton formed after a tree is subjected to spherically contracted topological connection.

[0078] Figure 7 Figure 3 is a schematic diagram of skeleton endpoint adjustment, wherein Figure 7 (a) is a skeleton bifurcation point positioning before adjustment; Figure 7 (b) is a skeleton bifurcation point positioning after adjustment.

[0079] Figure 8 Figure 4 is a schematic diagram of skeleton endpoint adjustment, wherein Figure 8 (a) is a skeleton endpoint positioning before adjustment; Figure 8 (b) is a skeleton endpoint positioning after adjustment.

[0080] Figure 9 Figure 5 is a local detail of a fruit tree branch skeleton, wherein Figure 9 (a) is the effect before smoothing of a fruit tree branch skeleton; Figure 9 (b) is the effect after smoothing of a fruit tree branch skeleton.

[0081] Figure 10 Figure 6 is a schematic diagram of a tree branch skeleton extraction system architecture for unmanned aerial vehicle point cloud data collection.

[0082] Figure 11 Figure 7 is a schematic diagram of an electronic device structure of the present application. DETAILED DESCRIPTION

[0083] In order to better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the drawings in the specification and specific embodiments.

[0084] Example 1

[0085] Referring to Figure 1A tree branch skeleton extraction method for unmanned aerial vehicle (UAV) collected point cloud data, comprising: S1, acquiring tree branch point cloud data collected by a UAV; S2, preprocessing the tree branch point cloud data, the preprocessing including point cloud denoising and tree branch point cloud density improvement; S3, based on an octree algorithm, performing spatial division on the aggregated point cloud, and extracting branch skeleton points from the point cloud data subjected to the preprocessing in the divided subspaces; S4, based on the extracted skeleton points, constructing a rough skeleton of a tree branch using a spherical contraction skeleton topology connection method and performing fine adjustment; and S5, performing curve smoothing on the rough skeleton subjected to the fine adjustment, optimizing the three-dimensional morphology of the rough skeleton, and thus obtaining a fine skeleton as a final tree branch skeleton.

[0086] As a preferred embodiment, the method further comprises: S6, setting an index BPF (Bifurcation Point F1-score) for evaluating the correctness of the skeleton morphology, an index EPF (End Point F1-score) for evaluating the correctness of the skeleton topology, and an index HD (Hausdorff Distance) for evaluating the correctness of the skeleton topology, so as to evaluate the correctness of the extracted final tree branch skeleton in topology and morphology.

[0087] As a preferred embodiment, the preprocessing of the tree branch point cloud data in S2 is better for extracting skeleton points from original tree branch point cloud, and comprises:

[0088] S21, denoising the original tree branch point cloud data.

[0089] In the data collection, due to the influence of the collection equipment and the collection environment, the original tree branch point cloud collected will have different degrees of noise. In this embodiment, part of the point set of the fruit tree branch point cloud deviates from the fruit tree branch, and these point sets can be considered as noise points generated in the data collection process. In order to reduce the influence of the point cloud noise on the effect of the fruit tree branch skeleton extraction, the original point cloud needs to be denoised first. In this embodiment, the DBSCAN algorithm (Density-Based Spatial Clustering of Applications with Noise) is used to realize the denoising of the original point cloud. The DBSCAN algorithm is a density-based clustering algorithm. The algorithm assumes that different categories of samples can be determined by the tightness of the sample distribution, which can be determined by the neighborhood radius eps and the minimum number of points in the neighborhood MinPts. If the number of points in the neighborhood radius eps of a sample point is greater than MinPts, the sample point is called a core point, and if it is less than MinPts, the sample point is called a boundary point. If a core point is in the eps neighborhood of another core point, the two core points are considered to be density-reachable, and multiple density-reachable core points have a density-reachable relationship. In the density-reachable sample set, the points in the neighborhood of the sample point form a density-connected sample set, and the density-connected sample points form a sample cluster, which can realize the clustering of sample points with noise.

[0090] In this embodiment, in the original fruit tree branch point cloud, the point cloud distribution at the fruit tree branch is concentrated and has a high density, and the noise points are distributed relatively dispersedly and have a low density. The DBSCAN algorithm can be used to separate the branch point cloud and the noise points. In this embodiment, the original fruit tree branch point cloud is taken as the sample to be clustered, and the appropriate neighborhood radius eps and the minimum number of points in the neighborhood MinPts are set to cluster the branch point cloud. The cluster with the largest number of samples after clustering is reserved as the branch point cloud, and the other clusters are removed as noise points, so as to reserve the branch point cloud X with a high density. Figure 2 (a) and Figure 2 (b) shows the fruit tree branch point cloud before and after the denoising by the DBSCAN algorithm. It can be seen that, by using the DBSCAN algorithm to denoise the original branch point cloud, the abnormal noise points generated in the point cloud collection process are filtered out, which is beneficial to the skeleton point extraction work in the later stage.

[0091] Figure 2 (a) represents the fruit tree branch point cloud before denoising, and the dashed circle represents the noise points; Figure 2 (b) represents the fruit tree branch point cloud after denoising, and the dashed circle represents the removed noise points.

[0092] S22, the tree branch point cloud after denoising is aggregated in a way of regional point cloud aggregation, forming a dense point cloud which can roughly describe the branch skeleton form, preparing for the subsequent skeleton point extraction.

[0093] In this embodiment, the branch skeleton is a series of curve combinations describing the center of the fruit tree branch, and the skeleton point is a spatial point constituting the curve. The spatial point is the center of the branch point cloud in a certain interval, and how to determine the center of the fruit tree branch point cloud in a certain space is the key to skeleton point extraction. Since the branch point cloud collected by the high-altitude RGB camera is relatively sparse, and the spatial distribution of the point cloud is uneven, directly extracting the skeleton point from the denoised point cloud will cause inaccurate positioning. If the fruit tree branch point cloud can be aggregated to the branch skeleton center line area in a certain way, forming a point cloud with high density which can describe the three-dimensional curve form of the skeleton, and then extracting the skeleton point from it, the accuracy of the skeleton point extraction can be effectively improved.

[0094] This embodiment proposes an algorithm for regional point cloud aggregation:

[0095] (1) Let the denoised fruit tree branch point cloud be X = {x1, x2…x i …x n |∈R 3}, set the regional aggregation radius r, as shown in equation (1):

[0096]

[0097] where k i is the k-th nearest neighbor point of x i , k is determined according to the empirical value of the preliminary experiment, and is adjusted according to different tree species;

[0098] (2) Traverse each point x i in the point cloud, set a search area with a radius of r around x i , let the point set contained in the search area be O i = {x1, x2…x j …x m ∈R 3}, take the centroid c i of the point set O i , as shown in equation (2):

[0099]

[0100] as the target position of x u , the new point cloud set C = {c1, c2…c j …c n ∈R 3} obtained after the point cloud traversal;

[0101] (3) keeping the search radius r unchanged, n iterations are performed on step (2) to obtain the aggregated branch point cloud X t .

[0102] Figure 3 (a)-(d) show the process of branch point cloud aggregation after n (n=8) iterations. As n increases, the distribution of fruit tree branch point cloud gradually converges to the centerline of the skeleton. Since the number of branch point cloud points does not change during this process, the density of the branch point cloud gradually increases. After n iterations of aggregation, the spatial distribution of the branch point cloud is dense and concentrated near the centerline of the branch skeleton. The three-dimensional morphology of the fruit tree branch skeleton can be effectively extracted, and the accuracy of the skeleton point positioning can be effectively improved.

[0103] As a preferred embodiment, the S3 comprises: the skeleton point extraction is to find a spatial point that can describe the branch skeleton from the branch point cloud. Since the spatial distribution of the aggregated fruit tree branch point cloud can describe the three-dimensional morphology of the branch skeleton, the skeleton point can be regarded as the concentrated representation of the fruit tree branch point cloud in a certain space. Therefore, the first step of extracting the skeleton point is to reasonably divide the space where the aggregated branch point cloud is located, so that each subspace contains as many branch point clouds as possible, and the combination of each subspace can still describe the morphology of the skeleton. Then the position of the branch skeleton point is calculated in the divided subspace.

[0104] In this embodiment, the octree is used as one of the data structures for dividing the three-dimensional space to accelerate the spatial query, which can efficiently manage the three-dimensional space. The method divides the parent space into eight subspaces in a recursive manner, and the degree of fineness of the three-dimensional space division can be controlled by setting the recursion depth. Therefore, the octree algorithm can be used to divide the three-dimensional space where the branch point cloud is located, and then the branch skeleton points are calculated from the divided subspaces. In this embodiment, the octree algorithm is used to divide the space after the point cloud is aggregated, and the process of extracting the branch skeleton points from the point cloud data after the data preprocessing in the divided subspaces is as follows: (1) determining the spatial range of the initial octree: assuming that the three-dimensional dimensions of the aggregated branch point cloud C of the fruit tree are L_x, L_y, L_z = [x_-x_min, y_-y_, z_-z_], the maximum dimension L_max = Max{L_x, L_y, L_z} is selected, and the expansion amount off_set_set = 0.01*L_max) is added to the maximum dimension L_max, so that the maximum dimension L_ is used as the initial parent space for octree division to prevent the point cloud located at the edge from being ignored during the initialization of the octree space; the maximum recursion depth n of the octree is set, the threshold t = 2 for skeleton point calculation is set, and t is adjusted according to the actual situation; (2) dividing the initial parent space (size_f = [l,,]) into eight subspaces, and the size of each subspace is traversing the point set in each subspace to calculate the number m of point sets contained in each subspace; (3) if m < t, the subspace is no longer recursively divided, and the centroid of the point set contained in the subspace is taken as the skeleton point; (4) if m ≥ t, the current recursion depth is judged, if the current recursion depth does not reach n, the subspace is taken as the parent space for the next iteration, and step (2) is continued; if the current recursion depth reaches n, the subspace is no longer recursively divided, and the centroid of the point set contained in the subspace is taken as the skeleton point; after the space is divided by the spatial octree, the skeleton points can be extracted from the denser branch skeleton point cloud, and the distribution of the skeleton points can better reflect the spatial form of the skeleton, which prepares for the skeleton construction. Figure 4 (a) shows the effect of spatial division of the aggregated branch point cloud using the octree algorithm; Figure 4 (b) shows the extracted branch skeleton points of the fruit tree, and it can be seen that the distribution of the extracted skeleton points still better reflects the skeleton form of the fruit tree.

[0105] As a preferred embodiment, the S4 comprises: after the branch skeleton points of the fruit tree are extracted, the skeleton points need to be topologically connected to form the skeleton of the tree branches.

[0106] S41, forming a rough skeleton of a tree branch based on a spherical contraction skeleton topology connection mode; in previous work, the skeleton of a tree point cloud is usually obtained based on a nearest neighbor or a top-down topology connection mode. Since a reasonable number of nearest neighbor skeleton points needs to be set, the number of sub-branches at the branch point cannot be well determined in the case of uneven distribution of skeleton points, affecting the correctness of the extracted skeleton topology structure. To solve this problem, the embodiment adopts a spherical contraction skeleton topology connection mode from the outside to the root node. This connection mode can effectively adapt to the branched structure of the fruit tree branch. While obtaining the skeleton of the fruit tree branch, the key points (end points, branch points) and skeleton segments (end points-branch points, branch points-branch points) of the skeleton are extracted.

[0107] Figure 5 The spherical contraction topology connection process of the local branch skeleton is shown. The specific process of the algorithm is as follows: (1) first, start from the farthest skeleton point p1, make a sphere with the point and the root node as the radius, and connect the point p3 inside the sphere with the nearest skeleton point; (2) select the second farthest point p2 as the starting point, make a sphere with the point and the root node as the radius, and select the nearest skeleton point p5 inside the sphere to connect, and iterate the above process to traverse all skeleton points; (3) after all skeleton points are traversed, calculate the div (div: the number of connections of a skeleton point with other skeleton points, in this embodiment, the div of an end point is defined as 1, the div of a normal branch skeleton point is defined as 2, and the div of a branch point is defined as >=3) of each skeleton point, extract the end points and branch points in the skeleton points, and calculate the branch skeleton segments according to the connection state between the skeleton points; (4) since the extracted skeleton points may have redundancy, there may be short burr branches (skeleton segments containing fewer skeleton points) in the skeleton after topology connection. Set a threshold l, if the number of skeleton points contained in the skeleton segment is greater than l, retain the skeleton segment, otherwise remove the skeleton segment, which can remove the small burr branches in the skeleton; after the skeleton topology connection, the end points, branch points and skeleton segment sets of the fruit tree branch are obtained. Figure 6 A rough skeleton formed after a tree is subjected to spherical contraction topology connection is shown.

[0108] S42, key points in the rough skeleton of the tree branch are located and fine adjustment is made, the key points including skeleton endpoints and branch points; since the skeleton point extraction operation is based on the regional point cloud aggregation, the skeleton points extracted using the octree algorithm can deviate from the positions of the real key points, and the positions of the skeleton key points (skeleton branch points and endpoints) constructed can also deviate, including: the extracted skeleton branch points are not located at the centers of the skeleton branch points; and / or the skeleton endpoints deviate from the skeleton ends due to the previous point cloud aggregation. Since the accurate skeleton key point positioning is an important basis for testing the effectiveness of the fruit tree branch point cloud skeleton extraction algorithm, and is also a prerequisite for the later skeleton shape optimization, it has a great influence on the later skeleton shape optimization part.

[0109] To better determine the positions of the key points, the embodiment proposes an algorithm for fine adjustment of the skeleton branch points and endpoints, including: (1) skeleton branch point adjustment: since the point cloud at the branch point of the fruit tree branch is relatively dense, the extracted skeleton branch point can deviate from the branch center of the branch point cloud. Since the later skeleton shape optimization needs to accurately position the skeleton branch point based on the skeleton, and better assists the later skeleton shape optimization, the skeleton branch point needs to be moved as much as possible to the parent branch direction, and the branch point needs to be adjusted to the branch center of the branch point cloud. Since in the three-dimensional space, the branch point positioning of the skeleton cannot be adjusted by using the method of intersecting the straight lines fitting the skeleton segments (the intersection point of multiple non-coplanar straight lines cannot be determined in the three-dimensional space). Therefore, the skeleton branch point adjustment strategy of the embodiment is as shown in Figure 7 , assuming that the initially extracted rough skeleton branch point is bp, the skeleton points of the adjacent child branches of bp are sp_1 and sp_2, the skeleton point of the parent branch is sp_f, the line connecting sp_1 and sp_f is L1, the line connecting sp_2 and sp_f is L2, and the line connecting bp and sp_f is L f , the projection points f1 and f2 of bp on L1 and L2 are calculated, then the midpoint of the projection points of f1 and f2 on L f is calculated as the new skeleton branch point bp', and the skeleton segment where bp' is located is updated. The position of the adjusted skeleton branch point is more reasonable; (2) skeleton endpoint adjustment: since the skeleton point extraction operation is based on the aggregated fruit tree branch point cloud, the extracted skeleton endpoint will naturally move to the inside of the branch, and cannot be positioned at the end of the fruit tree branch. To accurately position the skeleton endpoint, the skeleton needs to be extended to the end point of the fruit tree branch point cloud as much as possible near the extracted skeleton endpoint. Therefore, the skeleton endpoint adjustment strategy of the embodiment is as shown in Figure 8 , a spherical region with a radius of r (an empirical value) is set at the center O E of the endpoint ep, and the point set C EThe straight line where the skeleton point sp connected with the end point ep is taken as the normal line l, and the plane a containing the end point ep and vertical to l is calculated. The C E is segmented, and the point set A E opposite to sp is separated out E The point farthest from A E is selected as the adjusted skeleton end point ep, and ep is connected with ep, as the extension of the skeleton segment. After the position of the key point is adjusted, the positioning of the branch bifurcation point is closer to the center of the actual branch bifurcation, and the skeleton end point has also been extended to the end of the branch. The positioning of the key point after adjustment is more accurate.

[0110] As a preferred embodiment, the S5, the rough skeleton after the fine adjustment is curve-smoothed, and the three-dimensional morphology of the rough skeleton is optimized, so as to obtain a fine skeleton as the final tree branch skeleton, including: after the skeleton topology connection and the skeleton key point adjustment, the branch skeleton at this time can roughly describe the morphology of the tree branch, but the connection at the skeleton detail is still zigzag and unnatural, and cannot represent the real skeleton morphology of the tree, Figure 9 (a) shows a certain local detail of the fruit tree branch skeleton.

[0111] In three-dimensional space, the real tree branch skeleton can be considered as the combination of multiple smooth spatial curves, and the two end points of the curve are always at the end point and the bifurcation point of the branch skeleton, so the position of the end point and the bifurcation point of the skeleton should not be moved during the skeleton smoothing process. Based on this consideration, the spatial Bezier curve is selected for the spatial curve smoothing processing of the extracted skeleton. The Bezier curve is a mathematical curve applied to graphics drawing, which is defined by a starting point, an ending point and a control point. The shape of the Bezier curve is adjusted by adjusting the number and position of the control point, so as to realize the smoothing processing of the given curve.

[0112] In the extracted fruit tree branch skeleton, a certain skeleton segment is BH=[P0,p1,p2,…,p n ](n is the number of skeleton points contained in the skeleton segment), wherein P0 is the end point (or bifurcation point) of the skeleton segment, P n is the bifurcation point of the skeleton segment, P0 and P n are taken as the starting point and the ending point of the Bezier curve, and P1,p2,…,p n-1 are taken as the control points of the Bezier curve. The segment skeleton segment is smoothed using an m (m=n-1) order spatial Bezier curve, and the smoothed curve B(t) of the segment skeleton can be obtained. The definition of B(t) is shown in formula (3):

[0113]

[0114] wherein:

[0115]

[0116] As Figure 9 (b) shows that after the smoothing of the spatial Bezier curve, each segment of the skeleton is smoother and more natural, and can better reflect the three-dimensional spatial form of the real fruit tree branches.

[0117] As a preferred embodiment, the S6, the index BPF (Bifurcation Point F1-score) and EPF (End Point F1-score) for evaluating the correctness of the skeleton form and the index HD (Hausdorff Distance) for evaluating the correctness of the skeleton topology are set, so as to evaluate the correctness of the extracted final tree branch skeleton in topology and form, including: S61, the index BPF (Bifurcation Point F1-score) and EPF (End Point F1-score) for evaluating the correctness of the skeleton form and the index HD (Hausdorff Distance) for evaluating the correctness of the skeleton topology are set; the fruit tree shape analysis mainly focuses on whether the topology and form of the fruit tree skeleton are correct. The topology structure of the fruit tree skeleton is connected by skeleton points, and the end points and bifurcation points in the skeleton points are key points for constructing the skeleton, so the positioning accuracy of the skeleton key points directly affects the correctness of the skeleton topology. At the same time, whether the skeleton extracted by the algorithm can truly restore the form of the fruit tree branches is also an important basis for measuring the effectiveness of the skeleton extraction algorithm. In order to verify the effectiveness of the branch skeleton extraction algorithm, the embodiment proposes the index BPF (Bifurcation Point F1-score) and EPF (End Point F1-score) for evaluating the correctness of the skeleton topology connection and the index HD (Hausdorff Distance) for evaluating the correctness of the skeleton form, to verify the effectiveness of the fruit tree point cloud skeleton extraction algorithm. S62, based on the index for evaluating the correctness of the skeleton form and the index for evaluating the correctness of the skeleton topology, calculation is performed, including: (1) in order to realize the evaluation work of different tree species, the embodiment normalizes the real fruit tree point cloud and the extracted skeleton in the spatial range before calculating the evaluation index. The spatial range of the real fruit tree branch point cloud is [x min : max ,y min : max ,z min : max ], then the normalized coordinates of a point P = (x, y, z) in the space are shown in formula (4):

[0118]

[0119] The original fruit tree branch point cloud and the extracted branch skeleton are converted into a normalized three-dimensional space, and the skeleton evaluation work of the embodiment is performed in the normalized three-dimensional space.

[0120] (2) Calculate the skeleton topology correctness indicators BPF and EPF

[0121] Scientific fruit tree management requires parameters such as branch angles of fruit tree branches. These parameters are usually obtained by calculating the angle between the branch endpoints and the bifurcation points. Whether the positioning of the endpoints and the bifurcation points is accurate affects the topological correctness of the fruit tree branch skeleton. Therefore, reasonably evaluating the positioning accuracy of the endpoints and the bifurcation points is an important part of the skeleton evaluation work. Since it is relatively simple to obtain the endpoints and the bifurcation points of the branches from the real branch point cloud, and it is not easily affected by subjective judgment, the embodiment uses the spatial coordinates of the manually marked endpoints and bifurcation points obtained from the real branch point cloud as the true values to evaluate the positioning effect of the endpoints and the bifurcation points extracted by the algorithm.

[0122] The embodiment uses BPF (Bifurcation Point F1-score) to evaluate the extraction effect of the skeleton bifurcation points. The definition of BPF is shown in equation (5):

[0123]

[0124] In the formula:

[0125]

[0126] where BP is the number of accurately positioned skeleton bifurcation points extracted by the algorithm (assuming that the Euclidean distance d between the skeleton bifurcation point extracted by the algorithm and the nearest real skeleton bifurcation point is less than the set threshold t, then the skeleton bifurcation point is considered to be accurately positioned), BN is the total number of skeleton bifurcation points extracted by the algorithm, and BT is the total number of real branch skeleton bifurcation points.

[0127] Similarly, the embodiment sets EPF (of End Point F1-score) to evaluate the extraction effect of the skeleton endpoints. The definition of BPF is shown in equation (6):

[0128]

[0129] In the formula:

[0130]

[0131] Where EP is the number of accurately located skeleton endpoints extracted by the algorithm (let d be the Euclidean distance between the skeleton endpoint extracted by the algorithm and its nearest real skeleton endpoint; if d is less than the set threshold t, the skeleton endpoint is considered to be accurately located), EN is the total number of skeleton endpoints extracted by the algorithm, and ET is the total number of real branch skeleton endpoints.

[0132] (3) Calculate the skeletal morphology accuracy index HD (Hausdorff Distance).

[0133] To evaluate the accuracy of the skeleton morphology extracted by the algorithm, it is necessary to assess the degree of fit between the extracted skeleton and the real fruit tree. However, annotating the 3D skeleton from the point cloud of real fruit tree branches is difficult and involves a degree of subjectivity, which can affect the accuracy of the skeleton morphology evaluation results. Therefore, this embodiment generates a point cloud around the extracted skeleton and measures the morphological accuracy of the extracted skeleton by comparing the similarity between the generated fruit tree branch point cloud and the real fruit tree branch point cloud. Hausdorff distance is a measure of the similarity between two sets of point clouds. The smaller the Hausdorff distance, the greater the similarity between the two sets of point clouds. Therefore, this method can be used to measure the similarity between two sets of point clouds.

[0134] To evaluate the morphological accuracy of the fruit tree branch skeleton, this embodiment sets the denoised true branch point cloud as C. s Point cloud C is generated around the tree trunk and branch framework of the fruit tree through random sampling. g Calculate n times (in this example, n = 10). s and C g The average of the Hausdorff Distances between them is taken as the final C. s and C g The Hausdorff distance between the two values ​​reduces the error caused by a single calculation. s and C g Hausdorff Distance between: (C,C) g The calculation is shown in equation (7):

[0135]

[0136] In the formula:

[0137]

[0138] The present embodiment carries out a 50m and 20m height comparative experiment to verify the effect of the method proposed in the present application. It can be found that, compared with the L1-Medial algorithm and the LBC algorithm, the BPF, EPF and HD indexes of the algorithm proposed in the present application are better in the 50m and 20m height fruit tree branch point cloud skeleton extraction experiment. That is, the skeleton extracted by the algorithm of the present embodiment has better skeleton topology connection correctness and skeleton shape correctness, and can more truly describe the three-dimensional shape of the fruit tree branches. At the same time, from the comparative experiment results at different heights, it can be found that for the fruit trees with relatively sparse branch structure (such as chestnut trees and plum trees), the reduction of the flight height of the unmanned aerial vehicle can improve the quality of the collected fruit tree branch point cloud and improve the skeleton extraction effect of the algorithm. Compared with the L1-Medial algorithm and the LBC algorithm, the algorithm proposed in the present application can still maintain good experimental effect on more complex fruit tree branch point cloud, and can also adapt to the extraction task of the skeleton of the more complex fruit tree branch point cloud.

[0139] Embodiment two

[0140] Referring to Figure 10 , the present embodiment provides a tree branch skeleton extraction system for unmanned aerial vehicle collected point cloud data, comprising: a data acquisition module 101 for acquiring tree branch point cloud data collected by an unmanned aerial vehicle; a point cloud data preprocessing module 102 for preprocessing the tree branch point cloud data, including a point cloud denoising module and a tree branch point cloud density improvement module, wherein the point cloud denoising module is formed based on the DBSCAN algorithm, and is used for denoising the original branch point cloud data to reduce the influence of noise points on the subsequent skeleton extraction work; the branch point cloud density improvement module is formed based on the regional point cloud aggregation algorithm, and uses the regional point cloud aggregation method to aggregate the denoised tree branch point cloud to form a dense point cloud that can roughly describe the skeleton shape of the tree branch, and prepares for the subsequent skeleton point extraction; a skeleton point extraction module 103 for spatially dividing the aggregated point cloud based on the octree algorithm, and extracting branch skeleton points from the point cloud data subjected to the data preprocessing in the divided subspace; a skeleton construction module 104 for constructing a rough skeleton of the tree branch based on the extracted skeleton points using a spherical contraction skeleton topology connection method and performing fine adjustment; the skeleton construction module 104 comprises a skeleton topology connection submodule and a key point adjustment submodule, the skeleton topology connection submodule is used for forming a rough skeleton of the tree branch based on the spherical contraction skeleton topology connection method; the key point adjustment submodule is used for positioning and fine adjusting key points in the rough skeleton of the tree branch, the key points including end points and branch points; a skeleton shape optimization module 105 for performing curve smoothing on the fine adjusted rough skeleton to optimize the three-dimensional shape of the rough skeleton, thereby obtaining a fine skeleton as the final tree branch skeleton.

[0141] The application further provides a memory which stores a plurality of instructions for implementing the method in Embodiment I.

[0142] As shown in Figure 11 The application further provides an electronic device which comprises a processor 501 and a memory 502 connected to the processor 501, wherein the memory 502 stores a plurality of instructions which can be loaded and executed by the processor to enable the processor to perform the method in Embodiment I.

[0143] Although the preferred embodiments of the application have been described, those skilled in the art will be able to make additional changes and modifications to these embodiments once they learn the basic inventive concept. Therefore, the appended claims are intended to cover all the changes and modifications falling within the scope of the application. Obviously, those skilled in the art can make various modifications and variations to the application without departing from the spirit and scope of the application. Thus, if these modifications and variations of the application fall within the scope of the claims and their equivalents, the application is also intended to include these modifications and variations.

Claims

1. A method for extracting a tree skeleton from point cloud data collected by a UAV, the method comprising: Comprise: S1, obtain the tree branch point cloud data collected by the unmanned aerial vehicle; S2, preprocessing the tree branch point cloud data, the preprocessing includes point cloud denoising and improving the tree branch point cloud density; S3, based on the octree algorithm, the point cloud is divided in space, and the point cloud data after the preprocessing is extracted in the divided subspace; S4, based on the extracted skeleton, the coarse skeleton of the tree branch is constructed using the spherical contraction skeleton topology connection mode and is finely adjusted; S5, the curve of the fine adjustment of the coarse skeleton is smoothed, and the three-dimensional form of the coarse skeleton is optimized, so that the fine skeleton is obtained as the final tree branch skeleton; Wherein, the S4 includes: S41, based on the spherical contraction skeleton topology connection mode, the coarse skeleton of the tree branch is formed; including: (1) From the farthest skeleton point, make a sphere with the point and the root node as the radius, and connect the point to the skeleton point closest to the inside of the sphere shell where the point is located. (2) From the closest skeleton point, make a sphere with the point and the root node as the radius, and connect the point to the skeleton point closest to the inside of the sphere shell where the point is located. ​ (2) Select the second far point Take the point as the starting point, and make a ball with the root node as the radius, select the nearest skeleton point inside the ball with the point Connect, and iterate the above process to traverse all skeleton points; (3) after all the skeleton points are traversed, the connection number of each skeleton point and the surrounding other skeleton points is calculated, the end point and the branch point in the skeleton point are extracted, and the branch skeleton is calculated according to the connection state between the skeleton points; (4) For the skeleton segment containing less skeleton points in the skeleton connected, set a threshold , if the number of skeleton points contained in the skeleton segment is greater than , the skeleton segment is retained, otherwise the skeleton segment is removed; S42, the key points in the coarse skeleton of the tree branch are positioned and finely adjusted, and the key points include the skeleton end point and the branch point; including: (1) Skeleton branch point adjustment, including: set the preliminary extracted coarse skeleton branch point as , the adjacent sub-branch skeleton point as , , the parent branch skeleton point as , set and The line between them is , and The line between them is , and The line between them is , calculate The projection point of and on , , then calculate , The midpoint of the projection point on is taken as the new skeleton branch point , and the skeleton segment where it is located is updated; (2) Skeleton endpoint adjustment, including: at the endpoints For the center of the ball Set the radius to The spherical region is searched for the denoised point cloud. The set of points in this region , will be with the endpoint Connected skeleton points The line containing it is taken as the normal. , calculation and Vertical and including endpoints plane Using a plane Will Segment, separate Zhongyu Point sets on opposite sides ,choose Mid-range The farthest point is the adjusted skeleton endpoint. ,connect and As an extension of this skeletal segment.

2. The method of claim 1, wherein, Also include: S6, set the index bifurcation point F1 score BPF, end point F1 score EPF and Hausdorff distance HD for evaluating the correctness of the skeleton topology, so as to evaluate the correctness of the extracted final tree branch skeleton in topology and form.

3. The method of claim 2, wherein, The S2, preprocessing the tree branch point cloud data, includes: S21, denoising the original tree trunk point cloud data; including: using a density-based clustering method DBSCAN algorithm with noise to denoise the original tree trunk point cloud data, taking the original tree trunk point cloud as a sample to be clustered, setting a suitable neighborhood radius eps and a minimum number of points MinPts in the neighborhood to cluster the trunk point cloud, taking the cluster with the largest number of clustered samples as the trunk point cloud, and removing other clusters as noise, so as to retain the trunk point cloud with higher density ; S22, using the algorithm of regional point cloud aggregation, the denoised tree branch point cloud is aggregated to form dense point cloud describing the skeleton form of the tree branch; the algorithm of regional point cloud aggregation includes: (1) Set the tree branch point cloud after denoising as , set the regional aggregation radius , as shown in formula (1): ; wherein is the first nearest point, determined according to the experience value of the preliminary experiment, adjusted according to different tree species; (2) Traverse each point in the point cloud , set a search area with a radius of around the point, set the point set contained in the search area as , take the point set , and take the of the point set , as shown in formula (2): ; As a target position of movement, a new point cloud set obtained after the point cloud traversal is completed ; (3) keep the search radius unchanged, step (2) is performed for a further iteration, resulting in the aggregated branch point cloud .

4. The method of claim 3, wherein, The S3 includes: (1) Determine the spatial range of the initial octree: Let the aggregated tree branches be the cloud of points. The three-dimensional scale is: Select maximum scale At the largest scale Add expansion capacity Thus using the maximum scale When using the initial parent space of the octree partition, prevent point clouds located at the edges from being ignored during octree space initialization; set the maximum recursion depth of the octree. Skeleton point calculation threshold ; (2) The initial parent space Divided into eight subspaces, each subspace is of size [size missing]. Iterate through the point sets in each subspace and calculate the number of point sets contained in each subspace. ; (3) If the subspace is not further recursively divided, and the centroid of the point set contained in the subspace is taken as the skeleton point; (4) If , judge the current recursion depth, if the current recursion depth does not reach , take the subspace as the parent space of next iteration, continue step (2); if the current recursion depth reaches , the subspace no longer recurs, at this time take the centroid of the point set contained in the subspace as the skeleton point.

5. The method of claim 4, wherein, The S5, the curve of the fine adjustment of the coarse skeleton is smoothed, and the three-dimensional form of the coarse skeleton is optimized, so that the fine skeleton is obtained as the final tree branch skeleton includes: In the extracted tree branch skeleton, let a skeleton segment be wherein is the number of skeleton points contained in the skeleton segment, is the end point or the branching point of the skeleton segment, is the branching point of the skeleton segment, let , be the starting point and the ending point of the Bezier curve, let be the control point of the Bezier curve, and use order spatial Bezier curve to smooth the skeleton segment, wherein , to obtain the smoothed curve of the skeleton segment , The definition of is shown in formula (3): ; In the formula: 。 6. The method of claim 5, wherein, The S6, set the index bifurcation point F1 score BPF, end point F1 score EPF and Hausdorff distance HD for evaluating the correctness of the skeleton topology, so as to evaluate the correctness of the extracted final tree branch skeleton in topology and form includes: S61, set the index bifurcation point F1 score BPF, end point F1 score EPF and Hausdorff distance HD for evaluating the correctness of the skeleton topology; S62, based on the index for evaluating the correctness of the skeleton form and the index for evaluating the correctness of the skeleton topology, the calculation includes: (1) The real tree trunk point cloud and its extracted skeleton are normalized in the space range before the calculation. The space range of the real tree trunk point cloud is: The normalized coordinates of a certain point in the space are shown in formula (4): ; Convert the real tree branch point cloud point cloud and the extracted branch skeleton into the normalized three-dimensional space; (2) calculate the skeleton topology correctness index BPF, EPF, including: The spatial coordinates of the end point and the branch point obtained by manual marking in the real branch point cloud are taken as the true value; The extraction effect of the skeleton branch point is evaluated by BPF, and the definition of BPF is shown in formula (5): ; In the formula: ; ; wherein is the number of accurate positioning of the skeleton branch point extracted by the algorithm, and the Euclidean distance between the skeleton branch point extracted by the algorithm and the nearest real skeleton branch point is , if is less than the set threshold , the skeleton branch point is considered to be accurately positioned, is the total number of skeleton branch points extracted by the algorithm, is the total number of real branch skeleton branch points; Set EPF to evaluate the extraction effect of the skeleton end point, and the definition of EPF is shown in formula (6): ; In the formula: ; ; in Let be the number of accurately located skeleton endpoints extracted by the algorithm, and let be the Euclidean distance between each extracted skeleton endpoint and its nearest ground truth skeleton endpoint. ,like Less than the set threshold If so, the skeleton endpoints are considered to be accurately located. This represents the total number of skeleton endpoints extracted by the algorithm. The total number of actual branch and trunk skeleton endpoints; (3) Calculate the skeleton shape correctness index HD, including: set the denoised real branch point cloud as Generate a point cloud around the tree branch skeleton by random sampling Calculate the average value of HD between n times and as the final HD between and HD between and HD: Calculate as shown in formula (7): ; In the formula: ; 。 7.A tree skeleton extraction system for collecting point cloud data by a UAV, characterized in that, The system is used to perform the tree branch skeleton extraction method as claimed in any one of claims 1-6, comprising: a data acquisition module configured to acquire tree branch point cloud data collected by a UAV; a point cloud data preprocessing module configured to preprocess the tree branch point cloud data, including a point cloud denoising module and a tree branch point cloud density enhancement module, wherein the point cloud denoising module is formed based on a DBSCAN algorithm and is configured to denoise the original branch point cloud data to reduce the impact of noise points on subsequent skeleton extraction work; the branch point cloud density enhancement module is formed based on a regional point cloud aggregation algorithm and uses a regional point cloud aggregation method to aggregate the denoised tree branch point cloud to form a dense point cloud describing the skeleton morphology of the tree branch, thereby preparing for subsequent skeleton point extraction; a skeleton point extraction module configured to divide the aggregated point cloud in space based on an octree algorithm and extract branch skeleton points from the point cloud data subjected to the data preprocessing in the divided subspaces; a skeleton construction module configured to construct a coarse skeleton of the tree branch based on the extracted skeleton points using a spherical contraction skeleton topology connection method and to perform fine adjustment; the skeleton construction module includes a skeleton topology connection submodule and a key point adjustment submodule, the skeleton topology connection submodule is configured to form a coarse skeleton of the tree branch based on a spherical contraction skeleton topology connection method, and the key point adjustment submodule is configured to locate and fine-tune key points in the coarse skeleton of the tree branch, the key points including end points and branch points; a skeleton morphology optimization module configured to perform curve smoothing on the fine-tuned coarse skeleton to optimize the three-dimensional morphology of the coarse skeleton, thereby obtaining a fine skeleton as the final tree branch skeleton.

8. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions, the processor being configured to read the instructions and perform the tree branch skeleton extraction method as claimed in any one of claims 1-6.

9. A computer-readable storage medium storing a plurality of instructions, the plurality of instructions being readable and executable by a processor to perform the tree branch skeleton extraction method as claimed in any one of claims 1-6.