# An innovative and automated method for characterizing wood defects on trunk surfaces using high-density 3D terrestrial LiDAR data

Van-Tho Nguyen, Thiéry Constant, Francis Colin

► To cite this version:

Van-Tho Nguyen, Thiéry Constant, Francis Colin. An innovative and automated method for characterizing wood defects on trunk surfaces using high-density 3D terrestrial LiDAR data. Annals of Forest Science, 2021, 78 (2), pp.32. 10.1007/s13595-020-01022-3. hal-03628978

HAL Id: hal-03628978

https://hal.science/hal-03628978

Submitted on 4 Apr 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# An innovative and automated method for characterizing wood defects on trunk surfaces using high-density 3D terrestrial LiDAR data

Van-Tho Nguyen¹ · Thiéry Constant¹ · Francis Colin¹

Received: 27 June 2018 / Accepted: 7 December 2020 / Published online: 1 April 2021

© INRAE and Springer-Verlag France SAS, part of Springer Nature 2021

## Abstract

* **Key message** We designed a novel method allowing to automatically detect and measure defects on the surface of trunks including branches, branch scars, and epicormics from terrestrial LiDAR data by using only high-density 3D information. We could automatically detect and measure the defects with a diameter as small as 0.5 cm on either oak (Quercus petraea (Matt.) Liebl.) or beech (Fagus sylvatica L.) trees that display either rough or smooth bark.

* **Context** Ground-based light detection and ranging (LiDAR) technology describes standing trees with a high level of detail. This provides an opportunity to assess standing tree quality and to use this information in forest inventory. Assuming the availability of a very high level of detail, we could extract information about the surface defects, mainly inherited from past ramification and having a strong impact on wood quality.

* **Aims** Within the general framework of the development of a computing method able to detect, identify, and quantify the defects on the trunk surface described from 3D data produced by a terrestrial LiDAR, this study focuses on the relevance of the whole process for two tree species with contrasted bark roughness (*Quercus petraea* (Matt.) Liebl. and *Fagus sylvatica* L.) in terms of detection, identification of the defects, and comparison with measurements performed manually on the bark surface.

* **Methods** First, a segmentation algorithm detected singularities on the trunk surface. Next, a Random Forests machine learning algorithm identified the most probable defect type and allowed the elimination of false detections. Finally, we estimated the position, horizontal, and vertical dimensions of each defect from 3D data, and we compared them to those observed directly on the trunk by an operator.

* **Results** The defects were detected and classified with a high accuracy with an average $F_1$ score (harmonic mean of precision and recall) of 0.74. There were differences in computed and observed defect areas, but a much closer agreement for the number of defects.

* **Conclusion** The information about the defects present on the trunk surface measured from terrestrial LiDAR data can be used in an automated procedure for grading standing trees or roundwoods.

**Keywords** Tree quality · Roundwood quality · Forest inventory · Wood grading · Machine learning · Bark

**Handling Editor:** John Moore; **Guest Editor:** Patrick Heuret

**Contributions of the co-authors** Conceptualization: Thiéry Constant; Methodology: Van-Tho Nguyen, Thiéry Constant, and Francis Colin; Software: Van-Tho Nguyen; Validation: Van-Tho Nguyen and Francis Colin; Data curation: Van-Tho Nguyen; Writing – original draft: Van-Tho Nguyen; Writing – review & editing: Francis Colin and Thiéry Constant; Supervision: Francis Colin and Thiéry Constant; Project Administration: Francis Colin and Thiéry Constant; Funding acquisition: Thiéry Constant.

This article is part of the Topical Collection on *Epicormics and related botanical features*

Extended author information available on the last page of the article

## 1 Introduction

Grading standing trees is an essential task in forest inventory and pre-harvest assessment (Fonseca 2005). Besides global attributes such as volume and curvature, local defects are among the most critical factors influencing quality and valuation of wood. These defects can degrade the mechanical performance for structural use or the aesthetics for interior or furniture uses. In both cases, they depreciate the economic value. One method used in research for evaluating standing tree quality is to climb on the tree using a ladder and record all the defects and their attributes such as position, dimension, and
type (Colin et al. 2010b), but for inventory purposes, a visual
inspection from the ground is generally achieved (Jourez et al.
2010). For grading roundwood, X-ray tomography can be used
to measure the knots and other defects inside a log. Although
this approach provides the best performance, its main draw-
backs are the requirement for felling the tree and high invest-
ment costs (Thomas et al. 2006).

LiDAR (light detection and ranging) can measure an
object in 3D dimensions using a technique emitting a laser
beam and receiving the reflected light by a sensor. The data
provided by LiDAR is a point cloud, which contains the
three spatial coordinates of the intercepted points and addi-
tional characteristics such as reflectance or RGB values.

In forestry, Terrestrial LiDAR Scanning (TLS) can provide
unprecedented detail information of trees or forest plots. In
recent decades, several applications have been developed to
take advantage of the TLS for replacing conventional meth-
ods for measuring forest inventory attributes. The first step is,
however, the isolation of every tree or stem in the point cloud.
The attributes of each tree are then estimated such as DBH
(Simonse et al. 2003; Henning and Radtke 2006; You et al.
2016; Pitkänen et al. 2019), tree height (Popescu et al. 2002;
Srinivasan et al. 2015) or both DBH and height (Hopkinson
et al. 2004; Maas et al. 2008; Huang et al. 2011; Moskal and
Zheng 2012; Olofsson et al. 2014), wood volume or biomass
(Holopainen et al. 2011; Dassot et al. 2012; Yu et al. 2013;
Bienert et al. 2014), and the attributes of stem quality such as
curvature (Liang et al. 2014; Noyer et al. 2019), taper (Thies
et al. 2004; Norzahari et al. 2012), and ovality (Pfeifer and
Winterhalder 2004). Plot attributes can be calculated from
the TLS such as wood volume (García et al. 2011; Kwak
et al. 2014), stem density (Watt and Donoghue 2005; Brolly
and Kiraly 2009), canopy measurements (Zande et al. 2008;
Seidel et al. 2015; Cifuentes et al. 2017), and leaf area index
or leaf area density (Moorthy et al. 2008; Béland et al. 2011;
Bailey and Mahaffee 2017; Taheriazad et al. 2019).

TLS has been increasingly used for characterizing individ-
ual standing trees, thanks to the high density of 3-dimensional
point data. In particular, TLS allows an accurate reconstruc-
tion of the tree bark surface. Several studies have recently
investigated the grading of standing trees or roundwood using
TLS data by detecting defects on the reconstruction of bark.
Most approaches used the difference between the surface of
the trunk and a reference surface resulting from a primitive
shape fitting, such as circle (Thomas et al. 2006, 2010) or
cylinder (Schütt et al. 2004; Kretschmer et al. 2013; Stängle
et al. 2013). However, because the cross-sections of a log are
often not perfectly round, the primitive shapes hardly fit the
real log surface. The methods based on primitive shape fitting
result thus in detecting only large defects with a diameter above
12.7 cm and protruding more than 2.5 cm from the log surface
(Thomas et al. 2006). Depending on species and tree age, the
bark may have different structures (smooth or furrowed) that

can interfere with the detection of defects. Therefore, an auto-
mated process is challenging to design, especially for small
defects.

The earlier methods of estimation of tree quality using
TLS were mostly semi-automatic (Schütt et al. 2004;
Kretschmer et al. 2013; Stängle et al. 2013) and limited
to large branch scar defects. Schütt et al. (2004) presented
a semi-automatic approach to detect and classify wood
defects using both range and intensity information of TLS
data. The potential defects were firstly segmented by the
region-based segmentation of the greyscale image derived
from the distance between 3D point cloud of the log and the
fitted cylinders. A manual adjustment can be done to make
the final decision about these potential defects after clas-
sification by a neural network. Thomas et al. (2006, 2010)
proposed a method to automatically detect severe defects
on red oak and yellow poplar using a multi-scale analysis of
contours from 2D images derived from the distance between
3D points describing the log and the fitted circles. More
recently, Kretschmer et al. (2013) used a 3D approach based
on a distance map of the difference between the trunk sur-
face and the reference surface obtained by fitting cylinders.
The pseudo coloring of the distance map was a visual aid
to detect and measure the branch scars on European beech
within a diameter range from 4 to 18.2 cm. Stängle et al.
(2013) used a similar method to estimate the knotty core
size in European beech. The comparison with the X-Ray
scanning results led to an agreement of 62.5% between both
grading methods.

While branch scars constitute indisputably one of the
most common defects on trunks with a strong impact on the
wood quality, other defects, such as burl and picot (Colin
et al. 2010a), cannot be neglected as mentioned in the stand-
ards (Carpenter and Jones 1989; AFNOR 1997; Jourez et al.
2010). For example, epicormics consisting of burl, picot, and
bud cluster may degrade the quality of oak by at least one
class (Meadows and Burkhardt 2001).

During earlier research, we successfully developed algo-
rithms to detect surface defects with dimensions as small as
0.5 cm (Nguyen et al. 2016a) and then classified them by
using a machine learning approach (Nguyen et al. 2020a).
The features used by Random Forests included species, 3D
Hu moment invariants (Hu 1962), 3D dimensions, eigenval-
ues, and mean of the roughness of the defect point cloud.
The results obtained on trunks of several tree species includ-
ing oak, beech, wild cherry, pine, fir, and spruce were rather
promising with an average F₁ score (the harmonic mean of
precision and recall) of 0.86. The results showed robustness
to the tree species features, such as furrowed bark, age, trunk
diameter, and shape. These promising results allow us to go
to a step further to estimate defect attributes.

Indeed, besides type, dimensions of the defects have
an important impact on wood quality. Thus, an accurate
measurement of defects is important to estimate their impact. Moreover, dimensions of branch scars provide a prediction of the knot trace inside the wood (Wernsdörfer et al. 2005).

In the context of tree quality assessment, the first objective of this paper was to propose a method for automatically measuring the dimensions of the defects after detection (Nguyen et al. 2016a) and identification (Nguyen et al. 2020a). The second objective was to verify the efficiency of the whole data processing. For this, we compared the defect attributes automatically estimated with field measurements achieved by a forest expert. The third and last objective was to assess the computing time in relation to the main algorithm parameters.

# 2 Material and methods

## 2.1 Method overview

We developed an automated method consisting in three steps. The first step “Detection” aims to quickly find the smallest possible candidate defects on the mesh of the trunk. A threshold-based segmentation algorithm was developed to detect the occurrence of a defect based on the difference between the reference distance and the distance of 3D points to the trunk centerline. The reference distance to the centerline here represents the distance from the point to the centerline of an idealized trunk which would have no defects and obtained from the distribution of its neighboring points belonging to the elongated patch along the trunk axis. This first step was tested on different tree species (Nguyen et al. 2016a). The second step “Identification” has two main objectives: (1) to remove the false positives coming from the first step and (2) to classify the candidate defects into different types by their biological nature such as branch, branch scar, burl, and small defect (Nguyen et al. 2020a). The last step consists of estimating the position and dimensions of the identified defects, and this last part of the processing chain is thoroughly discussed in this paper.

## 2.2 Data collection and preprocessing

The assessment of the proposed approach required the availability of 3D point clouds datasets describing the intricate details of the trunks' surface as well as manual measurements superimposed over the 3D point cloud coordinate system.

### 2.2.1 Manual measurement of defects on standing trees

The objective of the manual measurement was to create a reference value of each defect attribute: type, position, and dimension(s). A measurement protocol was defined to facilitate the identification of the defects on the reconstructed surface of the trunk. The defects with a diameter greater or equal to 0.5 cm were described prior to carrying out the scans in terms of dimension, type, and position. The position was taken in an (*O*,*l*,*z*) coordinate system where *h* is the height and *l* is the arc length from a reference line to the defect. A measuring tape carefully adjusted over the trunk surface that best fit the visual projection of the trunk's centerline approximated the central axis of the trunk. The measuring tape divided the scanned portion of the trunk into two equal parts. It also allowed measurements of *z* coordinate. Two small markers (ping-pong balls or small pieces of paper) at 1-m height, the origin of the coordinate system (*O*), and 5-m height were in the scans and used as markers of the reference line to compute coordinates of the automatically detected defect. The area under evaluation was from 1 to 5 m in trunk length and a half of tree circumference.

After each defect type identification, the position of the defect was measured in the (*O*,*l*,*z*) coordinate system (Fig. 1a). The *z* coordinate was the position along the reference line. The *l* coordinate was the horizontal arc length between the tape and the defect. The measurement was carried out on both sides of the tape between -1/4 circumference (to the left hand) and 1/4 circumference (to the right hand) at breast height and with the height *z* ranging from 1 to 5 m from the ground.

The measurements of defect dimensions depend on defect type. For burl and small defects, the measurements were the defect width *w* and height *h* (Fig. 1b). The width *w* was measured by the arc length between the leftmost and rightmost points, assessed visually, of the intersection between the defect and the bark (see Fig. 1b). The height *h* was measured by the difference between the maximum and minimum *z* coordinates of the intersection between the defect and the bark. For branch scars, in addition to width *w* and height *h* of the scar, the Chinese mustache width (*w*<sub>k</sub>) and height (*h*<sub>k</sub>) were also measured by the same method used to measure *w* and *h*, respectively (Fig. 1c). For branch type, including sequential and epicormic branches, the branch diameter was measured at a short distance from the trunk after the junction between the branch and the trunk (Fig. 1d).

The validation of the automatic measurement of defects involved six trees including three oak trees and three beech trees. We used 401 defects on 17 other trees (Table 1) including seven sessile oaks (*Quercus petraea* (Matt.) Liebl.), five European beeches (*Fagus sylvatica* L.), two wild cherries (*Prunus avium* (L.) L.), one Scots pine (*Pinus Sylvestris* L.), and two silver fir (*Abies alba* Mill.) to train the classifier.
<figure><img src="image_2.png" /><figcaption>**Fig. 1** Manual measurement of defect width and height for different defect types</figcaption></figure>

### 2.2.2 TLS data collection and preprocessing

A Faro Focus 3D X130 scanned the sampled trees in the Champenoux forest close to Nancy, France (48° 43' 30.1" N, 6° 20' 52.1" E). The database consists of point clouds of trees of two species: sessile oak (*Quercus petraea* (Matt.) Liebl.) and European beech (*Fagus sylvatica* L.). In order to detect the small defects, we used a high-resolution setting and the distance from the scanner to the trunk was approximately 3–4 m. The angular resolution was 0.018° on both horizontal and vertical directions. Each tree was scanned from two points of view towards the target side to describe half of the trunk circumference. Scans of each tree were co-registered in FARO SCENE software (Faro Technologies Inc., Lake Mary, FL) and exported to a unique file to recover the 3D view of one side of the trunk.

The point cloud was preprocessed to enhance the outcome of the process. The noise was reduced by using an algorithm based on Euclidian distance clustering (Nguyen et al. 2020a).

Then the point cloud with its reduced noise was processed in the Graphite software (https://gforge.inria.fr/frs/?group_id=1465) including the following steps: (1) smoothing of the point cloud, (2) meshing of the point cloud, and (3) smoothing the resulting mesh. Additional details regarding the process were presented in Nguyen et al. (2020a). The data that support the findings of this study are openly available in (Nguyen et al. 2020b).

## 2.3 Detection

The detection of the defects is based on an enhanced version (Nguyen et al. 2020a) of an initial segmentation algorithm (Nguyen et al. 2016a). The outer part of a defect is typically a more protruded region compared with the surface of the local area surrounding it.

First, we computed the centerline of the trunk using an adaptation of the method proposed in Kerautret et al. (2016) based on the detections of voxels (a division of point cloud

<table><caption>**Table 1** Synthesis by species of the number and DBH range of the trees used to train Random Forest classifier (with the number of the measured defects) and to validate the method</caption><thead><tr><td>Species</td><td>Number of trees used to validate the measurement (defects number)</td><td>Number of trees used to train the classifier (defects number)</td><td>Diameter at breast height (cm)</td></tr></thead><tbody><tr><td>Oak (<i>Quercus petraea</i> (Matt.) Liebl.)</td><td>3 (57)</td><td>7 (232)</td><td>35–76</td></tr><tr><td>Beech (<i>Fagus sylvatica</i> L.)</td><td>3 (84)</td><td>5 (131)</td><td>30–57</td></tr><tr><td>Wild cherry(<i>Prunus avium</i> (L.) L.)</td><td></td><td>2 (20)</td><td>20–26</td></tr><tr><td>Pine (<i>Pinus Sylvestris</i> L.)</td><td></td><td>1 (4)</td><td>34</td></tr><tr><td>Fir (<i>Abies alba</i> Mill.)</td><td></td><td>2 (48)</td><td>23–42</td></tr><tr><td>Total</td><td>6 (141)</td><td>17 (401)</td><td></td></tr></tbody></table>

<figure><img src="image_3.png" /></figure>
into regular size cubes) where directions of interior normals to the surface converge.

Second, based on the computed centerline, we segmented the branches by dividing the point cloud volume into equal angular cylindrical sectors (pie slices) with the centerline is the axis of cylinders. Each angular cylindrical sector had height equals to L, and angle equals to $\frac{L}{R}$ where R is the radius of the trunk. The branch segmentation algorithm then divided the point cloud into two disjoint sets: the trunk set T and the branch set B. By choosing an appropriate value of L (L was set between 50 and 100 mm in our experiment), we could ensure that in each cylindrical sector, there was at least one trunk point, which was assumed to be the closest point to the centerline. We added these points to the set T; other points were added to the set B. Points in the set B with a distance below $\sqrt{2L}$ to at least one point in the set T were moved from set B to set T. At the end of the algorithm, we obtained the set T containing all trunk points and a small number of branch points which would be segmented in the next step and the set B containing only branch points.

Third, the detection of smaller protruding defects in the trunk set T was performed as follows: for each point P in the set T, a narrow longitudinal patch consisting of neighbors of P was defined. The reference distance to the centerline of a point P was computed from a least-squares linear regression linking the radius variation to longitudinal positions of all points belonging to the patch (Nguyen et al. 2016a). We then computed for each point the difference (denoted as $\delta$) between the distance of the point to the centerline and the corresponding reference distance to the centerline. An automatic thresholding method (Rosin 2001) processed the histogram of this $\delta$ for the whole set of trunk points to obtain the points of potential defects corresponding to the $\delta$ greater than the threshold. The potential defects were obtained by using the Euclidean clustering method (Rusu and Cousins 2011) on the union of these potential points of defects and the points of branches. The minimum distance used for the clustering method was set to 10 mm.

## 2.4 Identification

The identification (or classification) of defects is a critical step because the impact on wood quality depends on the defect type. Furthermore, the relevant characteristics of the defect are type-dependent. For example, the branch diameter was measured by the distance to the branch centerline, while the burl dimension was measured by the arc length between the leftmost and rightmost points. In a previous research (Nguyen et al. 2020a), we described in detail a classification method based on the supervised machine learning Random Forests (Breiman 2001) using a feature vector including the following elements: (1) species of the tree, (2) ratio between the number of points of the defect and

the volume of its bounding box, (3) the seven Hu moment invariants (Hu 1962), (4) defect width, (5) ratio between defects width and height, (6) ratio between defects width and thickness, (7) mean of the difference between the distance and the reference distance to the centerline of all points of the defect, (8) standard deviation of the difference between the distance and the reference distance to the centerline of all points of the defect, (9) ratio between the eigenvalue of the radial vector and the eigenvalue of the longitudinal vector, (10) ratio between the eigenvalue of the tangential vector and the eigenvalue of the longitudinal vector, and (11) angle between the radial vector and the principal axis of the tree.

Random Forests was trained by 401 defects on 17 trees (Table 1). In addition to defect type, a bark class was introduced in Random Forests. The bark class represents bark zones with a roughness above the local average which are not associated with a defect. Indeed, no size criterion was introduced for detecting a defect in the previous segmentation algorithm for exhaustivity purpose. The consequence was the detection of putative defects corresponding to a bark portion and the existence of such a class allowed the rejection of such false positives in the most refined analysis performed during the classification step. Finally, the different classes are as follows: (1) branch including sequential and epicormic branches; (2) branch scar; (3) burl; (4) small defects including picot, sphaeroblast, bud and bud cluster with less than 6 buds; and (5) bark.

After training, Random Forests classified the detected defects. For each candidate defect, its feature vector was computed and then passed to the Random Forests. Random Forests consists of a set of Classification and Regression Trees (Breiman et al. 1984). Each tree makes a classification, or in other words, gives a vote for a class. Random Forests chooses the class which is voted by the majority of trees.

## 2.5 Automatic estimation of dimensions

We tried to mimic as accurately as possible the approach applied when we manually measured the defects on the standing tree. Consequently, the measurement method depended on the defect type. We needed to represent the defect on an (*O*,*l*,*z*) coordinate system similar to what we used on the field. For the computational purpose, defect corresponded to a set of points $D = \{P(r, \theta, z)\}$ in a cylindrical coordinate system (*O*,*r*, *θ*, *z*) that can be converted to (*O*,*l*,*z*) coordinate system where *l* is the arclength and is the product of *θ* and *r*, respectively, expressed in radians and metrics unit. Figure 2 describes the conversion of a defect point P from Cartesian to a cylindrical coordinate system. The detail of the conversion is as follows. The intersection of the centerline of the trunk and the plane containing the marker point *M* (marked by the small ball on the bark) and this perpendicular to the centerline defines the origin *O*. The

<figure><img src="image_4.png" /></figure>
<figure><img src="image_5.png" /><figcaption>**Fig. 2** Description of the conversion of an arbitrary point P on the point cloud from the Cartesian to the cylindrical coordinate system. This is a simplification because the centerline computed by our algorithm can be a polyline</figcaption></figure>

radial distance *r* is the distance from P to the centerline. The azimuth *θ* is the angle between the radial vector *P*′*P* and *OM* with P' on the centerline, and P'P being perpendicular to the centerline. The height *z* is the distance between P' and O along the centerline.

## 2.5.1 Measurement of the position of the defect and the dimensions of burls, small defects, and branch scars

In the cylindrical coordinate system, the following procedure allowed measuring the width *w* and height *h* of burls and small defects and the Chinese mustache width *w*<sub>k</sub> and height *w*<sub>k</sub> of the branch scar.

* Compute the minimum distance to the centerline *r*<sub>min</sub> of all the defect points.

* Initialize the set I as empty: This set is used to store the closest points of the defect to the bark surface to avoid the positive error measurement due to shoots and leaves.

* For each point *P* of the defect points: Add *P* to set *I* if *r*<sub>*P*</sub> − *r*<sub>min</sub> < *r*<sub>*t*</sub>, with *r*<sub>*t*</sub> = 10mm; The threshold *r*<sub>*t*</sub> allows simulating the junction between the defect and the bark as we do it manually on the field. In other words, we measured only the closest points of the defect to the bark surface.

* Find the bounding box of the set *I*, represented by two points *P*<sub>1</sub> and *P*<sub>2</sub>.

* Compute the center of the bounding box of *I*: $P_C = \frac{P_1 + P_2}{2}$

* Compute the radius of the trunk at the defect position *r*<sub>trunk</sub> by using the mode of the distance to the centerline of all the points in a trunk segment of 5 cm length with *P*<sub>C</sub> as the center of the segment.

* The coordinate *z* of the defect is the coordinate *z* of *P*<sub>C</sub>.

* The coordinate *l* of the defect is *l* = *θ*<sub>*P*<sub>C</sub></sub> * *r*<sub>trunk</sub>

* Compute the width of the defect *w* (or *w*<sub>k</sub>)

$$ 
\begin{aligned}
\alpha &= |\theta_{P_2} - \theta_{P_1}| \\
w &= \alpha * r_{\text{trunk}}
\end{aligned}
 $$

* Compute the height of the defect *h* (or *h*<sub>k</sub>)

$$ h = |z_{P_2} - z_{P_1}| $$

## 2.5.2 Measurement of branch scar dimension *w* and *h*

A branch scar results in different shapes such as ellipse or Chinese mustache. Since the above-mentioned algorithm was expected to infer the dimensions of the internal knot from the externally visible branch scar, the dimension of the scar that was critical for estimating the knot diameter was more difficult to measure when it has a Chinese mustache shape. We proposed a simple method based on the variation of the height occupied by a given defect along the periphery of the trunk to detect and measure the branch scar. The principle is that a Chinese mustache has a significantly smaller height to the scar. Thus, on a profile of height along the arc length, the boundaries between the Chinese mustache and the scar can be detected by significant small local minima. The algorithm works with both ellipse and Chinese mustache shapes. The algorithm is illustrated in Fig. 3 and is described as follows. First, the defect points were converted from a cylindrical coordinate system into (O,l,z) coordinate system with *l* = *θ* * *r*<sub>trunk</sub>. Then, in the (O,l,z) coordinate system, the height profile (*h*(*l*)) of the defect was computed as the difference between the maximum and minimum *z* values of the defect as a function of the arc length *l*: *h*(*l*) = *z*<sub>max</sub>(*l*) − *z*<sub>min</sub>(*l*). Next, the profile was smoothed by an average of neighbors with a window of size 7 mm. Then, the profile is clipped at the first left (*M*<sub>1</sub>) and right local minima (*M*<sub>2</sub>) which have a height of less than 40% (empirically chosen) of the maxima (*d*). Finally, the scar width was computed by the difference between the arclength of *M*<sub>1</sub> and
<figure><img src="image_6.png" /><figcaption>**Fig. 3** Illustration of the dimensions of the branch scar using height profile by arc length. The scar dimensions were determined by the first left ($M_1$) and right ($M_2$) minima which had a height of less than 40% of the maxima of the profile</figcaption></figure>

$M_2$ ($w = l_{M_2} - l_{M_1}$) and scar height was the defect height at the maxima $M$ ($h = h_M$).

### 2.5.3 Estimation of branch diameter

The estimation of branch diameter occurred when the classification step returned a branch as defect type. A branch is different from the other defect types because the diameter is not measured at the junction of the branch and the trunk. We considered that branches have a tubular shape, and two measurement methods were developed because of the unsatisfactory results obtained by the first one. The first method was to fit a cylinder to a portion of the detected branch, and from our experience, the frequent flexuosity of the branch impedes the fitting of a cylinder, the frequent noise in 3D data at the branch junction has also an impact,

and a plausible initial diameter value is a priori required to ensure the success of the fitting procedure. The second method was to compute the centerline of the branch and compute the mode of the distance to the centerline of points in a portion of the branch close to the trunk. This second method was more robust and insensitive to the flexuosity and did not require initialization by a diameter value.

The following procedure describes the method based on the centerline. First, a portion of the branch corresponding to a distance between 3 and 8 cm from the trunk was extracted. Second, the computation of the centerline for the portion resulted from the same method as for the centerline of the trunk. Third, the distances of all points in the portion to the centerline were computed. And finally, the diameter of the branch was taken as twice the mode of the distance to the centerline.

<figure><img src="image_7.png" /></figure>
## 2.6 Implementation of the software

The input of the software is a mesh derived from TLS data of the trunk (the preprocess and creation of the mesh were presented in the section "Preprocessing" or in Nguyen et al. (2020a). The program was implemented in C++ language using several libraries: DGtal (DGtal) to represent 3D volumic data and for the computation of the trunk centerline, OpenCV (Bradski 2000) for the machine learning, GNU GSL (Gough 2009) for the linear regression, and PCL (Rusu and Cousins 2011) for normal computation and clustering. The final objective of the project was to provide a graphical tool for grading trunks or logs. The graphic environment was provided by the platform Computree (http://computree.onf.fr), an open-source software dedicated to processing LiDAR data in forestry. The graphical interface is currently available as a plugin of Computree and tested in a Linux operation system. A faster alternative, command-line mode, is also available for batch processing of multiple meshes. The source code of the command-line mode and sample data are available at the following GitHub repository: https://github.com/vanthonguyen/trunkdefectclassification.

# 3 Results

## 3.1 Defect detection and identification

Table 2 shows a comparison of the detection results of the segmentation and classification algorithms with the reference data. The segmentation algorithm could detect most defects on the oak and beech barks, even small defects such as picots and sphaeroblasts, the smallest diameter of detected defects being 0.5 cm. Overall, the segmentation algorithm detected 134 out of 141 defects in the meshes of six trunks. For each trunk, the missed defects (false negative) were at most 3. As expected, the result of the segmentation algorithm contained many false positives (false identification) resulting from miss-identified bark portions. The number of false positives was 270, which was reduced to 69 after the treatment by the classification

algorithm. The classification, however, removed also 19 correct detected defects.

Visually, the type of defects resulting from the classification corresponded well to the protrusion on meshes of trunk (Fig. 4). The evaluation criteria were the precision, recall, $F_1$ score, and the average $F_{\mu 1}$ (see Appendix for the definition of these criteria). These scores were calculated for each defect type (Fig. 5). The average $F_{\mu 1}$ was 0.74. There were obvious differences in the $F_1$ score between the different defect types: the branch type with an $F_1$ score of 1.0, following by the burl type with an $F_1$ score of 0.75. The algorithm performed less well than for the Branch scar and Small defect with $F_1$ scores of 0.53 and 0.56, respectively.

## 3.2 Defect measurement

The measurement results were compared with the reference value (manual measurement) using the absolute difference between the results and reference values (Fig. 6). Overall, the algorithm achieved a good result with the median of the difference close to zero both for defect width (10.1 mm) and height (5.9 mm). The overall coefficient of variation for the absolute difference between the automatic measurement and the manual measurement of the defect width ($cv_w$) and height ($cv_h$) was 145% and 144% respectively.

### 3.2.1 Branch scar

The Branch scar type had a relatively compact height difference and a small median of 2.9 mm. The difference of the Branch scars width was, however, more disperse and with a larger median of 16.5 mm. The distributions of the plots were slightly skewed on the positive side, but there is a considerable part of the plots with values below zero. The difference between the automatic and manual measurements of the Chinese mustache width had a considerable dispersion due to the weak relief of these parts in the defects making them very challenging to quantify. The coefficient of variation $cv_w$ and $cv_h$ were 134% and 139%, respectively. The coefficients of variation of the Chinese mustache's width and height were 101% and 122%, respectively.

<table><caption>**Table 2** Summary of the results of the segmentation (Seg.) and classification (Cla.) steps for three oak and three beech trunks compared with the observed defects</caption><thead><tr><th rowspan="2">Tree name</th><th rowspan="2">Observed</th><th colspan="2">True positive</th><th colspan="2">False positive</th><th colspan="2">False negative</th></tr><tr><th>Seg</th><th>Cla</th><th>Seg</th><th>Cla</th><th>Seg</th><th>Cla</th></tr></thead><tbody><tr><td>Oak 334</td><td>8</td><td>8</td><td>8</td><td>9</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Oak 411</td><td>25</td><td>22</td><td>17</td><td>19</td><td>4</td><td>3</td><td>8</td></tr><tr><td>Oak 569</td><td>24</td><td>23</td><td>21</td><td>70</td><td>6</td><td>1</td><td>3</td></tr><tr><td>Beech 101</td><td>31</td><td>30</td><td>24</td><td>53</td><td>16</td><td>1</td><td>7</td></tr><tr><td>Beech 102</td><td>29</td><td>29</td><td>25</td><td>66</td><td>19</td><td>0</td><td>4</td></tr><tr><td>Beech 104</td><td>24</td><td>22</td><td>20</td><td>53</td><td>24</td><td>2</td><td>4</td></tr><tr><td>Total</td><td>141</td><td>134</td><td>115</td><td>270</td><td>69</td><td>7</td><td>26</td></tr></tbody></table>

<figure><img src="image_8.png" /></figure>
<figure><img src="image_9.png" /><figcaption>**Fig. 4** Visualization of the classification results on the meshes of an oak (left) and a beech (right). The defects are highlighted according to their type. □ is Branch type including both sequential and epicor-</figcaption></figure>

mic branches. ■ is Branch scar, □ is Burl, and ▲ is Small defect including bud cluster, sphaeroblast, and picot

### 3.2.2 Burl

Burls were affected by the largest differences between the estimated and the observed value of width and height with medians of 24.4 mm and 25.1 mm, respectively. The distributions were relatively compact but situated mostly over zero. The coefficient of variation $cv_w$ and $cv_h$ were both 95%.

### 3.2.3 Small defect

The small defect type exhibited the most compact plots and had the smallest median width and height of 5.2 mm and 3.9 mm, respectively. The distributions of the width difference and height difference were similar. The positive median and the large part of the plots of small defects were above

<figure><img src="image_10.png" /><figcaption>**Fig. 5** Precision, recall and $F_1$ score of the different defect types with the bark type corresponding to almost normal bark singularities (see Appendix for definitions of precision and recall)</figcaption></figure>

<figure><img src="image_11.png" /></figure>
<figure><img src="image_12.png" /><figcaption>**Fig. 6** Violin plots of the differences between the estimated and the manual measurement of the defect dimensions for different defect types. For each plot, the dash lines show the quartiles and median with the latter accompanied by the number</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>**Fig. 7** Illustration of branch measurement by computing its centerline. The reconstruction of the branch from the centerline and estimated diameter is shown in purple. The defects are highlighted according to their type: is Branch type including both sequential</figcaption></figure>

and epicormic branches. is Branch scar, is Burl, and is Small defect including bud cluster, sphaeroblast, and picot

zero suggesting that the algorithm overestimated mostly the diameter of the small defects. The coefficient of variation $cv_w$ and $cv_h$ were 127% and 135%, respectively.

The absolute error is smallest for small defects and largest for branch scars. The coefficient of variation for small defects was, however, the largest due to its small mean (width mean of 18 mm and height mean of 13 mm).

### 3.2.4 Branch diameter measurement

Our test database mainly focused on naturally pruned parts of the trunks, where only two branches were measured: one in an oak tree and another on a beech tree. The estimated diameters of the branches were 8.3 mm (oak) and 20.3 mm (beech) compared with field measures of 8 mm and 20 mm, respectively. The reconstruction of the two branches is illustrated in Fig. 7.

<figure><img src="image_14.png" /></figure>
<figure><img src="image_15.png" /><figcaption>**Fig. 8** Difference between the estimated and manual measurement of overall defect dimensions on oak and beech</figcaption></figure>

### 3.2.5 Overall species effect

The distribution of the differences was also different between the two species (Fig. 8). The violin plot of the width of defects on oak was comparatively shorter which suggests that there was a good agreement between estimated and observed widths. The lower quartile was above 0 meaning that the algorithm overestimated the defect width for the oak trees. The violin plot of width on the beech trees was much taller which suggests that the agreement between estimated and observed widths was not as good as for oaks. The algorithm tended to underestimate large defects. The violin plots of the difference between the estimated and observed heights were shorter than the one of widths both on oak and beech. The coefficient of variation of the absolute difference between the estimated and the observed defect dimensions

was smaller on oak than on beech trees: the $cv_w$ and $cv_h$ of oaks were respectively 104% and 105% compared with the $cv_w$ and $cv_h$ of beeches were respectively 147% and 165%. The absolute error of the measurement of defect height was smaller than that of defect width. The coefficient of variation of the height measurement was however smaller because most defects displayed smaller heights than widths.

### 3.2.6 Missing and false identifications

The classification algorithm missed 26 out of 141 defects in total. The algorithm missed only small defects (Fig. 9). The largest missing defects had a width of 40 mm and 73% of the missing defects had a width equal to or less than 20 mm. All missing defects had a height smaller than or equal to 30 mm (showed in the histogram as from 30 to 40 mm).

Number of defects

<figure><img src="image_16.png" /></figure>

Number of defects

<figure><img src="image_17.png" /><figcaption>**Fig. 9** Number of defects by width and height that were not detected by the workflow</figcaption></figure>

<figure><img src="image_18.png" /></figure>
<figure><img src="image_19.png" /><figcaption>**Fig. 10** Number of non-defects by width and height that were incorrectly detected by the workflow</figcaption></figure>

The classification resulted in 69 false identifications (false positives). Most false positives were relatively small; 80% had a width that was less than 60 mm and a height that was less than 30 mm (Fig. 10).

## 3.3 Processing time

The running time was recorded by the “time” program provided in the GNU Linux operation system. The experiments were carried out on a laptop running GNU Linux with a 4th generation 2.7 GHz Intel Core i7 processor, 32 GB of RAM, and a Quadro K610M graphics card.

Figure 11 shows the running time of the program for 6 trunks and different settings of the main parameters, which

impact the running time of the different algorithmic steps. They are the number of points (vertices) in the meshes, the voxel size in the centerline computation, and the patch size in segmentation. If other parameters were fixed, the general trend is that the execution time increased when the number of points increased (Fig. 11a). However, the factors that had the strongest impact on execution time were the voxel size and the patch size of the segmentation algorithm. That was because the request for neighbors for the computation of reference points was done using a KD Tree (Friedman et al. 1977) with a complexity of $O(n^{2/3} + k)$ with $n$ is the number of points in the point cloud and $k$ is the number of returned points. And this request was done for each non-empty voxel; thus, the algorithm is bounded by complexity of

<figure><img src="image_20.png" /><figcaption>**Fig. 11** Summary of running times of the program on meshes using a command-line interface. The running times were counted for our 3 main steps. The time for preprocessing was not included</figcaption></figure>

<figure><img src="image_21.png" /></figure>
$$O(m(n^{\frac{2}{3}} + k))$$ where m is the number of non-empty voxels.

The execution time is almost inversely proportional to the square of the voxel size (Fig. 11b). As the voxel size increased from 1 to 3 mm, the execution time decreased from 6 to 10 times. The last main factor that had an impact on the execution time was the patch size. In our experiments, the execution time was proportional to the patch size. When we doubled both width and height, the execution time was almost doubled. In our experiments, the voxel size of 3 mm gave results that were as good as of the 1 mm voxel size but reduced the running time between 6 and 10 times (Fig. 11b). The choice of other parameters such as patch size and density depends on the characteristics of the tree and the defects on the trunk. In general, the patch size must be large enough to ensure the assessment of the local reference distance and thus be greater than the general defect height, a furrowed bark requires longer patches. The influence of these parameters on the performance of the segmentation was discussed in detail in Nguyen et al. (2016b).

# 4 Discussion

## 4.1 Defect detection and identification

The automatic detection of defects on the surface of the trunk using TLS data is still a real challenge. Despite having at disposal an efficient method, many factors could impact the results such as species and age of the tree, global shape of the trunk, resolution, and quality of the scan. The species and age of the tree have a direct impact on the structure of the bark passing from smooth to furrowed as the tree ages or as we move from the upper to the bottom part of the trunk. Good quality and high-resolution data are required for the detection of small defects. In our experiment, for detecting defects with a diameter of 0.5 cm a resolution of at least 20 points per cm² was required. From the results, we can say that our algorithms had an excellent performance in detecting even small defects. The detection outcomes of the segmentation algorithm were very good with only 7 missed defects out of 141 in total. Two reasons enabled the good detection rate. The first is that we have a very good and robust estimation of the trunk centerline. The second reason comes from our patch-based approach to estimate the local reference distance to the centerline for each individual point in the mesh of the trunk. The efficiency of estimation allows detecting even slight modifications of bark roughness. The smallest diameter of defects detected by our algorithm was 0.5 cm outperforming all previous studies with size ranging from 7.5 cm (Thomas et al. 2006) to 2 cm (Kretschmer et al. 2013). Moreover, our method takes all types of branching

defects into account whereas the previous works focused only on branch scars.

The detection results, however, contained 270 false negatives for 141 manually detected defects. The classification algorithm allowed removing 201 of these false negatives. The most critical challenge in the classification of the defects would be to reduce the number of false positives. For example, the precision of the classification of branch scars and small defects was low because of the false positives, in turn, due to the miss-classification of bark portions as branch scars (Fig. 5). They indeed directly affect the result of the assessment method. As discussed in Nguyen et al. (2020a), the performance of the classification might be improved by adding in the learning data set more defects having a large variability in shape, but also by defining several classes for a same biological defect taking size range into consideration for a better analysis of the performance.

## 4.2 Quantification

Since the defect size was estimated depending on the defect type, we will discuss first the performance of the defect size estimation by type. Second, we will discuss the robustness of our algorithms to species. Third, we will discuss the potential utilization of our results in grading standing trees and roundwoods. Finally, we will discuss some limits of our approach and the TLS technology.

### 4.2.1 Comparison between defect types

**Branch scar** Due to the particularity of branch scar shape, for inferring the knot size, we need the information about the scar seal width and height, and the Chinese mustache width and height. The scar width and height were estimated with a median of 16.5 mm and 2.9 mm respectively. Compared with the burl, the branch scar had a better distribution of the differences between the automatic and manual measurements. Nevertheless, two or more branch scars were rather frequently connected on a beech trunk. They were recognized by our program as one branch scar. This phenomenon denoted as under-segmentation led to a large error in the estimation of the scar dimension that appeared in the violin plots with a difference greater than 300 mm in scar width. This kind of under-segmentation could be detected by a more detailed analysis of the shape of the detected defect and future developments could be imagined solving this particularity. The performance of our algorithm on the measurement of scar height was similar to the result of Kretschmer et al. (2013) with 56% and 58% of measured scar height having a difference of less than 1 cm respectively.
<figure><img src="image_22.png" /><figcaption>**Fig. 12** The difference between the manual and the automatic measurement of the burl diameter. The automatic measurement often leads to larger values than the manual one</figcaption></figure>

**Burl** In our experiments, burls were only present on oak trunks. Our algorithm often overestimated their diameters. The algorithm overestimated 95% of both width and height with medians of the error equal to 24.4 mm and 25.1 mm respectively. Our sample oak trees had a furrowed bark resulting in small bark portions included in the detected defects (Fig. 12). This difference between the human and machine visions of the relief resulted in detected defects were often larger than the defects observed on the field.

**Small defect** The dimensions of small defects were also often overestimated with a rate of 73% for width and 76% for height. Because these defects have small dimensions, the relative measurement error was usually high. For example, the coefficient of variation of the absolute error between the manual and automatic measurement for width and height were 127% and 135%, respectively. However, from a wood quality point of view, the impact of these small defects is mainly related to their number independently of their actual size. For example, the standard NF EN 1316-1 (AFNOR 1997), treats a picot as a defect of diameter 5 mm.

**Branch diameter** The estimation of branch diameter was accurate, even though the result depends on the quality of the scan. The measurement of branch diameter was based on a reconstruction of the branch by a computation of the branch's centerline. The reconstruction was very robust (Fig. 7). The branch on the Beech 102 (Fig. 7a) was highly curved, and there was noise at the junction between the branch and the trunk. The reconstruction of the branch was close to the real surface and shape of the branch. The scan of the branch on the Oak 411 (Fig. 7b) was very noisy. The branch looked thus much larger and flatter than the real branch due to noisy contour. The algorithm estimated,

however, a very good diameter of 8.3 mm compared with 8 mm from the manual measurement. Besides accuracy, the approach based on the branch's centerline had the advantage of having fixed parameters: the accumulation radius (see Nguyen et al. (2016a) for the details of this parameter), the skipped distance from the trunk bark, and the length to estimate the diameter.

It is also possible to estimate the insertion angle, i.e., the angle between the principal axis of the branch and the axis of the trunk, with the branch reconstruction approach using the centerline. This information could be used to distinguish between a sequential branch and an epicormic branch since the former is more fastigiated. This angle could be also used to predict the knot diameter and direction inside the trunk wood.

### 4.2.2 Comparison between oak and beech

Our results showed that the method can work on both oak and beech which are the most common broadleaved species in Europe. There were, however, differences between the two species (Fig. 8) due to the difference in the bark, global shape of the tree, and defect types. The oak characteristics are a furrowed bark with often epicormic defects such as burl and picot. The branch scars on oak, however, are difficult to be detected from external characteristics of the bark because the scar tends to vanish with time, evolving towards a normal aspect of rhytidome. On the opposite, for beech, the smooth bark reveals easily even the very small and weak relief defects. And consequently, it is also very easy to get false detections. These false detections are more difficult to remove in comparison with the false detections occurring on oaks because they are very similar to old scars of early pruned branches ridging the bark surface.

Beech bark often has anomalies due to *Nectria* (*Nectria coccinea* Desm.). This disease caused by fungi and is one of the most common beech bark diseases at least in Northern France. The irregularities of the bark associated with the *Nectria* disease are mostly superficial and have little or no impact on wood quality (McCullough et al. 2005). These irregularities, however, were often miss-identified as branch scars by our algorithms. It might be possible to remove these false identifications in the classification step by adding a dedicated class for damages due to *Nectria*.

## 4.3 Potential application to grading roundwoods and standing trees

The results obtained in this study show clearly that the accuracy of defect measurements with TLS technology can be used to assess the wood quality of standing trees or roundwoods. It turns out that the use of the information delivered by our algorithm, such as position, type, and dimension of

<figure><img src="image_23.png" /></figure>
defects, makes the automated grading of roundwoods or standing trees possible by standards such as NF EN 1316-1 (AFNOR 1997) grading oak or beech logs and Jourez et al. (2010) for grading broad leaf standing trees. However, we observed that grading a class A log is rather challenging whether by an automatic algorithm or by an operator. That is because this class tolerates no defects on a beech log or just a small defect such as picot or sound knot, which has a diameter of less than 15 mm. An error of the algorithm or an operator could lead to a miss evaluation from class A to B or vice versa. For class B, these standards use the sum of the defect's diameters for grading oak and beech logs. However, as shown above, the algorithm gave results often larger than the results from a manual evaluation. For the sum of diameters, the automatic measurement is about 50% larger than the manual measurement on oak, which might lead to an under evaluation of quality compared with a manual evaluation, and must be corrected by improving the method or by inter-calibration like it is the rule when changing a measurement tool.

The method still has limits as the underestimation of branch scar edge due to the insufficiency of the relief and the under-segmentation of defects. The under-segmentation of defects may affect both the grading of standing trees and roundwood. For example, an under-segmentation might count two defects as one, which results in a class B log graded as a class A. Thus, further analysis is needed to detect under-segmentations and then correct them.

These results need to be improved through the different possibilities already mentioned. Furthermore, the two methods mentioned are based on the evaluation of external defects, the correctness of the assessment needs thus to be validated by a measurement of knot inside the wood, and the coupling between the outside and internal characteristics of the defect can be improved by building a learning database for classification making use of internal information coming from X-ray CT scanning.

An important point in grading log quality is the identification between a sound knot and an unsound knot. To our knowledge, there was no research about this aspect of using TLS. For a completed automatic procedure of grading log quality using TLS, a study of the feasibility of the identification of these two-knot types is still necessary.

The last aspect that we want to compare to a conventional procedure for grading standing trees such as Jourez et al. (2010) is the processing time. As shown in the section “Results,” the required time for running our algorithms was small if we choose an optimized parameter, in particular, using the voxel size of 3 mm. The execution time for a nearly 2 million vertices mesh was from 2 to 3 min. However, if we count the time for acquiring and preprocessing the TLS data for a tree, this could be as long as 2 h. The overall time

required to process a tree by using TLS data was longer than the field procedure used in research, with a duration around 30 min, and longer than the qualification duration of a tree by an expert which lasts a couple of minutes. Although the human vision is known to be better than the machine vision for an object recognition task, an operator, however, could make errors and inconsistent results depending on the emotion and working condition. Furthermore, digital information or its synthesis resulting from a computer program, however, often gives a reproducible result, and a significant advantage will be the availability of detailed information along the commercial and processing chain for traceability and optimization purposes. Moreover, with the future advance of technology, we could incrementally improve the accuracy and reduce the acquisition and processing times.

## 4.4 Limitations of TLS

The TLS has several limitations such as the occlusion by branches, moss, or ivy and the reduction of the spatial resolution in the high parts of tree trunks. A small cluster of moss can also look like a picot or a sphaeroblast leading to an increase in the number of detected defects. In this work, the choice of TLS data was justified as a reference method for getting detailed and accurate 3D information on standing trees, but the processing method is independent on the origin of the 3D cloud, and how can we speed up the 3D data acquisition keeping a relevant level of details, is the task we must and can address thanks to the present work. Furthermore, we only use geometrical information, in our approach, but other data, such as distance-normalized reflectance or color, could be used in addition to improving the classification.

## 5 Conclusion

In this paper, we presented the final evaluation of a method consisting of a suite of algorithms to measure the defects of the trunk surface from only 3D information contained in TLS data. This final evaluation depended on the success of the three different steps involved in the process. The detection algorithm was very performant despite it relies only on a geometrical analysis targeting local protuberance. This geometrical analysis was performed with high-density 3D data, and such density requires special conditions for the acquisition, and the question of the minimal defect size detectable with lower point densities is still opened. Nevertheless, the challenge achieved by this step is to be enough sensitive to avoid forgetting defects, the counterpart was the detection of many small singularities which are not defects but bark irregularities. This is the function of the Random Forests classification step to re-examine all detected singularities and to decide, which is the most probable class

<figure><img src="image_24.png" /></figure>
of defects it corresponds to. The classification was rather suc-cessful and failed mainly for small defects but as a supervised method it is highly dependent on the quality and quantity of data in the learning database, and some improvement of the current database could be looked by structuring it not only through the biological definition of the defects, but also through size criteria, and by additional data. Then, the last step looking for character-izing each defect according to its type by relevant dimensional characteristics gave encouraging results. Nevertheless, for some flat defects like old branch scars, some inconvenience is due to the definition of the defect borders coming from their different perceptions by the algorithm or by a human operator.

Despite possible improvements, the results presented in this paper demonstrates the theoretical feasibility of using detailed 3D information for looking for rather small defects complementing the trunk shape criteria to enhance the auto-mation of grading standing trees or roundwood. Nevertheless, these results also questioned the role of the bark in industrial processes and the useful information about quality it contains.

# Appendix

## Evaluation criteria for detection and classification

The criteria used to evaluate the performance of the detec-tion and classification were the $F_1$ score (F-measure), which is the harmonic mean of the precision (P) and the recall (R). The $F_1$ score of the classification result for each type is computed from the precision and the recall as follows:

$$F_1 = \frac{2PR}{P + R}$$

$$P = \frac{TP}{TP + FP}$$

$$R = \frac{TP}{TP + FN}$$

where TP, FP, and FN are true positive, false positive, and false negative respectively. Their definition is as follows:

* TP is the number of actual defects correctly classified as defect.

* FP is the number of non-defects incorrectly classified as defect.

* FN is the number of actual defects incorrectly classified as non-defect.

The overall F-measure ($F_{\mu}$) is computed from the aver-aged precision ($P_{\mu}$) and recall ($R_{\mu}$) (Manning et al. 2008) by the following equations:

$$F_{\mu 1} = \frac{2P_{\mu}R_{\mu}}{P_{\mu} + R_{\mu}}$$

$$P_{\mu} = \frac{\sum_{i=1}^{l} TP_{i}}{\sum_{i=1}^{l} (TP_{i} + FP_{i})}$$

$$R_{\mu} = \frac{\sum_{i=1}^{l} TP_{i}}{\sum_{i=1}^{l} (TP_{i} + FN_{i})}$$

where $TP_i$ and $FP_i$ are the true and false positive of class i (defect type i) respectively.

**Acknowledgements** We would like to thank Bertrand Kerautret, Isabelle Debled-Rennesson, and Alexandre Piboule for their support in the development of the algorithms. We would also like to thank Florian Vast for providing technical support and for scanning and measuring the trees used in this research and the anonymous reviewers for their constructive reviews.

**Funding** This work was supported by a grant overseen by the French National Research Agency (ANR) as part of the “Investissements d’Avenir” program (ANR-11-LABX-0002-01, Lab of Excellence ARBRE), and by the Grand-Est (ex-Lorraine) Region.

**Data availability** The datasets generated during and/or analyzed during the current study are available on the Data INRAE repository (https://doi.org/10.15454/EOBUM0).

## Compliance with ethical standards

**Conflict of interest** The authors declare that they have no conflict of interest.

## References

AFNOR (1997) EN 1316-1 - Hardwood round timber - Qualitative classification - Part 1: Oak and beech

Bailey BN, Mahaffee WF (2017) Rapid, high-resolution measurement of leaf area and leaf orientation using terrestrial LiDAR scanning data. Meas Sci Technol 28:064006. https://doi.org/10.1088/1361-6501/aa5cfd

Béland M, Widlowski J-L, Fournier RA et al (2011) Estimating leaf area distribution in savanna trees from terrestrial LiDAR measurements. Agric For Meteorol 151:1252-1266. https://doi.org/10.1016/j.agrformet.2011.05.004

Bienert A, Hess C, Maas H, Von Oheimb G (2014) A voxel-based technique to estimate the volume of trees from terrestrial laser scanner data. Int Arch Photogramm Remote Sens Spat Inf Sci 40:101

Bradski G (2000) The OpenCV Library. Dr Dobbs J Softw Tools

Breiman L (2001) Random forests. Mach Learn 45:5-32

Breiman L, Friedman J, Stone CJ, Olshen RA (1984) Classification and regression trees. CRC press
Brolly G, Kiraly G (2009) Algorithms for stem mapping by means of terrestrial laser scanning. Acta Silv Lignaria Hung 5:119–130

Carpenter RD, Jones M (1989) Defects in hardwood timber. US Department of Agriculture, Forest Service

Cifuentes RM, Zande DV der, Salas CM et al (2017) Modeling 3D canopy structure and transmitted PAR using terrestrial LiDAR

Colin F, Mechergui R, Dhôte JF, Fontaine F (2010) Epicormic ontogeny on Quercus petraea trunks and thinning effects quantified with the epicormic composition. Ann For Sci 67:813–813

Colin F, Mothe F, Freyburger C et al (2010) Tracking rameal traces in sessile oak trunks with X-ray computer tomography: Biological bases, preliminary results and perspectives. Trees - Struct Funct 24:953–967. https://doi.org/10.1007/s00468-010-0466-1

Dassot M, Colin A, Santenoise P et al (2012) Terrestrial laser scanning for measuring the solid wood volume, including branches, of adult standing trees in the forest environment. Comput Electron Agric 89:86–93. https://doi.org/10.1016/j.compag.2012.08.005

DGtal DGtal: Digital Geometry tools and algorithms library

Fonseca MA (2005) The measurement of roundwood: methodologies and conversion ratios. CABI

Friedman JH, Bentley JL, Finkel RA (1977) An algorithm for finding best matches in logarithmic expected time. ACM Trans Math Softw 3:209–226. https://doi.org/10.1145/355744.355745

García M, Danson FM, Riano D et al (2011) Terrestrial laser scanning to estimate plot-level forest canopy fuel properties. Int J Appl Earth Obs Geoinformation 13:636–645

Gough B (2009) GNU scientific library reference manual. Network Theory Ltd.

Henning JG, Radtke PJ (2006) Detailed stem measurements of standing trees from ground-based scanning lidar. For Sci 52:67–80

Holopainen M, Vastaranta M, Kankare V et al (2011) Biomass estimation of individual trees using stem and crown diameter TLS measurements. ISPRS-Int Arch Photogramm Remote Sens Spat Inf Sci 3812:91–95

Hopkinson C, Chasmer L, Young-Pow C, Treitz P (2004) Assessing forest metrics with a ground-based scanning lidar. Can J For Res 34:573–583

Hu MK (1962) Visual pattern recognition by moment invariants. IRE Trans Inf Theory 8:179–187

Huang H, Li Z, Gong P et al (2011) Automated methods for measuring DBH and tree heights with a commercial scanning lidar. Photogramm Eng Remote Sens 77:219–227

Jourez B, de Wauters P, Bienfait O (2010) Le classement des bois feuillus sur pied. Silva Belg 117:1–12

Kerautret B, Krähenbühl A, Debled-Rrennesson I, Lachaud JO (2016) Centerline detection on partial mesh scans by confidence vote in accumulation map. In: Pattern Recognition (ICPR), 2016 23rd International Conference on. IEEE, pp 1376–1381

Kretschmer U, Kirchner N, Morhart C, Spiecker H (2013) A new approach to assessing tree stem quality characteristics using terrestrial laser scans. Silva Fenn 47:1–14. https://doi.org/10.14214/sf.1071

Kwak DA, Cui G, Lee WK et al (2014) Estimating plot volume using LiDAR height and intensity distributional parameters. Int J Remote Sens 35:4601–4629

Liang X, Kankare V, Yu X et al (2014) Automated stem curve measurement using terrestrial laser scanning. IEEE Trans Geosci Remote Sens 52:1739–1748

Maas HG, Bienert A, Scheller S, Keane E (2008) Automatic forest inventory parameter determination from terrestrial laser scanner data. Int J Remote Sens 29:1579–1593

Manning CD, Raghavan P, Schütze H (2008) Introduction to information retrieval. Cambridge University Press, p 280

McCullough DG, Heyd RL, O'Brien JG, Marquette M (2005) Biology and management of beech bark disease. Mich State Univ Ext Bull E-2746

Meadows JS, Burkhardt E (2001) Epicormic branches affect lumber grade and value in willow oak. South J Appl For 25:136–141

Moorthy I, Miller JR, Hu B et al (2008) Retrieving crown leaf area index from an individual tree using ground-based lidar data. Can J Remote Sens 34:320–332

Moskal LM, Zheng G (2012) Retrieving forest inventory variables with terrestrial laser scanning (TLS) in urban heterogeneous forest. Remote Sens 4:1–20

Nguyen VT, Kerautret B, Debled-Rrennesson I et al (2016a) Segmentation of defects on log surface from terrestrial lidar data. In: Pattern Recognition (ICPR), 2016 23rd International Conference on. IEEE, pp 3168–3173

Nguyen VT, Kerautret B, Debled-Rrennesson I et al (2016b) Algorithms and implementation for segmenting tree log surface defects. In: International Workshop on Reproducible Research in Pattern Recognition. Springer, pp 150–166

Nguyen VT, Constant T, Kerautret B et al (2020) A machine-learning approach for classifying defects on tree trunks using terrestrial LiDAR. Comput Electron Agric 171:105332. https://doi.org/10.1016/j.compag.2020.105332

Nguyen VT, Constant T, Vast F, Colin F (2020b) 3D data from T-LiDAR describing tree trunks with bark singularities, and corresponding manual measurements. Data INRAE repository, V1. https://doi.org/10.15454/EOBUM0

Norzahari F, Turner R, Lim S, Trinder J (2012) Estimating taper diameter and stem form of Pinus radiata in Australia by terrestrial laser scanning. In: 2012 IEEE International Geoscience and Remote Sensing Symposium. IEEE, pp 6491–6494

Noyer E, Fournier M, Constant T et al (2019) Biomechanical control of beech pole verticality (Fagus sylvatica) before and after thinning: theoretical modelling and ground-truth data using terrestrial LiDAR. Am J Bot 106:187–198. https://doi.org/10.1002/ajb2.1228

Olofsson K, Holmgren J, Olsson H (2014) Tree stem and height measurements using terrestrial laser scanning and the RANSAC algorithm. Remote Sens 6:4323–4344

Pfeifer N, Winterhalder D (2004) Modelling of tree cross sections from terrestrial laser scanning data with free-form curves. Int Arch Photogramm Remote Sens Spat Inf Sci 36:W2

Pitkänen TP, Raumonen P, Kangas A (2019) Measuring stem diameters with TLS in boreal forests by complementary fitting procedure. ISPRS J Photogramm Remote Sens 147:294–306

Popescu SC, Wynne RH, Nelson RF (2002) Estimating plot-level tree heights with lidar: local filtering with a canopy-height based variable window size. Comput Electron Agric 37:71–95

Rosin PL (2001) Unimodal thresholding. Pattern Recognit 34:2083–2096. https://doi.org/10.1016/S0031-3203(00)00136-9

Rusu RB, Cousins S (2011) 3D is here: Point Cloud Library (PCL). In: IEEE International Conference on Robotics and Automation (ICRA). Shanghai, China

Schütt C, Aschoff T, Winterhalder D et al (2004) Approaches for recognition of wood quality of standing trees based on terrestrial laserscanner data. Laser-Scanners For Landsc Assess Proc ISPRS Work Group VIII2 Freibig Ger Int Arch Photogramm Remote Sens Spat Inf Sci 36:179–182

Seidel D, Ammer C, Puettmann K (2015) Describing forest canopy gaps efficiently, accurately, and objectively: new prospects through the use of terrestrial laser scanning. Agric For Meteorol 213:23–32. https://doi.org/10.1016/j.agrformet.2015.06.006

Simonse M, Aschoff T, Spiecker H, Thies M (2003) Automatic determination of forest inventory parameters using terrestrial laser scanning. In: Proceedings of the scandlaser scientific workshop on airborne laser scanning of forests. Sveriges Lantbruksuniversitet Umeåaa, pp 252–258

Srinivasan S, Popescu SC, Eriksson M et al (2015) Terrestrial laser scanning as an effective tool to retrieve tree level height, crown width, and stem diameter. Remote Sens 7:1877–1896

Stängle SM, Brüchert F, Kretschmer U et al (2013) Clear wood content in standing trees predicted from branch scar measurements with

<figure><img src="image_25.png" /></figure>
terrestrial LiDAR and verified with X-ray computed tomography
1. Can J For Res 44:145–153

Taheriazad L, Moghadas H, Sanchez-Azofeifa A (2019) Calculation of leaf area index in a Canadian boreal forest using adaptive voxelization and terrestrial LiDAR. Int J Appl Earth Obs Geoinformation 83:101923

Thies M, Pfeifer N, Winterhalder D, Gorte BG (2004) Three-dimensional reconstruction of stems for assessment of taper, sweep and lean based on laser scanning of standing trees. Scand J For Res 19:571–581

Thomas L, Shaffer CA, Mili L, Thomas E (2006) Automated detection of severe surface defects on barked hardwood logs. Forest

Thomas L, Thomas E, others (2010) A graphical automated detection system to locate hardwood log surface defects using high-resolution three-dimensional laser scan data. In: Proceedings of the 17th Central Hardwood Forest Conference. pp 5–7

Watt PJ, Donoghue DNM (2005) Measuring forest structure with ter-
restrial laser scanning. Int J Remote Sens 26:1437–1446

Wernsdörfer H, Constant T, Mothe F et al (2005) Detailed analysis of the geometric relationship between external traits and the shape of red heartwood in beech trees (Fagus sylvatica L.). Trees 19:482–491. https://doi.org/10.1007/s00468-005-0410-y

You L, Tang S, Song X et al (2016) Precise measurement of stem diameter by simulating the path of diameter tape from terrestrial laser scanning data. Remote Sens 8:717

Yu X, Liang X, Hyyppä J et al (2013) Stem biomass estimation based on stem reconstruction from terrestrial laser scanning point clouds. Remote Sens Lett

der Zande DV, Jonckheere I, Stuckens J et al (2008) Sampling design of ground-based lidar measurements of forest canopy structure and its effect on shadowing. Can J Remote Sens 34:526–538

Authors and Affiliations

Van-Tho Nguyen¹ID · Thiéry Constant<fnref n="1" /> · Francis Colin<fnref n="1" />

<figure><img src="image_26.png" /></figure>

Van-Tho Nguyen
nguyen.vantho@outlook.com

Thiéry Constant
thiery constant@inrae.fr

Francis Colin
francis.colin@inrae.fr

<figure><img src="image_27.png" /></figure>

<footnote n="1">¹ Université de Lorraine, AgroParisTech, INRAE, Silva, 54000 Nancy, France</footnote>