Plant point cloud extraction method and device based on octree and connectivity analysis
Through the method based on octree and connectivity analysis, the plant point cloud data is filtered and segmented, the target height is determined and the ground point cloud interference is removed, which solves the accuracy and efficiency of point cloud data processing in the existing technology, and achieves high-precision plant point cloud extraction.
Patent Information
- Application Number
- CN202510537929.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-27
AI Technical Summary
The existing point cloud data processing technology faces problems such as ground point interference, dense outliers and high computational complexity in the external environment, resulting in limited accuracy and efficiency of plant phenotype information extraction.
Using the method based on Octrene and connectivity analysis, the plant point cloud data is filtered and hierarchically segmented, the target height of the separation of plants and ground is determined, the ground point cloud interference is removed, and the point cloud with the largest connected component is extracted as the plant point cloud extraction result through connectivity analysis.
Effectively remove interference from ground point clouds and outliers, improve the accuracy and efficiency of plant point cloud extraction, and ensure accurate measurement and analysis of plant phenotype information.
Smart Images

Figure CN120070475A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data analysis, and particularly relates to a method and device for extracting plant point clouds based on octree and connectivity analysis. Background Art
[0002] Point cloud technology is increasingly widely used in plant phenotype research. High-precision measurement and analysis of the point cloud characteristics of each plant have important scientific value and practical significance.
[0003] Existing point cloud data processing technologies face problems such as ground point interference, the existence of dense outliers, and high computational complexity in the external environment, resulting in limited accuracy and efficiency in extracting plant phenotype information. Summary of the Invention
[0004] In view of this, the purpose of the present application is to propose a method and device for extracting plant point clouds based on octree and connectivity analysis to solve or partially solve the above technical problems.
[0005] Based on the above purpose, the present application provides a method for extracting plant point clouds based on octree and connectivity analysis, including: Determine the point cloud data of the plant, and perform filtering processing on the point cloud data to obtain filtered point cloud data; Use the octree data structure to hierarchically segment the filtered point cloud data to obtain point cloud spatial structure information; Obtain the leaf nodes at multiple heights in the point cloud spatial structure information, and determine the target height at which the plant is separated from the ground from the multiple heights; Determine the ground point cloud according to the target height, and remove the ground point cloud from the point cloud spatial structure information to obtain plant point cloud spatial structure information; Perform connectivity analysis on the leaf nodes in the plant point cloud spatial structure information to obtain multiple connected leaf node groups, and determine the connected components of each connected leaf node group, and extract the connected leaf node group with the largest connected component as the plant point cloud extraction result.
[0006] Based on the same inventive concept, the present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable by the processor. When the processor executes the computer program, the above method is implemented.
[0007] As can be seen from the above, the method and device for plant point cloud extraction based on octree and connectivity analysis provided by this application can filter the point cloud data of plants, avoid the interference of some noises, and also use the octree data structure for hierarchical segmentation to obtain the point cloud space structure information. Based on this point cloud space structure information, the target height at which the plant is separated from the ground can be accurately determined, and then the ground point cloud can be removed according to this target height, thus excluding the interference of the ground point cloud. Then, connectivity analysis is performed on the remaining leaf nodes in the plant point cloud space structure information, and then each connected leaf node group is found. In this way, the point cloud corresponding to the connected leaf node group with the largest connected component can be selected as the plant point cloud extraction result, and other outlier point clouds can be removed to improve the accuracy of plant point cloud extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in this application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only the embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0009] Figure 1 It is a flowchart of the method for plant point cloud extraction based on octree and connectivity analysis according to an embodiment of this application; Figure 2 It is a side view schematic diagram of the point cloud structure information of the first layer according to an embodiment of this application; Figure 3 It is a top view schematic diagram of the point cloud structure information of the first layer according to an embodiment of this application; Figure 4 It is a top view schematic diagram of the leaf nodes from the first layer to the 6th layer according to an embodiment of this application; Figure 5 It is a schematic diagram of the adjacent undirected graph according to an embodiment of this application; Figure 6 It is a schematic diagram of the process of removing the ground point cloud according to an embodiment of this application; Figure 7 It is a schematic diagram of the process of connectivity analysis and plant point cloud extraction according to an embodiment of this application; Figure 8 It is a structural block diagram of the device for plant point cloud extraction based on octree and connectivity analysis according to an embodiment of this application; Figure 9 It is a schematic diagram of the structure of an electronic device according to an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0010] To make the objectives, technical solutions, and advantages of this application more clear and understandable, the following further elaborates on this application in detail with reference to specific embodiments and the accompanying drawings.
[0011] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the embodiments of this application should have the ordinary meanings understood by those with ordinary skills in the field to which this application belongs. The "first", "second", and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are only used to distinguish different components. Words such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. Words such as "connected" or "linked" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to represent relative position relationships, and when the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0012] Glossary of terms: SOR: Statistical Outlier Removal, statistical filtering.
[0013] ROR: Radius Outlier Removal, radius filtering.
[0014] DFS: Depth-First-Search, depth-first search.
[0015] Octree: An octree is a tree-like data structure used to describe three-dimensional space.
[0016] Based on the description of the background technology, point cloud technology is increasingly applied in agricultural scientific research. In the field environment, it faces problems such as ground point interference, the existence of dense outliers, and high computational complexity, resulting in limited accuracy and efficiency in extracting plant phenotypic information. Traditional methods such as statistical filtering (SOR) and radius filtering (ROR) are difficult to effectively remove, and excessive filtering may lose key phenotypic information.
[0017] The following details the embodiments of this application with reference to the accompanying drawings.
[0018] The plant point cloud extraction method based on octree and connectivity analysis proposed in the embodiments of this application, as Figure 1 shown, includes: Step 101, determine the point cloud data of the plant, and perform filtering processing on the point cloud data to obtain filtered point cloud data.
[0019] In specific implementation, the plant point cloud data refers to the point cloud data of a single plant collected in a field environment (for example, the point cloud data of a rice plant). Since there is usually noise in the point cloud data, which may affect subsequent processing, the point cloud data is filtered (for example, statistical filtering) to obtain filtered point cloud data. The filtered point cloud data obtained in this way has less noise, reducing the workload of subsequent processing.
[0020] Step 102: Use an octree data structure to hierarchically segment the filtered point cloud data to obtain point cloud spatial structure information.
[0021] In specific implementation, using an octree data structure to hierarchically segment the filtered point cloud data can obtain point cloud spatial structure information including the distribution of leaf nodes at each height layer.
[0022] Step 103: Obtain the leaf nodes at multiple heights in the point cloud spatial structure information, and determine the target height at which the plant is separated from the ground from the multiple heights.
[0023] Step 104: Determine the ground point cloud according to the target height, and remove the ground point cloud from the point cloud spatial structure information (as Figure 6 shown) to obtain the plant point cloud spatial structure information.
[0024] In specific implementation, the point cloud data of the ground below the target height can be removed with the target height as the segmentation height, effectively avoiding the influence of the ground on subsequent analysis.
[0025] Step 105: Perform connectivity analysis on the leaf nodes in the plant point cloud spatial structure information to obtain multiple connected leaf node groups, and determine the connected components of each connected leaf node group.
[0026] In specific implementation, since the point clouds of each plant are definitely connected, performing connectivity analysis on the leaf nodes in the plant point cloud spatial structure information can separate multiple connected leaf node groups that are connected.
[0027] Step 106: Extract the point cloud corresponding to the connected leaf node group with the largest connected component as the plant point cloud extraction result (as Figure 7 shown).
[0028] In specific implementation, since the point cloud of the plant to be extracted must be the plant with the largest distribution range, and a large distribution range corresponds to a large connected component, the point cloud corresponding to the connected leaf node group with the largest connected component can be extracted, so that the connected leaf node groups of other small plants can be removed, and then an accurate plant point cloud extraction result can be obtained.
[0029] Through the above solution, it is possible to filter the point cloud data of plants, avoid the interference of some noises, and hierarchically segment using the octree data structure to obtain the point cloud spatial structure information. Based on this point cloud spatial structure information, the target height at which the plant separates from the ground can be accurately determined, and then the ground point cloud can be removed according to this target height, thus excluding the interference of the ground point cloud. Then, connectivity analysis is performed on the remaining leaf nodes in the plant point cloud spatial structure information, and then each connected leaf node group is found. In this way, the point cloud corresponding to the connected leaf node group with the largest connected component can be selected as the plant point cloud extraction result, and other outlier point clouds can be removed to improve the accuracy of plant point cloud extraction.
[0030] In some embodiments, step 102 includes: Step 1021, determine the nodes of the current layer according to the filtered point cloud data, and determine 8 leaf nodes of the nodes of the current layer.
[0031] Step 1022, perform point cloud allocation on each point cloud of the filtered point cloud data and allocate it to the corresponding leaf nodes of the nodes of the current layer. After determining that all point clouds of the filtered point cloud data are allocated to each leaf node of the nodes of the current layer, the point cloud structure information of the current layer is obtained.
[0032] Step 1023, iterative process: for each leaf node of the nodes of the current layer, re-use this leaf node as the node of the next layer, and re-determine 8 leaf nodes of this node of the next layer, and according to the process of point cloud allocation (that is, repeat the process of step 1022), re-allocate the point clouds belonging to this leaf node to obtain the point cloud structure information of the next layer.
[0033] In some embodiments, the determination process of 8 leaf nodes for each layer of nodes includes: Step A1, determine the node center and node side length of the node, where the node includes: the node of the current layer and / or the node of the next layer.
[0034] Specifically, a three-dimensional coordinate system (including the x-axis and y-axis in the horizontal direction and the z-axis in the longitudinal direction) is established according to the point cloud data.
[0035] Take the node of the first layer as the root node (representing the cubic bounding box of the entire point cloud).
[0036] First, find the point cloud inside this root node The bounding box range, that is, find the point coordinates with the smallest three dimensions in the point cloud data, and the point coordinates with the largest three dimensions in the point cloud data .
[0037] ,in m represents the number of corresponding point clouds, i Indicates the order number of traversing the point cloud. Indicates traversing the point cloud coordinates of the x-axis and selecting the minimum value of the x-axis; Indicates traversing the point cloud coordinates of the y-axis and selecting the minimum value of the y-axis; Indicates traversing the point cloud coordinates along the z-axis and selecting the minimum value of the z-axis.
[0038] , where m represents the number of corresponding point clouds and i represents the order number of traversing the point cloud. Indicates the point cloud coordinates traversing the x-axis and selecting the maximum value of the x-axis; Indicates the point cloud coordinates traversing the y-axis and selecting the maximum value of the y-axis; Indicates traversing the point cloud coordinates along the z-axis and selecting the maximum value along the z-axis.
[0039] The node center coordinates of the root node are: .
[0040] The node edge length of the root node is: .
[0041] Any node M consists of the following elements: Node Center Coordinates: ,in Representing three-dimensional quantities , each of which is a real number .
[0042] Node edge length: .
[0043] Leaf node collection: ,in, Represents 8 leaf nodes.
[0044] Point cloud belonging to this node: ,in , Represents the position coordinates corresponding to point cloud i, Representing three-dimensional quantities , each of which is a real number .
[0045] Step A2, determine the leaf node center point of each leaf node among the 8 leaf nodes according to the node center and the node edge length, and determine the leaf node edge length of each leaf node according to the node edge length (such as Figure 2 As shown), wherein the leaf node includes: the leaf node center point and the leaf node side length.
[0046] In specific implementation, 8 leaf nodes N j (N j ∈ The leaf node center point of each determined leaf node j is: wherein, represents the offset of leaf node j. For example, the offset is any one of (1, 1, 1), (1, 1, -1), (1, -1, 1), (1, -1, -1), (-1, 1, 1), (-1, 1, -1), (-1, -1, 1), (-1, -1, -1).
[0047] The side length of the leaf node wherein, is the side length of the leaf node.
[0048] Such as Figure 3 Showing the point cloud structure information of the first layer from the top view perspective, representing the relationship between the node center point coordinates and the leaf node center point coordinates of its leaf nodes. represents the node center coordinates, represents the leaf node center point coordinates of leaf node j, represents the point cloud assigned to the leaf node.
[0049] Through the above solution, the process of determining the leaf nodes can be accurately carried out.
[0050] In some embodiments, for the leaf nodes of the nodes in any layer, the process of corresponding point cloud assignment includes: Step B1, determine the target leaf node that meets the condition according to the position of each point cloud in the filtered point cloud data, wherein the target leaf node belongs to each leaf node of the nodes in any layer.
[0051] Step B2, assign the point cloud to the target leaf node. After determining that all the point clouds in the filtered point cloud data have been assigned, delete the leaf nodes without point clouds to obtain the point cloud structure information of this layer.
[0052] In specific implementation, for the coordinates of a certain point cloud i wherein, represents the coordinate of point cloud i on the x-axis, represents the coordinate of point cloud i on the y-axis, represents the coordinate of point cloud i on the z-axis. Determine the leaf node center point of the target leaf node j, and judge whether the coordinates of a certain point cloud i meet the following conditions: ; If satisfied, assign point cloud i to the target leaf node j.
[0053] After all the point clouds in the filtered point cloud data are assigned, the point cloud structure information corresponding to this layer is obtained.
[0054] Through the above solution, accurate point cloud assignment can be performed for each layer of leaf nodes obtained, ensuring that the filtered point cloud data can obtain the most suitable point cloud space structure information.
[0055] Step 1024, during the iteration process, count the iteration level (for example, ), determine that the iteration level is greater than or equal to the level threshold (for example, ), stop the iteration process, and use the point cloud structure information of the final layer obtained finally as the point cloud space structure information.
[0056] Specifically, when implementing, the number of nodes corresponding to one iteration level is 1, and the number of leaf nodes is 8; the number of nodes corresponding to two iteration levels is 8, and the number of leaf nodes is 8×8 = 64;...; the number of nodes corresponding to n iteration levels is 8 n-1 ones, and the number of leaf nodes is 8 n ones.
[0057] Figure 4 Shown from the top view For the recursive process with 6, the leaf nodes not assigned with point clouds will not be shown.
[0058] For each iteration level, all the point clouds in the filtered point cloud data will be assigned to the corresponding leaf nodes, and the leaf nodes without point clouds will be deleted to avoid affecting subsequent calculations.
[0059] Through the above solution, the finally obtained point cloud space structure information will include the leaf nodes of each height layer, which is convenient for subsequent determination of the target height for ground segmentation based on the leaf nodes of each height layer.
[0060] In some embodiments, step 103 includes: Step 1031, project the center points of the leaf nodes in the point cloud space structure information onto a vertical plane (for example, the xz plane formed by the x-axis and the z-axis), and there are corresponding projection points for each leaf node in the vertical plane.
[0061] Specifically, when implementing, determine the set O of the center points of the leaf nodes in the point cloud space structure information. For the center point coordinates of any leaf node j, project it onto the xz plane to obtain the projection point, and combine the projection points to obtain the initial projection point set , the corresponding formula is as follows: .
[0062] Step 1032, remove the repeated projection points in the vertical plane, and combine all the projection points in the vertical plane to obtain a set of projection points.
[0063] Specifically, when implementing, remove the repeated projection points in the initial set of projection points to obtain a set of projection points The formula is: , where unique() represents the de-duplication algorithm.
[0064] Step 1033, determine the mode of the set of projection points, and determine the target height according to the mode.
[0065] Specifically, when implementing, count the set Z of the z-axis coordinates of each projection point in the set of projection points , calculate the number of leaf nodes at each height level, and use the z-axis coordinate with the largest number of leaf nodes as the mode .
[0066] The z-axis coordinate corresponding to the mode can be directly used as the target height, or an offset corresponding to it can be added or subtracted as the target height.
[0067] Through the above solution, since the target height is determined according to the mode of the set of projection points, the mode of the set of projection points can represent the height of the layer with the most leaf nodes, and this layer generally represents the surface layer, so the target height determined in this way is relatively accurate.
[0068] In some embodiments, in step 1033, determining the target height according to the mode specifically includes: Step 10331, determine the height corresponding to the mode (for example, ), and obtain the side length of the leaf node of the leaf node in the point cloud spatial structure information (for example, ).
[0069] Step 10332, add the height corresponding to the mode to the side length of the leaf node at a predetermined ratio to obtain the target height (for example, ).
[0070] Specifically, when implementing, the predetermined ratio can also be set according to actual needs, and the predetermined ratio is less than or equal to 1, preferably 1 / 2. For example, the calculation formula for the target height is: .
[0071] Through the above solution, the height of the soil surface layer, that is, the target height, can be accurately determined.
[0072] In some embodiments, step 105 includes: Step 1051, construct at least one adjacent undirected graph according to the adjacency relationship between each leaf node in the plant point cloud spatial structure information.
[0073] In some embodiments, step 1051 includes: Step 10511, according to the Euclidean distance between each leaf node in the plant point cloud spatial structure information.
[0074] Specifically, when implemented, the set of leaf node center points of each leaf node in the plant point cloud spatial structure information , where n is the number of leaf nodes in the plant point cloud spatial structure information.
[0075] Calculate the leaf node center point of leaf node i and the leaf node center point of leaf node j The Euclidean distance between them The formula is: .
[0076] Combine the Euclidean distances between each leaf node to form a matrix D, where .
[0077] Step 10512, obtain the leaf node side length of the leaf nodes in the plant point cloud spatial structure information (for example, ).
[0078] Step 10513, determine that two leaf nodes with Euclidean distance less than or equal to the leaf node side length are adjacent nodes.
[0079] Specifically, when implemented, determine the adjacency relationship between leaf node i and leaf node j according to each value in matrix D : ; where Indicates adjacent, leaf node i and leaf node j are adjacent nodes, Indicates not adjacent, leaf node i and leaf node j are non - adjacent leaf nodes.
[0080] Step 10514, combine the leaf nodes that are adjacent to each other to form an adjacent undirected graph, and the plant point cloud spatial structure information corresponds to at least one adjacent undirected graph.
[0081] Specifically, when implemented, construct an adjacent undirected graph according to the adjacency relationship, for example, an adjacency list : , that is, the leaf nodes in each adjacent undirected graph Store a list that contains all the leaf nodes adjacent to this leaf node.
[0082] For example: G = {v1:[ v2, v3]} , indicating that the leaf node v1 can directly reach the leaf nodes v2 and v3.
[0083] For example, an example of the adjacency list G: Leaf node 0: [2, 8, 4, 1, 7]; Leaf node 1: [0, 4, 5]; Leaf node 2: [0, 8, 7, 6]; Leaf node 3: [8, 6, 4]; Leaf node 4: [0, 9, 3, 1]; Leaf node 5: [1]; Leaf node 6: [3, 8, 9, 2]; Leaf node 7: [2, 0]; Leaf node 8: [0, 2, 3, 6, 9]; Leaf node 9: [4, 6, 8].
[0084] The undirected adjacency graph constructed according to the above adjacency list is as Figure 5 shown.
[0085] Step 1052, for each undirected adjacency graph, combine the leaf nodes in the undirected adjacency graph to obtain a connected leaf node group corresponding to the undirected adjacency graph.
[0086] In some embodiments, step 1052 is performed for each undirected adjacency graph: Step 10521, construct an empty connected set (for example, CC), and traverse the unvisited leaf nodes in the undirected adjacency graph.
[0087] Step 10522, determine the leaf nodes connected to the unvisited leaf nodes, add the unvisited leaf nodes and the connected leaf nodes to the connected set, determine that all the leaf nodes in the undirected adjacency graph have been visited, and use the final connected set as a connected leaf node group corresponding to the undirected adjacency graph.
[0088] Specifically, after constructing the empty connected set CC, traverse the unvisited leaf node o in the undirected adjacency graph, execute the depth-first search (DFS) algorithm, and according to the adjacency list G, find the leaf node Mark all reachable leaf nodes to prevent repeated access, and then form a new connected component , satisfying , and .
[0089] Iteration: Continue to find the next unvisited leaf node until all leaf nodes in the undirected adjacency graph are traversed to obtain a connected leaf node group corresponding to the undirected adjacency graph.
[0090] Step 1053, count the connected components of each connected leaf node group.
[0091] In specific implementation, the corresponding connected component represents the number of leaf nodes in the connected leaf node group.
[0092] Through the above solution, the connected range of the corresponding leaf nodes can be determined through the connected component. The larger the connected component, the larger the connected range. Therefore, the connected leaf node group with the largest connected component belongs to the plant, and other connected leaf node groups belong to the weeds around the plant. In this way, these discrete leaf nodes can be directly removed according to the connected component to obtain the most suitable connected leaf node group, and then the corresponding point cloud is used as the plant point cloud extraction result.
[0093] It should be noted that the method of the embodiment of the present application can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this distributed scenario, one of the multiple devices can only execute one or more steps of the method of the embodiment of the present application, and these multiple devices will interact with each other to complete the described method.
[0094] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the above embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0095] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides a plant point cloud extraction device based on octree and connectivity analysis.
[0096] Refer to Figure 8 , the device includes: A filtering processing module 201, configured to determine point cloud data of a plant, perform filtering processing on the point cloud data to obtain filtered point cloud data; An octree processing module 202, configured to hierarchically segment the filtered point cloud data by using an octree data structure to obtain point cloud spatial structure information; A height determination module 203, configured to obtain leaf nodes at multiple heights in the point cloud spatial structure information, and determine a target height at which the plant is separated from the ground from the multiple heights; A ground point cloud removal module 204, configured to determine ground point cloud according to the target height, and remove the ground point cloud from the point cloud spatial structure information to obtain plant point cloud spatial structure information; A connectivity analysis module 205, configured to perform connectivity analysis on leaf nodes in the plant point cloud spatial structure information to obtain multiple connected leaf node groups, and determine the connected components of each connected leaf node group; A plant point cloud extraction module 206, configured to extract the point cloud corresponding to a connected leaf node group with the largest connected component as the plant point cloud extraction result.
[0097] In some embodiments, the octree processing module 202 includes: A node determination unit, configured to determine nodes of the current layer according to the filtered point cloud data, and determine 8 leaf nodes of the nodes of the current layer; A point cloud allocation unit, configured to perform point cloud allocation on each point cloud of the filtered point cloud data, and allocate them into corresponding leaf nodes of the nodes of the current layer. After determining that all point clouds of the filtered point cloud data are allocated to each leaf node of the nodes of the current layer, obtain the point cloud structure information of the current layer; An iterative processing unit, configured to execute an iterative process: for each leaf node of the nodes of the current layer, re-use the leaf node as a node of the next layer, and re-determine 8 leaf nodes of the node of the next layer, and re-allocate the point clouds belonging to the leaf node according to the process of point cloud allocation to obtain the point cloud structure information of the next layer; A point cloud spatial structure processing unit, configured to count the iteration levels during the iterative process, determine that the iteration level is greater than or equal to a level threshold, stop the iterative process, and use the point cloud structure information of the final layer finally obtained as the point cloud spatial structure information.
[0098] In some embodiments, the node determination unit is specifically configured to: Determine the node center and node side length of the node, where the node includes: the node of the current layer and / or the node of the next layer; Determine the center points of each leaf node among the 8 leaf nodes according to the node center and the node side length, and determine the leaf node side length of each leaf node according to the node side length, where the leaf nodes include: leaf node center points and leaf node side lengths.
[0099] In some embodiments, the point cloud allocation unit is specifically configured to: Determine the target leaf nodes that meet the requirements according to the positions of each point cloud in the filtered point cloud data, where the target leaf nodes belong to the respective leaf nodes of the nodes at any layer; Allocate the point cloud to the target leaf nodes. After determining that all the point clouds in the filtered point cloud data have been allocated, delete the leaf nodes without point clouds to obtain the point cloud structure information of this layer.
[0100] In some embodiments, the height determination module 203 is specifically configured to: Project the center points of the leaf nodes of each leaf node in the point cloud spatial structure information onto a vertical plane, and there are corresponding projection points for each leaf node in the vertical plane; Remove the repeated projection points in the vertical plane, and combine all the projection points in the vertical plane to obtain a projection point set; Determine the mode of the projection point set, and determine the target height according to the mode.
[0101] In some embodiments, the height determination module 203 is further specifically configured to: Determine the height corresponding to the mode, and obtain the leaf node side length of the leaf nodes in the point cloud spatial structure information; Add the height corresponding to the mode to the leaf node side length at a predetermined ratio to obtain the target height.
[0102] In some embodiments, the connectivity analysis module 205 includes: The adjacency relationship determination unit is configured to construct at least one adjacency undirected graph according to the adjacency relationships between the respective leaf nodes in the plant point cloud spatial structure information; The connectivity processing unit is configured to combine the respective leaf nodes in the adjacency undirected graph for each adjacency undirected graph to obtain a connected leaf node group corresponding to the adjacency undirected graph; The connected component statistics unit is configured to count the connected components of each connected leaf node group.
[0103] In some embodiments, the adjacency relationship determination unit is specifically configured to: According to the Euclidean distance between the respective leaf nodes in the plant point cloud spatial structure information; Obtain the leaf node side length of the leaf nodes in the plant point cloud spatial structure information; Determine that two leaf nodes with Euclidean distance less than or equal to the side length of the leaf node are adjacent nodes; Combine the leaf nodes that are adjacent to each other to form an undirected adjacency graph, and the plant point cloud spatial structure information correspondingly obtains at least one undirected adjacency graph.
[0104] In some embodiments, the connectivity processing unit performs, for each undirected adjacency graph: Construct an empty connectivity set and traverse the unvisited leaf nodes in the undirected adjacency graph; Determine the leaf nodes connected to the unvisited leaf nodes, add the unvisited leaf nodes and the connected leaf nodes to the connectivity set, determine that all the leaf nodes in the undirected adjacency graph have been visited, and use the final connectivity set as a connected leaf node group corresponding to the undirected adjacency graph.
[0105] For the convenience of description, when describing the above device, it is divided into various modules according to functions and described separately. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0106] The device in the above embodiment is used to implement the corresponding method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0107] Based on the same inventive concept, corresponding to the method in any of the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the method described in any of the above embodiments.
[0108] Figure 9 FIG. shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.
[0109] The processor 1010 may be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0110] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and called and executed by the processor 1010.
[0111] The input / output interface 1030 is used to connect to the input / output module to implement information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0112] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to implement communication interaction between this device and other devices. Among them, the communication module can implement communication in a wired manner (such as USB, network cable, etc.) or in a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0113] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0114] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solutions of the embodiments of this specification, and do not have to include all the components shown in the figure.
[0115] The electronic device in the above embodiment is used to implement the corresponding method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0116] Based on the same inventive concept, corresponding to the method in any of the above embodiments, the present application also provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the method described in any of the above embodiments.
[0117] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0118] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0119] Based on the same concept, corresponding to the method of any of the above embodiments, the present application also provides a computer program product, including computer program instructions. When the computer program instructions run on a computer, the computer is caused to execute the method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0120] It can be understood that before using the technical solutions of the various embodiments of the present application, the types, usage scopes, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0121] For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application program, server, or storage medium that performs the operations of the technical solutions of the present application according to the prompt message.
[0122] As an optional but non-limiting implementation manner, in response to receiving an active request from a user, the manner of sending a prompt message to the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0123] It can be understood that the above notification and the process of obtaining user authorization are only illustrative and do not limit the implementation manner of the present application. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present application.
[0124] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present application (including the claims) is limited to these examples; under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.
[0125] In addition, for the sake of simplicity of description and discussion, and in order not to make the embodiments of the present application difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. In addition, the device may be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation manner of these block diagram devices are highly dependent on the platform on which the embodiments of the present application will be implemented (that is, these details should be completely within the understanding of those skilled in the art). In the case where specific details (such as circuits) are set forth to describe the exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0126] Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0127] The embodiments of the present application are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the embodiments of the present application shall be included within the protection scope of the present application.
Claims
1. A plant point cloud extraction method based on octree and connectivity analysis, characterized in that: include: Determining point cloud data of the plant, and filtering the point cloud data to obtain filtered point cloud data; Using an octree data structure to hierarchically segment the filtered point cloud data to obtain point cloud spatial structure information; Acquire leaf nodes at multiple heights in the point cloud spatial structure information, and determine a target height at which the plant is separated from the ground from the multiple heights; Determine a ground point cloud according to the target height, remove the ground point cloud from the point cloud spatial structure information, and obtain plant point cloud spatial structure information; Performing connectivity analysis on leaf nodes in the plant point cloud spatial structure information to obtain multiple connected leaf node groups, and determining connected components of each connected leaf node group; The point cloud corresponding to the connected leaf node group with the largest connected component is extracted as the plant point cloud extraction result.
2. The method according to claim 1, characterized in that The step of using the octree data structure to hierarchically segment the filtered point cloud data to obtain point cloud spatial structure information includes: Determine the nodes of the current layer according to the filtered point cloud data, and determine 8 leaf nodes of the nodes of the current layer; Allocate each point cloud of the filtered point cloud data to the corresponding leaf nodes of the nodes of the current layer, and after all the point clouds of the filtered point cloud data and the leaf nodes of the nodes of the current layer are allocated, obtain the point cloud structure information of the current layer; Iteration process: for each leaf node of the current layer, the leaf node is re-used as the next layer node, and the 8 leaf nodes of the next layer node are re-determined, and the point cloud belonging to the leaf node is redistributed according to the point cloud allocation process to obtain the point cloud structure information of the next layer; During the iteration process, the iteration level is counted, and when it is determined that the iteration level is greater than or equal to the level threshold, the iteration process is stopped, and the point cloud structure information of the final layer obtained at the end is used as the point cloud spatial structure information.
3. The method according to claim 2, characterized in that The process of determining the eight leaf nodes of each layer of nodes includes: Determine the node center and the node edge length of the node, wherein the node includes: a node of the current layer and / or a node of the next layer; The leaf node center point of each leaf node among the eight leaf nodes is determined according to the node center and the node side length, and the leaf node side length of each leaf node is determined according to the node side length, wherein the leaf node includes: a leaf node center point and a leaf node side length.
4. The method according to claim 2, characterized in that: For the leaf nodes of any layer, the corresponding point cloud allocation process includes: Determine a target leaf node that meets the requirements according to the position of each point cloud in the filtered point cloud data, wherein the target leaf node belongs to each leaf node of a node in any layer; The point cloud is assigned to the target leaf node. After determining that all point clouds in the filtered point cloud data are assigned, the leaf nodes without point clouds are deleted to obtain the point cloud structure information of the layer.
5. The method according to claim 1, characterized in that: The step of obtaining leaf nodes at multiple heights in the point cloud spatial structure information and determining a target height at which the plant is separated from the ground from the multiple heights includes: Projecting the leaf node center point of each leaf node in the point cloud spatial structure information onto a vertical plane, where there is a projection point corresponding to each leaf node in the vertical plane; Removing duplicate projection points in the vertical plane, and combining all projection points in the vertical plane to obtain a projection point set; The mode of the projection point set is determined, and the target height is determined according to the mode.
6. The method according to claim 5, characterized in that Determining the target height according to the mode includes: Determine the height corresponding to the mode, and obtain the leaf node side length of the leaf node in the point cloud spatial structure information; The target height is obtained by adding the height corresponding to the mode to a predetermined ratio of the length of the leaf nodes.
7. The method according to claim 1, characterized in that The method of performing connectivity analysis on the leaf nodes in the plant point cloud spatial structure information to obtain a plurality of connected leaf node groups and determining the connected components of each connected leaf node group includes: Constructing at least one adjacency undirected graph according to the adjacency relationship between each leaf node in the plant point cloud spatial structure information; For each adjacency undirected graph, combine the leaf nodes in the adjacency undirected graph to obtain a connected leaf node group corresponding to the adjacency undirected graph; Count the connected components of each connected leaf node group.
8. The method according to claim 7, characterized in that The step of constructing at least one adjacency undirected graph according to the adjacency relationship between each leaf node in the plant point cloud spatial structure information includes: According to the Euclidean distance between each leaf node in the spatial structure information of the plant point cloud; Obtaining the leaf node side length of the leaf node in the plant point cloud spatial structure information; Determine two leaf nodes whose Euclidean distance is less than or equal to the leaf node side length of the leaf node as adjacent nodes; The leaf nodes that are adjacent to each other are combined to form an adjacency undirected graph, and at least one adjacency undirected graph is obtained corresponding to the spatial structure information of the plant point cloud.
9. The method according to claim 7, characterized in that: For each adjacency undirected graph, combining the leaf nodes in the adjacency undirected graph to obtain a connected leaf node group corresponding to the adjacency undirected graph includes: For each adjacency undirected graph, execute: Construct an empty connected set and traverse the unvisited leaf nodes in the adjacency undirected graph; Determine the leaf nodes connected to the unvisited leaf nodes, and add the unvisited leaf nodes and the connected leaf nodes to the connected set, determine that all leaf nodes in the adjacency undirected graph have been visited, and use the final connected set as a connected leaf node group corresponding to the adjacency undirected graph.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Single vegetation three-dimensional modeling method based on ground LiDAR point cloud data
CN105574929A
Large-scale point cloud visualization method based on improved octree and adaptive reading
CN112308974A
Plant model generation method and apparatus, computer device and storage medium
US20240112398A1