Adaptive point cloud stump extraction method, terminal device and storage medium
By using an adaptive point cloud tree stump extraction method, three-dimensional point cloud data is converted into two-dimensional image data, and parameters are adaptively acquired. This solves the problems of low computational efficiency and strong parameter dependence in tree stump location extraction in forest surveying, and achieves efficient and accurate tree stump identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTH SURVEYING & MAPPING INSTR
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies for extracting tree stump locations in forest mapping suffer from problems such as large data volume, low computational efficiency, strong parameter dependence, and noise and interference affecting recognition accuracy. In particular, in high-density 3D point cloud processing, the computation time is long, the memory consumption is large, and there is a lack of adaptive capability.
An adaptive point cloud tree stump extraction method is adopted. Feature point set is obtained through point cloud projection image processing, k-value nearest neighbor distance is calculated, nearest neighbor line is constructed and neighborhood radius parameter is obtained, clustering calculation and circle fitting are performed, and outlier detection is combined to obtain the actual tree stump coordinates and radius.
It significantly reduces the amount of data to be processed, lowers memory and computing resource consumption, improves computational extraction efficiency, enables adaptive parameter acquisition, and enhances the accuracy and robustness of tree stump identification, meeting the needs of real-time or near-real-time forest mapping.
Smart Images

Figure CN121861301A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of point cloud data processing technology, and in particular to an adaptive point cloud tree stump extraction method, its terminal device, and storage medium. Background Technology
[0002] Forest areas present a unique and challenging scenario for topographic mapping and updating. Traditional surveying relies primarily on equipment such as total stations, Global Positioning System (GPS), and Real-Time Kinematic (RTK). While these methods can efficiently collect ground control points and feature points in open areas, the dense canopy of trees in forest environments severely impacts satellite positioning accuracy and hinders direct observation of ground features. Tree stumps, the projections of tree trunks onto the ground, are crucial feature points in forest topography and can also aid in representing forest distribution, road alignment, and forest edge lines on topographic maps. In topographic mapping at scales of 1:500 to 1:2000, stump data can be combined with contour lines, rivers, buildings, and other elements to improve map accuracy and readability in forest areas. With the development of 3D mapping technologies such as LiDAR (Light Detection and Ranging) and multi-view image reconstruction, point cloud data has become a vital data source for forest topographic mapping. High-density 3D point cloud data of forest areas can be acquired using airborne, vehicle-mounted, backpack-mounted, or ground-based laser scanning platforms, including spatial information on tree trunks, canopies, ground surfaces, and other features. Extracting tree stump locations from point cloud data not only allows for high-precision labeling of tree positions but also enables integration with digital elevation models (DEMs) and digital orthophoto maps (DOMs) to create more comprehensive terrain information products.
[0003] Currently, methods for extracting tree stump locations in forest mapping and resource surveys mainly include low-height slice projection clustering, 3D cylinder fitting, raster density analysis, and point cloud segmentation based on deep learning. While these methods can achieve tree stump identification to some extent, they still have the following drawbacks: large data volume and low computational efficiency. Traditional methods directly perform clustering or fitting on high-density 3D point clouds, requiring traversal of a large number of spatial points, resulting in long computation time and large memory consumption, which is not conducive to real-time applications. Strong parameter dependence and poor universality. Parameters such as clustering radius and threshold are usually set based on point cloud density or empirical values. Different acquisition platforms (airborne, ground, backpack) have large differences in point cloud resolution, requiring manual adjustment of parameters and lacking adaptive capabilities. Noise and interference affect recognition accuracy. Factors such as understory shrubs and terrain undulations can introduce a large number of non-tree stump points in low-height slices, easily leading to false positives or false negatives. The existing density-based spatial clustering of applications with noise (DBSCAN) methods often rely on brute-force search of neighborhood points, resulting in high time complexity and poor efficiency in processing large-area forest point clouds. Summary of the Invention
[0004] This invention provides an adaptive point cloud stump extraction method, its terminal device, and storage medium, which can solve the technical problems of large data volume and strong parameter dependence in the prior art, realize adaptive acquisition of relevant parameters, and effectively improve the point cloud extraction efficiency.
[0005] This invention provides an adaptive point cloud tree stump extraction method, comprising: Acquire raw point cloud data, and obtain a point cloud projection image based on the raw point cloud data and a preset height range; A feature point set is obtained based on the point cloud projection image; Based on all feature points in the feature point set, obtain several k-valued nearest neighbor distances; The starting point, the ending point, and several intermediate points are obtained based on several k-value nearest neighbor distances and a preset sorting method. Based on the starting point and the ending point, a nearest neighbor line is constructed, and the neighborhood radius parameter is obtained based on several intermediate points, the nearest neighbor line and a preset value method. Clustering and circle fitting are performed based on the neighborhood radius parameter and feature point set to obtain target tree stump data; The actual tree stump coordinates and actual tree stump radius are obtained based on the target tree stump data, point cloud projection image, and threshold region recognition parameters.
[0006] This invention provides an adaptive point cloud tree stump extraction method. It transforms 3D point cloud data into 2D image data through point cloud projection imaging, significantly reducing the amount of data to be processed and lowering memory and computing resource consumption. Next, it calculates the k-value nearest neighbor distance and adaptively obtains the neighborhood radius parameter based on sorting and constructing nearest neighbor lines. This eliminates the need for manual parameter adjustment under different point cloud resolutions and acquisition conditions, improving versatility across various point cloud resolutions and acquisition conditions. This lays the foundation for subsequent clustering, circle fitting, actual parameter conversion, and accurate extraction of tree stump location and size. It solves the technical problems of large data volume and strong parameter dependence in existing technologies, achieving adaptive acquisition of relevant parameters and effectively improving the efficiency of point cloud tree stump extraction.
[0007] Furthermore, based on the starting point and the ending point, a nearest neighbor line is constructed, and a neighborhood radius parameter is obtained based on several intermediate points, the nearest neighbor line, and a preset value method, including: Construct nearest neighbor lines based on the starting and ending points; The vertical distances between several intermediate points are obtained based on several intermediate points and nearest neighbor lines; The maximum vertical distance among several intermediate points is selected as the neighborhood radius parameter.
[0008] In the above scheme, by taking the maximum value of the vertical distance from the midpoint to the nearest neighbor line, the key threshold in the distribution of the nearest neighbor distance of the feature point k value is accurately captured. This ensures that the obtained neighborhood radius parameter can accurately reflect the density distribution characteristics of the feature points, providing a reasonable distance judgment standard for subsequent clustering analysis. It avoids the problem of overly coarse or overly fine clustering caused by unreasonable neighborhood radius parameters, further improving the adaptive accuracy of the neighborhood radius parameter and ensuring the effectiveness of subsequent clustering calculations.
[0009] Further, the step of performing clustering calculations and circle fitting based on the neighborhood radius parameter and feature point set to obtain target tree stump data includes: Clustering calculations are performed based on the neighborhood radius parameter and the feature point set to obtain the clustering results; Based on the clustering results, a circle fitting is performed to obtain the coordinates of the tree stump's center and the tree stump's radius. Outlier detection is performed based on the center coordinates and radius of the tree stump to obtain target tree stump data.
[0010] In the above scheme, firstly, clustering calculations are used to aggregate points with high feature point density into independent groups to screen out potential tree stump point clouds; then, circle fitting is performed to extract the core geometric parameters of the tree stumps from each group to clarify the preliminary location and size of the tree stumps; finally, outlier detection is used to remove abnormal tree stump data caused by noise interference (such as the fitting results of groups formed by non-tree stump point aggregation), effectively suppressing the interference of forest vegetation and terrain noise, significantly improving the accuracy and robustness of tree stump identification, and solving the problem of false detection and missed detection caused by noise in traditional methods.
[0011] Further, clustering calculations are performed based on the neighborhood radius parameter and the feature point set to obtain clustering results, including: Density clustering is performed on all feature points in the feature point set until all feature points in the feature point set are polled to obtain clustering results including several target clusters. Based on the clustering results, circle fitting is performed to obtain the target tree stump data; The density clustering action includes: Based on the feature point set, unvisited points are marked to obtain the unvisited point set; Randomly select any unvisited feature point from the unvisited point set and mark it as visited to obtain the visited feature points; Based on the visited feature points and the neighborhood radius parameter, a core point determination action is performed to obtain a set of nearest neighbor feature points. When the determination is based on the set of nearest neighbor feature points and a preset numerical range and meets the preset core point conditions, the original cluster is obtained based on the set of nearest neighbor feature points and the visited feature points. Based on the original cluster, perform a cluster expansion operation to obtain the target cluster.
[0012] In the above scheme, core feature points with high density are accurately identified by core point determination, providing a reliable starting point for clustering; the original clusters are obtained based on feature points and cluster expansion is performed, aggregating all associated feature points of the same tree stump into a target cluster, avoiding the tree stump point cloud from being scattered into multiple clusters, ensuring the correspondence between the clustering results and the actual tree stumps, improving the clustering accuracy, and providing complete point cloud data support for subsequent circle fitting.
[0013] Furthermore, including: Based on the original cluster, a nearest core point determination action is performed. When it is determined that there is a target nearest feature point that meets the preset core point condition, a nearest extended cluster is obtained based on the target nearest feature point. The current extended cluster is obtained based on the nearest neighbor extended cluster and the original cluster; Based on the current extended cluster, the nearest core point determination action is repeated until it is determined that there is no current nearest feature point that meets the preset core point condition, and then the target cluster is obtained.
[0014] Furthermore, including: Based on the original cluster, a nearest core point determination action is performed. When it is determined that there is no target nearest neighbor feature point that meets the preset core point condition, the original cluster is directly used as the target cluster.
[0015] In the above scheme, by repeatedly determining nearest-neighbor core points and expanding clusters, feature points associated with the original cluster density are included in the clusters to the greatest extent possible. This ensures that the target cluster completely contains all point cloud data of the same tree stump, avoiding missing tree stump point clouds due to insufficient cluster expansion, and further improving the completeness of the clustering results. This provides more comprehensive point cloud data for subsequent circle fitting to extract accurate tree stump parameters, reducing fitting errors caused by incomplete point clouds. At the same time, non-core points are directly removed to avoid meaningless repeated determination and expansion actions, reduce computational redundancy, improve the efficiency of clustering calculation, and ensure that when the density of the original cluster itself meets the requirements, it can be directly used as a valid target cluster, without omitting small or relatively low-density but real tree stump point cloud clusters, thus balancing computational efficiency and clustering completeness.
[0016] Furthermore, including: Obtain a set of nearest neighbor feature points. If the set of nearest neighbor feature points and a preset numerical range do not meet the preset core point conditions, mark the visited feature points as noise points. Obtain a set of currently unvisited points and perform the density clustering operation based on the set of currently unvisited points.
[0017] In the above scheme, by marking noise points, isolated and low-density non-stump feature points, such as understory shrubs, are removed in real time during the clustering process. This reduces the interference of noise points on subsequent clustering results and avoids clustering errors caused by noise points being mistakenly included in stump clusters.
[0018] Further, obtaining the actual tree stump coordinates and actual tree stump radius based on the target tree stump data, point cloud projection image, and threshold region recognition parameters includes: The conversion ratio is obtained based on threshold region identification parameters and point cloud projection images; The actual tree stump coordinates and actual tree stump radius are obtained based on the target tree stump data and the conversion ratio.
[0019] The above scheme introduces a conversion ratio to realize the conversion from pixel dimension to actual physical dimension, ensuring that the final output tree stump coordinates and radius conform to the size standards of the real scene, meeting the requirements for tree stump position and size accuracy in topographic map drawing, improving the accuracy and readability of the map in forest areas, and solving the problem that traditional methods can only obtain relative positions but cannot obtain actual parameters.
[0020] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements an adaptive point cloud stump extraction method as described above.
[0021] Another embodiment of the present invention provides a storage medium comprising: a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform an adaptive point cloud stump extraction method as described above.
[0022] This invention provides an adaptive point cloud tree stump extraction method. First, feature point sets are extracted using point cloud projection imaging. Then, the k-value nearest neighbor distance is calculated, and a nearest neighbor line is constructed to adaptively obtain the neighborhood radius parameter. Next, density clustering is performed based on the adaptively obtained parameters to filter tree stump point cloud clusters. Finally, preliminary tree stump parameters are extracted through circle fitting. Noise is removed based on outlier detection, and actual parameters are converted based on a conversion ratio. The 3D image processing is converted into a 2D point cloud projection, effectively reducing the amount of data to be processed and lowering memory and computing resource consumption. Adaptive parameter calculation eliminates the need for manual parameter adjustment, improving versatility under different point cloud resolutions and acquisition conditions. It effectively suppresses noise interference from understory vegetation and terrain, reducing false positives and false negatives, and improving the accuracy and robustness of tree stump identification. Ultimately, it accurately outputs the actual coordinates and radius of the tree stump, improving the speed of clustering and fitting operations, achieving high-efficiency and high-precision real-time tree stump location identification. This meets the real-time or near-real-time processing needs of forest mapping and resource surveys and is suitable for rapid processing of large-scale, high-density forest point cloud data. Attached Figure Description
[0023] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of an adaptive point cloud tree stump extraction method provided in this embodiment; Figure 2 This is a schematic diagram of an adaptive point cloud tree stump extraction method provided in this embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0027] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0028] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0029] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0030] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0031] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0032] This embodiment provides an adaptive point cloud tree stump extraction method, such as... Figure 1 As shown, it includes: S1. Obtain raw point cloud data, and obtain a point cloud projection image based on the raw point cloud data and a preset height range; S2. Obtain a feature point set based on the point cloud projection image; S3. Obtain several k-valued nearest neighbor distances based on all feature points in the feature point set; S4. Obtain the starting point, the ending point, and several intermediate points based on the nearest neighbor distances of several k-values and a preset sorting method; S5. Construct a nearest neighbor line based on the starting point and the ending point, and obtain the neighborhood radius parameter based on several intermediate points, the nearest neighbor line and a preset value method. S6. Based on the neighborhood radius parameter and feature point set, perform clustering calculation and circle fitting to obtain target tree stump data; S7. Based on the target tree stump data, point cloud projection image and threshold region recognition parameters, obtain the actual tree stump coordinates and actual tree stump radius.
[0033] This embodiment provides an adaptive point cloud tree stump extraction method. It transforms 3D point cloud data into 2D image data through point cloud projection imaging, significantly reducing the amount of data to be processed and lowering memory and computing resource consumption. Next, it calculates the k-value nearest neighbor distance and adaptively obtains the neighborhood radius parameter based on sorting and constructing nearest neighbor lines, avoiding manual parameter adjustment and improving versatility under different point cloud resolutions and acquisition conditions. This lays the foundation for subsequent clustering, circle fitting, actual parameter conversion, and accurate extraction of tree stump location and size. It solves the technical problems of large data volume and strong parameter dependence in existing technologies, achieving adaptive acquisition of relevant parameters and effectively improving the efficiency of point cloud extraction.
[0034] In the specific implementation process, in step S1, the original point cloud data is acquired. Based on the characteristics of the point cloud data, the original point cloud data is sliced within a preset height range (this range is set according to the actual application environment, such as using a horizontal slice at 0.6 meters in this embodiment) to make the tree stump positions in the point cloud clearly visible, thus obtaining a point cloud projection image.
[0035] In the specific implementation process, when obtaining the feature point set based on the point cloud projection image in step S2, the generated point cloud projection image is binarized, and the white pixels (point cloud points) are denoted as feature points f, and their set is denoted as feature point set F.
[0036] Optionally, step S5 includes: Construct nearest neighbor lines based on the starting and ending points; The vertical distances between several intermediate points are obtained based on several intermediate points and nearest neighbor lines; The maximum vertical distance among several intermediate points is selected as the neighborhood radius parameter.
[0037] In the specific implementation process, during the adaptive parameter calculation, this embodiment first solves for the K-distance map of the feature points based on the feature point set F. For all feature points in the feature point set... Calculate the distance to its k-th nearest neighbor and obtain several k-valued nearest neighbor distances. Then sort these k-valued nearest neighbor distances according to a preset sorting method: treat the sorted points as a series of points on a curve. ,in Indicates index (0, ..., N-1). This represents the nearest neighbor distance corresponding to the k-value. A line segment is drawn connecting the first point (starting point) and the last point (ending point) of the curve to construct the nearest neighbor line. The perpendicular distance from each intermediate point to the intermediate point of this nearest neighbor line is calculated, and the point with the largest perpendicular distance is selected; its y-value is the neighborhood radius parameter of DBSCAN. In practical applications, when using DBSCAN with point cloud data, the k-value of the k-distance map and the minimum number of samples (min_samples) of DBSCAN are taken to be the same. Testing shows that for point clouds of a typical scale (such as tens of millions of points), a k-value of 6 yields relatively good clustering results.
[0038] Optionally, step S6 includes: performing clustering calculation based on the neighborhood radius parameter and the feature point set to obtain clustering results; performing circle fitting based on the clustering results to obtain the center coordinates and radius of the tree stump; and performing outlier detection based on the center coordinates and radius of the tree stump to obtain target tree stump data.
[0039] In the specific implementation process, when performing circle fitting based on the clustering results, for several target clusters included in the clustering results, each target cluster is treated as a group, and circle fitting with Random Sample Consensus (RANSAC) is performed separately: for any target cluster, three non-collinear points are randomly selected from its point set, and the parameters of the circle, including the coordinates of the circle center, are calculated from these three points. and radius r. Then for all points ( , ), calculate their distances to the circle. : ; if If a point is found to be an interior point, it is considered an interior point. The number of interior points is counted; if the current circle has more interior points than the historical best, the most recent circle model is updated. This process is repeated N times to obtain the optimal circle fit. Generally, the more iterations the algorithm performs, the better the circle fit; however, too many iterations can negatively impact the algorithm's efficiency. Therefore, this embodiment uses the following formula to determine N: ; in, This represents the probability of finding the optimal circle, which is set to 0.95 in this embodiment. is the probability that each point is an interior point, that is, the proportion of points belonging to the real circle. After preprocessing in this embodiment, the tree-like outline of the point cloud is more obvious and there is less noise. Therefore, all w can take a large value of 0.3. This represents the minimum number of points required for each fitting operation; for a circle, this is 3 points. Calculations show that N = 110 is a relatively optimal value. Let the center of the circle fitting result be... The coordinates of the tree stump's center are given, and the radius r is the tree stump's radius.
[0040] In the specific implementation process, after obtaining the center coordinates and radius of the tree stump, outlier detection is performed on the obtained tree stump radius to eliminate noise interference. The detailed steps include: calculating the median med of all tree stump radii, and calculating the difference between each radius and med. Then, take the median of these differences to obtain the MAD. For the radius of each tree stump... Calculate its ratio to MAD. ,like If the tree stump location is considered noise, the result is discarded. Otherwise, it is retained, thus obtaining the target tree stump data.
[0041] Optionally, clustering calculations are performed based on the neighborhood radius parameter and the feature point set to obtain clustering results, including: performing density clustering based on all feature points in the feature point set until all feature points in the feature point set are iterated to obtain clustering results including several target clusters; performing circle fitting based on the clustering results to obtain target tree stump data; wherein, the density clustering action includes: marking unvisited points based on the feature point set to obtain an unvisited point set; randomly selecting any unvisited feature point in the unvisited point set to mark it as visited to obtain visited feature points; performing core point determination based on the visited feature points and the neighborhood radius parameter to obtain a nearest neighbor feature point set; when the determination based on the nearest neighbor feature point set and a preset numerical range meets the preset core point conditions, obtaining an original cluster based on the nearest neighbor feature point set and the visited feature points; and performing cluster expansion based on the original cluster to obtain target clusters.
[0042] Optionally, the process includes: performing a nearest core point determination action based on the original cluster; when it is determined that there is a target nearest feature point that meets the preset core point condition, obtaining a nearest extended cluster based on the target nearest feature point; obtaining a current extended cluster based on the nearest extended cluster and the original cluster; and repeating the nearest core point determination action based on the current extended cluster until it is determined that there is no current nearest feature point that meets the preset core point condition, and then obtaining the target cluster.
[0043] Optionally, it includes: performing a nearest core point determination action based on the original cluster; when it is determined that there is no target nearest neighbor feature point that meets the preset core point condition, the original cluster is directly used as the target cluster.
[0044] Optionally, it includes: obtaining a set of nearest neighbor feature points; when it is determined based on the set of nearest neighbor feature points and a preset numerical range that the preset core point conditions are not met, marking the visited feature points as noise points; obtaining a set of currently unvisited points; and performing the density clustering operation based on the set of currently unvisited points.
[0045] In the specific implementation process, the basic flow of density clustering in this embodiment includes: initialization, marking all feature points in the feature point set as "unvisited" to obtain the unvisited point set; point-by-point scanning, randomly selecting an unvisited feature point from the unvisited point set and marking it as visited to obtain the visited feature point; then finding all neighbors (including the visited feature point itself) within the neighborhood radius parameter of the visited feature point to obtain the nearest neighbor feature point set; when performing the core point determination action, if the total number of feature points in the nearest neighbor feature point set (number of neighbors) is... If `min_samples` is used, then if the preset core point condition is met, `p` is determined to be a core point, a new original cluster is generated, and all points in the nearest feature point set are added to this cluster. If the number of neighbors... If `min_samples` is not found, the visited feature points are temporarily marked as noise points because they do not meet the preset core point conditions. When expanding the original cluster, each newly added neighbor point is checked individually, i.e., a core point determination is performed on each one. If a neighbor point is also a core point, its neighbors (corresponding to the nearest neighbor expanded cluster mentioned earlier) are also added to the cluster, resulting in the current expanded cluster. This expansion continues until the cluster can no longer grow, yielding the final target cluster. Then, the remaining unvisited feature points are processed, repeating the above steps until all points in the unvisited point set have been processed, i.e., all feature points in the feature point set are polled.
[0046] In the specific implementation process, in the basic workflow of the above density clustering operation, when searching for neighbors within all neighborhood radius parameters of the feature point set, the range search of the KD tree can be used to speed up the process. The specific workflow of KD tree construction and range search is as follows: Building the tree: For all points in the feature point set, based on the depth of the tree... The current partitioning dimension is determined using the following formula: ; In the formula: Axis refers to the coordinate axis dimension used to partition the data in the current layer. To maintain the balance of the tree, each layer of the tree needs to be partitioned using a different coordinate axis dimension. For example, the first layer is partitioned by x, the second layer by y, the third layer by x, and so on. Then, all points are sorted according to the Axis dimension, and the median of the sorted points is taken as the current node. Clicks to the left of the median are divided into the left subtree, and clicks to the right of the median are divided into the right subtree, recursively constructing subtrees. The tree construction is complete when the point set is empty. Input the center o and radius r of the search range, and recursively search the tree starting from the root node. Determine whether the current node is within the search range r. If it is, add the node to the result set. Determine based on the current partitioning dimension Axis: if... If the target node is not found, search the left subtree; otherwise, search the right subtree. The search ends after all possible nodes containing the target node have been traversed, and a set of all neighboring nodes within the range is returned.
[0047] Optionally, obtaining the actual tree stump coordinates and actual tree stump radius based on the target tree stump data, point cloud projection image, and threshold region recognition parameters includes: The conversion ratio is obtained based on threshold region identification parameters and point cloud projection images; The actual tree stump coordinates and actual tree stump radius are obtained based on the target tree stump data and the conversion ratio.
[0048] In the specific implementation process, the target tree stump data, such as the center pixel coordinates and the stump radius, of the selected tree stump locations need to be proportionally converted to obtain the actual center coordinates and radius length of the stump circle. Specifically: based on the known recognition area, threshold region recognition parameters and other data, including the true coordinates of the recognition area, are obtained. A conversion ratio is established between this data and the pixel resolution of the point cloud projection image (including the pixel coordinates of the recognition area) to obtain the conversion ratio p, which represents the correspondence between pixel length and actual distance. The specific calculation process is shown in the following formula: ; Wherein, PixelA is the minimum x-coordinate of the pixel coordinate in the recognition area, and PixelB is the maximum x-coordinate of the pixel coordinate in the recognition area; XA is the minimum x-coordinate of the true pixel coordinate in the recognition area, and XB is the maximum x-coordinate of the true pixel coordinate in the recognition area.
[0049] This embodiment provides a specific implementation process for an adaptive point cloud tree stump extraction method, such as... Figure 2 As shown, it includes the following steps: S21. Horizontal slicing of raw point cloud data; S22. Establish a conversion ratio p between the pixel resolution of the identified area and the projected image; S23. Binarize the point cloud projection image; S24. Calculate the esp (neighborhood radius) parameter of DBSCAN and use KD tree to accelerate DBSCAN clustering. S25. Use RANSAC to perform circle fitting on the clustering results of DBSCAN to obtain the center and radius of the tree stump based on pixel coordinates. Use the outlier detection algorithm to remove noise circles with excessively large or small radii.
[0050] This embodiment provides a specific implementation flow for an adaptive point cloud tree stump extraction method. By projecting point cloud slices into images and combining pixel-to-actual-size ratios, clustering and fitting parameters are adaptively set based on the actual size. This method is highly versatile and utilizes a KD-tree structure to accelerate the DBSCAN clustering process, achieving efficient and accurate real-time tree stump location identification. Projecting point cloud slices into images reduces data processing volume and accelerates identification speed. By calculating the pixel-to-actual-distance ratio, the pixel width can be estimated from the actual stump diameter. The K-distance map automatically calculates the eps and min_samples parameters for DBSCAN clustering without human intervention. The KD-tree structure accelerates the DBSCAN clustering process, speeding up the algorithm and enabling real-time stump location identification. The tree stump locations obtained from RANSAC circle fitting are further processed using an outlier detection algorithm to remove noise and abnormal stump locations identified by noise, effectively improving the algorithm's accuracy. This method is suitable for the rapid processing of large-scale, high-density forest point cloud data.
[0051] Based on the above-described embodiment of the adaptive point cloud tree stump extraction method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements an adaptive point cloud tree stump extraction method according to any embodiment of the present invention.
[0052] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0053] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0054] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0055] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute an adaptive point cloud stump extraction method as described in any of the above-described method embodiments of the present invention.
[0056] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0057] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. An adaptive point cloud tree stump extraction method, characterized in that, include: Acquire raw point cloud data, and obtain a point cloud projection image based on the raw point cloud data and a preset height range; A feature point set is obtained based on the point cloud projection image; Based on all feature points in the feature point set, obtain several k-valued nearest neighbor distances; The starting point, the ending point, and several intermediate points are obtained based on several k-value nearest neighbor distances and a preset sorting method. Based on the starting point and the ending point, a nearest neighbor line is constructed, and the neighborhood radius parameter is obtained based on several intermediate points, the nearest neighbor line and a preset value method. Clustering and circle fitting are performed based on the neighborhood radius parameter and feature point set to obtain target tree stump data; The actual tree stump coordinates and actual tree stump radius are obtained based on the target tree stump data, point cloud projection image, and threshold region recognition parameters.
2. The adaptive point cloud tree stump extraction method as described in claim 1, characterized in that, Based on the starting point and ending point, a nearest neighbor line is constructed. The neighborhood radius parameter is obtained based on several intermediate points, the nearest neighbor line, and a preset value method, including: Construct nearest neighbor lines based on the starting and ending points; The vertical distances between several intermediate points are obtained based on several intermediate points and nearest neighbor lines; The maximum vertical distance among several intermediate points is selected as the neighborhood radius parameter.
3. The adaptive point cloud tree stump extraction method as described in claim 1, characterized in that, The process of clustering and circle fitting based on the neighborhood radius parameter and feature point set to obtain target tree stump data includes: Clustering calculations are performed based on the neighborhood radius parameter and the feature point set to obtain the clustering results; Based on the clustering results, a circle fitting is performed to obtain the coordinates of the tree stump's center and the tree stump's radius. Outlier detection is performed based on the center coordinates and radius of the tree stump to obtain target tree stump data.
4. The adaptive point cloud tree stump extraction method as described in claim 3, characterized in that, Clustering calculations are performed based on the neighborhood radius parameter and the feature point set to obtain clustering results, including: Density clustering is performed on all feature points in the feature point set until all feature points in the feature point set are polled to obtain clustering results including several target clusters. Based on the clustering results, circle fitting is performed to obtain the target tree stump data; The density clustering action includes: Based on the feature point set, unvisited points are marked to obtain the unvisited point set; Randomly select any unvisited feature point from the unvisited point set and mark it as visited to obtain the visited feature points; Based on the visited feature points and the neighborhood radius parameter, a core point determination action is performed to obtain a set of nearest neighbor feature points. When the determination is based on the set of nearest neighbor feature points and a preset numerical range and meets the preset core point conditions, the original cluster is obtained based on the set of nearest neighbor feature points and the visited feature points. Based on the original cluster, perform a cluster expansion operation to obtain the target cluster.
5. The adaptive point cloud tree stump extraction method as described in claim 4, characterized in that, The step of performing cluster expansion based on the original cluster to obtain the target cluster includes: Based on the original cluster, a nearest core point determination action is performed. When it is determined that there is a target nearest feature point that meets the preset core point condition, a nearest extended cluster is obtained based on the target nearest feature point. The current extended cluster is obtained based on the nearest neighbor extended cluster and the original cluster; Based on the current extended cluster, the nearest core point determination action is repeated until it is determined that there is no current nearest feature point that meets the preset core point condition, and then the target cluster is obtained.
6. The adaptive point cloud tree stump extraction method as described in claim 5, characterized in that, include: Based on the original cluster, a nearest core point determination action is performed. When it is determined that there is no target nearest neighbor feature point that meets the preset core point condition, the original cluster is directly used as the target cluster.
7. The adaptive point cloud tree stump extraction method as described in claim 5, characterized in that, include: Obtain a set of nearest neighbor feature points. If the set of nearest neighbor feature points and a preset numerical range do not meet the preset core point conditions, mark the visited feature points as noise points. Obtain a set of currently unvisited points and perform the density clustering operation based on the set of currently unvisited points.
8. The adaptive point cloud tree stump extraction method as described in claim 1, characterized in that, The process of obtaining the actual tree stump coordinates and actual tree stump radius based on the target tree stump data, point cloud projection image, and threshold region recognition parameters includes: The conversion ratio is obtained based on threshold region identification parameters and point cloud projection images; The actual tree stump coordinates and actual tree stump radius are obtained based on the target tree stump data and the conversion ratio.
9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements an adaptive point cloud stump extraction method as described in any one of claims 1-8.
10. A storage medium, characterized in that, include: A stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform an adaptive point cloud stump extraction method as described in any one of claims 1-8.