Repeatability in Automatic Sorting of Curved Norway Spruce Saw Logs

Sawn wood from curved logs is prone to have cross grain and contain compression wood, both of which affect the dimensional stability. Different types of curvature can, however, have different effects on both the sawing process and board quality, which is why a standard measure of bow height alone is not enough to sort logs or set the log quality. The aim of this study was to evaluate the repeatability when sorting curved saw logs using a 3D log scanner. In the study, 56 logs were categorized into five different curvature types and four different degrees of curvature severity. The logs were run through a Rema 3D log scanner four times, and the external geometry was recorded. From the geometry data, variables describing log shapes were calculated and used to develop models using linear discriminant analysis, which was used to classify the logs according to curvature type. The accuracy and repeatability were evaluated for the classifications with Cohen’s simple Kappa coefficient. The results of this study showed that it is possible to sort logs by curve type using a 3D log scanner, although sorting by curve type was largely dependent on curve severity. The repeatability test determined that the chance of a curved log being graded identically two consecutive times was 0.40, measured as kappa.


Introduction
The external geometry of a tree can give information about the internal wood quality.Sharp curvature often indicates internal defects such as a top failure with cross grain overgrown by compression wood, long smooth curvature indicates compression wood on the outer side of the bow and end sweep often indicates severe compression wood distributed in the lower part of the stem (Timell 1986).Logs with some type of curvature can also be subjected to process-related problems such as decreased volume recovery and decreased feeding speed at the sawmill.With 3D log scanners, currently used for diameter sorting, it is possible to obtain external geometry variables describing aspects of the curvature such as bow height, curvature sharpness and position of largest bow (Lundgren 2000).
Trees that lean or have a pronounced curvature such as sweep, crook or sinuosity, often contain compression wood (Timell 1986).Cross sections from these trees also tend to be elliptical with eccentric pith (Mork 1928, Larsson 1965, Nicholls 1982, Robertson 1991).The relation between external geometry of stems and the distribution of compression wood has been discussed by e.g.Low (1964) and Koch et al. (1990).However, even straight, vertical trees with circular boles may contain large amounts of compression wood (Low 1964).Rune and Warensjö (2002) found a strong correlation between the degree of basal sweep and compression wood content in 6-year-old Scots pine (Pinus sylvestris L.) trees.Even though there is a correlation between curvature and compression wood the yield from logs with curvature does not necessary have poorer properties than the yield from straight logs.Taylor (1996) and Wagner (2002) found that mean twist was least and bow was greatest in lumber sawn from high-sweep and double sweep Douglas-fir logs.Results that indicate that logs with sweep could produce straighter lumber than straight logs if they are curve sawn.
Several authors have tried to classify trees and logs according to their curvature (Low 1964, Dyson 1969, Taylor 1996, Gjerdrum et al. 2001).Dyson's (1969) model contained five major classes: sinuosity, bow, sweep, bends and forks.Bends and forks are examples of expressed cur-vatures that seldom reach sawmills today.Low (1964) included straight and straight but leaning in his model.Gjerdrum et al. (2001) used six classes to describe the curvature of logs: straight, end sweep, long sweep, angular crook, cross crook and multiple sweeps.The curvature that Dyson (1969) describes as bow is the same as the J-shaped described by Low (1964) and long sweep described by Gjerdrum et al. (2001).Timell (1986) describes crook as an abrupt bend, sweep as a gradual bend and bow as a gradual bend with a deviation from the vertical in two directions.Abrupt bends are strongly associated with large amounts of severe compression wood, but also bends that are more gradual are associated with compression wood formation.Abrupt bends such as cross-crook (Gjerdrum et al. 2001) are often a result of top failures and are usually caused by environmental factors such as a combination of wet snow or ice and wind (Timell 1986).It is generally agreed (Kärki and Tigerstedt 1985, Timell 1986, Giertych 1991) that stem curvature is a characteristic that can be inherited and that stem form is closely correlated with provenance (Moss 1971, Ståhl et al. 1990).Timell (1986) suggested that crook is more strongly heritable than sweep and lean, which are often caused by environmental factors such as wind or snow.
Sorting logs by type of curvature could be useful in log grading for pricing.In the Swedish log grading system (1999) logs with a bow height higher than 1% are downgraded, logs with bow in combination with compression wood get lower grade than if there only was compression wood, and logs with crook that is caused by top failure are downgraded (VMR 1999).Today measurement for pricing is done using the human eye but this is an intricate and time-consuming method.Using the available log scaling equipment to measure curvature and use these variables in the log grading would probably be efficient and more accurate than the manual estimate.
Optical shadow scanners have been used for automatic log scaling in Swedish sawmills for more than a decade (Jäppinen and Nylinder 1997).However, since the mid 90's several sawmills have started using 3D-laser scanners (Warensjö and Jäppinen 1997, Staland et al. 2002, Edlund 2004).These scanners are used for log grading as well as for optimising saw yield during sawing (Staland et al. 2002).Data from 3D scanners describe the spatial co-ordinates of the log surface at high resolution.With this kind of data it is possible to calculate geometric variables for logs, such as unevenness, taper, ovality and straightness (Lundgren 2000).Saint-Andre and Leban (2001) showed that such data could be used to estimate pith position and ring eccentricity.Variables from 3D-data have also been obtained (Lundgren 2000, Gjerdrum et al. 2001) and used to create log models based on straightness: the curvature of the log centroid was used to model the straightness.Some variables developed by Lundgren (2000) for describing straightness included sweep (bow height), angle (abruptness of bend), snake (sum of angular deviation) and number of curve.According to Gjerdrum et al. (2001) logs with sharp curvatures, that are prone to contain compression wood, can easily be detected by using these variables.Most compression wood was confirmed in butt logs with end or long sweep and in logs with a high value of the variable MRD (maximum radial deviation).MRD is correlated to the intrinsic parameter bow height (Gjerdrum et al. 2001).
Sorting logs by curvature type can be useful to avoid logs with compression wood and grain deviation, which causes warp.This can be done both during log grading for pricing and for the sawmills own process planning.The aim of this study was to evaluate the possibility of sorting curved logs based on different curvature types and evaluate the repeatability of the curvature variables and classification in curvature type.The accuracy of the sorting was compared for different severity classes and for different feeding speeds.

Material
All logs in the study were taken from a stand in eastern central Sweden (59°48´N, 17°41´E) (Table 1).The stand was chosen because of the high incidence of curved trees, which probable was an effect of environmental factors such as wind and soil type.A sample of 20 Norway spruce (Picea abies (L.) Karst.)trees representing different curvature types (Fig. 1 a-d) was chosen.The external geometry of the lowest 4 meters of the standing trees was measured using a plummet and a calliper.Trees were felled and the northern azimuth was marked on all boles.All stems were crosscut so that the maximum deviation was positioned in the middle of the logs, with the exception of the butt log in the stem.Only logs with a top diameter larger than 10 cm were used.
The logs were transported to a sawmill where the top diameter, maximum bow height, position of maximum bow height, curvature type and severity of the curvature type were measured manually or assessed at log yard.The curvature type and the severity of the curvature type were a subjective classification and there was an approximately even distribution of curve severity types within each curvature type class.Maximum bow height was measured using an elastic cord and a calliper.The log was positioned with the maximum deviation (curve) parallel to the ground and the elastic cord was attached at the centre of both log ends creating a straight line.The maximum bow height was then measured as the maximum distance between the cord and the log centroid (Fig. 3).The logs were run through a Rema 3D log scanner four times, recording the external geometry (Fig. 2) resulting in 224 sets of log shape data.During the first two runs, the feeding speed was one meter/second and for following two runs the feeding speed was increased to two meters/ second, which is the normal feeding speed during ordinary log grading.The position of the log curve was altered between measurements.The first time the curve was turned to the right and the following time it was turned to the left.For the last two runs, the direction of the log curve was random.The purpose of using different log positions and feeding speed was to evaluate if this affected the repeatability and sorting accuracy.
Data obtained from the log scanner was used to calculate variables describing different types of log curvature.These variables were originally developed for sorting Scots pine saw logs (Lundgren 2000).The calculation was made using the software Matlab 5.2.(Matlab 1998).
The logs were classified into five curvature types based on their external log geometry.The curvature types (excluding the straight curvature type) are illustrated in Fig. 1 a-d.The severity of the curve (curve severity) is a subjective estimate of the impact on product and process performance and can largely be estimated by the variable bow height.However, the severity of the curve of two logs with identical bow heights can differ substantially, e.g. a log with smooth curvature such as long sweep can be curve sawn with a relatively high volume yield compared to a log with multiple sweeps.Below are the four classes and as a comparison the bow height variation within the classes.0) Uncurved log. 1) Somewhat curved log (bow height between 0.5% and 1%).2) Curved log (bow height between 0.8% and 2%).

Curve Variables
The curve variables (below) were originally developed but not used by Lundgren (2000).To calculate the variables the coordinates of the log centroid was calculated from the coordinates of the mantle surface, this was done using Matlab (Matlab 1998) and data retrieved from the 3D log scanner.The 3D log scanner data were also used to calculate the straight line between the log end centres.The perpendicular distance between the straight line and the log centroid was used to calculate the variables.The variables were later used to develop the models to approximate the curve types.Bow height is the most important measure of curvature type and can easily be estimated using both automatic and manual methods.Bow height can be used to evaluate curve severity and is calculated as the maximum deviation between the log centroid and a straight line joining the two log end centres (Fig. 3).
Curve position was calculated as the distance from butt end to position of maximum bow height.This was related to total log length measured along a straight line combining the two log end centres (Fig. 3).The curve position was used to estimate the curvature type End Sweep.
Sum of angles is the degree of irregularity of the curvature.This is the sum of angles of the bow heights along the log, multiplied with the distances between the log centroid and the straight line joining the log end centres.The angle at a point along the straight line was calculated as the perpendicular angle between the bow height at that point and the perpendicular angle of the point of maximum bow height (Fig. 4).
Sharpness of the curve was calculated as the second differential coefficient of the log centroid at the point of maximum bow height.Number of curve was a measurement of how many time the log curves.This is the same as how many times the log centroid changes direction.This variable was later discarded from further analysis because of its discontinuous nature (Fig. 4).

Calculations
The linear models for classification of curvature type were determined with discriminant analysis.This method was preferred as there are more than two groups/classes and it has been used (Belli et al. 1993, Gjerdrum et al. 2001, Edlund 2004) in similar studies.For known groups, rules can be developed by which new observations can be classified into the same groups.Logs are therefore classified into an appropriate grade or in the grade with the least risk of misclassification.
The repeatability of the curve variables was calculated (Eq.1).The average of the standard deviations for each log in all runs was related to the variation between logs for each run.A low value of the relative repeatability meant that the variance between runs for the same log was low compared to the variance between different logs; hence, the variable was stable and probably more accurate.As it was not continuous, the variable "number of crooks" was not evaluated.The variables from the first run were used to develop curve models according to estimated curve type.The significance of the variables was  controlled using the SAS function for stepwise discriminant analysis.The variable "number of crook" was not further evaluated as it was found not significant.The SAS function for linear discriminant analysis was used to establish the linear functions for each curve type (SAS Online 1999): the linear method was chosen, as it has been proved better than PLS (Projections to Latent Structures) and logistic regression in similar studies (Edlund 2004).
Using the models, the grade (straight log, long sweep, end sweep and multiple sweep/cross crook) was set on the control logs and the agreement between the two classifications, true grading and the automatic grading, was evaluated, primarily using the simple kappa (k) coefficient (Eq.2).As kappa coefficient was chance corrected, it was preferred before the commonly used proportion of observed agreement (P 0 ), which was included in the calculations of the simple kappas.Eq. 2 shows that the kappa value was calculated by correcting the proportion of observed agreement (P 0 ) with the chance factor (P e ) (Cohen 1960).Early evaluation of the data indicated that for some logs all four automatic classifications were the same, however, this classification differed compared to the manually assessed "true" classification.The reason for this is probable the difference between how the machine and models classify curvature type.The repeatability was therefore further studied using the simple kappa.
The simple kappa coefficient can also be calculated for more than two classifications to evaluate the repeatability if the formulas for the proportion of observed agreement (P 0 ) and the chance factor (P e ) are altered (Fleiss 1971).The formula for simple kappa stays the same as in Eq. 2 and the new formulas for P 0 and P e are presented in Eqs. 3 and 4.
where the subscript i = 1,.., N represents the subjects and the subscript j = 1,..., K represents the categories of scale.The n is the number of ratings per subject.
where p •j refers to the proportion of observations placed in grade j by all gradings.
A value of P 0 may be interpreted as follows.A log is classified as a specific curve type in one of the four runs, and then classified in a second run, the first classification agrees with the second P 0 % of the classifications.When P 0 is adjusted for the chance coefficient generating Kappa the chance agreement is removed from consideration (Fleiss 1971).
To test the null hypothesis of equal kappa's, the Chi-square statistic test (Eq.5) was used, to determine if the accuracy between runs or repeatability between curve types were equal.
where h is the strata, q is the number of strata, κ h is the kappa for strata h and κ overall is the kappa for all the strata.

Results
The relative repeatability for the four variables used is shown in Table 2.The lowest and best values were calculated for bow height and curve position, these variables had the least complex algorithms.With the log data from the first run, the standardized parameter estimates for the linear discriminant functions were calculated for each log type (Table 3).Early tests indicated that it was difficult to separate the curve types multiple sweep and cross crook so these were combined into one class.
In Table 4a, the number of observations for different combinations of true curve type and predicted curve type are shown for all logs in all four runs, i.e. four times the number of logs in the study.From the data in Table 4a the simple kappa, P 0 and P e were calculated for all logs and divided into different runs and degrees of curve severity.These values are found in Table 4b along with the test for equal kappas (Q k ).The accuracy between the four different runs was similar (P = 0.60) indicating that a decrease in feed speed did not affect the accuracy.The difference in accuracy between the three different degrees of curve severity was significant (p = 0.0001).The accuracy among the least curved logs was very low (kappa = 0.13) and there was improved accuracy among the curved (kappa = 0.62) and very curved logs (kappa = 0.60).
The repeatability of the classification is shown in Table 5.The overall P 0 was 0.65 which could be interpreted as the chance for a random log classified as one curve type in one run to be classified as the same curve type the next run.When this was corrected for chance, the probability was 0.40.As expected, the curve type with the best repeatability was end sweep as this curve type was easy to distinguish.

Discussion
The results of this study confirmed that it is possible to sort logs by curve type using a 3D log scanner, which supports the findings of Gjerdrum et al. (2001).However, unlike Gjerdrum et al. (2001) the logs in this study were classified by both curve type and curve severity, and from this it was determined that accuracy in sorting by curve type was dependent on curve severity.
Curve severity was a subjective manual evaluation that could roughly be estimated by bow height.The sorting worked only for logs with a curve severity of 2 or more, that means a bow height larger than 0.8%.The repeatability test, measured as kappa, showed that the chance for a curved log to be graded identically two consecutive times was 0.40 and the repeatability for different curve types varied.The best repeatability was obtained for logs with end sweep.Similar repeatability was also expected for logs with long sweep, however, the relatively poor repeatability was probably an effect of the small average bow height.
The logs used for this study were taken from a stand with a high degree of curved stems, the percentage of curved logs was 75%.Normally the amount of curved logs at a sawmill is small and these logs will normally end up as pulpwood rather than saw logs.In an industrial implementation it could be advantageous to first separate the curved logs (bow height larger than 0.8%) from straight ones using the variable bow height.Then the logs are separated into different curvature types where the suggested model could be used.This implies that the bow height variable accurately can separate curved logs from straight logs in a large normal sample.This, however, needs to be further investigated in future studies.Logs with different curve types can be separated for different reasons depending on what kind of saw technique used, type of end products and raw material used.A sawmill that uses curve sawing can e.g.accept long sweep logs but be restrict cross crook and multiple sweep due to a higher probability of compression wood and cross grain and thereby higher probability of warp and strength loss.
Bow height and curve position are variables that are commonly used during ordinary log sorting routines.These variables can be measured both automatically and manually with good precision.The reliability in comparison with other variables tested was proved in the assessment of the relative repeatability.The variables sharpness and sum of angles were more complex and thus had lower repeatability.These variables were however necessary for the separation of logs with more complex curvature from logs with long sweep.
Discriminant analysis was used to sort logs according to developed linear classification models that calculated the probability for each curve type and log.The curve type with the highest probability was chosen.All four variables contributed to the models except number of curves, which was discarded from further analysis.The number of crooks could however be used for similar applications.The classification was evaluated with Cohen's kappa (Cohen 1960) and the kappa's for different degrees of curve severity.
Equality of curve type and runs was tested with a Chi-square test and no differences in the accuracy between different runs with different feed speed were detected.Thus, the reduced speed and thereby reduced number of measurements appeared unaffected.It can be expected that log curvature in general is less sensitive to lengthwise resolution compared to bumps and diameters, since it is a lengthwise rather than a radial property.
The logs used in this study came from one site and were not randomly selected since mostly curved trees were chosen.The positive effect of selecting trees from more sites when studying curvature was considered limited, since the aim was evaluate how well data from the 3D log scanner could be used to grade logs according to curvature and not to study the biology and physiognomy of curved trees.The proportion of logs in the different classes were though somewhat unbalanced with a large proportion of straight logs and a small proportion of logs with end sweep.This was due to the lack of such curvatures in the stands and could be a source of error in the study.Tests showed however that the best repeatability were for end sweep logs indicating that the models also worked when few logs were represented.
As there are no objective rules for measuring curve variables apart from bow height in the Swedish Grading instruction for saw logs (VMR 1999) or any other standards, the true curve type and curve severity were visually assessed by the authors.The assessment of curvature type approximately followed the subjective classification of Gjerdrum et al. (2001) and a guideline for curve severity was given by the maximum and minimum bow height within each class.The lack of objective grading rules for the log curvature classes could be a source of error in the study.
The conclusion of this study is that it is possible to sort logs by curve type using a 3D log scanner, although sorting by curvature type was largely dependent on curve severity.The result in a study such as this is largely affected on how the curvature types and curvature severity are defined which is difficult to do in a fully objective manner.

Fig. 1 .
Fig. 1.Four logs with different types of curvature: a = end sweep; b = long sweep; c = cross crook and d = multiple sweep.

Fig. 2 .
Fig. 2. The same log at the four different measuring runs reconstructed from external geometry data.
x) Straight log -a log with a maximum bow height of 0.2% a) End sweep -a curved log with smooth curvature in one single plane where the maximum bow height is positioned within 1.5 meters from butt end (own definition) b) Long sweep -a curved log with smooth curvature where the length of the curve is distributed within one single plane and extends more than half of the log length (definition according to Swedish Grading instruction (VMR 1999)).c) Cross crook -a curved log with a sharp curvature (crook) that indicates overgrown top failures (definition according to Swedish Grading instruction (VMR 1999)) d) Multiple sweep -a curved log with two or more bends in one or several planes (own definition)

Fig. 3 .
Fig. 3. Principal descriptions of maximum bow height using log centroid and a straight line joining both log end centres for a log with long sweep.

Fig. 4 .
Fig. 4. Principal description of maximum bow height and bow height of second curve using log centroid and a straight line joining the centres of both log ends for a log with multiple sweep.
of grades p ii = the proportion of observations placed in grade i at the first and second grading event p i• = the proportion of observations placed in grade i at the first grading event irrespective of the second grading event p •i = the proportion of observations placed in grade i at the second grading event irrespective of the first grading event.

Table 1 .
External features of the 56 Norway spruce saw logs used in the study.

Table 2 .
Relative repeatability of the four variables used.

Table 3 .
Standardized parameter estimates for a discriminant model explaining the probability for each curve type and log.

Table 4a .
Number of observations for different combinations of true curve type and predicted curve type for the four different runs.

Table 4b .
Kappa values, proportion of observed agreement (P 0 ), chance factor (P e ) and number of logs for different runs and for different degree of curve severity.

Table 5 .
Repeatability of automatically classified curve type for all logs and by curve type.