PithExtract: A robust algorithm for pith detection in computer tomography images of wood – Application to 125 logs from 17 tree species H. Boukadida a,b , F. Longuetaud a,b,⇑ , F. Colin a,b , C. Freyburger a,b , T. Constant a,b , J.M. Leban c , F. Mothe a,b a INRA, UMR1092 LERFoB, 54280 Champenoux, France b AgroParisTech, UMR1092 LERFoB, 54000 Nancy, France c ENSTIB, 88051 Epinal, France article info Article history: Received 3 November 2011 Received in revised form 13 March 2012 Accepted 31 March 2012 Keywords: CT-scanning Automatic feature detection Hardwood Softwood ImageJ abstract An algorithm to automatically detect the stem pith within X-ray scanned logs was adapted and validated for a wide range of tree species on the basis of an initial version developed for Picea abies by Longuetaud et al. (2004). The algorithm was enhanced by using adaptive thresholds, a final smoothing operation and an optional reversion of the CT slice order for better accuracy in the presence of branch forks. The 3D aspect of CT slice stacks was used both to reduce the processing time and to correct the pith position on some CT slices containing knots. The current improved version of the algorithm was published under the GPL and implemented as a plug-in for ImageJ software. It was validated on a big sample covering a very wide range of tree species. A total of 125 logs of 17 species (mainly hardwood) were tested (in total, 100451 images were processed). The results of pith detection were accurate for most of the logs, regard- less of their position within the tree. The overall mean error was 1.69 mm. The highest errors (above 10 mm) were observed for five logs of Sorbus torminalis, Carpinus betulus and Acer campestre due to nar- row annual ring widths with respect to the pixel size or to a low contrast in the CT images. The potential applications of the method under industrial conditions are discussed. Ó 2012 Elsevier B.V. All rights reserved. 1. Introduction In addition to its anatomical importance, the stem pith is a stra- tegic location within logs, which is very useful to detect features in CT images of round wood. Many internal wood structures are re- lated to the pith, especially knots whose principal axis passes approximately through the pith, and annual growth rings that are pith-centred. In addition, it was shown that the stem pith can be used as a marker of primary growth for Quercus petraea (Edelin, 1993; Heuret et al., 2000), for Picea abies and Fraxinus excelsior (Longuetaud and Caraglio, 2009) and, potentially, for other species, based on size and/or density variations. Pith position can also be used as an indicator of wood quality. For example, pith eccentricity is related to the presence of reaction wood (Rune and Warensjö, 2002). A detailed review of the literature about pith detection algo- rithms was given in Longuetaud et al. (2004), and more recently in Wei et al. (2011). Briefly, we can distinguish the Hough-based methods that are based on voting and accumulation principles (Bhandarkar et al., 1996; Wu and Liew, 2000; Andreu and Rinnhofer, 2001; Longuetaud et al., 2004), from all the other meth- ods (Som et al., 1993, 1995; Chalifour et al., 2001; Sliwa et al., 2003). The Hough-based methods are known to be particularly robust. Computing time can be reduced by processing only regions of interest in the images. More recently and not mentioned in the previous reviews, Entacher et al. (2008) proposed several methods for pre-processing and pith detection in CT images. Among them, some were based on the Hough accumulation principle. A set of 36 CT images from one spruce (Picea sp.) tree was used for the val- idation. Norell and Borgefors (2008) developed two algorithms, each one based on the computation of local orientations, to detect the pith in log end images obtained with a digital camera in a saw- mill environment. Local orientations were used to compute Hough accumulation images. A set of 53 images selected for the purpose of identifying difficulties such as rot or eccentricity was used for the validation. An improved and simplified version of the algo- rithm was used as a prerequisite for annual ring measurements by Norell (2011) and validated on the end face images of 75 logs. The original algorithm (Longuetaud et al., 2004) was developed for P. abies logs. Picea species have a specific architecture charac- terised by the presence of branch pseudo-whorls located between two growth units (Colin and Houllier, 1991, 1992). A particular ef- fort was made to correct the pith position when the annual rings were distorted by the presence of knots. The algorithm was 0168-1699/$ - see front matter Ó 2012 Elsevier B.V. All rights reserved. http://dx.doi.org/10.1016/j.compag.2012.03.012 ⇑ Corresponding author at: INRA, UMR1092 LERFoB, 54280 Champenoux, France. E-mail addresses: haykel.boukadida@yahoo.fr (H. Boukadida), fleur.longuetaud@ nancy.inra.fr (F. Longuetaud), colin@nancy.inra.fr (F. Colin), freyburg@nancy.inra.fr (C. Freyburger), constant@nancy.inra.fr (T. Constant), Jean-Michel.Leban@enstib. uhp-nancy.fr (J.M. Leban), mothe@nancy.inra.fr (F. Mothe). Computers and Electronics in Agriculture 85 (2012) 90–98 Contents lists available at SciVerse ScienceDirect Computers and Electronics in Agriculture journal homepage: www.elsevier.com/locate/compag