We present a cloth simulation-based framework to construct pit-free CHMs from point clouds and compare the results with those of other common algorithms using a comprehensive accuracy assessment procedure. The flowchart of this study is illustrated in Fig. 4. The methodology used in this study includes five main parts, namely, pre-processing, cloth simulation-based pit-free CHM construction, post-processing, comparison of different algorithms and accuracy assessment.

### Pre-processing

The pre-processing of LiDAR data consists of three steps, namely, noise removal, height normalisation and grid. In practice, the real and simulated data were pre-processed using the LAStools (point cloud processing software, Rapidlasso Company, Gilching, Germany) modules which include lasnoise, lasground and lasgrid (Isenburg 2017). The first step in the real data was to remove high or low noise points using the lasnoise module. Secondly, the lasground module was used to extract the ground points and then calculated the relative height above the ground for each point (i.e., *z* coordinate). Each point was height-normalised by replacing the height of each point with its relative height above the ground. Consequently, the height of all points classified as the ground is zero. Finally, the lasgrid module was used to grid the height-normalised points, only retaining the maximum point in each grid cell. Considering that the simulated data have no noise, and the ground height is set to zero, these data were assigned to a grid, and only the maximum point in each grid cell was retained using the lasgrid module.

### Theoretical basis: cloth simulation

This algorithm is based on the physical process simulation of cloth-touching objects (Zhang et al. 2016; Zhang et al. 2019; Cai et al. 2019; Wan et al. 2019). Imagine that a piece of cloth is placed above a height-normalised forest landscape, and then this cloth progressively drops because of gravity. When touching the uppermost layer of the forest canopy, the corresponding particles of the cloth will stop dropping and be fixed. The movement of cloth particles near the pits will be constrained by forces produced by adjacent fixed cloth particles. The final shape of the cloth can be confirmed and regarded as a pit-free CHM (Fig. 5).

Cloth modelling is a term of 3D computer graphics. Typically, the cloth is modelled as a grid consisting of particles and springs. Both components control the shape of the cloth (Fig. 6).

The positions of the cloth particles in the 3D space are calculated to confirm the shape of the cloth at a specific time. The position of each particle is determined by an external force operation followed by an internal one. On the basis of Newton’s second law, the relationship between position and forces is calculated using Eq. (3).

$$ m\frac{\partial Z(t)}{\partial {t}^2}={F}_{\mathrm{ext}}\left(Z,t\right)+{F}_{\mathrm{int}}\left(Z,t\right), $$

(3)

where *m* stands for the mass of the cloth particle (*m* is typically set to 1), *Z* indicates the position of a particle at time *t*, *F*_{ext}(*Z*, *t*) represents the external force and *F*_{int}(*Z*, *t*) denotes the internal force produced by interconnections between particles. Figure 7 illustrates such a process.

For simplicity, the external force is set to zero, that is, each particle drops to measurements at a constant velocity. The displacement vector \( {\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{ext}} \) of each particle after one time step *∆t* is determined only under the external force:

$$ {\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{ext}}=v\Delta t\bullet {\overrightarrow{n}}_{\mathrm{ext}}, $$

(4)

where *v* is the velocity, and \( {\overrightarrow{n}}_{\mathrm{ext}} \) represents a normalised vector that points to the movement direction, \( {\overrightarrow{n}}_{\mathrm{ext}}={\left(0,0,-1\right)}^T \). If the cloth particle collides with the measurement surface, then this particle will stop falling and be labelled unmovable. Displacement distance is the height difference (HD) between the old position of this particle and the measurement surface, that is, \( {\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{ext}}=\mathrm{HD}\bullet {\overrightarrow{n}}_{\mathrm{ext}} \).

After dropping the cloth particles, an internal force is exerted to movable particles to restrict the particles’ displacement in the void areas, such as data pits, of the surface. In Fig. 8, the neighbouring particle and the current one are moved by the same distance in the opposite direction when the neighbouring particle is movable; when the neighbouring particle is unmovable, the current one is moved towards the neighbouring particle by half of the HD between the two particles. The displacement vector \( {\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{int}} \) of the current particle is computed using (5).

$$ {\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{int}}={\sum}_{i=1}^8\frac{1}{2}b\left({Z}_{p_i}-{Z}_{p_0}\right)\bullet {\overrightarrow{n}}_{\mathrm{int}},\kern2.75em $$

(5)

where *b* is 0 when the current particle is unmovable, otherwise it is equal to 1, \( {Z}_{p_0} \) represents the height value of the current particle *p*_{0}, \( {Z}_{p_i} \) (*i* = 1, 2, …, 8) stands for the height values of the eight neighbouring particles *p*_{i} that connect with *p*_{0}, and \( {\overrightarrow{n}}_{\mathrm{int}} \) represents a normalised vector that points to the movement direction, \( {\overrightarrow{n}}_{\mathrm{int}}={\left(0,0,1\right)}^T \). The final displacement vector \( \overrightarrow{Z\left(\Delta t\right)} \) of each particle after one time step *∆t* is calculated as follows:

$$ \overrightarrow{Z\left(\Delta t\right)}={\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{ext}}+{\overrightarrow{Z\left(\Delta t\right)}}_{\mathrm{int}}, $$

(6)

### Post-processing

At the edge of tree crowns, this algorithm may yield relatively large errors because the cloth poorly fit with ground measurements given the internal constraints amongst particles (Fig. 9). A post-processing method is proposed to solve this problem. This method searches an unmovable particle in the eight adjacent neighbourhoods of each movable particle. If the height value of unmovable particle and that of the nearest LiDAR point for the movable particle in the *x–y* plane equal to zero, then the movable particle is moved to the ground and set as unmovable. The example exhibited in Fig. 9 displays that *P*_{2} is the unmovable particle from the eight adjacent neighbourhoods of *P*_{1}. The height values of *P*_{1}^{′} and *P*_{2}^{′}, which are the nearest LiDAR points of *P*_{1} and *P*_{2} correspondingly, are both zero, then *P*_{1} is moved to *P*_{1}^{′} and is set as unmovable. This procedure is repeated until all the movable particles are properly handled.

### Comparison between different pit-free CHM construction algorithms

We compared our algorithm with two other pit-free CHM construction algorithms, namely, mean and median filters, to test the performance of the proposed algorithm. Firstly, the raw CHM was constructed using the las2dem modules of LAStools. The LiDAR points were triangulated into a triangulated irregular network on the basis of Delaunay triangulation and then rasterised onto a raster through standard linear interpolation. Secondly, the raw CHM was processed using the mean and median filters for pit filling. The following derivative products were generated:

### Accuracy assessment

Considering that the accuracy of the CHMs influences that of the tree height estimation in the raster-based method, the height of the tallest tree in each plot was obtained from the CHMs and compared with a field-measured height to evaluate the performance of the pit filling algorithms. This approach indirectly provides a comparison between the proposed algorithm and the other algorithms. The accuracy of the tree height measurements was assessed by computing the bias in accordance with the following mathematical formulation:

$$ \mathrm{bias}=\frac{1}{n}{\sum}_{i=1}^n\left({h}_m-{h}_c\right), $$

(7)

where *n* is the number of plots, *h*_{m} is the field-measured plot-level maximum tree height and *h*_{c} is the plot-level maximum tree height derived from the CHM.

We constructed a reference CHM using the simulated data without data pits to validate the accuracy of the constructed pit-free CHM. Based on the index for evaluating the accuracy of DTM, the root mean square error (RMSE) was used to measure the HD between each pixel of the reference CHM and the corresponding pixel of the constructed pit-free CHM. This index is expressed as follows:

$$ \mathrm{RMSE}=\sqrt{\frac{1}{n}{\sum}_{i=1}^n{\left({z}_i-{\hat{z}}_i\right)}^2}, $$

(8)

where *z*_{i} and \( {\hat{z}}_i \) are the true and predicted values at the *i*-th pixel in the CHM, respectively. *n* is the number of pixels in the CHM.