09. Trees - VUKOZ-OEL/3d-forest-classic GitHub Wiki
The trees is a part of the 3D forest menu that serves for computing attributes of individual trees or tree cloud editing.
Tree Cloud Edit
To remove points from an existing tree cloud, go to the Trees → Tree cloud edit. The dialog window gives options to choose the tree cloud to be edited and to set a name for a new cloud with all removed points. Points are removed by the same scheme as in the manual segmentation, see section Vegetation.
DBH Cloud Edit
If the results of DBH (Diameter at breast height) estimation are suspicious, there is an option to display and edit the calculation source point cloud. The path Trees → DBH cloud edit enables the selection of the tree and the respective DBH cloud to be edited. The editing scheme is as in the manual segmentation again. All selected points will be excluded from the DBH computation. However, they will be removed from the tree cloud temporarily, i.e. for the 3D Forest session. The DBH cloud edit is voided by closing the project.
Tree Base Position
Tree base position is a key variable providing a baseline for computation of other tree variables such as DBH, tree height, stem curve, and the visualization of convex/concave tree projection. Therefore, these functions are not available before the tree position is calculated. The 3D forest offers two methods for tree base position calculation. However, their results may slightly vary (Fig. 5). The selected method thus influences all dependent tree variables. For that reason, these variables are automatically modified according to the actual tree position. Still, it is important to keep in mind, which method of the tree position calculation is being used for the particular trees. Both methods may be calculated with or without the terrain cloud. This is used for adjustment of the tree base Z coordinate. It is strongly recommended to use terrain adjustment if the terrain cloud is available. In such a case, the influence of the tree cloud lowest outliers on the resulted tree base position is lowered (Fig. 5). This is particularly important on steeper slopes. The possibility to calculate tree position without terrain is thus set aside for cases when terrain cloud is missing.
Tree Base Position by Lowest Point
The tree base position computed by the lowest point method can be used via Trees → Position lowest point. The dialog window enables the selection of trees whose base positions should be calculated. Besides, it is necessary to set the vertical distance [cm] from the lowest point of the trees to set the tree points included in the calculation. The terrain cloud, if available, should be selected to adjust the Z coordinate to the terrain level. Correspondingly, the number of the closest terrain points (N) employed in this adjustment has to be set. The XY position is then computed as a median coordinate of the points of the tree that are lying between the lowest point of the tree cloud and the user-defined distance. The Z coordinate is defined as the median Z value of N closest points of the terrain at the XY position. If there is no terrain cloud available, the Z value is defined by the lowest tree point. The tree base position is displayed as a sphere with the center at the position and radius of 5 cm.
Tree Base Position by RHT
The tree base position computed by randomized Hough transformation (RHT) is accessed via Trees → Position RHT. The dialog window enables users to select the tree(s) for tree base position calculation and set the number of RHT iterations. It is recommended to use at least 200 iteration steps. The terrain cloud, if available, should be specified to adjust the Z coordinate to terrain level as well as the number of the closest terrain points (N) used for that adjustment should be set. The iteration takes the lowest point of the tree cloud as an initial position. The tree base position by RHT then computes the tree base position using centers of two circles fitted by RHT to the stem at 1.3 and 0.65 m above the initial or previously computed position. The RHT position is then defined as the intersection of the vector aiming from the upper circle center (at 1.3 m) to the lower circle center (at 0.65 m) and the horizontal plane defined by the median Z value of the N closest points of the terrain cloud.
Diameter at Breast Height (DBH)
The diameter at breast height (DBH) is computed from the subset of points of the tree cloud (so-called DBH cloud). This cloud lies between 1.25 m and 1.35 m above the tree base position. It is highly recommended to build the DBH cloud on the tree base position adjusted to terrain level as mentioned in section 7.3, otherwise, the DBH might be significantly misrepresented. There are two methods of DBH calculation implemented in the 3D Forest: i) based on the randomized Hough transformation (RHT) and ii) based on the least square regression (LSR). Both methods use the same DBH cloud as input, however, their results may differ. The RHT is a robust method if there are enough points of the segmented stem. This method is however computationally more demanding. On the other hand, the LSR function works well even with a small number of points of the segmented stem. However, it frequently overestimates the diameter value as it is very sensitive to the presence of outlying points. A significant difference between results given by these two methods points to the low quality of the tree segmentation or the overhanging branches. This may be fixed by the Tree cloud edit function (8.1) or by the DBH cloud edit function (8.2), where only the points of the tree subset from 1.25 to 1.35 m above the ground are adjusted.

Figure 1: Differences between the DBH computed according to the tree base position estimated from the tree’s lowest points (left) and the DBH recomputed according to the tree base position adjusted to the terrain cloud (right). The tree base position is represented by the red dot.
DBH by Randomized Hough Transformation
Computing DBH using randomized Hough transformation is done via Trees -> DBH RHT. The dialog window gives the option to select trees of interest and set the number of iterations. As always, the amount of iterations is a trade-off between computation time and accuracy. It is recommended to use at least 200 iterations for fast computation. A higher amount of iterations costs more computational time with rising accuracy. The use of 2000 iterations already provides fairly consistent results. Resulting DBH is displayed as a 10 cm high cylinder with the diameter of the best-fitted circle. The method itself is based on the parametric description of objects within the polar coordinate system. The DBH subset of the tree cloud (i.e. from 1.25 to 1.35 m) is projected to a horizontal plane. The Z coordinates are transformed to 1.3m. Then, the scheme searches every possible center of the circle for each point of the subset. The most frequent circle center is selected as a result (Xu and Oja, 1993).
DBH by Least Squares Regression
Computing DBH using Least squares regression is done via Trees → DBH LSR. The dialog window gives the option to select trees of interest. Resulting DBH is again displayed as a 10 cm high cylinder with the center and the diameter of the best-fitted circle. As already mentioned, the LSR method is very sensitive to outlying points that do not represent the tree stem (Fig.6). Therefore, this method is suitable for tree clouds with clearly visible stems. The method starts similarly as DBH RHT, i.e. DBH subset of points lying between 1.25 and 1.35 m is projected to a horizontal plane and the Z coordinates are transformed to 1.3m. Then the circle is fitted to these points by the Least-squares regression. The LSR method is based on minimizing the mean square distance between the fitted circle and data points. The circle fitting is done employing the Gauss-Newton method (Chernov and Lesort, 2003).

Figure 2: Differences between the RHT (left) and the LSR (middle and right) method; the wrong value given by LSR is caused by an overhanging branch, which was included in an automatically defined DBH subset of the tree cloud.
Tree Height
To obtain the tree height go to Trees → Height. There is an option to select trees of interest in the dialog window. The result is displayed in meters on the top of the tree. This tool also displays a vertical line from the tree base position to the highest point.
Tree Length
The tree or cloud length calculation is done via Trees → Length. The dialog window gives an option to select tree clouds of interest. The tool calculates Euclidean distance between the most distant points in the tree cloud and displays their connection. The cloud length is displayed in meters at the bottom of the tree. This tool is suitable for the calculation of the real length of inclined or lying trees.
Convex Planar Projection
The tree convex planar projection is evaluated via Trees → Convex planar projection. The dialog window gives an option to select tree clouds of interest. The convex planar projection tool calculates and displays the area of the convex hull of the tree cloud orthogonally projected to the horizontal plane at the tree base height. The result can be exported/imported to the ArcGIS polygon shapefile (see Exporting tree planar projection in section Data Export. The calculation is based on the Gift wrapping algorithm (Rosén et al., 2014). As the first step, the point A with the lowest y coordinate is found. This point (A) is the first and the last point of the polygon. Next, two vectors are defined. They are the vector defined by points A and (-1,-1), and the vector defined by point (A) and another point of the tree cloud (X). The angle between these vectors (α) is then calculated for each point (X) of the point cloud. The point (X) that leads to the largest angle (α) is then selected as the second point in the polygon. Other points of the polygon are added similarly, only the vector defined by points A and (-1,-1) is replaced by a vector given by the last two points of the polygon. This continues until the last point is equal to the first point A.
Concave Planar Projection
The tree concave planar projection can be computed via Trees → Concave Planar Projection. The tree cloud of interest is selected in the dialog window as well as the maximum edge length, i.e. the threshold distance TD in cm. The tool calculates and displays the area of orthogonal concave tree projection to the horizontal plane in the tree base height and the result can be exported/imported to the ArcGIS polygon shapefile (see 9.2). The calculation is based on the Gift wrapping algorithm and the modified Divide and Conquer algorithm (Rosén et al., 2014). In the first step, the convex hull is computed similarly as in the previous section. Then edges longer than the initial threshold/searching distance (TD) are found. These edges are split in the next step and the algorithm looking for points inside the polygon is as follows: A, B are adjacent points of the convex hull and X is a point tested to be added in between them. If the distance AX is shorter then TD and BX < AB, or BX < TD and AX < AB, then X is considered as a possible candidate. The edges created by split must be shorter than the original one. If more than one point complies with these rules, the one with the largest α AXB is selected. These conditions avoid too sharp angles in the new polygon. Once the new point X was selected, the algorithm continues with edge AX or BX if one of them is longer than TD. In the case that edges may not be split, because there are no points to satisfy the split conditions, the algorithm increases TD by 10 cm and repeats the split procedure. This continues until all edges are shorter than TD.

Figure 3: Planar projection of the same tree, convex (red), concave (blue).
Stem Curvature
The stem diameters within 1 m intervals along the tree length can be received via Trees → Stem Curvature. The stem diameters are computed as circles by Randomized Hough transformation (see DBH by randomized Hough transformation) from 7 cm high slices of the tree cloud. They are displayed as 7 cm high cylinders defined by the RHT fitted circles. The number of RHT iterations is set by the user. The algorithm starts with the stem diameter at 0.65 m above the ground, then at 1.3 m and 2 m above the ground. Then it continues computing diameters with 1 m spacing until the new diameter is two times wider than the previous two diameters, i.e. the calculation is terminated when branches forming the crown got involved in the calculation. Because numerous circles are fitted to each tree, the higher number of RHT iterations significantly increases the computational time. Though, for higher accuracy more iterations are recommended. The output of the stem curve calculation is x,y,z coordinates of the centers of fitted circles and the diameters itself. See also Export Stem Curvature in the chapter Data Export.