+ All Categories
Home > Documents > Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Date post: 30-Dec-2016
Category:
Upload: fleur
View: 220 times
Download: 3 times
Share this document with a friend
11
Automatic knot segmentation in CT images of wet softwood logs using a tangential approach Jean-Romain Roussel a , Frédéric Mothe a,b , Adrien Krähenbühl c , Bertrand Kerautret c , Isabelle Debled-Rennesson c , Fleur Longuetaud a,b,a INRA, UMR1092 LERFoB, 54280 Champenoux, France b AgroParisTech, UMR1092 LERFoB, 54000 Nancy, France c LORIA, UMR CNRS 7503, Université de Lorraine, 54506 Vandœuvre-lés-Nancy, France article info Article history: Received 6 November 2013 Received in revised form 3 March 2014 Accepted 8 March 2014 Keywords: Computed Tomography Sapwood Knottiness Algorithm Wood quality abstract Computed Tomography (CT) is more and more used in forestry science and wood industry to explore internal tree stem structure in a non-destructive way. Automatic knot detection and segmentation in the presence of wet areas like sapwood for softwood species is a recurrent problem in the literature. This article describes an algorithm named TEKA able to segment knots even into sapwood and other wet areas by using parallel tangential slices into the log that enable to follow the knot from the stem pith to the bark. On each tangential slice, knot pith is detected, then knot diameter is estimated by analyzing gray level variations around the knot pith. A validation was performed on 125 knots from five softwood spe- cies. The CT slice resolution ranged from 0.4 to 0.8 mm/pixel with an interval between slices of 1.25 mm. Compared to manual diameter measurements performed on the same CT slices, the TEKA algorithm led to a RMSE of 3.37 mm and a bias of 0.81 mm, which is rather good compared to other algorithms working only in heartwood. Ó 2014 Elsevier B.V. All rights reserved. 1. Introduction The application of X-ray Computed Tomography (CT) to wood sci- ence and industry was investigated since many years. After the pio- neer works of Taylor et al. (1984), Funt (1985) and Funt and Bryant (1987), numerous works have been conducted to develop algo- rithms to automatically detect wood features in CT images with a special interest for knots. (Longuetaud et al., 2012) presented a review of the literature about automatic knot detection algorithms. Recent works can be added to this review: Aguilera et al. (2012) (spe- cies not specified), Breinig et al. (2012) on Norway spruce and Johansson et al. (2013) for Scots pine and Norway spruce. In overall, algorithms for knot detection and segmentation are efficient on dried wood, but a recurrent problem mentioned in the literature is the presence of wet areas generally within sapwood. For many soft- wood species, sapwood has a much higher wood density than heart- wood at fresh state (Polge, 1964) due to the higher water content of sapwood. Within fresh logs of these species, classical approaches based on gray level values are not efficient because fresh sapwood has almost the same density as knots. Aguilera et al. (2012) is the continuation of an approach based on simulated annealing in deformable contours (Aguilera et al., 2008a,b). Using deformable contours for knot segmentation is an original approach that can work in presence of sapwood. However, in the examples of their experiments, only a very small part of the knots is included within sapwood. Moreover, the segmentation pro- cess is not fully automatic since the deformable model must be man- ually initialized and the method was not statistically validated. Breinig et al. (2012) algorithm is a classical approach based on gray level thresholding. They first remove sapwood in the CT images in order to detect knots in heartwood only, based on a fixed gray level threshold corresponding to a density of 900 kg m 3 . Morphological operations are then used to improve the knot detec- tion. The algorithm was designed to work within fresh heartwood but not within sapwood. Indeed, the method shows some weak- nesses in presence of partly dried sapwood. A statistical validation was performed based on 55 knots from 55 cross-sections. The knots with very unclear border were avoided in the validation sample, which could artificially improve the accuracy results. Until now, Johansson et al. (2013) are the only ones to propose a method designed for working in heartwood and in sapwood as well. Their algorithm is the continuation of Grundberg and http://dx.doi.org/10.1016/j.compag.2014.03.004 0168-1699/Ó 2014 Elsevier B.V. All rights reserved. Corresponding author at: INRA, UMR1092 LERFoB, 54280 Champenoux, France. E-mail addresses: [email protected] (J.-R. Roussel), [email protected]. fr (F. Mothe), [email protected] (A. Krähenbühl), bertrand.kerautret@loria. fr (B. Kerautret), [email protected] (I. Debled-Rennesson), [email protected] (F. Longuetaud). Computers and Electronics in Agriculture 104 (2014) 46–56 Contents lists available at ScienceDirect Computers and Electronics in Agriculture journal homepage: www.elsevier.com/locate/compag
Transcript
Page 1: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Computers and Electronics in Agriculture 104 (2014) 46–56

Contents lists available at ScienceDirect

Computers and Electronics in Agriculture

journal homepage: www.elsevier .com/locate /compag

Automatic knot segmentation in CT images of wet softwood logsusing a tangential approach

http://dx.doi.org/10.1016/j.compag.2014.03.0040168-1699/� 2014 Elsevier B.V. All rights reserved.

⇑ Corresponding author at: INRA, UMR1092 LERFoB, 54280 Champenoux, France.E-mail addresses: [email protected] (J.-R. Roussel), [email protected].

fr (F. Mothe), [email protected] (A. Krähenbühl), [email protected] (B. Kerautret), [email protected] (I. Debled-Rennesson),[email protected] (F. Longuetaud).

Jean-Romain Roussel a, Frédéric Mothe a,b, Adrien Krähenbühl c, Bertrand Kerautret c,Isabelle Debled-Rennesson c, Fleur Longuetaud a,b,⇑a INRA, UMR1092 LERFoB, 54280 Champenoux, Franceb AgroParisTech, UMR1092 LERFoB, 54000 Nancy, Francec LORIA, UMR CNRS 7503, Université de Lorraine, 54506 Vandœuvre-lés-Nancy, France

a r t i c l e i n f o

Article history:Received 6 November 2013Received in revised form 3 March 2014Accepted 8 March 2014

Keywords:Computed TomographySapwoodKnottinessAlgorithmWood quality

a b s t r a c t

Computed Tomography (CT) is more and more used in forestry science and wood industry to exploreinternal tree stem structure in a non-destructive way. Automatic knot detection and segmentation inthe presence of wet areas like sapwood for softwood species is a recurrent problem in the literature. Thisarticle describes an algorithm named TEKA able to segment knots even into sapwood and other wet areasby using parallel tangential slices into the log that enable to follow the knot from the stem pith to thebark. On each tangential slice, knot pith is detected, then knot diameter is estimated by analyzing graylevel variations around the knot pith. A validation was performed on 125 knots from five softwood spe-cies. The CT slice resolution ranged from 0.4 to 0.8 mm/pixel with an interval between slices of 1.25 mm.Compared to manual diameter measurements performed on the same CT slices, the TEKA algorithm led toa RMSE of 3.37 mm and a bias of 0.81 mm, which is rather good compared to other algorithms workingonly in heartwood.

� 2014 Elsevier B.V. All rights reserved.

1. Introduction

The application of X-ray Computed Tomography (CT) to wood sci-ence and industry was investigated since many years. After the pio-neer works of Taylor et al. (1984), Funt (1985) and Funt and Bryant(1987), numerous works have been conducted to develop algo-rithms to automatically detect wood features in CT images with aspecial interest for knots. (Longuetaud et al., 2012) presented areview of the literature about automatic knot detection algorithms.Recent works can be added to this review: Aguilera et al. (2012) (spe-cies not specified), Breinig et al. (2012) on Norway spruce andJohansson et al. (2013) for Scots pine and Norway spruce. In overall,algorithms for knot detection and segmentation are efficient ondried wood, but a recurrent problem mentioned in the literature isthe presence of wet areas generally within sapwood. For many soft-wood species, sapwood has a much higher wood density than heart-wood at fresh state (Polge, 1964) due to the higher water content ofsapwood. Within fresh logs of these species, classical approaches

based on gray level values are not efficient because fresh sapwoodhas almost the same density as knots.

Aguilera et al. (2012) is the continuation of an approach based onsimulated annealing in deformable contours (Aguilera et al.,2008a,b). Using deformable contours for knot segmentation is anoriginal approach that can work in presence of sapwood. However,in the examples of their experiments, only a very small part of theknots is included within sapwood. Moreover, the segmentation pro-cess is not fully automatic since the deformable model must be man-ually initialized and the method was not statistically validated.

Breinig et al. (2012) algorithm is a classical approach based ongray level thresholding. They first remove sapwood in the CTimages in order to detect knots in heartwood only, based on a fixedgray level threshold corresponding to a density of 900 kg m�3.Morphological operations are then used to improve the knot detec-tion. The algorithm was designed to work within fresh heartwoodbut not within sapwood. Indeed, the method shows some weak-nesses in presence of partly dried sapwood. A statistical validationwas performed based on 55 knots from 55 cross-sections. Theknots with very unclear border were avoided in the validationsample, which could artificially improve the accuracy results.

Until now, Johansson et al. (2013) are the only ones to propose amethod designed for working in heartwood and in sapwood aswell. Their algorithm is the continuation of Grundberg and

Page 2: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56 47

Grönlund (1992) works. The algorithm is also based on images ofconcentric surfaces (CS) or cylindrical shells within the logs, fol-lowing approximately annual rings. The main difference is thatJohansson et al. (2013) have applied their algorithm on images oflower resolution than classical CT images obtained from medicalscanners. The objective was to process images like the ones whichwould be obtained by a high speed industrial CT scanner. The knotdetection is based on 10 CS with a minimum of five CS in heart-wood. CS are thresholded in order to detect high density objectsand then ellipses are fitted on these objects. Ellipses which canbe matched through at minimum three consecutive heartwoodCS are assumed to correspond to knots. Regression models for sizeand location of knots are fitted from the detections in heartwoodand they are then used to generate sub-images in sapwood CS sup-posed to contain the knots. Computation of gray level standarddeviations in rows and columns in these sub-images confirm ornot the presence of a knot. If a knot is present they ‘‘try to findthe position and size of it in the sub image using morphologicaldilation’’. This last step is not detailed. Since the authors write thatthe detection in sapwood succeeds only for ‘‘knots that have higherdensity than the surrounding sapwood’’, it may be supposed thatknots are detected and measured by gray level thresholding. Givenour images, a method based on a threshold could fail in manycases.

This paper presents an algorithm – named TEKA – designed forknot segmentation into wet logs in which sapwood can have a den-sity similar to knot density. We chose to focus on the segmentationstep. That means that we started from already defined ‘‘knotareas’’, i.e., angular sectors, radius range and slice interval framingeach knot. TEKA is then able to separate the knot from sapwood ormoisture areas within each knot area. Indeed, in our approach, we

Fig. 1. Illustration of one CT slice per log in order to visualize some knots and the sapwofirst letters of the log names identify the species, the following digit identifies the tree,

have assumed that detection (i.e., localization of knot areas) andsegmentation (i.e., segmentation of the knot within each knot area)were two different steps. The algorithm could plug after any exist-ing software able to achieve the detection step and to define knotareas.

Starting from a knot area, TEKA uses an original approach bylooking at the log in a tangential view rather than the classicaltransversal view (i.e., CT slices or cross-sections). A tangentialimage is orthogonal to the CT slices and tangential with regard toannuals rings. Grundberg and Grönlund (1992) followed byJohansson et al. (2013) already presented a quite similar approachbut based on concentric surfaces centered on the log pith (seeabove). The main difference is that our segmentation method isbased on knot pith detection and analysis of gray level variationsaround the knot pith rather than on classical image thresholding.Furthermore, it was designed for working as well in heartwoodand in sapwood. Validation results obtained on five softwood spe-cies are provided and discussed hereafter.

2. Materials and methods

2.1. Sampling

We developed and validated the algorithm based on 125 knotsfrom 16 wet logs (12 trees) of five softwood species: four Douglas-fir logs (25 knots), three silver fir logs (29 knots), three Europeanlarch logs (26 knots), three Scots pine logs (20 knots) and threeNorway spruce logs (25 knots). Logs were provided by Siat Braunsawmill (France).

The diameters of the logs ranged from 12 to 27 cm with a sap-wood ratio ranging from 24% to 62% of the log radius.

od, as well as to obtain an information about the moisture content of logs. The threethe last letter indicates the stem bottom (B) or top (T).

Page 3: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Fig. 2. Transversal, radial and tangential sections for the five softwood species (knots DOU-1-T-58, FIR-1-T-278, LAR-4-T-96, PIN-2-T-96 and SPR-3-T-301. The knot numbersinclude the log name followed by a slice number).

48 J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56

Before being transported to the laboratory, the logs were storedduring 1 to 5 months under water sprinkling on the log yard. Inconsequence, the moisture content of logs could be variable: fromfresh, with an entire sapwood visible in CT images, to partly air-dried, with a sapwood that could have partly dried in some areas(Fig. 1). The algorithm was designed to be able to process all therange of drying states which may be encountered in a sawmill.

The knots have been selected manually trying to be representa-tive of the usual sizes for each species. The range of knot diameters(maximal diameter of the knot along its radial profile) of our sam-ple was 5.6 mm to 42 mm with an average of 19 mm. We selectedonly knots originating from the pith and ending close to the bark.Fig. 2 shows transverse, radial and tangential cross-sections ofsome of the sampled knots.

2.2. CT scanning

The logs were analyzed using a medical CT scanner (Bright-Speed Excel by GE Healthcare). Stacks of 512 � 512 pixels imageswere obtained. Image thickness and interval between two imageswere 1.25 mm. The pixel width (w) ranged between 0.4 and0.8 mm/pixel depending on the log diameter.

2.3. Manual detection and measurement of knots

For the validation of our algorithm, each knot was manuallydescribed with the Gourmands plug-in (Colin et al., 2010) for

ImageJ software (Schneider et al., 2012). This tool allows the userto browse the stack of images and place markers on the knot bor-ders. Two lines of markers have to be placed on both sides of eachknot. The knot diameter in the direction tangential to the annualgrowth rings of the log is assessed by computing the distancebetween the two lines. The middle line defines the knot trajectory.For each knot, 11 values of knot local diameters and trajectorypoints were recorded every 10% of the knot length from the logpith to the bark. The maximum of the 11 local diameters of eachknot was also recorded.

Here-after, it will be assumed that the trajectory pointscorrespond to the knot pith location. This is probably correct inthe tangential direction but less true in the vertical direction (i.e.,along the main log axis) if the pith is not vertically centered.

A repeatability test based on 44 randomly chosen knots wasperformed to evaluate the accuracy of the human measurements.The knots were measured twice by the same operator. The rootmean square deviations between both set of measurements were1.4 mm for the maximal diameter, 2.1 mm for the local diameter,5.1 mm for the vertical pith coordinate and 0.7 mm for thehorizontal pith coordinate.

2.4. Automatic knot segmentation algorithm

The TEKA algorithm, written in Java language as a plug-in forImageJ software, works with stacks of tangential images (i.e.,images sliced tangentially to annual growth rings). We have

Page 4: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Fig. 3. Illustration of the tangential reslicing method (log DOU-1-B). Parallel red lines correspond to the planes used for reslicing. (For interpretation of the references to colorin this figure legend, the reader is referred to the web version of this article.)

J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56 49

resliced the original stack of CT images (cross-section slices orthog-onal to the main log axis) to produce stacks of tangential images ofthe knots from the log pith to the bark (Fig. 3). This step was per-formed using an ImageJ macro taking as input a radial line passingthrough the knot, manually drawn by the operator. The tangentialimages were produced with a pixel size w equal to the pixel size ofthe original CT slices. The distance between two tangential imageswas also fixed to w.

The TEKA plug-in delivers knot radius and knot pith coordinatesfor each tangential image. Segmented images of the knot are alsodelivered to visualize the results.

2.5. Statistical validation

We have compared the automatic diameter measurements(based on the radii provided by TEKA) and the automatic knot pithdetections to the diameters and knot centers measured manually.The comparison was made for each knot at 11 positions by interpo-lating the data to get manual and automatic measurements every10% of the knot length. In total, since the first knot diameter is null,1250 diameters and 1375 coordinates were compared (125knots � 10 or 11 measurements per knot).

For allowing to compare the accuracy of the algorithm in heart-wood and sapwood, the stacks of tangential images were reviewedto decide for each knot at which image occurred the transitionfrom heartwood to sapwood. In total, 589 measurements over1250 (47%) were attributed to sapwood.

The statistical software R (R Development Core Team, 2011)was used for statistical validation. The statistical values that werecomputed are: root mean square deviation (RMSD) and error(RMSE), mean absolute error (MAE), r-square (R2) and mean bias(computed as the mean of (automatically measured values �man-ually measured values)).

3. Description of the segmentation algorithm

The TEKA algorithm can be divided into three main steps:

Step 1: Knot pith detection.Step 2: Knot diameter measurement.Step 3: Post-processing.

1 The values of the setting parameters used for testing the algorithm are given inSection 3.4.

Steps 1 and 2 are processed on each tangential image (after res-licing the original CT images, see Fig. 3) whereas step 3 concernsthe whole profile.

3.1. Step 1: knot pith detection

The PithExtract algorithm initially presented by Longuetaudet al. (2004) was used. This algorithm was recently improved byBoukadida et al. (2012) and validated on a big set of 100451 CT-images, with pixel size ranging from 0.2 to 1 mm. PithExtract isbased on a Sobel edge detection, where edges correspond here tothe border of the knot cross-section, and the Hough accumulationprinciple. The pith detection is robust even with partial informa-tion, noise or ellipticity.

3.2. Step 2: knot diameter measurement

TEKA computes the knot radius on each tangential slice in twosub-steps:

3.2.1. Sub-step 1: polar elliptic transformation centered on the knotpith

It was assumed that knots have circular shapes on cross-sec-tions oriented orthogonally to the knot pith profile. Due to the knotinclination, the knot section on a tangential plane perpendicular tothe stem cross section has an elliptical shape. For each tangentialimage, an ellipticity rate s was computed from the local verticalinclination angle a. This angle a is the discrete derivative of thevertical pith position, assuming that azimuthal deviations arenegligible:

a ¼ arctanDzDr

s ¼ R2

R1¼ cos a

where Dr is the horizontal distance between two successive tangen-tial slices (which was here equal to the pixel width w), Dz is the cor-responding vertical deviation of the knot pith, R1 and R2 are themajor and minor radii of an ellipse.

The tangential images were first smoothed with a Gaussian blurfilter with a radius of l pixels1 in order to smooth the gray level pro-file used in Section 3.2.2.

Then, a polar elliptic transformation centered on the automati-cally detected knot pith was performed. Like polar circular trans-formation, polar elliptic transformation consists in converting the

Page 5: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Fig. 4. Example of polar transformation applied to a slice of Scots pine knot PIN-1-T-107. (a) Original tangential slice. (b) Polar circular transformation. (c) Polar elliptictransformation. The automatically detected knot pith (red cross) is the centre of the polar transformations. In the polar images, the vertical axe represents the azimuth aroundthe pith (with a one degree step) and the horizontal axe the distance to the pith. After the elliptic transformation, the knot contour appears as a rather straight vertical line,allowing to compute the radial profile of Fig. 5 (sapwood) by averaging the pixel columns. (For interpretation of the references to color in this figure legend, the reader isreferred to the web version of this article.)

50 J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56

image from cartesian to polar coordinates but by using parametricequations of ellipses rather than circles. The resolution of theresulting polar image was equal to one degree in the angular direc-tion and to w in the radial direction, where w is the pixel width onthe tangential slices.2 Fig. 4 illustrates how that elliptic transforma-tion (Fig. 4c) is more appropriate than circular transformation(Fig. 4b) to obtain a vertical pattern corresponding to the knot (onthe left of the images).

Fig. 5. Profile of mean Hounsfield units for two slices of Scots pine knot PIN-1-T-107. X-axis corresponds to the horizontal distance from the knot pith. Point A is theglobal maximum value of the profile. Point B is the first local minimum encounteredafter A. Point C is computed with Eq. (1), C abscissa giving the knot minor radius.

3.2.2. Sub-step 2: analysis of the gray level profileThe gray level profile corresponding to the mean values of each

pixel column was computed (Fig. 5). This profile f has twocharacteristics:

1. A maximum value into the knot because of knot sapwood den-sity at point AðrA; yA ¼ f ðrAÞÞ.

2. A negative derivative from point A to the end of the knot/woodtransition that occurs at point BðrB; yB ¼ f ðrBÞÞ, where the deriv-ative is 0.

Points A and B are automatically detected. rA is an underestima-tion of the ellipse minor radius whereas rB is an overestimation.The real minor radius is estimated by Eq. (1) at pointCðrC ; yC ¼ f ðrCÞÞ (Fig. 5).

The sapwood slice is shown in Figs. 4 and 6, the heartwood slice is shown in Fig. 6.

rC ¼ f�1ðyB þ bðyA � yBÞÞ ð1Þ

f�1 is the reciprocal function of f reduced to ½rA; rB� and b a param-eter included in ½0;1�.

The radius at point C corresponds to the minor radius of theellipse. The major radius is computed using the ellipticity rate s.

Fig. 6 illustrates two examples of knot segmentation into sap-wood and into heartwood.

2 Actually, the radial resolution of the polar elliptic images varied between w and ws

depending on the angular position.

3.3. Step 3: post-processing

The post-processing step was designed to improve the algo-rithm accuracy. First, outlier radii are identified and replaced bylinear interpolation. Then, the profile of knot radii is smoothed.Last, the very end of the knot profile is corrected.

3.3.1. Detection and correction of outliersSome errors might appear during the knot radius computation

when the pattern previously described was not present in the gray

Page 6: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Fig. 6. Automatic segmentation for two tangential images of Scots pine knot PIN-1-T-107. (a) Sapwood slice. (b) Heartwood slice.

J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56 51

level profile. In such a case, a large overestimation or underestima-tion of the radius was observed. For this reason, the algorithm pro-cessed to a correction of the radii identified as outliers.

To identify outliers we used a nonparametric regressionmethod. We chose the LOWESS algorithm (LOcally WEighted Scat-terplot Smoothing) created by Cleveland (1979) which is consid-ered to be resistant to outliers. We fitted the LOWESS curve onthe knot radius profile (Fig. 7a) and computed the residualsbetween model and data. The outliers are the points out of the lim-its given by ½Q 1 � k� IQR;Q3 þ k� IQR� where Q 1 and Q3 are thefirst and third quartiles respectively and IQR the inter-quartile dis-tance. The constant k was fixed to 1 by trial and error method.

Then, outliers were removed and the gaps were filled by linearinterpolation between the boundaries of the gaps (Fig. 7b).

We used the standard Java implementation of the LOWESSregression algorithm from the Common math 3.2 API.3

3.3.2. Smoothing of the knot radii profileThe knot radius at the log pith was forced to be 0. Then, the pro-

file was smoothed using an approximated Gaussian blur filter withs pixels radius. We chose the approximated Gaussian filter becauseit is simple and it better preserves local variations than a notweighted moving average. This step allows to get a continuous pro-file (Fig. 7c).

3.3.3. Extrapolation of the knot radius at the bark sideThe knot segmentation was often difficult in tangential slices

very close to the bark. For this reason, the radii estimated on thelast p percent of slices located at the bark side were deleted. Theknot end was extrapolated with a constant radius value equal tothe last valid value, still centered on the location given by the pith-Extract algorithm (Fig. 7c).

3 http://commons.apache.org.

3.4. Choice of the parameters

For testing the accuracy of the TEKA algorithm in the next sec-tion, the parameters were set empirically by trial and error methodto the following values:

� The radius l of the Gaussian blur mask applied to the imagebefore polar elliptic transformation was set to 7 pixels.� The b parameter was set to 0.75.� The percentage p of the knot length for which diameters were

extrapolated was set to 10%.� The radius s of the Gaussian blur mask for the knot radius pro-

file was set to 22 pixels.� The LOWESS regression algorithm from the Common math 3.2

API takes 3 parameters named bandwidth, robustness and accu-racy which were set respectively to 0.33, 3 and 0.� The k constant used to define the outlier diameters was set to 1.� The PithExtract parameters were set to the default values

described in Boukadida et al. (2012) except the wood/back-ground threshold (B) which was set to �300 HU rather than�700 HU.

4. Results

Figs. 8–10 show the segmentation results by TEKA for threeknots of various size and species. The three examples are visuallysatisfactory in comparison with what would be obtained by man-ual segmentation.

Table 1 summarizes the results of the comparison with manualmeasurements by species and wood compartments for the maxi-mal and local diameters and for knot pith positioning.

4.1. Accuracy of the diameter measurements

Fig. 11 shows the plot of local diameters automatically mea-sured by TEKA versus corresponding manual measurements. Allthe 1375 measurements are represented. By definition the knotdiameter at the log pith location was always 0 and thus 125 pointsare at (0,0) in the plot. Statistics were calculated by removing thesepoints which would artificially improve the results.

For local diameter measurements, RMSE was 3.37 mm, meanabsolute error was 2.26 mm, mean bias was +0.81 mm and R2

was 0.85. Fig. 12 presents the errors as a function of the positionalong the knot. Each box is made of 125 measurements from the125 knots. The accuracy of the local diameter measurements wasalmost the same everywhere in the knot although errors wereslightly higher close to the bark.

For maximal diameter, RMSE was 3.83 mm, mean absoluteerror was 2.62 mm, mean bias was +0.69 mm and R2 was 0.85.

The largest errors were obtained for Scots pine (maximal diam-eter) and Douglas fir (local diameter), the smallest errors for larchand silver fir. No difference was observed between sapwood andheartwood.

4.2. Accuracy of the knot pith position

Fig. 13 shows the absolute error made on vertical and horizon-tal pith positioning versus the relative position along the knot.Each box is made of 125 measurements from the 125 knots.

On vertical positioning, RMSE was 4.21 mm, mean absoluteerror was 2.04 mm and mean bias was �0.11 mm. R2 betweenautomatic detection and manual positioning was 0.96. For thepositions 0% and 100%, where the errors were the highest, theRMSE were 9.44 mm and 5.38 mm, respectively. Between positions10% and 90%, the RMSE ranged between 1.36 mm and 5.96 mm.

Page 7: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

(a)

(b)

(c)

Fig. 7. Post-processing steps applied to Scots pine knot PIN-1-B-33: (a) Raw data with two groups of outlier points; the red line is the LOWESS curve fitted on the data. (b)Outliers are removed and gaps are filled. (c) The profile is smoothed and the end of the profile is extrapolated. (For interpretation of the references to color in this figurelegend, the reader is referred to the web version of this article.)

Fig. 8. Automatic segmentation of a 30 mm diameter knot of Norway spruce (knot SPR-2-T-301) from the log pith (left) to the bark (right). (a) Tangential views. (b)Transversal views. (a) 89 � 102 mm. (b) 89 � 139 mm.

52 J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56

On horizontal positioning, RMSE was 1.59 mm, mean absoluteerror was 0.81 mm and mean bias was +0.05 mm. R2 betweenautomatic detection and manual positioning was 0.97. For the

positions 0% and 100%, where the errors were the highest, theRMSE were 3.31 mm and 2.49 mm, respectively. Between positions10% and 90%, the RMSE ranged between 0.47 mm and 1.94 mm.

Page 8: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Fig. 9. Automatic segmentation of a 6 mm diameter knot of Douglas fir (knot DOU-1-T-173). (a) Plane AA. (b) Plane BB. (c) Plane CC. In red the extrapolated part of the knot.(a) 59 � 71 mm. (b) 90 � 71 mm. (c) 59 � 90 mm. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Fig. 10. Automatic segmentation of a 41 mm diameter knot of Scots pine (knot PIN-1-B-33). (a) Plane AA. (b) Plane BB. (c) Plane CC. In red the extrapolated part of the knot.(a) 82 � 163 mm. (b) 135 � 163 mm. (c) 82 � 135 mm. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of thisarticle.)

Table 1Main statistics on diameter measurements and pith positioning by species and wood compartment.

Maximal diameter Local diameter Vertical position Horizontal position

Na RMSE (mm) Mean bias (mm) R2 RMSE (mm) Mean bias (mm) R2 RMSE (mm) Mean bias (mm) R2 RMSE (mm) Mean bias (mm) R2

Douglas-fir 25 3.44 +0.14 0.91 4.40 +0.96 0.79 2.64 �0.29 0.99 0.93 0.00 0.99Silver fir 29 2.61 +1.27 0.67 2.43 +1.19 0.70 2.34 �0.14 0.91 1.67 �0.10 0.88European larch 26 1.83 �0.18 0.94 2.10 +0.63 0.93 6.05 +0.53 0.80 1.39 +0.23 0.96Scots pine 20 5.70 +2.25 0.75 4.34 +2.04 0.85 6.09 �1.18 0.97 2.22 +0.17 0.89Norway spruce 25 4.91 +0.22 0.64 3.28 -0.56 0.81 2.77 +0.28 0.94 1.60 �0.02 0.95

All sapwood 125 – – – 3.63 +0.57 0.86 3.40 +0.52 0.98 1.56 +0.13 0.97All heartwood 125 – – – 3.12 +1.03 0.80 4.73 �0.58 0.92 1.61 �0.02 0.97

All species 125 3.83 +0.69 0.85 3.37 +0.81 0.85 4.21 �0.11 0.96 1.59 +0.05 0.97

a N is the number of knots. The number of observations is N for maximal diameter, N � 10 for local diameter and N � 11 for vertical and horizontal positions.

J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56 53

The largest errors were obtained for Scots pine, the smallesterrors for silver fir (vertical position) and Douglas fir (horizontalposition). No difference was observed between sapwood andheartwood.

5. Discussion

Regarding the accuracy of our algorithm, the observed errors onlocal knot diameter (3.37 mm) and pith position (4.21 mm verti-cally and 1.59 mm horizontally) were in the same order as the rootmean square differences between two repetitions of manual

measurements (2.13 mm for diameter, 5.12 mm vertically,0.73 mm horizontally). Considering moreover that the knot pithwas not really measured manually but estimated through thecenter line of the knot, this result is really satisfactory.

The pith positioning errors were bigger vertically than horizon-tally. It is probably due to the uncertainty of the manual measure-ments which is also bigger vertically than horizontally. It can alsobe related to the voxel size of the initial CT images (1.25 mmvertically, 0.36–0.81 mm horizontally) even if no effect of voxelhorizontal size was observed on RMSE.

The pith positioning errors were bigger close to the log pith andclose to the bark. Close to the log pith the knots are very small,

Page 9: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

Fig. 11. Comparison between automatic and manual measurements of local diameters (left side) and maximal diameters (right side). Diagonal lines show the y ¼ x lines.

Fig. 12. Error on local diameter measurement as a function of the relative distancealong the knot. The circles identify the points out of 1.5� the interquartile range.Relative position 0 corresponds to the log pith and 100% to the log bark.

Fig. 13. Absolute error on vertical and horizontal pith positioning as a function ofthe relative distance along the knot. The circles identify the points out of 1.5� theinterquartile range. Relative position 0 corresponds to the log pith and 100% to thelog bark; two outliers with vertical errors of 76 and 46 mm are not visible.

54 J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56

with a fuzzy shape and very few edge pixels can be used by PithEx-tract algorithm to find the pith. Furthermore, other knots of thesame whorl might appear in the images and lead to detectionerrors. At the other side, the external knot end is often perturbedby bark, resin pockets or other complications which increasedthe detection errors. Moreover, some of the tested knots whichended just before the bark led to incorrect results.

For comparison purposes, Breinig et al. (2012) gave a RMSE of4 mm, a bias of 1.7 mm and a R2 of 0.68 based on 119 knot mea-surements in heartwood only and for Norway spruce.Longuetaud et al. (2012) provided validation results based on365 knots from Norway spruce and silver fir detected into driedlogs without any sapwood problem on the images. For the maxi-mum diameter measurements, they obtained a RMSE of 3.4 mm,a bias of �1.8 mm and a R2 of 0.87. TEKA run into the same orderof error but works into sapwood.

About Johansson et al. (2013) algorithm, the only one in theliterature dealing with knots included into sapwood, the authors

presented slightly higher errors (RMSE for local diameter of4.7 mm for pine, 5.1 for spruce) which can be due to the lowerresolution of their images. Nevertheless, the errors cannot be com-pared directly to those of Table 1 since they applied a geometricmodel (in the form / ¼ Aþ B � r1

4 where r is the distance to the pithand / is the conic angle from pith to the local diameter) both to theoutputs of their algorithm and to the reference measurements.With applying the same model to our data we obtain significantlylower RMSE of 3.6 mm for pine and 3.0 mm for spruce.

In the literature, some authors (Breinig et al., 2012; Nordmark,2003; Andreu and Rinnhofer, 2003; Oja, 2000) validated their algo-rithm by comparison with manual measurements made on realboards or cross-sections. Instead, we decided to validate our algo-rithm by comparison with manual measurements on CT images(like Longuetaud et al., 2012; Johansson et al., 2013) and not onreal wood samples. The reason of our choice is that the comparisonbetween knot borders visible on color images (i.e., based on woodcolor variations) and on corresponding CT images (i.e., based on

Page 10: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56 55

wood density variations), although very interesting, is a distinctproblem, totally independent of the algorithm performance, andwhich should be studied separately. One reason for studying thecorrespondence between the knot borders based on color andwood density variations is that current grading rules are definedbased on knot sizes measured on real boards.

To distinguish between sound and dead knots or betweensound and dead parts of knots based on CT images is not an easytask since the pattern of annual rings around knots is not alwaysclearly visible, especially within sapwood where the moisture con-tent is high. Based on our knot segmentation, another way to esti-mate the position of the limit would be to check the knot diameterprofile radially and to put the limit where the knot has stopped itsgrowth. However, it would not be very accurate because there is aperiod of time during which the knot does not grow anymore (oralmost anymore) but is still sound. Some authors mention a periodof decline between eight and ten years during which the knot isstill alive but without growing (e.g., Dietrich, 1973; Kershawet al., 1990; Colin, 1992). Johansson et al. (2013), assuming thatthe dead knot border is located at the maximal knot diameter,obtained a RMSE of 12 mm for the position of the border with aR2 of 0.19 based on 65 knots of Scots pine. In the literature, veryfew studies provide validation results about the detection of thedead knot border and the results are in overall not satisfactory.Moreover, Johansson et al. (2013) mention that in order to accu-rately estimate product value, it is more valuable to improve diam-eter measurements than to improve the dead knot borderdetection.

In addition to wet sapwood, another similar problem is thepresence of wet heart which occurs very often in silver fir trees(Torelli et al., 2009). The reason for the presence of wet heart infir trees is not well known. Our sample included knots passingthrough wet heart (17 knots from a total of 31 fir knots) and thecorresponding results were satisfactory (although not perfect)thanks to the correction of outliers.

In this work, we made the assumption, both for manual mea-surements and in the algorithm, that knot cross-section was circu-lar. Actually, it is known that knot vertical diameter is slightlybigger than knot horizontal diameter (measurements in axes per-pendicular to the longitudinal axis of the knot). On Sitka spruce,Achim et al. (2006) found a slight difference between horizontaland vertical diameters for whorl branches but no difference forinter-whorl branches and Merkel (1967) reported a 1.057 ratiobetween diameter measured vertically and diameter measuredhorizontally for Norway spruce knots.

Five softwood species were used for the development and forthe validation of the algorithm. It was thus necessary to developa generic approach by identifying the common patterns to all thesespecies. Another approach would have been to adapt the parame-ters for each species independently. Knot characteristics are veryvariable depending on the species: size, inclination, shape, density.We have observed such differences for the five softwood speciesbased on a more complete sample of 1668 knots from six logsper species (results obtained from a Master thesis work not pub-lished). However, in the heartwood, knots appeared denser thannormal surrounding wood for all the five softwood species and inthe sapwood the low density band around knots was present, withvarying intensity, for all the species.

We are not able to biologically explain the occurrence of a lowdensity band around knots. Is this phenomenon due to a differencein moisture content or in wood density? This question should befurther studied. The visibility of this band is related to the wooddensity within the band, the width of the band and the resolutionof the CT images. It would be interesting to decrease the resolutionof images in order to find the limit above which the band remainsvisible.

More generally, the question of the image resolution has to bediscussed. In the present paper, the images were provided by amedical CT scanner and the resolution could be considered as rel-atively high. Our first objective was knot measurements for scien-tific purposes. In an industrial context, the longitudinal resolutionwould probably be about 1 image every 1 cm and the transversalresolution would be in the order of 1 mm/pixel. The impact of alow longitudinal resolution will be different depending on the spe-cies due to the species-specific knot inclination and knot size. Forexample, some species like fir have almost horizontal and smallbranches whereas branches are much bigger and more inclinedfor pine trees. As a consequence, a knot from fir will be presenton a very few number of consecutive images, often only on oneimage, which will limit the 3D reconstruction of knots. In the liter-ature, Johansson et al. (2013) explain that they have simulated lowresolution images from images provided by a medical CT scannerin order to be comparable with the industrial context. However,they do not explain how they have decreased the resolution andwhat is the final transversal resolution of the images (the longitu-dinal resolution is 1 image every 1 cm) on which the algorithm hasto work. In our eyes, a low longitudinal resolution and a lack of 3Dsupport for knots is more limiting than a low transversal resolu-tion. Nevertheless, the algorithm should work accurately on thebiggest knots (several centimeters of diameter) which are the mainconcern for structural uses. We also could expect that the resolu-tion will not be limiting anymore in the near future due to techno-logical improvements regarding the next generations of industrialCT scanners.

The algorithm was implemented as an ImageJ plug-in pro-grammed in Java language without any optimization concern. Itwas applied here to CT images obtained with a medical scanner.Before envisaging online application in industrial conditions fur-ther work is needed:

� The processing time must be reduced. It should be relativelyeasy since the algorithm does not require any very timeconsuming operation and could work in parallel on severalknots.� The effect of reducing image resolution on the accuracy of mea-

surements has to be tested.

Another needed improvement would be the detection of theknot end. In the present work, all the knots were reaching the bark.It would be possible to find criteria to estimate the reliability of theknot pith and diameter detection on each transversal image. Forthe reliability of the pith detection, we could use the radial profileof the Hough accumulation value. A decrease in the accumulationat the bark side would indicate a potential problem in the detec-tion of the pith or signify that the knot is no more present at thislocation. Future implementation of the algorithm will include thisimprovement.

Weaknesses of the proposed method

� The knot pith detection is difficult and few accurate at the stempith side due to the low number of edge pixels (small diameterof the knot at this location) voting in the Hough accumulationmethod.� An extrapolation is used for estimating the diameter of the last

10% of the knot length located at the bark side.� The algorithm does not detect the knot end.� The algorithm depends on the knot detection step which should

have previously isolated each knot within a 3D sector in view ofthe segmentation step.� The algorithm is not yet optimized.

Page 11: Automatic knot segmentation in CT images of wet softwood logs using a tangential approach

56 J.-R. Roussel et al. / Computers and Electronics in Agriculture 104 (2014) 46–56

Strengths of the proposed method

� The algorithm works in the heartwood and in the sapwood.� The detection is generic and robust because it is based on the

observation of a typical pattern of density variation aroundknots and not on a fixed threshold of density which woulddepend on the species and on the moisture content. Moreoverthe algorithm works even if the low density band is only par-tially visible around the knot.� The algorithm is easy to optimize by parallelization of the pro-

cessing of each knot.

6. Conclusion

The knot segmentation algorithm named TEKA was developedbased on a tangential approach. The algorithm starts from a stackof sub-images oriented tangentially to the log annual growth rings.The stack of consecutive sub-images follows the knot radial direc-tion. After detecting the knot pith on each tangential slice, a polarelliptic transformation centered on the knot pith is applied forcomputing the profile of density from the knot pith to the normalwood surrounding the knot. The knot diameter is estimated bysearching a local minimum in the profile. This minimum seemsto correspond to the normal stem wood in heartwood and to alow density band that was observed around most of the knots insapwood.

The method was applied to a set of 125 knots from five soft-wood species: Douglas-fir, silver fir, European larch, Scots pineand Norway spruce. The accuracies of knot positions and diameterswere assessed by comparison with manual measurements. Theerrors were almost identical in heartwood and sapwood, and fewdifferences were observed between species. Compared to previ-ously published algorithms, TEKA does not seem more accuratebut works as well for sapwood and heartwood contrarily to othercomparable algorithms. Moreover, it seems robust enough to pro-cess a large range of knot morphologies and various aspects of sap-wood including more or less advanced states of drying.

A free and open source version of the TEKA algorithm wasimplemented as a plug-in4 for ImageJ. A fully automated versionwill be soon embedded in the TKDetection software5 (Krähenbühlet al., 2012a,b, 2013) which will perform the preliminary detectionstep and call TEKA for each detected knot. This tool will be used ina next future for performing a sensitivity analysis on the inputparameters and to validate the complete processing (i.e., knot detec-tion and segmentation) on a larger sampling.

Acknowledgements

We would like to thank Ets. Siat-Braun who graciously suppliedthe log samples and Charline Freyburger who performed scannermeasurements. The UMR 1092 LERFoB is supported by a grantoverseen by the French National Research Agency (ANR) as partof the ‘‘Investissements d’Avenir’’ Program (ANR-11-LABX-0002-01, Lab of Excellence ARBRE).

References

Achim, A., Gardiner, B., Leban, J., Daquitaine, R., 2006. Predicting the branchingproperties of Sitka spruce grown in Great Britain. NZ. J. Forestry Sci. 36 (2/3),246.

Aguilera, C., Sanchez, R., Baradit, E., 2008a. Detection of knots using X-raytomographies and deformable contours with simulated annealing. Wood Res.53 (2), 57–66.

4 http://www6.nancy.inra.fr/foret-bois-lerfob/Zoom-sur/Outils-pour-le-traite-ment-d-images/Tomographie-X.

5 https://github.com/akrah/TKDetection.

Aguilera, C., Sanchez, R., Baradit, E., 2008b. Internal wood inspection with activecontour using data from CT-scanning. Wood Res. 53 (4), 13–22.

Aguilera, C., Ramos, M., Sappa, A., 2012. Simulated Annealing – Advances,Applications and Hybridizations, Simulated Annealing: A Novel Application ofImage Processing in the Wood Area, InTech, pp. 91–104 (chap.).

Andreu, J.-P., Rinnhofer, A., 2003. Modeling of internal defects in logs for valueoptimization based on industrial CT scanning. In: Proceedings of the 5thInternational Conference on Image Processing and Scanning of Wood, BadWaltersdorf, Austria, pp. 141–150.

Boukadida, H., Longuetaud, F., Colin, F., Freyburger, C., Constant, T., Leban, J.-M.,Mothe, F., 2012. PithExtract: a robust algorithm for pith detection in computertomography images of wood – application to 125 logs from 17 tree species.Comput. Electron. Agric. 85, 90–98.

Breinig, L., Brüchert, F., Baumgartner, R., Sauter, U., 2012. Measurement of knotwidth in CT images of Norway spruce (Picea abies [L.] Karst.) – evaluating theaccuracy of an image analysis method. Comput. Electron. Agric. 85, 149–156.

Cleveland, W.S., 1979. Robust locally weighted regression and smoothingscatterplots. J. Am. Stat. Assoc. 74, 829–836.

Colin, F., 1992. Analyse et modélisation de la branchaison de l’épicéa commun envue de prédire la qualité de la ressource, Doctoral Thesis.

Colin, F., Mothe, F., Freyburger, C., Morriset, J.-B., Leban, J.-M., Fontaine, F., 2010.Tracking rameal traces in sessile oak trunks with X-ray computer tomography:biological bases, preliminary results and perspectives. Trees-Struct. Funct. 24(5), 953–967.

Dietrich, G., 1973. Untersuchungen über die Astbildung und NatürlicheAstreinigung der Weisstanne. Forstwirtschaftliche Forschungen, Parey, vol. 34.

Funt, B.V., 1985. A computer vision system that analyzes CT-scans of sawlogs. In:Proceedings of IEEE Conference on Computer Vision and Pattern Recognition,San Francisco, California, pp. 175–177.

Funt, B.V., Bryant, E.C., 1987. Detection of internal log defects by automaticinterpretation of computer tomography images. Forest Prod. J. 37 (1), 56–62.

Grundberg, S., Grönlund, A., 1992. Log scanning – extraction of knot geometry. In:The 1st International Seminar/workshop on Scanning Technology and imageProcessing on Wood, skelleteå, Sweden.

Johansson, E., Johansson, D., Skog, J., Fredriksson, M., 2013. Automated knotdetection for high speed computed tomography on Pinus sylvestris L. and Piceaabies (L.) Karst. Using ellipse fitting in concentric surfaces. Comput. Electron.Agric. 96, 238–245.

Kershaw, J.A., Maguire, D.A., Hann, D.W., 1990. Longevity and duration of radialgrowth in Douglas-fir branches. Can. J. Forest Res. 20 (11), 1690–1695.

Krähenbühl, A., Kerautret, B., Debled-Rennesson, I., Longuetaud, F., Mothe, F., 2012a.Knot detection in X-ray CT images of wood. In: Advances in Visual Computing.Lecture Notes in Computer Science. Springer, Berlin Heidelberg, ISBN 978-3-642-33190-9, 978-3-642-33191-6, pp. 209–218.

Krähenbühl, A., Longuetaud, F., Morisset, J.-B., Colin, F., Debled-Rennesson, I.,Kerautret, B., Mothe, F., 2012b. Knot shape assessment on various speciesthrough X-ray CT scanning. In: iUFRO Conference, Division 5, Forest Products, 8-13 Juillet, Estoril Congress Centre, Lisbon, Portugal.

Krähenbühl, A., Kerautret, B., Debled-Rennesson, I., 2013. Knot segmentation innoisy 3D images of wood. In: Discrete Geometry for Computer Imagery. LectureNotes in Computer Science. Springer, Berlin Heidelberg, ISBN 978-3-642-37066-3, 978-3-642-37067-0, pp. 383–394.

Longuetaud, F., Leban, J.-M., Mothe, F., Kerrien, E., Berger, M.-O., 2004. Automaticdetection of pith on CT images of spruce logs. Comput. Electron. Agric. 44, 107–119.

Longuetaud, F., Mothe, F., Kerautret, B., Krähenbühl, A., Hory, L., Leban, J.-M.,Debled-Rennesson, I., 2012. Automatic knot detection and measurements fromX-ray CT images of wood: a review and validation of an improved algorithm onsoftwood samples. Comput. Electron. Agric. 85, 77–89.

Merkel, O., 1967. Der Einfluss des Baumabstandes auf die Aststärke der Fichte. Allg.Forst Jagdzeitg. (138), 113–125.

Nordmark, U., 2003. Models of knots and log geometry of young Pinus sylvestrissawlogs extracted from computed tomographic images. Scand. J. Forest Res. 18,168–175.

Oja, J., 2000. Evaluation of knot parameters measured automatically in CT-images ofNorway spruce (Picea abies (L.) Karst.). Holz als Roh- und Werkstoff 58 (5), 375–379.

Polge, H., 1964. Délimitation de l’aubier et du bois de coeur par analysedensitométrique de clichés radiographiques. Ann. Sci. Forest. 21, 605–623.

R Development Core Team, 2011. A Language and Environment for StatisticalComputing. R Foundation for Statistical Computing, Vienna, Austria. URL<http://www.R-project.org/>, ISBN 3-900051-07-0.

Schneider, C., Rasband, W., Eliceiri, K., 2012. NIH image to ImageJ: 25 years of imageanalysis. Nat. Methods (9), 671–675.

Taylor, F.W., Wagner, J.F.G., McMillin, C.W., Morgan, I.L., Hopkins, F.F., 1984.Locating knots by industrial tomography – a feasibility study. Forest Prod. J.34(5), 42–46.

Torelli, N., Sinjur, I., Piškur, M., et al., 2009. Properties and quality of silver fir wood(Abies alba Mill.). Stud. Forestalia Slov. (135), 69–78.


Recommended