1 Introduction

Douglas-fir (Pseudotsuga menziesii (Mirb.) Franco) is a tree species recognized for its advantageous stem taper characteristic (Cardoso and Pereira 2017), durability (Blohm et al. 2014; Highley 1995), superior mechanical properties, and workability (Fahey et al. 1991). Such characteristics, in addition to the excellent growth potential under most European climate conditions (Bastien et al. 2013; Remes and Zeidler 2014), justified the establishment and spread of the species’ plantations in Europe. Forest inventories in Europe indicate that more than 52% of the Douglas-fir area is located in France, followed by approximately 23% in Germany, and around 5% in the UK (Bastien et al. 2013). Douglas-fir is regarded as a promising introduced species due to its resilience to climate change (Vitali et al. 2017), therefore being considered a plausible economic alternative to Norway spruce (Picea abies (L.) Karst.) (Kohnle et al. 2012; Vitali et al. 2017). In Germany, such characteristics led to an increase of the species’ planted area to about 19% (representing 1.7% of the total German forest area in 2012), according to the Third German National Forest Inventory (Thünen Institut 2014).

As a first step towards the optimal use and establishment of an introduced species, the research around the adaptability, impact, and production of Douglas-fir covering various aspects was undertaken in Europe. For instance, there have been a number of studies on the response of Douglas-fir to different silvicultural treatments (Hapla 1980; Hein et al. 2008b; Rais et al. 2014), applying distinct modeling approaches in different geographic regions (Hein et al. 2008a), and focusing on roundwood (Daquitaine et al. 2002; Fischer 1994; Sauter 1992; Wobst 1995) and timber quality effects (Blohm et al. 2014; Hapla 1980; Rais et al. 2014; Remes and Zeidler 2014).

Roundwood quality is the focus of foresters when managing a stand. They prioritize actions towards the minimization of features that might decrease the log value. For sawmillers the roundwood quality is also important, as it might influence the potential recovery from a log of a given size class (Bender 2006; Fischer 1994; Lowell et al. 2014). Such a quality is, however, highly influenced by irregular structural features of natural occurrence, perceived as defects from the wood technology point of view. In this context, the most negative effect is the presence of knots.

A knot is the portion of a branch embedded in the stem that usually originates at the stem pith. From there, they may present different trajectories and size distributions, in a growth process influenced by intricate spatiotemporal interactions, considering the tree vigor and its environment (Duchateau et al. 2015). Due to variations in grain angle in and around knots (Longuetaud et al. 2012), they represent a discontinuity in the uniform macroscopic wood matrix, generally leading to a loss in timber bending and tension strengths. As a consequence, knots can cause a considerable reduction in product volume (Fahey et al. 1991) and value recovery from logs (Barbour and Parry 2001; Gartner 2005), particularly when considering industrial drying and grading in the production process. With regard to knottiness, the European Standard for round timber qualitative classification DIN EN1927-3 (2008), states that Douglas-fir logs should not present sound knot diameters larger than 5 cm or dead knot diameters larger than 4 cm to be graded as B-class. Distinct knot regions (i.e., sound and dead portions) influence the roundwood quality differently, even though both lower the mechanical properties (Lowell et al. 2014) and might also decrease the aesthetic value of wood products (Nyrud et al. 2008).

Even if imprecise, information on internal defects before sawing can improve the value of the resulting sawn timber compared with a sawing process without such base data. According to Todoroki (2003), an increase in value may vary between 13% using imprecise data, and up to 26% when applying precise knowledge of the internal knot structure. The use of such information to optimize log grading, as well as the final product value, has been discussed by Berglund et al. (2013), Fredriksson (2014), and Oja et al. (2010). In addition, knot geometry data can also be employed to build knot models, which aid in stand management decision making, thus enabling the implementation of wood quality–oriented strategies earlier in the wood supply chain. Another application of knot models is to elucidate the knot development as part of tree growth (Daquitaine et al. 2002; Duchateau et al. 2013; Osborne and Maguire 2016) and to expand the results to the tree crown architecture, thus linking knot structure to crown models.

In order to obtain data on the knot structure, Koehler (1936) proposed a method in which a cross-cut is performed just above the whorl and then cut again through the knot, producing a surface where knot parameters can be manually measured. Maguire and Hann (1987) describe a similar method, but instead of cutting longitudinally through the knot, this procedure is performed almost transversally, considering the knot angular orientation. As a manual reference method, Breinig et al. (2012) cut the stem transversally through knots, using laser lines to reach the best possible cut accuracy.

In general, conventional methods for knot measurement are primarily destructive, time-consuming, and require extra attention to technical details. As an alternative, the use of computed tomography (CT) has been acknowledged, in research institutes as well as in the industry, as a powerful method to obtain information on the internal knot structure of a log (Oja 1997; Tong et al. 2013). Since the X-ray attenuation (i.e., the difference between the emitted and received energy) of an object is directly related to, among other factors, its density (Freyburger et al. 2009; Lindgren 1991), the scanning of a log will be processed into a gray-scale image, usually revealing low (dark) and high (bright) density areas. The ability to distinguish knots inside a stem depends mainly on the resolution of the image and the moisture content of the log. A review of CT scanners (Schmoldt et al. 2000), as well as research on CT scanning applied to stems, is given by Wei et al. (2011).

Different solutions have been developed to use CT images in the most efficient way. Internal quality features that are detectable to varying degrees in CT images include: moisture content zones (Cherepanova and Hansson 2012; Osborne et al. 2016), cracks (Andreu and Rinnhofer 2003; Wehrhausen et al. 2012), rot areas (Bhandarkar et al. 1999), and knots (Andreu and Rinnhofer 2003; Breinig et al. 2012; Giudiceandrea et al. 2011; Johansson et al. 2013; Longuetaud et al. 2012; Roussel et al. 2014). Longuetaud et al. (2012) also present a review of existing methods to automatically acquire the internal knot structure of a log based on CT images.

An algorithm developed for use with high-speed CT industrial scanners robustly and accurately detected knots in Scots pine (Pinus sylvestris L.) and Norway spruce (Johansson et al. 2013). This algorithm is also one of the first capable of detecting knots in both heartwood and sapwood regions. Given that the knot detection quality depends mainly on the image resolution and the settings used to detect knots, which vary from species to species, the objective of this study was to test an established knot detection algorithm (Johansson et al. 2013) on CT images of freshly cut Douglas-fir logs. The validation of the algorithm was performed by evaluating the knot detection rate in the sampled logs and the knot detection accuracy in relation to the two most commonly used reference methods (manual measurements on CT images and on physical samples).

2 Material and methods

2.1 Log sampling

Logs were cut from six 78-year-old Douglas-fir trees growing in the Forest District of Kirchzarten (8° 0′ 3″ E, 47° 56′ 16″ N), southwest Germany. The trees were felled in April 2015 and 15 logs were selected from the merchantable length range (minimum diameter of 7 cm) of these trees, sampling the different positions within the tree (Fig. 1). The mean log diameter ranged from 11 to 63 cm and the length varied from 4.1 to 5.2 m. The logs were transported to the Forest Research Institute of Baden-Württemberg (FVA) and stored in the log yard for 48 days until all the scans were concluded in June 2015. Therefore, the state of the logs was considered fresh at the time of the image acquisition.

Fig. 1
figure 1

Diameter of the 15 selected logs. In log identification, letters correspond to trees and numbers represent the ascending order of the log in the tree (from bottom to top). For each log, the butt, middle, and top diameter measurement positions are presented (distinguished by grey shades)

2.2 Knot selection and measurement

The knots were selected based on CT images, in a process that considered the knot status (sound or dead) and occurrence (internodes or in a whorl), as well as occluded knots (see Fig. 9 for an example from a pruned log). The sampling targeted an even distribution of knots from the log length; however, it did not follow any formalized randomization procedure. For knots in a whorl, the only restriction was to respect a minimum of 30° distance between knots, to avoid selecting knots too close to each other, which would result in difficulties in preparing complete knots for the physical measurements. Therefore, a maximum of four knots per whorl were sampled. Overall, the database comprised 282 knots: 152 sound knots, 130 dead knots, 79 internode knots, 145 belonged to a whorl, and 58 occluded knots. Occluded knots could be also classified as internode knots or in a whorl, but since they characterize a very particular occurrence in terms of CT detection, a separate class was considered more appropriate.

The knot measurements were performed according to three methods: an alternative and two reference methods. The alternative method being validated was a knot detection algorithm based on CT images (referred to as “CT”), an automatic and non-destructive procedure to quickly obtain knot structure characteristics. Both reference methods were susceptible to errors; however, manual measurement on physical samples (referred to as “Physical”) was considered very reliable, since it represents a direct and destructive method, and is considered a good approximation to the quality control reality in sawmills. The second reference method consisted of manual measurements performed on CT images (referred to as “Manual”), a non-destructive procedure that revealed how well the CT algorithm detects knots in CT images compared to the human eye. In addition, the comparison between both aforementioned references enabled the establishment of the uncertainty level inherent to the CT image.

In this study, the comparison between pairs of methods was performed by evaluating five descriptors of the knot structure. Such descriptors were measured either at the knot level (angular position, length, and dead knot border—DKB) or at the knot measurement point level (diameter, longitudinal position), providing one or multiple observations per knot, respectively.

2.2.1 Automated knot detection algorithm (CT)

The logs were scanned at the FVA, using the Microtec CT.LOG scanner (Giudiceandrea et al. 2011), a unique prototype, developed especially for research purposes. The machine scanned the log throughout its length, producing a series of transversal slices that, when organized in a row, form a three-dimensional virtual log. Each slice had the transversal resolution of 1.107 × 1.107 mm, and accounted for 5 mm of the log length.

A positioning system and a reference point (stem pith) were needed in order to successfully detect knots. First, the stem pith was recognized along the log length, for which a modification of the algorithm presented by Boukadida et al. (2012) was used. In the sequence, the heartwood-sapwood, sapwood-bark, and outer border were recognized by applying a smoothing filter to remove the differences between earlywood and latewood. The next step was the application of a threshold for the different responses between the regions of interest. Ultimately, interpolations of the borders were used to bridge over the presence of knots. This process was performed based on the knowledge of border recognition described by Longuetaud et al. (2007), also considering the alterations mentioned by Baumgartner et al. (2010).

The knot detection algorithm tested was originally developed for Scots pine and Norway spruce by Johansson et al. (2013). Since the present study focused on a different species than those used while designing the algorithm, a test of filter parameter configurations was necessary. Different combinations of settings for the following filter parameters were tested: radial filter (15 and 25), median filter (300 × 300 and 510 × 510 mm), number of concentric surfaces—CSs (10 and 30), and shrinkage index (20 and 40%). The best set of filter configurations for Douglas-fir was reached by visually analyzing the CT images and the results of the automatic detection (Fig. 2). Such inspection was performed for all 15 logs. The decision considered the higher knot detection rate (number of correctly detected knots) in combination with visual accuracy (how well the automatic generated ellipses fitted to the knots). Unless the value of the filter parameter was mentioned below, the parameters used in the present study were similar to the ones applied by Johansson et al. (2013).

Fig. 2
figure 2

CT image of a log showing a concentric surface (CS) at 40 mm of distance from the pith (a) and the same image providing the resulting ellipses of the automatic knot detection in orange (b). The vertical and horizontal axes are respectively the longitudinal (0 to 5 m, in slices) and angular (0 to 360°) positions. Regarding colors, the reader is referred to the digital version of this article

The algorithm started with the application of a radial filter (of 25 mm) to smooth the grey response variability due to the annual rings. From this point on, the algorithm procedures were based on CSs, which are roughly cylindrical shells at a given radial distance from the pith, approximately following the pattern of the annual rings instead of a perfect circle. The algorithm created ten CSs, from which at least five were located within the heartwood area. Since this is a region with more density contrast between knot and the surrounding wood, it was therefore easier to detect knots. In each heartwood CS, a median filter of 300 × 300 mm was used to obtain background information. Then, a threshold was applied to enhance the difference between high-density areas and the background. Subsequently, ellipses were fitted to these lighter response areas considering plausibility rules for angular orientation and size. Shrinkage of the ellipse diameter in the order of 40% was applied to compensate for an imprecise ellipse enlargement during the threshold operation. Ellipses in consecutive CSs and at a reasonable positioning from each other were combined and formed a knot unit. Thus, using the regression models presented in Table 1, each knot was parametrized and extrapolated to the sapwood area. A buffer area (big enough to ascertain the knot existence in that space) was created around the likely position of the knot in the sapwood CSs. This area delimitated a sub-image that was searched for size and position of a knot using morphological dilation (Rosenfeld and Pfaltz 1966). The parameters of the aforementioned models were then updated and given as the final output for each knot.

Table 1 Models for knot parameterization

The performance assessment of the algorithm (with the aforementioned set of filter configurations) was carried out in two steps: (1) the evaluation of the detection rate, in which the knot detection rate and false positives occurrences were counted and (2) the evaluation of the detection accuracy, in which knot descriptors (diameter, longitudinal position, angular position, length, and dead knot border—DKB) were compared with those obtained from the reference methods.

The calculation of the knot descriptors was based on the models presented in Table 1, using the output parameters (A to I) from the automatic detection process. The descriptors knot length and DKB were given directly by the parameters H and I, respectively. Both variables are measures of the horizontal distance from the pith to the point either where the knot ends (length) or where the knot dies (DKB). The latter was specifically defined as the point where the knot reaches its maximum diameter (Grönlund et al. 1995), meaning that from that point onwards (towards the bark), it will no longer increase in size, and it is therefore acknowledged as the border between the sound and dead part of a knot.

Indirectly, it was possible to obtain the other knot descriptors, such as diameter, angular position (Grönlund et al. 1995), and lengthwise position (Andreu and Rinnhofer 2003). The models presented in Table 1 considered the parameters given automatically by the algorithm and the radial position, which was fixed at 10, 20, 40, 60 mm, and every 20 mm until the knot ends. The equations were then applied, in order to generate the knot descriptors for every desired radial position within a knot. However, for the angular position, the only radial distance input was the one corresponding to the knot length, thus at the closest position to the log periphery.

The diameter output (ϕ) referred in Table 1 was taken perpendicularly to the knot pith at the determined radial position. It was primarily the measurement of an arc, corresponding to the knot size in the radial direction. Even though the difference in distance between an arc and the corresponding chord for narrow angles is rather small, in order to avoid overestimation, this output was transformed to the chord (D), a straight-line segment between the two ends of the arc (see Fig. 3a), making it more directly comparable with the other methods.

Fig. 3
figure 3

Detail of knot diameter measurements from the CT automatic detection (a), manual reference on CT images (b), and manual reference on physical samples (c). Lines in orange and brown indicate respectively the sound and dead parts of the knot automatic detection. White lines display the original automatic output (dashed, ϕ), and the measure after the transformation (full, D). Blue lines indicate the location of measurement recorded manually on CT images. Regarding colors, the reader is referred to the digital version of this article

2.2.2 Manual measurements on CT images (Manual)

The procedure started from a CT-scanned log image being filtered for pith and borders (heartwood/sapwood, sapwood/bark, and bark/outside). The pith detection and border refinement settings were identical to the ones used for the automated detection. The pith detection was a crucial marker since it defines, for instance, the angular accuracy, and consequently the accuracy of any size measurement (i.e., knot diameter). The borders were also important, not only to determine the knot length, but also to delimit heartwood and sapwood, two very different regions in terms of density response (for softwoods), especially when the log is scanned fresh.

In this method, the knot diameter output was given in both vertical (longitudinal direction) and horizontal (tangential direction) planes. When calculating the knot diameter ratio (vertical/horizontal), a mean ratio of 1.553 (SD = ± 0.41, N = 1347) was observed, as well as a decreasing ratio with increasing distance to the pith (Fig. 4). Such a pattern is directly related to the knot inclination along the radial gradient (Fig. 5). Depending on the knot inclination, the difference between the methods can be exaggerated, since they measure the same variable slightly differently (Fig. 3). Furthermore, the larger longitudinal size of the voxels, when compared to their transversal size, should also be considered, since it affects the accuracy of the measurements. Therefore, in order to compare with the other methods without incurring an overestimation of the knot diameter, it was assumed that knots were perfectly round, thus allowing the use of the horizontal diameter (Fig. 3b2). The manual measurements were taken every 20 mm of the log radius, starting at 20 mm from the stem pith. In this method, the DKB was visually identified, based on the differentiation in grey levels along the knot length, and between the knot and the surrounding wood. The distance from stem pith to sapwood-bark border was the maximal knot length recorded.

Fig. 4
figure 4

Distribution of knot diameter ratio (vertical/horizontal) measured manually on CT images along the log radius. The dashed line exemplifies a round knot instance

Fig. 5
figure 5

Illustration of the knot inclination influence on the vertical measurement of knot diameter. The knot (delineated by wheat colored lines) was exaggerated to show the contrast in size between measurements taken perpendicularly (green lines) to the knot pith (dashed line) and parallel (orange lines) to the stem pith. Regarding colors, the reader is referred to the digital version of this article

2.2.3 Manual measurements on physical samples (Physical)

The samples were obtained in the same manner as the whorl method described by Koehler (1936), independently of the type of knot. However, the sampling did not necessarily comprise all the knots in a whorl, and additional information from the CT images, such as longitudinal and angular positions, were considered prior to the cuts. Based on the full scan of the logs, a secure interval in the longitudinal direction that contained each selected knot was defined. These intervals were used to cut the logs into shorter sections (thick discs). The discs were then individually rescanned, aiming to obtain a precise angular position to cut longitudinally through the knot, thus generating the proper surface for measurement (Fig. 6).

Fig. 6
figure 6

Manual measurements on physical samples. Black arrow: clarifies the face of the cut; vertical blue line: direction of the stem pith; blue dashed lines: reference lines perpendicular to the stem pith; yellow dots: points of measurement according to the fixed radial positions; red dot: extra point of measurement representing the knot death point; white lines: direction of knot diameter measurement; yi and xi: coordinates of each point; purple lines: indicate the measurement of knot length and dead knot border (DKB); capital letters: indicate whether the respective point belongs to the dead (D) or sound (S) part of a knot. Regarding colors, the reader is referred to the digital version of this article

The measurements consisted of knot diameter (measured always perpendicular to the direction of the knot at that point), longitudinal position and status (sound/dead) at every radial position (fixed at 10, 20, 40, 60 mm, in intervals of 20 mm) through the total knot length. Additionally, the total length of the knot and the distance from the stem pith to the dead point (DKB) were recorded. The DKB was established by identifying the point of maximum knot diameter (Grönlund et al. 1995), not necessarily coinciding with the evenly spaced measurement points.

For technical reasons, it was assumed that the knots were perfectly straight (i.e., no angular variation throughout the knot length), although, in practice, such an assumption might not always hold. Therefore, the angular position was disregarded throughout the results in comparisons involving this method. Given the difficulty to cut through a knot while respecting its angular changes, all knots were carefully inspected to ensure the maximal reliability of this method. To this end, it was crucial that the knot pith was visible. Thus, measurements that were not reliable after the sawing process, either due to the knot pith absence or broken surfaces, were excluded. The number of knots and point measurements varied for each considered variable, since this exclusion was performed targeting the validity of each variable individually. Ultimately, datasets of different sizes (comprising distinct numbers of knots) were generated for each variable, considering the pairing of values of the same knot or knot position in each comparison. For instance, the points considered to evaluate knot diameter in the Physical vs. CT comparison were, at least partly, distinct from the ones included in the Physical vs. Manual comparison. An overview of the datasets is provided in Table 2.

Table 2 Descriptive statistics of each analyzed variable, based on matching pairs in each comparison. Angular position was not acquired as a variable from the physical method, hence the absence of values in comparisons 1 and 3

2.3 Data analysis

The first step in the evaluation of the algorithm was to analyze the detection rate. Therefore, the images of all 15 logs were visually inspected. The comparison between the CT-grey-level image and the results obtained with the automatic knot detection enabled the acquisition of two values: number of detected knots and number of false positive instances. Subsequently, the assessment of the knot detection accuracy was done by comparing the automatically generated data from the algorithm with results from the two reference methods (Manual and Physical). Both reference methods were also compared, to verify how well the image allows the recognition of a knot. Therefore, three comparisons were established (reference vs. alternative method): (1) Physical vs. CT; (2) Manual vs. CT; (3) Physical vs. Manual. Due to more information being available for assessment, for instance coloration and texture, the physical method was considered as the reference in comparisons 1 and 3, while the Manual method constitutes the reference in comparison 2.

Each comparison was described by the mean error and standard deviation of the errors. It was not meaningful to analyze the variable DKB, due to insufficient number of measurement points. Alternatively, the status classification of each knot as sound or dead was investigated. A confusion matrix was used to analyze the sound/dead status of the measurement points. The other variables were analyzed using two approaches: (1) the limits of agreement from Bland and Altman (2003), which determines a tangible error range in the variable’s unit and (2) the concordance correlation coefficient (Lin 1989), which provides an unbiased measure of concordance between the data’s best-fit line and the reference line (x = y). The software R 3.3.1 (R Core Team 2016) was used for data management, and the epiR package (Stevenson et al. 2018) to perform Lin’s analysis.

3 Results

The algorithm detected 1784 out of 1899 knots, which had been visually identified in the CT images of the 15 logs. Among this total, there were also 28 knots falsely detected, half of them concentrated in one top log. The observed number of knots per log varied between 79 (in a butt log, with a minimum of 15 and a maximum of 24 knots/m of log) and 180 (in a top log, with a minimum of 36 and a maximum of 58 knots/m of log) in different trees. Maximum knot diameter measured in the manual reference varied between 3.8 and 73.4 mm.

The descriptive results regarding all comparisons are presented in Table 3. Negative mean absolute errors (MAE) indicate an underestimation by the CT in comparisons 1 and 2 and by the Manual method in comparison 3. The limits of agreement of the errors (LAE) intervals delimitate the range in which the mean error of the correspondent variable is expected in 95% of the instances. The concordance values (ρc) range from − 1 to 1, which express how far the best-fit line is from the reference line x = y (closer to 1, stronger the correlation), as well as its direction (positive and negative values). This parameter can be further investigated by analyzing both scale (v) and location (u) shift parameters (Lin 1989), which indicate the contribution of each shift type in the data as it deviates from 1 and 0, respectively. Additionally, the evaluation of the parameter Cb exposes how biased is the best-fit line in comparison with the reference line x = y (closer to 1, smaller the bias).

Table 3 Summary of error measures and concordance analysis of the knot descriptors

On average, the CT detection overestimates the variables diameter, longitudinal position, and length, in contrast to both reference methods. The concordance analysis revealed values of ρc higher than 0.8 for knot diameter and angular position, and higher than 0.9 for knot length and longitudinal position, with rather small bias and shifts in both location and scale. The knot diameter spread in each comparison is presented in Fig. 7, in which the limits of agreement are also indicated. The LAE varied between comparisons, with a knot diameter accuracy range of 22.68 mm for comparison 1 (Physical vs. CT), 30.27 mm for comparison 2 (Manual vs. CT), and 17.43 mm for comparison 3 (Physical vs. Manual). With regard to the longitudinal position, comparison 1 (Physical vs. CT) had the larger LAE (Table 3), partly due to the interference of the cuts in the physical method. The difference in angular position observed in comparison 2 between Manual and CT varied approximately 7.6° (with 29° of LAE range). Figure 8 shows the distribution of the error for knot length for each comparison, in which the majority of occluded knot lengths, as well as dead knot lengths, are overestimated by the CT in both comparisons 1 and 2.

Fig. 7
figure 7

Scatter plots of the knot diameter variable. For each comparison CT vs. physical (a), CT vs. manual (b), and manual vs. physical (c), we present an alternative-versus-reference plot (1) and a Bland-Altman plot (2). Black lines represent the y = x relation on left plots and the mean difference (full) and the 95% limits of agreement (MAE ± 1.96 SDE; dashed) on right plots. Colors distinguish heartwood (red) and sapwood (black) points, while symbols distinguish status (cross: dead; triangle: sound). Regarding colors, the reader is referred to the digital version of this article

Fig. 8
figure 8

Scatter plots of the knot length variable. For each comparison, CT vs. physical (a), CT vs. manual (b), and manual vs. physical (c), we present an alternative-versus-reference plot (1) and a Bland-Altman plot (2). Black lines represent the y = x relation on left plots and the mean difference and the 95% limits of agreement (MAE ± 1.96 SDE; dashed) on right plots. Colors distinguish full (black) and occluded (blue) knots, while symbols distinguish status (cross: dead; triangle: sound). Regarding colors, the reader is referred to the digital version of this article

The confusion matrix of the status of each knot, as well as the correct classification rates (CCR) for each comparison, is summarized in Table 4, in which the number of identically sorted knots (matched between methods) is presented, both in total and by status. In both comparisons with CT, the CCR for dead knots was higher than that for sound knots. However, when looking at the comparison between references, we found the reverse to be true. The results indicate a rather low overall match (31% and 18%) between the knot status classification performed by the CT against the physical and manual methods, respectively.

Table 4 Confusion matrices of knots’ status and the correct classification rate of each comparison

4 Discussion

The algorithm identified 93.9% of all knots in the selected logs, which is within the range of 88–94% observed by Johansson et al. (2013) when applying the same algorithm to Norway spruce and Scots pine. Nonetheless, when comparing the number of false positives, the present study reports 1.5%, while the previously mentioned work reports about 1% of overdetection. Fredriksson et al. (2017) split a mixed dataset of partially dried jack pine (Pinus banksiana Lamb.) and white spruce (Picea glauca (Moench) Voss.) into logs with regular and irregular heartwood, and applied the same knot detection algorithm. They obtained detection rates (false positives) of 87.3% (1.9%) and 71.2% (4.9%) for regular heartwood groups of jack pine and white spruce logs, respectively. The knot detection rate corroborates the robustness behind the construction of the algorithm (Johansson et al. 2013) and its applicability potential to other softwood species (Fredriksson et al. 2017), especially when the logs are fresh.

According to Altman (1991), the concordance between the methods was “excellent,” since all ρc values, and even their lower confidence interval limits, were above 0.8. Nonetheless, considering the scale suggested by McBride (2005), the classification for ρc values would be as follows: under 0.9, “poor”; between 0.9 and 0.95, “moderate”; and above 0.99, “almost perfect”. However, the interpretation of these coefficients, such as Lin’s, varies among fields of study and should be analyzed in each case. Thus, in our experiment, the concordance was considered very good overall, given the aim of the study (adjust the algorithm settings to another species) and the associated errors.

The knot diameter results of comparison 3 (Manual vs. Physical) indicate an inaccuracy of 4.4 mm of the manual method (Table 3). Using manual measurements on CT images as a reference method to validate their algorithms, Johansson et al. (2013) found total diameter deviation values of 4.6 mm for Scots pine and 5.1 mm for Norway spruce. Applying the same methods, Fredriksson et al. (2017) observed an accuracy in total diameter of 4.9 mm for regular and 6.2 mm for irregular heartwood groups of jack pine and white spruce logs. The study used an image resolution of 0.605 × 0.605 × 1 mm in contrast to 1.107 × 1.107 × 5 mm applied in the present study, which may explain the observed difference in performance, aside from the different analyzed species. Using another algorithm (3DKnotDM software) to automatically detect knots in medical CT images of dried silver fir (Abies alba Mill.) and Norway spruce beams, Longuetaud et al. (2012) reported an accuracy of maximal knot diameter in the order of 2.9 mm. They report only the accuracy of the maximum knot diameter, which might be biased given that (1) it may be located in the sapwood area and (2) it is certainly not affected by the low voxel density near the stem pith. Nonetheless, it indicates a probable increase in accuracy due to dried samples and/or the usage of a higher image resolution. Unfortunately, neither condition reflects the real situation of a sawmill operation. Using the same medical scanner, Roussel et al. (2014) implemented a semi-automated tangential approach in the TEKA algorithm. In this approach, CT images and an initial input from the operator (radial line passing through the knot) are needed to establish the tangential surfaces of detection for each knot. The study analyzed, among other species, Douglas-fir fresh logs. The authors reported a knot diameter RMSE (root-mean-squared error) of 4.4 mm for the species, based on 250 measurements (25 knots). These are good indicative results, but problematic to implement in a sawmilling environment due to the long computing time and the semi-automated nature of the algorithm.

The majority of heartwood measurement points for knot diameter lie within the 95% LAE and show a tendency of overestimation in this area (Fig. 7ab), while sapwood points present a wider spread, wherein the larger number of points outside the LAE reveal a tendency of underestimation. In comparison 1 (Physical vs. CT), such behavior was likely influenced by measurement points from a few individual knots, since all knot measurements above 40 mm of physical reference diameter were underestimated by the algorithm. These knots were responsible for the curved patterns illustrated in the right portion of Fig. 7a1. A similar pattern was also observed by Johansson et al. (2013) for Norway spruce and can be attributed to the low contrast between the knot and the surrounding wood within the saturated sapwood, a problem frequently raised in the literature (Breinig et al. 2012; Fredriksson et al. 2017; Funt and Bryant 1987; Johansson et al. 2013; Longuetaud et al. 2012; Wei et al. 2009). Despite different approaches being developed to overcome this issue (Johansson et al. 2013; Krähenbühl et al. 2016; Roussel et al. 2014), it remains not completely solved. In this context, the effect of sapwood was clearly observed in two situations: (1) when the knot detection ended in the middle of the sapwood region, usually underestimating the knot diameter and (2) when the knot detection stopped right before or at the heartwood/sapwood border, normally resulting in a sound classification. Thus, incomplete knot detection, as a consequence of the wet sapwood response, is an issue that should be considered in further improvements within the algorithm.

Given the log length scale (between 4 and 5 m), the accuracy in longitudinal knot position was satisfactory. Johansson et al. (2013) observed an accuracy of 7.8 (Norway spruce) and 9.2 mm (Scots pine) for this variable, while Fredriksson et al. (2017) reported 7.03 mm for a mix of jack pine and white spruce logs with regular heartwood boundary. The probable effect of the image longitudinal resolution on the accuracy of manual measurement (especially for small knots) performed on CT images is a point Longuetaud et al. (2012) discussed, as they observed that a squared beam scanned with longitudinal resolution of 1.25 mm presented better results regarding maximal knot diameter and knot length accuracy than six other squared beams scanned with a longitudinal resolution of 3.75 mm. The accuracy of the longitudinal position of a measurement point, as well as of the overall knot diameter and consequently, the DKB, is likely influenced by the longitudinal resolution of the images.

The results for angular position showed an error of 7.6°, while analogous studies reported values of 5.1° for a mix of jack pine and white spruce (Fredriksson et al. 2017), 2.3° for Scots pine, and 1.9° for Norway spruce (Johansson et al. 2013). Although it is impossible to distinguish to which extent the accuracy in angular position found in the present study is derived from the image or the CT algorithm (absence of data from comparison 3), it can be said that results may vary according to the image resolution and species.

With regard to the knot length, we found SDE (standard deviation of the error) values of 22.4 mm (Physical vs. CT) and 23.2 mm (Manual vs. CT) for this variable. Error standard deviations of 21 mm were attributed to the use of the same algorithm to Scots pine and 29 mm to Norway spruce (Johansson et al. 2013), while values of 18.1 and 24.3 mm were found for regular and irregular heartwood (mix of jack pine and white spruce) logs, respectively (Fredriksson et al. 2017). Studies applying other algorithms reported a wide range of accuracy. For instance, Longuetaud et al. (2012) found values of SDE between 0.7 and 3.9 mm for silver fir, and between 2.1 and 3.8 mm for Norway spruce dried beams (with sufficient contrast between knots and the surrounding wood) using a medical scanner. Oja (1997) reported SDE values of 15 and 34 mm for Norway spruce logs, in comparison to knot length from the whorl and flitch methods (both physical references), respectively. The comparison between the reference methods (3) suggests that the image resolution is mainly responsible for 8.6 mm of SDE in knot length (Table 3). The wide range of deviation for the knot length was driven mostly by dead knots (Fig. 8ab). The majority of points with large deviation from the reference, in both comparisons 1 and 2, indicate an overestimation tendency by the CT. Knot repercussion was identified, based on visual investigations, as the main cause of these deviations in occluded knots. Here, knot repercussion denominates the occurrence of an area of density higher than its surroundings in the radial direction, appearing usually after an occluded knot ended. Figure 9 shows an example of how this subsequent low contrast area interferes in the automated detection of an occluded knot. These areas are likely part of the healing process of the tree, in an attempt to adjust the wood matrix in the space that will no longer be occupied by a knot. In terms of CT image, they appear as a smoothed area adjacent to the end of the knot, thus hardly distinguishable when only analyzing gray level differences. Further testing on CT filter configurations is therefore recommended to overcome such issues and improve the accuracy results in knot length detection.

Fig. 9
figure 9

Faulty knot detection due to knot repercussion. The same occluded knot is presented in the radial (a) and cross-section (b) views. Red lines represent orientation lines: in (a), it refers to the longitudinal (horizontal line) and radial position (vertical line); in (b), it refers to the angular (straight line) and radial position (circle). Orange and brown lines delimitate respectively sound and dead detected areas of a knot. Regarding colors, the reader is referred to the digital version of this article

The image itself seems to affect the identification of the DKB, evidenced by the total CCR in comparison 3 (Table 4). Concerning the comparisons against the CT, occluded knots might also have influenced the results, as these knots were mainly detected as dead, when they were in fact still sound. The problem seems to rely on the correct detection of sound knots by the CT, which reflects a deficiency by the algorithm in the identification of the maximum diameter point. However, according to Kershaw Jr. et al. (1990), Douglas-fir knots might be sound for an average of 8 (± 4.7) years with no distinguishable increment in diameter. Therefore, the classification of knot status considering only the maximum diameter, although logical, might not be the optimal approach to establish the DKB for this species.

Reference methods are not exempt from difficulties when delineating the borders of a knot (see LAE values for comparison 3 in Table 3). As also observed by Breinig et al. (2012), sound knots in physical samples that do not present a distinct border or clear differences in texture between knot and the surrounding wood matrix are extremely challenging for detection. Conversely, in manual measurements on CT images, smoothed surfaces that provide a similar response (low contrast) around knots induce errors, either by considering the smoothed area as part of the knot (overestimation) or due to conservative delineation as a consequence of the uncertainty raised by the smoothed area (underestimation)

5 Conclusions

This is the first study to test a fully automated knot detection algorithm on a substantial number of Douglas-fir samples, in comparison with two reference methods. The algorithm tested is able to provide the position of knots in Douglas-fir with satisfactory accuracy. However, when analyzing the knot diameter performance, the results show room for improvement in order to achieve an appropriate accuracy for future application in sawmills. Further development in specific areas may improve its performance, not only for the knot geometry accuracy, but also for the detection of knot length and DKB. An alternative to improve the algorithm accuracy would be to adjust it to enhance the knot diameter measurement, as this is a relevant feature as well as the basis to determine the DKB under its current definition. Based on image examination, texture information seems to be an aspect that could be added in distinct steps of the detection algorithm to improve its performance. Still, exclusively considering the tools already implemented, the intensification of concentric surfaces should reduce the radial spacing between points of data acquisition, thus improving the parametrization accuracy of the models. Hence a direct advance in, but not limited to, the knot length and DKB is expected.

In terms of reference method, physical sampling, although very time consuming and onerous in terms of material expenditures, provides a good reference to validate not only the CT detection but also the manual method. The difficulties faced when measuring knots in physical samples emphasize the importance of CT as an alternative reliable method for knot measurement acquisition. However, manual measurements on CT images are useful, given the amount of data able to be collected in the three-dimensional space, eliminating the uncertainty of the cut to obtain a viable sample. Provided that its limitations are considered or improved, the use of manual measurements on CT images as a reference method can be recommended to validate knot detection algorithms in further investigations, standardizing the images as the basis of comparison in both methods. At this point, the aim is to establish how well the image allows the recognition of specific structures. Any other source of variation would be theoretically removed, and the remaining comparison would be between the algorithm detection and the human eye. Nonetheless, it is our understanding that a link to reality should be, at some point, established for each species, either between physical and manual methods, or directly between a physical method and the automated CT detection, so that the application of such algorithms reflects the physical knot structure.