A computer-aided method for identifying the presence of softwood growth ring boundaries

The objective of this study was to develop a computer-aided method to quantify the obvious degree of growth ring boundaries of softwood species, based on data analysis with some image processing technologies. For this purpose, a 5× magnified cross-section color micro-image of softwood was cropped into 20 sub-images, and then every image was binarized as a gray image according to an automatic threshold value. After that, the number of black pixels in the gray image was counted row by row and the number of black pixels was binarized to 0 or 100. Finally, a transition band from earlywood to latewood on the sub-image was identified. If everything goes as planned, the growth ring boundaries of the sub-image would be distinct. Otherwise would be indistinct or absent. If more than 50% sub-images are distinct, with the majority voting method, the growth ring boundaries of softwood would be distinct, otherwise would be indistinct or absent. The proposed method has been visualized as a growth-ring-boundary detecting system based on the .NET Framework. A sample of 100 micro-images (see S1 Fig via https://github.com/senly2019/Lin-Qizhao/) of softwood cross-sections were selected for evaluation purposes. In short, this detecting system computes the obvious degree of growth ring boundaries of softwood species by image processing involving image importing, image cropping, image reading, image grayscale, image binarization, data analysis. The results showed that the method used avoided mistakes made by the manual comparison method of identifying the presence of growth ring boundaries, and it has a high accuracy of 98%.


Introduction
Generally, a wood species can be identified according to the macroscopic and microscopic structural characteristics of the wood, which is a time-consuming process. The traditional methods of wood identification include manual comparison, dichotomous keys, multiple entry keys, punch card search and computer database program search [1]. Researchers have also tried to use DNA molecular marker technology [2], near-infrared spectroscopy technology [3], GC-MS technology [4], computer vision technology [5] and other auxiliary a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 identification methods to improve the accuracy of traditional methods in wood identification and speed the process of identifying wood species.
Tree-ring variables have been shown to be strongly influenced by environmental conditions [6]. The phenomenon of distinct, indistinct or absent growth rings is a wide range of tree-ring research, and its feature is used for wood identification [7]. Recently, researchers have attempted to recognize wood species by utilizing a growth ring boundary detection algorithm [8] such as the Gray Level Co-occurrence Matrix [8,9], and the color histogram statistical method [10] to extract wood features. Subsequently, various techniques, including Support Vector Machine (SVM) [11], K-nearest neighbor (KNN) ( [12][13][14]), and neural network [15,16], have been used to create many classifiers.
According to the IAWA list of microscopic features for softwood identification [17], Tsuga chinensis var. forrestii (Fig 1) is always identified as having distinct growth ring boundaries, but Podocarpus neriifolius (Fig 2) may be recognized as having either obvious growth ring boundaries or not obvious growth ring boundaries [18]. The presence of growth ring boundaries in Podocarpus neriifolius varies from person to person, due to definitions of "growth ring boundaries = growth rings with an abrupt structural change at boundaries between them" and "growth ring boundaries indistinct or absent = growth rings boundaries vague and with marked gradual structural changes" being qualitative, not quantitative, which generates a serious problem for a wood identification researcher.
There is no tool available to quantify the obvious degree of growth ring boundaries in softwood species, although many tools can be used to analyze wood anatomy images, for example, the image analysis tool ROXAS can be used to recognize annual rings in large samples (linear and circular) with > 100 annual rings (see www.wsl.ch/roxas), and to build centuries-long tracheid-lumen chronologies in conifers [19] or quantify plasticity in vessel grouping [20]. DENDRO-2003 densitometer can be used to measure the density profiles of tree ring [21]. Besides, WinDENDRO can measure ring-width manually on sampled cross-sections [22]. They can not judge whether the softwood growth ring boundaries are obvious.
To address this issue, this paper aim to develop a computer-aided method to identify automatically and quantitatively whether there are distinct growth ring boundaries present in softwood species, and provide a powerful quantitative wood anatomy tool [23] making the identification of softwood species more objective and more efficient, in contrast to the method of identifying tree species [8][9][10][11][12][13][14][15][16].

Image acquisition
A total of 100 microscopic slides were collected from Wood Collections, Chinese Academy of Forestry, representing 100 species (see S1 Table included in https://github.com/senly2019/Lin-Qizhao/), involving 8 families of Ginkgoaceae, Araucariaceae, Podocarpaceae, Cephalotaxaceae, Taxaceae, Pinaceae, Taxodiaceae, and Cupressaceae. These slides were prepared following wood anatomical steps: (i) The cores were cut into small (1cm × 1cm × 2cm) pieces; (ii) Thin sections (ca.15μm) were cut with a microtome; (iii) These sections were stained with safranin and permanently fixed with Gum Arabic. Imaging was performed with a digital camera (LEICA DMC4500) mounted on a light microscope (LEICA DM2000 LED). Images of 2560 × 1920 pixels were captured at 5× magnification using Leica Application Suite (Version 4.9.0). Numerical analysis and data visualization were carried out using Origin8.0.

Proposed methods
The description of the method includes three parts. 1) The flow chart of the method. 2) The image processing techniques used in this study. 3) How to obtain the final result by some digital techniques, which also include data and statistical analysis. A brief introduction of the workflow is given below. Based on the workflow, a visual computer program has been designed by authors.
Part I: Flow chart. The flow chart of this method is presented in Fig 3. The flow chart was described below: Step 1. Input a microscopy RGB (RGB, R = Red, G = Green, B = Blue) color image collected from cross-section of softwood. The growth rings are parallel to the horizontal direction as far as possible.
Step 2. Crop imported image into 20 sub-images averagely in size along the horizontal direction.
Step 3. Read the images in sequence. If it is successful, then turn to Step 4, otherwise switch to Step 9.
Step 4. Convert a color image into a grayscale image.
Step 5. Calculate a threshold, and then change the grayscale image to get a binary image.
Step 6. Set up the slope value in a loop, if the slope is bigger than the threshold value, turn to Step 3.
Step 7. Count the number of black pixels in each row of the binary image from top to bottom by the slope.
Step 8. Analyze the data generated from Step 7, and then find a row index that meets the specific criteria described below. If it can be found, the growth ring boundaries are distinct and turn to Step 3, otherwise, the growth ring boundaries are indistinct or absent, and turn to Step 6.
Step 9. Statistically analyze all the results output by Step 8. If more than 50% sub-images resulted in distinct growth ring boundaries, then the growth ring boundaries of the sample are distinct, otherwise, they are indistinct or absent.
To operate the program correctly, the detailed instructions and constraints are emphasized as follows.

At
Step 2, compared with the original imported image, the sub-image after cropping can reduce the ordinate range of the boundary of the growth ring. Part II: Image processing technology. At Step 4, the image processing is performed to find growth rings with an abrupt change at the boundaries. The microscopic RGB images of a

PLOS ONE
cross-section of a softwood species were first stored in a two-dimensional matrix defined as f (x,y), converted into a grayscale image, and then changed into a black-and-white binary image. Every pixel point of the color image was calculated by Eq 1 below. The gray value of R, G, B ranges from 0 to 255, and values of all these pixel points lay between 0 to 255 calculated by Eq 1. Image's dark pixel points represent the tracheid wall thickness, due to tracheid wall is dark but tracheid lumen is light.
For segmenting an image, setting up the threshold was simple, efficient, and fast [24]. At Step 5, thresholds were calculated by the program designed by the authors. Threshold values may be changed with different grayscale images. For getting the threshold τ, the program calculated the average value μ and standard deviation σ of all pixel points. These parameters μ, σ, and τ were calculated by Eqs 2, 3, and 4, respectively.
s ¼ ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffiffi Where x i,j is the value of a grayscale image pixel point;i is the row index;

PLOS ONE
j is the column index; m is the image height; n is the image width. The program output various thresholds from different binary images, as shown in Fig 5. By Eq 5, the value of pixel p(x) is defined as 0 (black) when if the gray value is less than the threshold τ, otherwise it is defined as 255 (white). After this process, a grayscale image could be converted into a binary image finally.
Part III: Mathematical technique. A mathematical technique is conducted at Steps 7-9. Fig 7 shows an example of counting black pixels. The first column of the sheet contains row index and the second column contains the counting of black pixels. The first row is at the top of the binary image. The number of black pixels in each row Y j is counted by Eq 6. In order to find the growth ring boundary, j was corrected by Eq 7, where s was the slope of the growth ring boundary and computed by Eq 8. The proposed method gets k in a loop process. The maximum j equaled to h-w, where h is the height of the image.
Where: i is the row index; j is the column index; and w is the width of the image.
After Step 7, the computer program normalizes these values by Eq 9 at Step 8. Where: The purpose of normalization operation is to make all scatter plots have the same longitudi-

PLOS ONE
nal coordinates ranging that from 0 to 100. The computer program calculates normalized values by Eq 10 and processes normalized values to 0 or 100, which is a binarized operation.
Where YB i is the binarized value of YN i i is the row index. Fig 8 is a comparison of sum-image before and after being binarized. From Figs 9 to 11, it was easy to find out special regions that are labeled by the red rectangular box. These special regions represent growth ring boundaries.
In this study, a sub-method is included at Step 8, which aims to find a row index making it can be found, the growth ring boundaries are defined as "distinct", otherwise, they are indistinct or absent. At Step 9, the computer program analyzed the results generated from Step 8. If more than 50% sub-images are reported as "distinct", then the growth ring boundaries of the sample were distinct, otherwise, they were indistinct or absent.

Results and discussion
For using this method, a visual computer program as shown in Fig 12 was designed with C# based on the .NET Framework. The experimental results are shown in Table 1 including 100 softwood species. All the cross-section micro-images (available via https://github.com/ senly2019/Lin-Qizhao/) are 2560×1920 pixels with the same magnification.
As shown in Table 1, the manual comparison method was composed of 9 experts with experience in the identification of softwood to determine whether the boundaries of softwood growth ring were distinct by cross-section micro-image. Among these 100 cross-sections of softwood identified by 9 experts, 91 were identified as an obvious feature of growth ring boundaries by all experts, 1 was identified as a non-obvious feature of growth ring boundaries by all experts.
There were different judgments on 8 cross-sections, as shown in Table 2, different experts have different judgments on the transition type of the growth ring boundaries on these 8 cross-sections of softwood involving 7 families of Ginkgoaceae, Podocarpaceae, Cephalotaxaceae, Taxaceae, Pinaceae, Taxodiaceae, and Cupressaceae. The proposed method provides a quantitative value of the degree of distinctness of growth ring boundaries, and then provides a qualitative conclusion with the majority voting method. Compared with the traditional method [17], to judge whether the growth ring boundaries were distinct, the advantage of the proposed method is providing a qualitative conclusion with the majority voting method based on quantitative computation, which minimized mistakes made by the manual comparison method.
Compared with qualitative results of the manual comparison method which have been run by distinct counts and indistinct counts with the majority voting method [25], qualitative In order to enable more people to use the software to identify whether softwood has distinct growth ring boundaries, the major function has been integrated into the "Softwood Retrieval System". This website can be accessed at http://woodlab.swfu.edu.cn/, as shown in Fig 13. A cross-section micro-image can been input by clicking "Choose File" button, then feature code of presence of growth ring boundaries will been shown as "40p" or "41p" after "IdentifyFeatures" button clicked, represent distinct and indistinct respectively.
In order to automatically identify whether there are distinct growth ring boundaries present in softwood species, the proposed method used automatic threshold value without humancomputer interaction. As shown in Fig 14, the result of automatic threshold binarization is similar to this of non-automatic threshold binarization. Fig 14B and 14C can basically reflect cell wall and cell cavity of Fig 14A. The proposed method could be improved by combining with a variance which can be used to measure the fluctuation of the image region, to automatically identify the transition from

PLOS ONE
earlywood to latewood of softwood. It could also be applied to assess the distinctiveness of hardwood growth ring boundaries.

Conclusions
In this paper, a computer-aided method has been proposed for quantifying the obvious degree of growth ring boundaries of softwood species, based on data analysis with some image processing technologies. The proposed method was visualized as a growth-ring-boundary detecting system. A sample of 100 micro-images of softwood cross-sections cut from 100 conifer species were selected for evaluation purposes. In short, this detecting system computes the obvious degree of growth ring boundaries of softwood species by image processing involved image importing, image cropping, image reading, image grayscale, image binarization, data analysis. The results showed that the method has a high accuracy of 98%. In addition, in order to enable more people to use the software to identify whether softwood has distinct growth ring boundaries, the major function has been integrated into the "Softwood Retrieval System". This website can be accessed at http://woodlab.swfu.edu.cn/. This system can output microscopic feature code as "40p" or "41p" after submitting a cross-section micro-image, represent distinct and indistinct respectively.
Compared with the manual comparison method, our proposed method makes the identification of softwood species more objective and more efficient. The computer-aided method was used instead of the manual operation, which reduced the subjective affection. Automatic methods, such as setting threshold value were employed, which save a lot of time. In the further, we plan to improve performance of "Softwood Retrieval System". We will collect more samples from various coniferous wood to enhance the generalization performance, and optimize the system in order to convenience the users.    Table. (TXT)