A method, system, device, and medium for detecting stem damage
By generating a complete tree trunk surface model through multi-view temporal scanning and point cloud preprocessing techniques, and combining voxel downsampling and clustering, the problem of damage detection accuracy of lidar in complex occlusion environments is solved, and efficient and reliable tree trunk damage detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING LANDSCAPE ARCHITECTURE DESIGN & RES INST CO LTD
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-26
AI Technical Summary
Existing lidar detection methods struggle to accurately reconstruct complete tree trunk surface models when dealing with tree trunk damage detection in complex, obstructed environments, resulting in insufficient accuracy in damage detection.
A complete tree trunk surface point cloud model is generated by employing multi-view temporal scanning and point cloud preprocessing techniques. Key geometric features are preserved through voxel downsampling. Combined with ground segmentation and clustering, tree trunk point clouds are generated. The distance from each point to the fitted circle is calculated by circle fitting. Damaged areas are determined by combining the radius of abnormal slices and the radius of adjacent slices.
It significantly improves the accuracy of damage detection, reduces the false alarm rate, and ensures the reliability and precision of damage detection.
Smart Images

Figure CN122289155A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of lidar remote sensing technology, specifically to a method, system, device, and medium for detecting tree trunk damage. Background Technology
[0002] With the increasing importance of urban greening and forest resource management, the monitoring and assessment of tree health has become a critical technical issue. As the primary supporting structure of a tree, the integrity of the trunk directly affects the tree's stability and safety. During growth, tree trunks may suffer from pests and diseases, mechanical damage, environmental stress, and other factors, leading to surface damage such as dents, cavities, and rot. If these damages are not detected and treated promptly, they may cause tree collapses and other safety accidents. Therefore, accurate and efficient detection of trunk surface damage is of great significance for tree health management.
[0003] In recent years, 3D point cloud technology based on lidar has been introduced into the field of tree trunk detection, enabling rapid acquisition of 3D geometric information of the tree trunk surface. However, existing lidar detection methods struggle to accurately reconstruct a complete tree trunk surface model when processing point cloud data in complex occlusion environments, resulting in insufficient accuracy in damage detection. Summary of the Invention
[0004] This application provides a method, system, device, and medium for detecting tree trunk damage, which can improve the accuracy of damage detection.
[0005] In a first aspect, this application provides a method for detecting tree trunk damage. The method includes: acquiring a point cloud dataset containing occluded areas generated by a lidar performing a time-series scan of a tree trunk from multiple perspectives; preprocessing the point cloud dataset to generate a complete tree trunk surface point cloud model; performing voxel downsampling on the tree trunk surface point cloud model, retaining the point closest to the geometric center of each voxel in the voxel grid as a representative point, performing ground segmentation on the representative point to generate ground points and non-ground points; performing clustering on the non-ground points, filtering the clustering results by geometric features to generate a tree trunk point cloud, slicing the tree trunk point cloud at preset height intervals to generate multiple slices, performing circle fitting on each slice and calculating the distance from each point in the slice to the fitted circle; determining abnormal slices and abnormal points in the abnormal slices based on the distances, and verifying the spatial continuity of the abnormal points; when the abnormal points form a continuous region, acquiring the first radius of the fitted circle corresponding to the abnormal slice and the second radius of the fitted circle corresponding to the adjacent slice of the abnormal slice, and combining the first radius and the second radius to determine the tree trunk damage area.
[0006] By adopting the above technical solutions, multi-view temporal scanning and point cloud preprocessing techniques effectively solve the problem of incomplete data caused by occlusion areas in traditional LiDAR scanning, generating a complete tree trunk surface point cloud model, laying a data foundation for subsequent accurate analysis. Voxel downsampling processing retains representative points closest to the geometric center of each voxel, significantly reducing the amount of data and improving the computational efficiency of subsequent processing while maintaining key geometric features. Ground segmentation and clustering processing, combined with geometric feature screening, accurately extracts the tree trunk point cloud and eliminates environmental interference, providing clean target data for damage detection. Slicing at preset height intervals transforms the complex three-dimensional tree trunk structure into a series of two-dimensional cross-sectional analyses. By calculating the distance from each point to the fitted circle through circle fitting, an anomaly identification mechanism based on geometric deviation is established. Anomaly slices and anomaly points are determined based on the distance, and spatial continuity verification effectively distinguishes between real damage and random noise, significantly reducing the false alarm rate. When anomaly points form a continuous region, comprehensive analysis is performed by combining the first radius of the anomaly slice and the second radius of the adjacent slice, achieving dual verification of surface anomaly features and geometric deformation features, thus improving the accuracy of damage detection.
[0007] Secondly, this application provides a tree trunk damage detection system, the system comprising: an acquisition module, a first processing module, a second processing module, a verification module, and a judgment module; wherein, The acquisition module is used to acquire a point cloud dataset containing occluded areas generated by a lidar performing a time-series scan of the tree trunk from multiple perspectives, preprocess the point cloud dataset, and generate a complete tree trunk surface point cloud model. The first processing module is used to perform voxel downsampling on the tree trunk surface point cloud model, retaining the point closest to the geometric center of each voxel in the voxel grid as a representative point, and performing ground segmentation on the representative point to generate ground points and non-ground points. The second processing module is used to perform clustering on the non-ground points, perform geometric feature filtering on the clustering results, generate a tree trunk point cloud, slice the tree trunk point cloud at preset height intervals to generate multiple slices, perform circle fitting on each slice, and calculate the distance from each point in the slice to the fitted circle. The verification module is used to determine abnormal slices and abnormal points in the abnormal slices based on the distances, and verify the spatial continuity of the abnormal points. The judgment module is used to acquire the first radius of the fitted circle corresponding to the abnormal slice and the second radius of the fitted circle corresponding to the adjacent slice of the abnormal slice when the abnormal points form a continuous region, and determine the tree trunk damage area by combining the first radius and the second radius.
[0008] Thirdly, this application provides an electronic device that adopts the following technical solution: it includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to make the electronic device execute a computer program of any of the above-described tree trunk damage detection methods.
[0009] Fourthly, this application provides a computer-readable storage medium that stores a computer program capable of being loaded by a processor and executing any of the above-mentioned tree trunk damage detection methods.
[0010] In summary, this application includes at least one of the following beneficial technical effects: Multi-view temporal scanning and point cloud preprocessing techniques effectively solve the problem of incomplete data caused by occlusion areas in traditional LiDAR scanning, generating a complete tree trunk surface point cloud model, laying a data foundation for subsequent accurate analysis. Voxel downsampling retains representative points closest to the geometric center of each voxel, significantly reducing data volume and improving computational efficiency for subsequent processing while maintaining key geometric features. Ground segmentation and clustering combined with geometric feature filtering accurately extract the tree trunk point cloud and eliminate environmental interference, providing clean target data for damage detection. Slicing at preset height intervals transforms the complex three-dimensional tree trunk structure into a series of two-dimensional cross-sectional analyses. By calculating the distance from each point to the fitted circle through circle fitting, an anomaly identification mechanism based on geometric deviation is established. Anomaly slices and anomaly points are determined based on distance, and spatial continuity verification effectively distinguishes between real damage and random noise, significantly reducing the false alarm rate. When anomaly points form continuous regions, comprehensive analysis is performed by combining the first radius of the anomaly slice and the second radius of adjacent slices, achieving dual verification of surface anomaly features and geometric deformation features, thus improving the accuracy of damage detection. Attached Figure Description
[0011] Figure 1 This is a schematic flowchart of a tree trunk damage detection method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a multi-scale circle fitting and outlier clustering analysis flowchart provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a tree trunk damage detection system provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0012] Explanation of reference numerals in the attached figures: 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0014] In the description of the embodiments in this application, words such as "illustrative," "for example," or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "illustrative," "for example," or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of words such as "illustrative," "for example," or "for example" is intended to present the relevant concepts in a specific manner.
[0015] Figure 1 This is a schematic flowchart of a tree trunk damage detection method provided in an embodiment of this application. Figure 1 As shown, the method includes S101-S105: S101: Obtain the point cloud dataset containing occluded areas generated by the LiDAR after performing a time-series scan of the tree trunk from multiple perspectives. Preprocess the point cloud dataset to generate a complete point cloud model of the tree trunk surface.
[0016] This study acquires a point cloud dataset, including occluded areas, generated by a LiDAR scanner performing time-series scans of a tree trunk from multiple perspectives. The point cloud dataset is then preprocessed to generate a complete point cloud model of the tree trunk surface. Traditional single-view LiDAR scanning inevitably results in occlusion when dealing with complex tree trunk structures due to the linear propagation characteristics of the laser beam and the irregular shape of the trunk surface. This leads to missing point cloud data for the back of the trunk or recessed areas, which are precisely the areas most prone to tree trunk damage. Therefore, multi-view time-series scanning is necessary to obtain complete information about the tree trunk surface.
[0017] This invention employs a lidar device to perform time-series scanning along multiple preset locations around a tree trunk. Each scanning location is maintained 3-8 meters from the center of the trunk, with scanning angle intervals set at 30-45 degrees to ensure the lidar can capture detailed information about the tree trunk surface from different angles. During the scanning process, the lidar continuously collects point cloud data at preset time intervals (typically 0.1-0.5 seconds). Each scan generates raw point cloud data containing coordinate information (x, y, z), intensity information, and a timestamp. These time-series scan data collectively constitute a point cloud dataset including occluded areas. Due to coordinate system differences and spatial registration issues between scan data from different perspectives, the point cloud dataset inevitably contains overlapping areas, occluded areas, and noise points. Systematic preprocessing is required to generate a complete point cloud model of the tree trunk surface.
[0018] The first step in preprocessing is multi-view point cloud registration. This is achieved using an Iterative Closest Point (ICP) algorithm combined with feature point matching to unify point cloud data from different times and perspectives into a single coordinate system. Specifically, the point cloud data from the first scanned position is used as the reference coordinate system. Geometric feature points on the tree trunk surface (such as inflection points of the trunk outline and prominent points of surface texture) are extracted as control points for registration. The rotation matrix and translation vector between subsequent point cloud data from each perspective and the reference coordinate system are calculated, transforming all point cloud data into a unified coordinate system to form fused point cloud data. During the fusion process, a weighted average method is used to process point cloud data in overlapping areas. The weight coefficients are calculated based on the distance between the LiDAR and the scanned point and the angle of incidence. Point cloud data that are closer and have smaller angles of incidence have higher weights, ensuring the accuracy of the fusion result.
[0019] Next, point cloud density gradient analysis is performed to identify occluded areas. A cylindrical coordinate system centered on the tree trunk is established, and the fused point cloud data is divided into regular grid cells in the radial and vertical directions. Each grid cell is set to 5cm × 5cm. Then, the local point cloud density within each grid cell is calculated, i.e., the number of points contained in a unit volume. For a fully scanned tree trunk surface, the point cloud density of adjacent grid cells should show a smooth trend of change. However, due to the lack of effective point cloud data, the local point cloud density of occluded areas will drop sharply, forming a significant density gradient with the surrounding area. Specifically, the density difference between each grid cell and its eight adjacent grid cells is calculated, and the spatial rate of change of density is determined, i.e., the magnitude of density change per unit distance. When the spatial rate of change of a grid cell exceeds a preset threshold (usually set to three times the standard deviation of the overall density mean), that area is identified as an occluded area.
[0020] After determining the occlusion area, it is necessary to obtain the geometric constraints of the tree trunk to guide the point cloud completion process. This invention establishes a mathematical constraint model of the tree trunk's geometric shape based on the natural growth pattern of the tree trunk. First, it is assumed that the tree trunk has an approximately cylindrical structure in the vertical direction, with an elliptical or circular cross-section and a radius that continuously changes along the height direction. By analyzing the point cloud data of the unoccluded area, the least squares method is used to fit the equation of the tree trunk's central axis and the radius variation function, establishing the geometric constraints of the tree trunk. For point cloud completion of the occluded area, an interpolation algorithm based on the constraints is used to calculate the point cloud coordinates where the occluded area should exist, based on the point cloud distribution characteristics of the adjacent unoccluded areas and the geometric constraints. During the completion process, a layered completion strategy is adopted. The tree trunk is divided into multiple horizontal layers according to a preset height interval (usually 10-20cm), and the occluded area within each horizontal layer is completed separately to ensure that the completion result conforms to the natural morphological characteristics of the tree trunk.
[0021] Based on the above embodiments, as an optional implementation method, in S101, preprocessing the point cloud dataset to generate a complete tree trunk surface point cloud model specifically includes S11-S13: S11 performs multi-view point cloud registration on the point cloud dataset, unifying point cloud data from different times and perspectives into the same coordinate system to form fused point cloud data.
[0022] Multi-view point cloud registration was performed on a point cloud dataset to address the issue of spatial coordinate system consistency among point cloud data acquired at different scanning positions and times. The registration process employed a hybrid strategy combining the Iterative Closest Point (ICP) algorithm with feature point matching. First, geometric feature points, such as tree trunk edge points and surface curvature change points, were extracted from the point clouds at each viewpoint to establish feature point correspondences for coarse registration. Then, the ICP algorithm was used for fine-tuning and optimization. A convergence threshold of 0.02 meters was set during the registration process to ensure accurate alignment of point cloud data from different viewpoints, resulting in spatially consistent fused point cloud data.
[0023] S12, perform point cloud density gradient analysis on the fused point cloud data, identify areas with abnormal density changes, calculate the spatial change rate of local point cloud density in areas with abnormal density changes, and identify areas with spatial change rates exceeding a preset threshold as occlusion areas.
[0024] Point cloud density gradient analysis is performed on fused point cloud data to identify missing data regions. Point cloud density is defined as the number of points contained in a unit volume. A 3D mesh is constructed to divide the space into voxel units with a side length of 5 cm, and the number of points in each voxel is counted as the local density value. Density gradient analysis calculates the density difference between adjacent voxels. The density change in normal areas is relatively gradual, while the density drops sharply in data missing regions caused by occlusion. Spatial change rate is defined as the ratio of the density difference between adjacent voxels to the distance. When the spatial change rate exceeds a preset threshold of 80%, the corresponding region is identified as an occluded region. These regions typically correspond to parts of a tree trunk that are obscured by branches, leaves, or other objects.
[0025] S13: Obtain the geometric constraints of the tree trunk. Based on the geometric constraints, perform geometric completion on the point cloud data of the occluded area to generate a complete point cloud model of the tree trunk surface.
[0026] Geometric completion of the occluded area is performed based on the geometric constraints of the tree trunk. These constraints are formulated according to the natural growth patterns of the tree trunk and include constraints on the continuity of the trunk surface, cylindrical approximation, and vertical growth trend. The completion algorithm first analyzes the normal point cloud distribution around the occluded area, fits a local cylindrical surface model, and then interpolates based on the geometric parameters of the adjacent areas to complete the missing point cloud in the occluded area. The completion process ensures that the generated point cloud density is consistent with the surrounding normal area, and the positional accuracy of the completed points is controlled within ±3 cm. Through this preprocessing, the integrity of the final complete tree trunk surface point cloud model is improved to over 95%, providing a high-quality data foundation for subsequent damage detection.
[0027] S102, perform voxel downsampling on the point cloud model of the tree trunk surface, retain the point closest to the geometric center of each voxel in the voxel grid as the representative point, perform ground segmentation on the representative point to generate ground points and non-ground points.
[0028] Voxel downsampling is a point cloud simplification technique based on 3D mesh generation. Its core idea is to divide the 3D space into regular cubic mesh units, each called a voxel. Then, within each voxel, the most representative point is selected to replace all other points within that voxel. In this invention, the boundaries of the voxel mesh are first determined based on the spatial extent of the complete tree trunk surface point cloud model. The 3D space containing all point cloud data is then uniformly divided according to a preset voxel size, set to a cube of 3-5 cm. This size effectively reduces the amount of data while preserving the main geometric features of the tree trunk surface. For each non-empty voxel (i.e., a voxel containing at least one point cloud data point), the arithmetic mean of the coordinates of all points within the voxel is first calculated to obtain the coordinates of the voxel's geometric center. Then, the 3D Euclidean distance from each point within the voxel to the geometric center is calculated, and the original point closest to the geometric center is selected as the representative point of that voxel.
[0029] When a voxel contains only a single point, that point is directly retained as the representative point. When a voxel contains multiple points equidistant from the geometric center, the point with the highest Z-coordinate value is selected first, thus better preserving the feature information of the top of the tree trunk and protruding parts. The representative point inherits the 3D coordinate information of the original point while also retaining additional information such as laser intensity and color attributes, ensuring that subsequent processing algorithms can fully utilize these multi-dimensional features. After voxel downsampling, the amount of point cloud data can typically be reduced to 10%-30% of the original, significantly improving the processing efficiency of subsequent algorithms while maintaining the integrity of geometric features.
[0030] The next step is ground segmentation of representative points, a crucial preliminary step for tree trunk point cloud extraction. A complete tree trunk surface point cloud model includes not only the tree trunk itself but also point cloud data from the ground, grassland, shrubs, and other terrain features. Accurate separation of the tree trunk point cloud from this complex environment is essential. The first step in ground segmentation is adaptive identification of the height axis, addressing the issue of coordinate system differences between different data sources. Due to variations in the installation method and scanning angle of LiDAR equipment, the generated point cloud data may use different coordinate systems. For example, ground-based LiDAR scanning typically uses the Z-axis as the height direction, while UAV LiDAR may use the Y-axis or other axes. Directly assuming a specific coordinate axis as the height direction will lead to ground segmentation failure.
[0031] This invention automatically determines the height axis by calculating the data range of representative points on the X, Y, and Z coordinate axes. The data range is defined as the difference between the maximum and minimum values of the point cloud data on each coordinate axis. For typical tree trunk scanning scenarios, the data distribution range on the height axis is significantly larger than that on the horizontal axis because the height of a tree trunk is typically several meters to tens of meters, while the horizontal range is relatively small. By comparing the data range values of the X, Y, and Z coordinate axes, the axis with the largest data range is determined as the height axis. Then, the coordinate data of the representative points is reorganized so that the height axis becomes the new vertical axis (usually relabeled as the Z-axis). This ensures that subsequent processing algorithms can correctly identify the vertical and horizontal directions.
[0032] After determining the elevation axis, an improved RANSAC (Random Sample Consensus) algorithm is used for ground plane detection and segmentation. RANSAC is a robust model fitting algorithm, particularly suitable for datasets containing noise and outliers. In ground segmentation applications, the ground can be approximated as a plane in three-dimensional space, and ground regions are identified by finding the best-fitting plane. Specifically, three non-collinear points are randomly selected from representative points to construct a candidate ground plane model. The plane equation is expressed in the form ax + by + cz + d = 0. Then, the vertical distance from all representative points to this candidate plane is calculated. A preset distance threshold of 10-20 cm is set, and the number of points with a distance less than this threshold is counted. These points are called inliers, and the number of inliers reflects the fitting quality of the candidate plane model. After a preset number of iterations (usually set to 1000-5000), the candidate plane model with the most inliers is selected as the target ground plane model, as this model best represents the true ground morphology.
[0033] Based on the target ground plane model, all representative points are divided into two categories: ground points and non-ground points. Representative points that are less than a preset distance threshold from the target ground plane are classified as ground points, which mainly correspond to objects close to the ground surface such as the ground, grass, and fallen leaves; representative points that are greater than or equal to the preset distance threshold are classified as non-ground points, which mainly include objects above the ground such as tree trunks, branches, and shrubs.
[0034] Based on the above embodiments, as an optional implementation, in S102, ground segmentation is performed on the representative points to generate ground points and non-ground points, specifically including S21-S25: S21, calculate the data range of the representative point on the three coordinate axes X, Y, and Z, determine the coordinate axis with the largest data range as the height direction axis, and reorganize the representative points so that the height direction axis is the vertical axis.
[0035] The main orientation of the scene is determined by analyzing the data distribution range of representative points on the three coordinate axes. The difference between the maximum and minimum values of the representative point set on the X, Y, and Z axes is calculated; the coordinate axis with the largest data range typically corresponds to the direction of height change in the scene and is thus determined as the height axis. This adaptive coordinate system adjustment can handle scanning data from LiDAR equipment in different postures, ensuring that subsequent ground segmentation algorithms can correctly identify horizontal ground. The coordinates of the representative points are reorganized so that the height axis becomes the vertical axis, laying the coordinate foundation for ground segmentation based on the horizontal plane model.
[0036] S22, Select a preset number of representative points to construct a candidate ground plane model.
[0037] S23, calculate the distance from each representative point to the candidate ground plane model, and count the number of interior points whose distance is less than the preset distance threshold.
[0038] S24. After a preset number of iterations, select the candidate ground plane model with the most interior points as the target ground plane model.
[0039] A robust ground plane estimation method based on the RANSAC (Random Sample Consensus) algorithm is employed. In each iteration, three representative points are randomly selected to construct a candidate ground plane model, which is the minimum number of points required to determine a spatial plane. By calculating the Euclidean distances from all representative points to the candidate plane, the number of interior points whose distances are less than a preset distance threshold (usually set to 0.1-0.2 meters) is counted. The selection of the preset distance threshold needs to balance the accuracy of ground identification with tolerance for ground unevenness, including points belonging to the ground while excluding obviously non-ground points.
[0040] After a preset number of iterations (usually set to 1000-2000), the candidate ground plane model with the most inliers is selected as the target ground plane model. The core idea of the RANSAC algorithm is to find the model parameters that best match the distribution of the main data through a large number of random samples, which can effectively resist the interference of noise points and outliers. The plane model with the most inliers represents the most important horizontal structure in the scene, that is, the real ground plane. The plane equation parameters of this model describe the spatial position and normal vector of the ground.
[0041] S25, based on the distance of each representative point to the target ground plane model, determine the representative points whose distance is less than the preset distance threshold as ground points, and determine the representative points whose distance is greater than or equal to the preset distance threshold as non-ground points.
[0042] The final ground segmentation is performed on all representative points based on the target ground plane model. The vertical distance from each representative point to the target ground plane model is calculated; representative points with a distance less than a preset distance threshold are identified as ground points, while those with a distance greater than or equal to the preset distance threshold are identified as non-ground points. This hard segmentation method based on geometric distance is simple and efficient, clearly dividing the point cloud data into two mutually exclusive sets.
[0043] S103, perform clustering processing on non-ground points, filter the geometric features of the clustering results, generate a trunk point cloud, slice the trunk point cloud at preset height intervals to generate multiple slices, perform circle fitting on each slice and calculate the distance from each point in the slice to the fitted circle.
[0044] Clustering is performed using DBSCAN (Density-Based Spatial Clustering), a density-based clustering algorithm that automatically discovers clusters of arbitrary shapes and effectively handles noisy points, making it particularly suitable for processing 3D objects with irregular surface shapes, such as tree trunks. The core parameters of the algorithm include the clustering distance threshold (eps) and the minimum number of points threshold. The clustering distance threshold defines the maximum spatial distance between two points that can belong to the same cluster, set to 0.1-0.5 meters. This range ensures that point clouds belonging to the same tree trunk are correctly clustered while preventing the incorrect merging of point clouds from different objects. The minimum number of points threshold defines the minimum number of points required to form an effective cluster, set to 20-50 points, estimated based on a voxel size of 3-5 cm and the minimum cross-sectional area of the tree trunk, ensuring that small groups of noisy points are not incorrectly identified as independent clusters.
[0045] The DBSCAN algorithm performs clustering by calculating the density reachability of each non-ground point. For any point, if the number of points in its eps neighborhood is not less than a minimum point threshold, then that point is defined as a core point. All points that can be connected by density through core points are grouped into the same cluster. This density-based clustering method can effectively handle irregular shapes and branching structures on tree trunk surfaces. Even if the tree trunk surface is uneven or slightly curved, the algorithm can still identify it as a continuous cluster. During the clustering process, spatially adjacent non-ground points with sufficient density are automatically grouped into multiple point cloud clusters. Each cluster may correspond to a tree trunk, a clump of shrubs, a branch, or other three-dimensional objects.
[0046] To accurately identify the trunk cluster from multiple point cloud clusters, systematic geometric feature calculation and filtering are required. For each point cloud cluster, its geometric feature parameters are first calculated, including cluster height, cluster width, and main extension direction. The cluster height is obtained by calculating the difference between the maximum and minimum values of all points within the cluster on the vertical axis, reflecting the vertical extension range of the cluster. The cluster width is obtained by projecting the cluster points onto a horizontal plane and calculating the minimum circumcircle diameter of the projected points, representing the maximum horizontal span of the cluster. The main extension direction is calculated using Principal Component Analysis (PCA). By analyzing the eigenvectors of the covariance matrix of the clustered point clouds, the main extension direction vector of the cluster is obtained, indicating the main extension trend of the cluster in three-dimensional space.
[0047] Based on the natural growth characteristics of tree trunks, geometric feature screening conditions were established to identify tree trunk clusters. As the main supporting structure of woody plants, tree trunks exhibit a clear vertical upward growth characteristic and a relatively stable cylindrical cross-section. These natural attributes provide a reliable basis for geometric screening. The geometric feature screening conditions include three constraints: First, the cluster height must be greater than a preset height threshold, typically set at 1.3 meters. This threshold is based on the standard diameter at breast height (DBH) measurement and can exclude low-lying shrubs and herbaceous plants. Second, the cluster width must be less than a preset diameter threshold, typically set at 1.5 meters. This threshold is based on the trunk diameter range of common tree species and can exclude large buildings and abnormally large clusters. Finally, the angle between the main extension direction of the cluster and the vertical axis must be less than a preset angle threshold, typically set at 30 degrees, to ensure that the clusters have obvious vertical growth characteristics.
[0048] After geometric feature screening, point cloud clusters that meet all screening criteria are labeled as candidate tree trunk clusters. However, further shape verification is still needed to ensure the accuracy of identification. Shape verification is performed by calculating the height-to-width ratio of the candidate tree trunk clusters. A real tree trunk should exhibit a slender shape with a height much greater than its width, and the ratio should typically be greater than 3. This threshold can effectively distinguish tree trunks from other objects that may have vertical features but whose shapes do not meet the requirements. Simultaneously, the uniformity of the point cloud density distribution of the candidate tree trunk clusters needs to be checked. Clusters with local point densities abnormally lower than 50% of the overall mean are removed to avoid misidentification due to incomplete point cloud data. The candidate tree trunk clusters that have passed shape verification are ultimately determined as tree trunk point clouds, and these point cloud data represent real tree trunk objects in the scene.
[0049] After obtaining the tree trunk point cloud, it is sliced at preset height intervals to prepare for subsequent circle fitting analysis. The preset height interval is set to 10-30 cm. This interval ensures sufficient analytical accuracy while guaranteeing that each slice contains enough point cloud data for effective circle fitting. The slicing process involves dividing the tree trunk point cloud vertically into equally spaced horizontal planes. The intersection of each horizontal plane with the tree trunk point cloud forms a two-dimensional slice. The point cloud data within the slice reflects the cross-sectional shape characteristics of the tree trunk at that height. Due to the natural growth characteristics of the tree trunk, each slice should normally exhibit an approximately circular or elliptical distribution, providing a theoretical basis for circle fitting analysis.
[0050] Circle fitting for each slice is a core step in damage detection. The least squares method is used to fit an optimal circular model to approximate the distribution shape of the point cloud data within the slice. The goal of circle fitting is to find a center coordinate and radius parameter that minimizes the sum of the squared distances from all points within the slice to the circle. The fitting process employs an iterative optimization algorithm. The initial center is set to the centroid coordinates of all points within the slice, and the initial radius is set to the average distance from all points to the centroid. Then, the center and radius parameters are continuously adjusted using gradient descent until convergence to the optimal solution. After fitting, the radial distance from each point within the slice to the fitted circle is calculated. These distance data reflect the degree to which the cross-sectional shape of the tree trunk deviates from a standard circle, providing a quantitative analytical basis for subsequent anomaly detection.
[0051] Based on the above embodiments, as an optional implementation, in S103, clustering is performed on non-ground points, and geometric feature filtering is performed on the clustering results to generate a trunk point cloud, specifically including S31-S35: S31, perform clustering processing on non-ground points, set clustering distance threshold and minimum number of points threshold, classify spatially adjacent non-ground points into the same cluster, and generate multiple point cloud clusters.
[0052] The DBSCAN clustering algorithm is used to spatially group non-ground points. A clustering distance threshold of 0.2-0.5 meters is set, defining the maximum spatial distance between two points that can belong to the same cluster. This threshold ensures that point clouds belonging to the same object are correctly clustered while preventing incorrect merging of different objects. A minimum point count threshold of 30-50 points is set to ensure that only regions containing a sufficient number of points form effective clusters, filtering out small, noisy point clusters. The algorithm calculates the density reachability between points, grouping spatially adjacent non-ground points with sufficient density into the same cluster, generating several point cloud clusters representing different 3D objects.
[0053] S32, calculate the geometric features of each point cloud cluster to obtain the cluster height, cluster width and main extension direction of each point cloud cluster.
[0054] For each point cloud cluster, key geometric feature parameters are calculated. Cluster height is obtained by calculating the difference between the maximum and minimum values of all points within the cluster on the vertical axis, reflecting the vertical extent of the object. Cluster width is obtained by projecting the cluster points onto a horizontal plane and calculating the minimum circumcircle diameter of the projected points, representing the maximum horizontal span of the object. The main extension direction of the cluster is determined using principal component analysis. By analyzing the eigenvectors of the covariance matrix of the clustered point cloud, the main extension direction of the cluster in 3D space is obtained, and this direction vector indicates the main geometric trend of the object.
[0055] S33. The point cloud clusters are filtered according to the preset geometric feature filtering conditions. The geometric feature filtering conditions include: the cluster height is greater than the preset height threshold, the cluster width is less than the preset diameter threshold, and the angle between the main extension direction of the cluster and the vertical axis is less than the preset angle threshold.
[0056] S34. Point cloud clusters that meet the geometric feature selection criteria are identified as candidate trunk clusters.
[0057] Geometric feature selection criteria were established based on the natural growth characteristics of tree trunks. As the primary supporting structure of woody plants, tree trunks exhibit a distinct vertical growth characteristic and a relatively stable cylindrical cross-section. The geometric feature selection criteria included three constraints: cluster height greater than a preset height threshold of 1.3 meters (based on standard diameter at breast height measurements, excluding low shrubs and herbaceous plants); cluster width less than a preset diameter threshold of 1.5 meters (based on the diameter range of common tree species, excluding large buildings); and the angle between the main extension direction of the cluster and the vertical axis less than a preset angle threshold of 30 degrees, ensuring that the object exhibits a clear vertical growth characteristic. Point cloud clusters that met all selection criteria were identified as candidate tree trunk clusters.
[0058] S35, perform shape verification on each candidate trunk cluster, calculate the height-to-width ratio of each candidate trunk cluster, and determine the candidate trunk cluster with a ratio greater than the preset ratio as the trunk point cloud.
[0059] Final shape verification is performed on the candidate tree trunk clusters. The height-to-width ratio of each candidate tree trunk cluster is calculated. A true tree trunk should exhibit a slender shape with a height much greater than its width. Candidate tree trunk clusters with a ratio greater than a preset ratio of 3 are identified as tree trunk point clouds. This threshold effectively distinguishes tree trunks from other objects that may have vertical features but whose shapes do not meet the requirements. For example, man-made structures such as utility poles and streetlights usually have a larger height-to-width ratio, while shrubs have a relatively smaller height-to-width ratio.
[0060] S104, Determine the abnormal slice and the abnormal points in the abnormal slice based on the distance, and verify the spatial continuity of the abnormal points.
[0061] Since damage to the tree trunk surface usually manifests as localized depressions, protrusions, cracks, or decayed areas, these damages can cause the cross-sectional shape of the trunk to deviate from the normal circular outline. In point cloud data, this is reflected as significant anomalies in the distances of some points to the fitted circle. However, relying solely on distance thresholds can easily lead to false alarms, as noise during the lidar scanning process, the natural texture of the bark, and measurement errors can also cause anomalies in the distances of individual points. Therefore, it is necessary to combine spatial continuity analysis to distinguish between real damage and occasional noise, ensuring the accuracy and reliability of damage detection.
[0062] Anomaly slices are identified using an adaptive thresholding method based on statistical analysis, avoiding the potential for insufficient adaptability with fixed thresholds. For each slice, the statistical distribution characteristics of the distances from all points within the slice to the fitted circle are first calculated, including key parameters such as mean distance, standard deviation, and quartiles. The mean distance reflects the degree to which the slice deviates from the circle, the standard deviation reflects the dispersion of the distance distribution within the slice, and the quartiles provide quantile information of the distance distribution. Based on the 3σ principle of normal distribution, points whose distances exceed the mean distance plus or minus three times the standard deviation are defined as candidate anomalies. However, this statistical method may be affected by extreme values, so the interquartile range (IQR) method is used for double verification. The interquartile range is defined as the difference between the 75th percentile and the 25th percentile. Points whose distances exceed the 25th percentile minus 1.5 times the IQR or the 75th percentile plus 1.5 times the IQR are also marked as candidate anomalies.
[0063] To improve the robustness of anomaly detection, this invention also introduces a correlation analysis mechanism between adjacent slices. Considering that genuine trunk damage often exhibits a certain degree of continuity in the vertical direction, while occasional measurement noise typically only affects localized areas, analyzing the anomalies in adjacent slices enhances the reliability of the judgment. Specifically, the proportion of anomalies in each slice is calculated, i.e., the ratio of the number of candidate anomalies to the total number of points within the slice. When the proportion of anomalies in a slice exceeds 15%, and at least one of its two adjacent slices (upper and lower) also has an anomaly proportion exceeding 10%, that slice is identified as an anomaly slice. This vertical correlation judgment mechanism effectively filters out false anomalies caused by single-layer measurement errors, improving the accuracy of anomaly slice identification.
[0064] Based on the identified abnormal slices, further precise identification of anomalous points within these slices is required. Since abnormal slices may contain both normal and anomalous points, more refined screening and verification of candidate anomalous points are necessary. Anomaly identification employs a comprehensive method combining local density analysis and distance analysis. First, a local neighborhood of each candidate anomalous point is established within the abnormal slice, with a neighborhood radius of 5-10 cm. The number of points contained within the neighborhood is counted as a local density index. For actual damaged areas, due to physical missing or deformed tree trunk surfaces, the point cloud density in local areas will be significantly lower than in normal areas. Therefore, candidate anomalous points with a local density lower than 50% of the slice's average density are preferentially marked as anomalous. Simultaneously, a secondary verification is performed using the radial distance from the point to the fitted circle; candidate anomalous points with a distance deviation exceeding 20% of the fitted circle's radius are also marked as anomalous.
[0065] Spatial continuity verification of anomalies is a key technical step in damage identification, used to distinguish between true continuous damage and discrete noise interference. Spatial continuity verification is based on the connectivity analysis principle in graph theory, treating anomalies as nodes in a graph. If the spatial distance between two anomalies is less than a preset connection threshold (usually set to 10-15% of the fitted circle radius), a connection edge is established between these two nodes, forming an adjacency graph of the anomalies. The connection threshold setting must ensure that anomalies within the true damage area are effectively connected, while avoiding incorrect connections between anomalies from different damage areas. Therefore, the threshold size needs to be adaptively adjusted according to the trunk diameter and scanning accuracy.
[0066] Based on the adjacency graph of anomalies, a depth-first search algorithm is used for connected component analysis to identify all connected anomaly clusters. A connected anomaly cluster refers to a set of anomalies connected by edges, where there is at least one path connecting any two points in the set. This connectivity reflects the spatial clustering characteristics of the anomalies. For each connected anomaly cluster, the number of anomalies it contains, the spatial extent it covers, and its shape characteristics are calculated. Real tree trunk damage typically manifests as relatively concentrated, continuous areas; therefore, connected anomaly clusters must meet a minimum size requirement: containing at least 10 anomalies and covering a spatial area of at least 20 square centimeters. This threshold is based on the minimum detectable size of common tree trunk damage.
[0067] To further improve the accuracy of spatial continuity verification, this invention also introduces shape regularity analysis. While real damage areas vary in shape, they typically possess relatively compact and regular geometric features, whereas noise-generated anomaly clusters are often loosely distributed and irregularly shaped. The shape regularity is evaluated by calculating the compactness index of connected anomaly clusters. Compactness is defined as the ratio of the actual area of a connected anomaly cluster to the area of its smallest circumcircle; a ratio closer to 1 indicates a more compact and regular shape. A compactness threshold of 0.3-0.8 is set; connected anomaly clusters below this threshold are considered too loose and may be false anomalies caused by noise, thus being removed from the anomaly list.
[0068] After spatial continuity verification, connected anomaly groups that meet the continuity and shape regularity requirements are identified as real damage candidate regions, and the anomalies contained within them are marked as damage-related anomalies. To provide more accurate damage location information, geometric parameters such as geometric center coordinates, main extension direction, maximum size, and average depth are calculated for each identified connected anomaly group. The geometric center coordinates are obtained by calculating the weighted average of the coordinates of all anomalies within the connected anomaly group. The weights are determined based on the distance deviation of the anomalies; anomalies with greater distance deviations have higher weights, ensuring that the geometric center accurately reflects the core location of the damage.
[0069] Based on the above embodiments, as an optional implementation, in S104, determining the abnormal slice and abnormal points in the abnormal slice according to the distance, and verifying the spatial continuity of the abnormal points specifically includes S41-S46: S41, perform statistical analysis on the distance from each point in each slice to the fitted circle, and calculate the mean and standard deviation of the distance distribution for each slice.
[0070] S42, points whose distance to the fitted circle exceeds the mean of the corresponding slice distance distribution plus a preset standard deviation are identified as outliers.
[0071] Statistical anomaly detection methods are used to identify initial outliers. Statistical analysis is performed on the distances from all points within each slice to the fitted circle, calculating the mean and standard deviation of the distance distribution. These two statistical parameters describe the distributional characteristics of the deviation of the point cloud data within that slice from the ideal circular contour. Under normal circumstances, the point cloud on the surface of a healthy tree trunk should be approximately distributed near the circular contour, with distance deviations following an approximately normal distribution. Points whose distances exceed the mean plus a preset standard deviation multiple (usually set to 2-3 times the standard deviation) are identified as outliers. This anomaly detection method based on the 3σ criterion can effectively identify data points that significantly deviate from the normal distribution. The selection of the preset standard deviation multiple balances detection sensitivity and false alarm rate.
[0072] S43, count the number of outliers in each slice, and identify slices with an outlier count exceeding a preset outlier threshold as outlier slices.
[0073] Abnormal slices are identified by counting the number of outliers in each slice. Normal slices typically contain a small number of occasional outliers, while damaged slices will contain a large number of concentrated outliers. A preset outlier threshold is set based on the proportion of the total number of points in the slice, usually between 10% and 20%. When the number of outliers in a slice exceeds this threshold, the slice is identified as abnormal. This slice-level judgment based on outlier density can effectively identify potentially damaged areas, providing key targets for subsequent refined analysis.
[0074] S44: Perform spatial continuity verification on outliers in each outlier slice, perform clustering on outliers, and set the minimum number of clusters for outliers.
[0075] S45 defines outliers that form clusters and whose cluster size is greater than the minimum cluster size of outliers as continuous outliers.
[0076] Spatial continuity was verified for outliers within the abnormal slices. Genuine trunk damage, such as decay, insect infestation, or mechanical injury, typically forms spatially continuous areas, while outliers caused by measurement noise and environmental interference tend to be randomly distributed. Outliers were clustered using a density-based clustering algorithm with a cluster radius of 0.05-0.1 meters, grouping spatially adjacent outliers into the same cluster. The minimum cluster size was set to 8-15 points to ensure that only outlier groups containing a sufficient number of points were considered spatially continuous. Outliers forming clusters with a cluster size greater than the minimum cluster size were identified as continuous outliers, as these points are more likely to represent actual damage areas rather than random errors.
[0077] S46, calculate the spatial coverage height of each cluster of consecutive anomalies, and determine the clusters of consecutive anomalies with spatial coverage height greater than the preset consecutive height threshold as anomalies forming a continuous region.
[0078] Further verification of the spatial continuity of consecutive anomalies in the vertical direction was conducted. The spatial coverage height of each consecutive anomaly cluster was calculated, which is the difference between the maximum and minimum vertical values of all points within the cluster. Real tree trunk damage often exhibits a certain degree of continuity in the vertical direction, while local surface irregularities or measurement errors typically only affect a small height range. A preset continuity height threshold was set at 0.2-0.3 meters. When the spatial coverage height of a consecutive anomaly cluster exceeds this threshold, the cluster is identified as an anomaly forming a continuous region, and these anomalies meet the basic spatial distribution requirements of damage characteristics.
[0079] S105, when anomalies form a continuous region, obtain the first radius of the fitted circle corresponding to the anomaly slice and the second radius of the fitted circle corresponding to the adjacent slice of the anomaly slice. Combine the first radius and the second radius to determine the trunk damage area.
[0080] Since trunk damage not only manifests as local anomalies in surface point clouds, but more importantly, it leads to systematic changes in the geometry of the trunk cross-section, especially for deep damage such as decay, insect infestation, or mechanical damage, it can cause a decrease or increase in the local diameter of the trunk. Simply relying on the spatial distribution of abnormal points cannot accurately assess the depth and extent of the damage. Therefore, it is necessary to analyze the radius difference between abnormal slices and adjacent normal slices to quantitatively assess the degree of impact of damage on the structural integrity of the trunk, and provide a reliable geometric quantitative basis for damage severity classification and tree health assessment.
[0081] The process of obtaining the first radius requires reliability verification and correction of the fitted circle parameters for the abnormal slices. This is because abnormal slices contain anomalies caused by damage, which can affect the accuracy of the circle fitting algorithm and may produce fitting results that deviate from the true tree trunk outline. To obtain a more accurate first radius, a robust circle fitting method that excludes anomalies is adopted. First, the damage-related anomalies identified in step S104 are removed from the abnormal slices, and the point cloud data of the normal areas are retained for circle fitting. However, when the proportion of anomalies in the abnormal slices is too high (more than 50%), the remaining normal points may not be sufficient to support stable circle fitting. In this case, an interpolation correction method based on information from adjacent slices is used.
[0082] Specifically, when the number of valid fitted points for an abnormal slice is less than 30, the theoretical center and radius of the abnormal slice are estimated using linear interpolation by analyzing the fitted circle parameters of the two adjacent slices. Linear interpolation assumes that the tree trunk exhibits a continuous conical or cylindrical variation characteristic within a local area, and the theoretical geometric parameters of the abnormal slice should lie along the linear trend of the parameters of the adjacent slices. By calculating the arithmetic mean of the fitted circle center coordinates and radii of the adjacent slices, the corrected circle center coordinates and corrected radius of the abnormal slice are obtained, serving as a reference benchmark for the first radius. This interpolation correction method can still provide a relatively reliable geometric reference even when outliers significantly affect the fitting quality, ensuring the continuity and consistency of damage assessment.
[0083] Determining the second radius involves selecting adjacent slices of the anomalous slice and the radius calculation strategy. Adjacent slices are defined as the slices immediately above and below the anomalous slice in the vertical direction. However, not all adjacent slices are suitable as reference benchmarks because damage may have some continuity in the vertical direction, and adjacent slices may also be affected by the damage. Therefore, a health assessment of adjacent slices is first required. This is determined by calculating the proportion of anomalous points and the circle fitting quality index of adjacent slices to judge whether they are affected by damage. Adjacent slices with an anomalous point proportion below 5% and a root mean square error of the circle fitting less than 5% of the fitted radius are considered healthy slices and meet the conditions for use as reference benchmarks.
[0084] When both the upper and lower adjacent slices of an abnormal slice are healthy slices, the fitted circle radii of the upper and lower slices are calculated separately, and the average of the two is taken as the second radius. This two-sided averaging method can reduce the influence of local measurement errors and provide a more stable reference value. When only one side of the adjacent slices is a healthy slice, the fitted circle radius of that healthy slice is directly used as the second radius. When both the upper and lower adjacent slices are affected by damage, the search range needs to be expanded outward to find the closest healthy slice to the abnormal slice as a reference. The search range is usually limited to 3-5 slices above and below the abnormal slice to ensure that the reference slice is spatially close enough to represent the normal geometric state that the abnormal slice should have.
[0085] The core of determining the damaged area of the tree trunk by combining the first and second radii is calculating the radius deviation and assessing the damage impact. The radius deviation is defined as the absolute value of the difference between the first and second radii, i.e., |first radius - second radius|. This value directly reflects the degree of geometric deformation of the abnormal section relative to the normal state. When the first radius is smaller than the second radius, it indicates inward damage in the area, such as decay, insect infestation, or mechanical dent; the depth of the damage can be estimated by the radius difference. When the first radius is larger than the second radius, it indicates outward anomalies in the area, such as burls, callus tissue, or foreign attachments. The severity of the damage is classified by setting a radius deviation threshold: a deviation less than 10% of the second radius is defined as minor damage, a deviation between 10% and 25% is defined as moderate damage, and a deviation exceeding 25% is defined as severe damage.
[0086] To accurately define the spatial extent of the tree trunk damage area, a boundary determination method based on gradual radius deviation analysis is employed. Since real tree trunk damage typically does not appear and disappear abruptly, but rather exhibits a gradual transition from the normal area to the core of the damage, the upper and lower boundaries of the damage area are determined by analyzing the trend of radius deviation changes along the vertical direction. Starting from the abnormal slice, the radius deviation of adjacent slices is calculated layer by layer upwards and downwards. When the radius deviation of two consecutive slices is less than a damage threshold (usually set to 5% of the second radius), that location is determined as the boundary of the damage area. This gradual boundary determination method accurately captures the complete range of the damage area, avoiding incomplete damage assessments caused by fixed boundaries.
[0087] In the horizontal direction, the extent of the damaged area is determined by analyzing the spatial distribution of anomalies. All anomalies belonging to the anomalous slices within the damaged area are projected onto a horizontal plane, and the minimum bounding rectangle or ellipse of the projected point set is calculated as the horizontal spatial extent of the damaged area. Simultaneously, the geometric center, main extension direction, and shape characteristic parameters of the damaged area are calculated to provide detailed information for precise damage localization and morphological analysis. The volumetric estimation of the damaged area is obtained by multiplying the vertical damage depth by the horizontal damage area; this volumetric parameter is crucial for assessing the impact of the damage on the structural strength of the tree trunk.
[0088] This invention also considers the interaction and overall assessment of multiple damaged areas. When multiple independent damaged areas exist on the same trunk, the geometric parameters and influence range of each damaged area are calculated separately, and then the spatial relationship between the damaged areas is assessed. If the vertical distance between two damaged areas is less than twice the height of the smaller damaged area, and they overlap or are close in the horizontal direction (distance less than 50% of the trunk radius), they are merged into a composite damaged area, and the geometric parameters and influence assessment of the merged area are recalculated. This correlation analysis of multiple damaged areas can more accurately reflect the overall health of the trunk and avoid risk assessment bias caused by ignoring the interaction between damages.
[0089] Based on the above embodiments, as an optional implementation, in S105, determining the trunk damage area by combining the first radius and the second radius specifically includes S51-S55: S51, calculate the relative rate of change between the first radius and the second radius. When the relative rate of change exceeds the preset rate of change threshold, the corresponding abnormal slice is identified as a radius abnormal slice.
[0090] The degree of geometric deformation of an abnormal slice is quantified by calculating the relative rate of change between the first and second radii. The relative rate of change is defined as |first radius - second radius| / second radius × 100%. This indicator reflects the degree of deviation of the abnormal slice from its normal state, considering both absolute change and eliminating the influence of scale differences in trunk thickness through standardization. A preset threshold for the rate of change is typically set at 15%-20%. When the relative rate of change exceeds this threshold, it indicates significant geometric deformation of the abnormal slice, which is then identified as a radius-abnormal slice. This method based on relative change is more adaptable to the differences in trunks across different tree species and growth stages than an absolute distance threshold.
[0091] S52, count the number of consecutive radius abnormal slices. When the number of consecutive radius abnormal slices is greater than the preset consecutive slice threshold, it is determined that there is a morphological abnormality signal.
[0092] The number of consecutive slices with abnormal radius is counted to identify morphological anomalies. True trunk damage typically exhibits vertical continuity, affecting not just a single slice but multiple consecutive slices with abnormal radius. Consecutive slices with abnormal radius refer to a sequence of adjacent slices in the vertical direction that all meet the criteria for abnormal radius. A preset threshold of 3-5 consecutive slices is set. When the number of consecutive slices with abnormal radius exceeds this threshold, a morphological anomaly is confirmed. This requirement for continuity effectively eliminates sporadic anomalies caused by local measurement errors or minor surface irregularities, improving the reliability of damage identification.
[0093] S53, calculate the overlap between the abnormal slice and the radius abnormal slice. When the overlap is greater than the preset overlap threshold, the overlapping area is determined as a candidate damage area.
[0094] Candidate damage regions are determined by calculating the overlap between anomaly slices and radius anomaly slices. Anomaly slices are identified based on surface anomaly point recognition, while radius anomaly slices are based on geometric deformation analysis. The overlapping area is more likely to represent the true damage location. The overlap is defined as the ratio of the number of slices that simultaneously meet the conditions for both anomaly slices and radius anomaly slices to the total number of anomaly slices. A preset overlap threshold is set at 60%-70%. When the overlap exceeds this threshold, it indicates that the surface anomaly and geometric deformation are highly consistent in space, and the overlapping area is identified as a candidate damage region. This dual verification mechanism significantly reduces the false alarm rate, ensuring that the identified damage region simultaneously possesses dual evidence of both surface feature anomalies and structural geometric anomalies.
[0095] S54. Calculate the damage score of the candidate damage area based on the density and relative change rate of abnormal points within the candidate damage area.
[0096] A damage score is calculated based on the comprehensive characteristics of the candidate damage area for quantitative assessment. The damage score comprehensively considers two key indicators: anomaly density and relative change rate. Anomaly density reflects the concentration of damage on the surface, while the relative change rate reflects the depth of the damage's impact on structural integrity. The specific calculation formula is: Damage Score = α × Anomaly Density + β × Average Relative Change Rate, where α and β are weighting coefficients, typically set to 0.4 and 0.6, reflecting the greater importance of structural deformation compared to surface anomalies. Anomaly density is calculated as the ratio of the number of anomalies in the candidate damage area to the total number of points, and the average relative change rate is the arithmetic mean of the relative change rates of all radius anomaly slices within the candidate damage area.
[0097] Based on the above embodiments, as an optional implementation, in S54, calculating the damage score of the candidate damage area according to the density and relative change rate of abnormal points within the candidate damage area specifically includes S541-S544: S541, normalize the density of outliers, map the density of outliers to a preset density scoring range, and generate a density score.
[0098] Anomaly density is normalized to generate a density score. Anomaly density is defined as the ratio of the number of anomalies within a candidate lesion region to the total number of points in that region. This value typically ranges from 0 to 1, but the actual distribution may be concentrated in a smaller interval. Anomaly density is mapped to a preset density score range of 0-100 using a linear mapping. The mapping formula is: Density Score = (Anomaly Density - Minimum Density Value) / (Maximum Density Value - Minimum Density Value) × 100, where the minimum and maximum density values are determined statistically based on a large amount of measured data and are typically set to 0.05 and 0.8, respectively. Normalization ensures that the density score is distributed within a standard range, facilitating comprehensive calculation with other scoring indicators.
[0099] S542, calculate the weighted average of the relative change rates of all radius-abnormal slices within the candidate damage region. The weighting coefficient of the weighted average is proportional to the number of abnormal points in each radius-abnormal slice.
[0100] Calculate the weighted average of the relative change rates of all radius-anomalous slices within the candidate damage region. Since slices of different radii contain varying numbers of anomalous points, slices with more anomalous points generally indicate more severe damage at that location and should therefore have a greater weight in the average calculation. The weighting coefficient is proportional to the number of anomalous points within each radius-anomalous slice, specifically calculated as: Weighting coefficient i = Number of anomalous points in slice i / Total number of anomalous points across all radius-anomalous slices. The weighted average is calculated as: Weighted average = Σ(Relative change rate i × Weighting coefficient i). This weighted calculation method more accurately reflects the overall geometric deformation of the damage region, avoiding the bias that may result from a simple arithmetic average.
[0101] S543, normalize the weighted average value, map the weighted average value to the preset range of rate of change score, and generate a rate of change score.
[0102] The weighted average is normalized to generate a rate of change score. The relative rate of change typically ranges from 0% to 100%, but most injuries have a relative rate of change concentrated in the 15%-50% range. A linear mapping is used to map the weighted average to a preset rate of change score range of 0-100. The mapping formula is: Rate of Change Score = (Weighted Average - Minimum Rate of Change) / (Maximum Rate of Change - Minimum Rate of Change) × 100, where the minimum rate of change is set to 15% corresponding to a score of 0, and the maximum rate of change is set to 60% corresponding to a score of 100. When the weighted average exceeds the maximum rate of change, the rate of change score is directly set to 100 to ensure that severe injuries receive the highest score.
[0103] S544 calculates the damage score of the candidate damage area by weighting the density score and the rate of change score.
[0104] The final damage score is generated by weighting the density score and the rate of change score. Considering that geometric deformation reflects the impact of damage on the trunk structure integrity better than surface anomaly distribution, the rate of change score is weighted at 0.6, and the density score at 0.4. The damage score calculation formula is: Damage Score = 0.4 × Density Score + 0.6 × Rate of Change Score. The final damage score ranges from 0 to 100, with higher values indicating more severe damage. Damage levels are classified based on the score: 0-30 for minor damage, 30-60 for moderate damage, and 60-100 for severe damage.
[0105] S55, identify candidate damage areas whose damage scores exceed the preset damage threshold as trunk damage areas.
[0106] The final damage area is determined based on the damage score. A preset damage threshold is set according to actual application requirements and detection accuracy requirements, typically a standardized score of 0.6-0.8. Candidate damage areas with damage scores exceeding the preset threshold are identified as trunk damage areas; these areas possess complete damage characteristics including surface anomalies, geometric deformation, and spatial continuity. Detailed parameters for each damage area are recorded, including damage location, affected area, damage score, and degree of geometric deformation, providing a quantitative basis for subsequent damage severity grading and treatment recommendations.
[0107] Figure 2 This is a schematic diagram of a multi-scale circle fitting and outlier clustering analysis flowchart provided in an embodiment of this application, as shown below. Figure 2 As shown, the process starts from "Start" and first enters the "Trunk Point Cloud Slicing" stage, which is the foundation of the entire detection system's data preprocessing. The system sets a fixed height step of 0.1-0.3 meters to horizontally slice the trunk point cloud, slicing from the long axis of the trunk point cloud according to height, and skipping slices without point clouds. This slicing method transforms the complex three-dimensional trunk structure into a series of two-dimensional cross-sections, facilitating subsequent geometric analysis and anomaly detection, while ensuring the systematic nature and completeness of the detection.
[0108] Next, the "circle fitting" stage is entered, where circle fitting analysis is performed on each slice. The system performs circle fitting on each slice, calculates the distance from each point to the fitted circle, and records the radius of the fitted circle. This process is based on the biological characteristic that the cross-section of a healthy tree trunk is approximately circular. By establishing an ideal circular model, a reference benchmark is provided for subsequent anomaly identification. The quality of the fitted circle directly affects the accuracy of anomaly detection.
[0109] The "outlier identification" stage is the core of damage detection. The system calculates outliers whose distances exceed certain conditions, identifies outliers with distances greater than 2 standard deviations, and records the location and number of outliers. This stage uses a statistical anomaly detection method, based on the 3σ criterion, to identify data points that significantly deviate from the normal distribution. These outliers may represent damage, defects, or structural abnormalities on the tree trunk surface.
[0110] The "anomaly clustering verification" stage verifies the spatial continuity of identified anomalies. The system is configured with DBSCAN clustering parameters (eps=0.05m) to cluster anomalies and check for the existence of continuous regions (>3 points). This clustering verification effectively distinguishes between continuous anomaly regions formed by actual damage and discrete anomalies generated by random noise, significantly improving the reliability of detection.
[0111] The "radius profile analysis" stage analyzes damage characteristics from a geometric deformation perspective. The system calculates the radius change rate of three consecutive slices, identifies regions with a change rate >25%, and records the location of abnormal regions. This radius change-based analysis method can detect deep-seated structural damage that may be missed by surface anomaly detection.
[0112] The final "Comprehensive Damage Area Determination" stage integrates the analysis results from the preceding stages. The system combines anomaly point and radius change information to calculate the area fraction (0-100%) of the damaged area. When the area damage exceeds 75%, it is determined to be a damaged area, and the location and severity of the damage are marked. This comprehensive determination mechanism ensures the comprehensiveness and accuracy of damage identification, considering both surface feature anomalies and geometric structural deformation.
[0113] The entire process embodies the design concept of multi-level verification and comprehensive analysis. Through six key steps—point cloud slicing, circle fitting, anomaly detection, cluster verification, radius analysis, and comprehensive judgment—it achieves automated and accurate detection of tree trunk damage, providing reliable technical support for tree health management and risk assessment.
[0114] Based on the above method, this application also discloses a trunk damage detection system, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of a tree trunk damage detection system provided in an embodiment of this application. The system includes: an acquisition module, a first processing module, a second processing module, a verification module, and a judgment module; wherein, The system comprises the following modules: an acquisition module, which acquires a point cloud dataset containing occluded areas generated by a LiDAR scanner performing a time-series scan of the tree trunk from multiple perspectives; a preprocessing module, which generates a complete point cloud model of the tree trunk surface; a first processing module, which performs voxel downsampling on the point cloud model of the tree trunk surface, retaining the point closest to the geometric center of each voxel in the voxel grid as a representative point, and performing ground segmentation on the representative points to generate ground points and non-ground points; a second processing module, which performs clustering on the non-ground points, filters the clustering results based on geometric features, generates a tree trunk point cloud, slices the tree trunk point cloud at preset height intervals to generate multiple slices, performs circle fitting on each slice, and calculates the distance from each point within the slice to the fitted circle; a verification module, which determines abnormal slices and abnormal points within abnormal slices based on distance, and verifies the spatial continuity of abnormal points; and a judgment module, which, when abnormal points form a continuous region, acquires the first radius of the fitted circle corresponding to the abnormal slice and the second radius of the fitted circle corresponding to the adjacent slice of the abnormal slice, and determines the damaged area of the tree trunk by combining the first and second radii.
[0115] It should be noted that the system provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0116] Please see Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.
[0117] The communication bus 1002 is used to realize the connection and communication between these components.
[0118] The user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0119] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0120] The processor 1001 may include one or more processing cores. The processor 1001 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. Optionally, the processor 1001 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1001 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1001 and may be implemented as a separate chip.
[0121] The memory 1005 may include random access memory (RAM) or read-only memory. Optionally, the memory 1005 may include a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 4 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a tree trunk damage detection method.
[0122] exist Figure 4In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 1001 can be used to call an application program stored in the memory 1005 for a tree trunk damage detection method. When executed by one or more processors, the electronic device performs one or more of the methods described in the above embodiments.
[0123] An electronic device readable storage medium stores instructions that, when executed by one or more processors, cause the electronic device to perform one or more of the methods described in the above embodiments.
[0124] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0125] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between devices or units may be electrical or other forms.
[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0129] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0130] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A method for detecting tree trunk damage, characterized in that, The method includes: A point cloud dataset containing occluded areas is obtained after a time-series scan of a tree trunk by a lidar from multiple perspectives. The point cloud dataset is then preprocessed to generate a complete point cloud model of the tree trunk surface. The point cloud model on the tree trunk surface is subjected to voxel downsampling processing. The point closest to the geometric center of each voxel is retained in the voxel grid as a representative point. The representative point is then segmented into ground points and non-ground points. Clustering is performed on the non-ground points, and geometric features are filtered on the clustering results to generate a tree trunk point cloud. The tree trunk point cloud is sliced at preset height intervals to generate multiple slices. Circle fitting is performed on each slice and the distance from each point in the slice to the fitted circle is calculated. Based on the distance, anomaly slices and anomaly points within the anomaly slices are determined, and the spatial continuity of the anomaly points is verified. When the abnormal points form a continuous region, the first radius of the fitted circle corresponding to the abnormal slice and the second radius of the fitted circle corresponding to the adjacent slice of the abnormal slice are obtained. The trunk damage area is determined by combining the first radius and the second radius.
2. The method for detecting tree trunk damage according to claim 1, characterized in that, The preprocessing of the point cloud dataset to generate a complete tree trunk surface point cloud model includes: Multi-view point cloud registration is performed on the point cloud dataset to unify point cloud data from different times and different views into the same coordinate system, forming fused point cloud data. Perform point cloud density gradient analysis on the fused point cloud data, identify regions with abnormal density changes, calculate the spatial change rate of local point cloud density in the regions with abnormal density changes, and determine the regions with spatial change rates exceeding a preset threshold as occlusion regions. Obtain the geometric constraints of the tree trunk, and perform geometric completion on the point cloud data of the occluded area based on the geometric constraints to generate a complete point cloud model of the tree trunk surface.
3. The method for detecting tree trunk damage according to claim 1, characterized in that, The step of segmenting the representative points into ground points and generating non-ground points includes: Calculate the data range of the representative point on the three coordinate axes X, Y, and Z, determine the coordinate axis with the largest data range as the height direction axis, and reorganize the representative points so that the height direction axis is the vertical axis; Select a preset number of representative points to construct a candidate ground plane model; Calculate the distance from each representative point to the candidate ground plane model, and count the number of interior points whose distance is less than a preset distance threshold; After a preset number of iterations, the candidate ground plane model with the most interior points is selected as the target ground plane model. Based on the distance from each representative point to the target ground plane model, representative points whose distance is less than the preset distance threshold are determined as ground points, and representative points whose distance is greater than or equal to the preset distance threshold are determined as non-ground points.
4. The method for detecting tree trunk damage according to claim 1, characterized in that, The process of clustering the non-ground points, filtering the clustering results by geometric features, and generating a trunk point cloud includes: Clustering is performed on the non-ground points, and a clustering distance threshold and a minimum number of points threshold are set to group spatially adjacent non-ground points into the same cluster, generating multiple point cloud clusters; Geometric feature calculations are performed on each of the point cloud clusters to obtain the cluster height, cluster width, and main extension direction of each point cloud cluster; Each point cloud cluster is filtered according to preset geometric feature filtering conditions, which include: the cluster height is greater than a preset height threshold, the cluster width is less than a preset diameter threshold, and the angle between the main extension direction of the cluster and the vertical axis is less than a preset angle threshold. Point cloud clusters that meet the geometric feature screening conditions are identified as candidate trunk clusters; Shape verification is performed on each candidate trunk cluster, the height-to-width ratio of each candidate trunk cluster is calculated, and the candidate trunk cluster with a ratio greater than a preset ratio is determined as a trunk point cloud.
5. The method for detecting tree trunk damage according to claim 1, characterized in that, The step of determining the abnormal slice and the abnormal points in the abnormal slice based on the distance, and verifying the spatial continuity of the abnormal points, includes: Statistical analysis was performed on the distances from each point within each slice to the fitted circle, and the mean and standard deviation of the distance distribution for each slice were calculated. Points whose distance to the fitted circle exceeds the mean of the corresponding slice distance distribution plus a preset standard deviation are identified as outliers. The number of outliers in each slice is counted, and slices with an outlier count exceeding a preset outlier threshold are identified as outlier slices. Spatial continuity verification is performed on the outliers in each of the outlier slices, and the outliers are clustered to set a minimum number of clusters for the outliers. Anomalies that form clusters and whose number of clusters is greater than the minimum number of clusters for the anomalies are defined as continuous anomalies. Calculate the spatial coverage height of each cluster of continuous anomalies, and determine the clusters of continuous anomalies with spatial coverage height greater than a preset continuous height threshold as anomalies forming a continuous region.
6. The method for detecting tree trunk damage according to claim 1, characterized in that, The step of determining the damaged area of the tree trunk by combining the first radius and the second radius includes: Calculate the relative rate of change between the first radius and the second radius. When the relative rate of change exceeds a preset rate of change threshold, the corresponding abnormal slice is identified as a radius abnormal slice. The number of consecutive radius-abnormal slices is counted. When the number of consecutive radius-abnormal slices is greater than a preset consecutive slice threshold, a morphological abnormality signal is determined to exist. Calculate the overlap between the abnormal slice and the radius abnormal slice. When the overlap is greater than a preset overlap threshold, the overlapping area is determined as a candidate damage area. The damage score of the candidate damage area is calculated based on the density of abnormal points within the candidate damage area and the relative rate of change. Candidate damage areas whose damage scores exceed a preset damage threshold are identified as trunk damage areas.
7. The method for detecting tree trunk damage according to claim 6, characterized in that, The step of calculating the damage score of the candidate damage region based on the density of abnormal points within the candidate damage region and the relative rate of change includes: The density of the outliers is normalized and mapped to a preset density scoring range to generate a density score. Calculate the weighted average of the relative change rates of all radius-abnormal slices within the candidate damage region, wherein the weighting coefficient of the weighted average is proportional to the number of abnormal points within each radius-abnormal slice; The weighted average value is normalized and mapped to a preset range of rate of change scores to generate a rate of change score. The density score and the rate of change score are weighted and calculated to generate the damage score of the candidate damage region.
8. A tree trunk damage detection system, characterized in that, The system includes: an acquisition module, a first processing module, a second processing module, a verification module, and a judgment module; wherein, The acquisition module is used to acquire a point cloud dataset containing occluded areas generated by the lidar after performing a time-series scan of the tree trunk from multiple perspectives, and to preprocess the point cloud dataset to generate a complete point cloud model of the tree trunk surface. The first processing module is used to perform voxel downsampling processing on the point cloud model of the tree trunk surface, retain the point closest to the geometric center of each voxel in the voxel grid as a representative point, and perform ground segmentation on the representative point to generate ground points and non-ground points; The second processing module is used to perform clustering processing on the non-ground points, perform geometric feature filtering on the clustering results, generate a tree trunk point cloud, slice the tree trunk point cloud at preset height intervals to generate multiple slices, perform circle fitting on each slice and calculate the distance from each point in the slice to the fitted circle. The verification module is used to determine the abnormal slice and the abnormal points in the abnormal slice based on the distance, and to verify the spatial continuity of the abnormal points. The judgment module is used to obtain the first radius of the fitted circle corresponding to the abnormal slice and the second radius of the fitted circle corresponding to the adjacent slice of the abnormal slice when the abnormal point forms a continuous region, and to determine the trunk damage area by combining the first radius and the second radius.
9. An electronic device, characterized in that, The device includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed as described in any one of claims 1-7.