2.4.1. Introduction to LAPO and DBSCAN Algorithms

The LAPO algorithm [24] has four important stages, including the cloud surface penetrating the air phase, the lightning channel moving downward, the upward pilot starting to spread from the ground (or grounded object), and the last fight back stage. The LAPO algorithm has a strong optimization ability in many engineering problems, and no additional parameters need to be set, which can help to avoid subjective factors influencing the results of the algorithm. Due to the influence of randomness and other factors, the standard LAPO algorithm may also fall into a local optimum, which makes it impossible to obtain a better solution every time. There is room for further improvement in its stability. Therefore, this algorithm has also been applied and improved in various clustering algorithms [25,26].

The DBSCAN algorithm [27] is based on a certain distance measurement criterion, which clusters closely related data points based on their criteria into one category. The following two parameters are set before clustering. The first one is *Eps* (the radius of the given object is the neighborhood). The second one is *MinPts* (the minimum number of components that make up a class). The traditional DBSCAN clustering algorithm is affected by *Eps* and *MinPts*. These two parameters are global and fixed so that only the data in the data set that meet the threshold condition can be effectively clustered, meaning that data of other densities may be treated as noise. In addition, the traditional DBSCAN algorithm

needs to traverse each data point. When the data scale is large, the algorithm execution efficiency will be low, and the processing time will be long, which is not conducive to the realization of the algorithm. In view of the shortcomings of the traditional DBSCAN algorithm, our predecessors in this area have carried out a considerable amount of research and improved the DBSCAN algorithm [28–30].

### 2.4.2. Fruit Tree Detection Algorithm Based on LAPO-DBSCAN

Due to the shortcomings of the two algorithms, this paper proposes a fruit tree position detection algorithm based on LAPO-DBSCAN. This algorithm is mainly used to obtain the position of fruit trees. This process includes preparation and detailed steps, and its flow chart is shown in Figure 3.

**Figure 3.** Fruit tree detection based on LAPO-DBSCAN.
