# Research on Leaf Area Density Detection in Orchard Canopy Using LiDAR Technology
## 2 Materials and Methods
### Leaf Area Density Detection Algorithm Based on Leaf Fitting  
This research proposes a leaf fitting-based algorithm for detecting the leaf area density of an orchard canopy, which is designed to process point cloud data while fully considering the shape factors of leaves during the processing. The algorithm mainly consists of four key steps, which are detailed as follows:  
The first step is data acquisition and preprocessing. The canopy leaf area density detection system obtains point cloud data by moving with the aid of a self-propelled vehicle. However, during the data collection process, due to the displacement of the LiDAR, the point cloud data is prone to distortion. To address this issue, this research adopts the LIO-LIVOX algorithm. On the one hand, it utilizes an Inertial Measurement Unit (IMU) to calibrate the LiDAR data, thereby reducing the point cloud distortion caused by changes in the LiDAR's attitude. It employs a multi-angle LiDAR scan data fusion method. By matching the point clouds between different frames, it acquires LiDAR point cloud data of the orchard from various angles, thus improving the spatial resolution and accuracy of the orchard canopy parameters. The second step is the removal of non-target point cloud. The point cloud data collected by LiDAR inevitably contains some non-canopy point clouds, which mainly originate from other objects in the surrounding environment, such as fixed orchard trellises, branches  
Figure 1: Canopy parameter detection system. 1. Fixed bracket; 2. power supply; 3. self-propelled cart; 4. LiDAR sensor; 5. transmission cable; 6. industrial personal computer. within the canopy, and weeds on the ground. To remove these non-target point cloud, this research employs multiple methods. First, the straight-through filtering method is utilized to eliminate point clouds that are directly far from the canopy. Second, considering that the shape and distribution of leaf clusters are relatively complex and their local sphericity is usually high, a screening method based on local sphericity (S) is adopted to eliminate non-target point clouds caused by fixed orchard trellises and branches within the canopy, with the threshold set as S < 0.1. Finally, the DBSCAN clustering algorithm is applied to remove point clouds of weeds on the ground, thereby obtaining the target canopy. The extracted canopy point clouds are then fitted with a cuboid to obtain key parameters such as canopy thickness and detection distance. The third step is leaf fitting-based processing. This research employs a leaf fitting method to detect leaf area density. By extracting the contour or boundary information of the leaves, a more realistic leaf model is constructed. To some extent, this can mitigate the detection errors occurring due to incomplete leaf scanning point clouds caused by the resolution limitations of LiDAR, thus yielding more accurate leaf area calculation results. For different plant species and growth environments, various clustering methods can be adopted to improve the accuracy of leaf recognition. In environments such as orchards where leaves are densely packed and irregularly distributed, this research selects the distance-based K-means clustering method. The K-means method can group data points into a predefined number of clusters (k), ensuring that each data point within a cluster is closest to its respective cluster center. By adjusting the value of k and optimizing the selection of cluster centers, it can better adapt to the situation of densely packed and unevenly distributed leaves in orchards, thereby enhancing the accuracy of leaf recognition. In practical scenarios, the exact number of leaves is often difficult to obtain, and the chosen value of k directly affects the clustering results. To ensure the accuracy and stability of k, this research takes a series of measures.