## 2 Data and Method
### Methods
#### 2.2.4 Rough Location of Trees  
The normalized tree points _CNTP_ are used to derive the tree locations by pinpointing the treetop points which are literally scattered on top among the trees.  
Grids derived from points cluster CNTP are required. The size of each grid cell depends on the average distance \(\overline{d}\) between terrain points, as shown in (1). All tree points are divided into grids accordingly and a a certain value to each grid (GV) via the following formula:  
\[W_{grid}=k\overline{d}\,\ k>0 \tag{1}\]  
\[GV=\begin{cases}\begin{matrix}0,&m=0\\ \max\bigl{(}Z_{\text{{NTP}}}^{i}\bigr{)},&m\geq 1,\ i=1,\ 2,\ 3,\ldots,m\end{matrix}\end{cases} \tag{2}\]  
where  
\(GV\): the value of the grid cell  
\(m\): he tree point amount in one grid  
_ZNTP_: the Z value of the tree points  
The cell containing the treetop point should have the biggest value among the eight neighboring cells, and the top point at center should not be adjacent to any grid without tree points. The template in (2) is applied to derive the treetop grids _GVtop_. Among all the _GVtop_, the point with the biggest value is regarded as the initial treetop point _Ptop_, and every point _Ptop_ in the grids is clustered as point set of _CPtop_.  
\[T=\begin{bmatrix}-1&-1&-1\\ -1&8&-1\\ -1&-1&-1\end{bmatrix} \tag{3}\]  
Figure 3: The iteration processing of the ground points generation.  
\[H(GV)=T\cdot GV \tag{4}\]  
\[\left\{\begin{matrix}H(GV)_{ij}\;\in\;GV_{top}&H(GV)_{ij}>H_{T}\\ p\;\in\;C_{p_{bp}}&Z_{p}=\max(Z_{p_{t}})\end{matrix}\right. \tag{5}\]  
where  
\(T\): the convolution template  
\(GV\): the Z value of the current gird  
\(H\) (\(GV\)): judgement value for treetop  
\(HT\): threshold value of \(H\)(\(GV\))  
\(p\): certain tree point in current grid  
\(Zp\), \(Zpt\): Z value of the point  
In the case of missing small treetops, the size of the grid cell is condensed into an acceptable small range, which results in redundancy in that there are some small treetops belonging to their neighboring tall tree (see Figure 4). Assuming that the tree top point stands for the tree location, the point set _CPtop_ is lowered by the Z value, according to the symmetric structure of trees, and the treetop point can be seen as the center of the tree trunk.  
To percolate the fake treetop points, Formula (6) is used. Once treetop points are refined, the number of points is exactly the number of trees.  
\[\left\{\begin{matrix}\max(P_{i}\;,\;P_{i+1}\;\;)\in C_{top},&P_{i}\;P_{i+1}\;<D \\ P_{i}\;,\;P_{i+1}\;\;\in C_{top},&P_{i}\;P_{i+1}\;>D\end{matrix}\right. \tag{6}\]  
where  
\(D\): threshold distance of two treetops.  
From Figure 4, the distance between the \(p_{1}\), \(p_{2}\), and \(p_{2}\), \(p_{3}\) are both less than threshold \(D\), but \(p_{1}\) is taller than \(p_{3}\), so \(p_{2}\) will be merged with \(p_{1}\) and that is in line with the fact that the taller the tree is, the larger the crown will be.  
In this section, all the tree locations can be detected, including the false ones, because the template calculation is more sensitive to elevation fluctuations. As Figure 5 shows, in one tree, there may be multiple treetops. And the Figure 6 shows the process of obtaining original treetop points.