# Simultaneous Wood Defect and Species Detection with 3D Laser Scanning Scheme

Authors: Zhao Peng; Li Yue; Ning Xiao
Journal: International Journal of Optics
 (2016)

---

## Abstract

Wood grading and wood price are mainly connected with the wood defect and wood species. In this paper, a wood defect quantitative detection scheme and a wood species qualitative identification scheme are proposed simultaneously based on 3D laser scanning point cloud. First, an Artec 3D scanner is used to scan the wood surface to get the 3D point cloud. Each 3D point contains itsX, Y, and Z coordinate and its RGB color information. After preprocessing, the Z coordinate value of current point is compared with the set threshold to judge whether it is a defect point (i.e., cavity, worm tunnel, and crack). Second, a deep preferred search algorithm is used to segment the retained defect points marked with different colors. The integration algorithm is used to calculate the surface area and volume of every defect. Finally, wood species identification is performed with the wood surface’s color information. The color moments of scanned points are used for classification, but the defect points are not used. Experiments indicate that our scheme can accurately measure the surface areas and volumes of cavity, worm tunnel, and crack on wood surface with measurement error less than 5% and it can also reach a wood species recognition accuracy of 95%.


---

## Body

## 1. Introduction

Wood species and wood defects are two key issues in the wood quality assessment so as to judge the physical property and commercial value of different wood products (e.g., wood veneer, lumber, or board) correctly [1]. Some visual image characteristics have been used in the wood species recognition and can be divided into two general categories: wood surface’s texture analysis [2, 3] and its color analysis [4, 5]. Recently, the wood spectral reflectance characteristics are also exploited for the species classification. The more common schemes in the literature consider the vibration spectroscopy [6, 7] and the Raman spectroscopy [8]. For example, Piuri and Scotti present a scheme for the wood species classification based on the analysis of fluorescence spectra [9].As for the wood surface’s defect detection, the spectral analysis and laser scanning schemes are usually used to fulfill the qualitative detection on the wood external defects (e.g., cavity, worm tunnel, knots, or erosion) [10–12]. Researchers also have proposed some schemes for detecting wood internal defects by using X-rays, gamma rays, microwaves, and longitudinal stress waves [13–15]. For example, Wang et al. combine the wavelet transform and neural networks to analyze and recognize different types and sizes of wood internal defects using an ultrasonic device [16].However, simultaneous investigations on wood species and wood defect detections are scarcely performed to make an objective wood quality assessment. In fact, wood species detection and wood defect detection are usually performed with different instruments or technologies. Even if the same instrument or technology such as spectral analysis may be used for wood species and defect detection, the mutual disturbance exists so that the detection accuracy is low. For example, the wood species recognition accuracy is not good for wood veneer if there are many defects on wood surface by using spectral reflectance features. To solve this hard issue, we use a 3D laser scanning instrument to make a qualitative wood species recognition and a quantitative wood defect measurement (i.e., the precise measurement of surface area and volume of every external defect such as cavity, worm tunnel, and crack on the wood product’s surface) simultaneously. Therefore, the wood detection efficacy is improved by using our scheme and it can provide a better basis for the subsequent wood quality assessment.


## 2. Materials and Methods

### 2.1. 3D Scan

The 3D scan is a nondestructive detection technology based on laser processing with a fast scan speed and a high scan accuracy. Therefore, it is usually used in the object’s 3D reconstruction. In our scheme, a portable Artec 3D laser scanner is used to get the wood surface’s 3D point cloud, as illustrated in Figure1. This scanner is small and portable with an adjustable flash lamp and with a 3D scan resolution of 0.5 mm. It is used conveniently with a number of data storage formats. This scanner is equipped with software system Artec Studio 9 to read the scanner data and then display the scanned object’s surface. The object’s surface is calibrated with the instrument’sXOY plane automatically by this software and then the object’s surface is stored as a file with OBJ format. For example, Figure 2 illustrates the scanned wood surface in the Artec Studio 9. Each scanned point contains its X, Y, and Z coordinate and its RGB color information. The point’s X, Y, and Z coordinates are used in the defect detection, while its RGB information is used in the species recognition.Figure 1
A portable Artec 3D laser scanner.Figure 2
Scanned wood surface in the Artec Studio 9.


### 2.2. Defect Segmentation

In this section, two steps need to be executed to segment different defects. First, every point’sZ coordinate is compared with the set threshold to determine whether this point is a depressed defect (i.e., cavity, worm tunnel, and crack) point. Second, the retained defect points are processed with a deep preferred search algorithm to segment different defects. The defect points which belong to the same defect will be marked with the same number and displayed with the same color. A detailed flow graph is illustrated in Figure 3, and different defects are displayed with different colors, as illustrated in Figure 4.Figure 3
The flow graph on wood defect segmentation.Figure 4
The segmented defects displayed with different colors.


### 2.3. Defect Measurement

For every defect such as every cavity or worm tunnel, we propose an integration scheme to calculate its surface area and volume. To achieve this goal, we need to extend each defect point into a small surface. As illustrated in Figure5, every three adjacent defect points form a triangle plane, while each defect point is the vertex of six triangle planes. Therefore, we should extend each defect point into a regular hexagon surface model, as illustrated in Figure 6. In Figure 6, the point O is the current processed defect point with six adjacent points A~F. We draw six midnormals on OA,OB,…,OF, and these six midnormals intersect each other at the six vertices P, Q, R, S, N, and T. These six cross-points form a small purple regular hexagon. In fact, we finally extend each defect point into this small purple regular hexagon PQRSNT.Figure 5
Wood surface’s grid graph in the Artec Studio 9 without color information.Figure 6
A defect point is extended into a purple regular hexagonPQRSNT.As for the surface area computation of every defect, we should firstly calculate the area of the small purple regular hexagonPQRSNT. Define L as the mean distance value of parallel opposing sides such as PQ and SN in PQRSNT, and this distance L can be approximated as the mean length value of six sides OA,OB,OC,…,OF. After we calculate every defect point’s surface area (i.e., the area ofPQRSNT), then we can summarize all defect point’s areas of one defect to get one defect’s total surface area, as illustrated in (1)S=∑i=1n32·Li2.As for the volume computation of every defect, we should also similarly extend a defect pointO into regular hexagonPQRSNT. In this way, we can summarize all defect point’s volumes of one defect to get one defect’s total volume, as illustrated in (2)V=∑i=1nSi·zi=∑i=1n32·Li2·zi.In (2), the corresponding volume for every defect point O is approximated as the volume of the regular hexagonal prism, as illustrated in Figure 7. The height h is approximated as zi, which is the absolute value of Z coordinate of the ith defect point.Figure 7
The regular hexagonal prism model for volume calculation.


### 2.4. Species Identification

Wood species identification is performed with wood surface’s color information. Each scanned point contains itsX, Y, and Z coordinate and its RGB color information. The point’s RGB color information is used here to calculate the color moment features for subsequent species identification. Obviously the wood surface’s defect points will disturb the precise calculations of color moment features and these defect points should be deleted. Fortunately, in Section 2.2, we have successfully extracted these defect points and therefore the disturbance from defect points can be overcome effectively.The following three color moments are used for RGB three channels, and we can get 9 classification features. As for the classifier design, the BP neural network is used.(3)α=1n∑i=1nPi,β=1n∑i=1nPi-α21/2,γ=1n∑i=1nPi-α31/3.


## 2.1. 3D Scan

The 3D scan is a nondestructive detection technology based on laser processing with a fast scan speed and a high scan accuracy. Therefore, it is usually used in the object’s 3D reconstruction. In our scheme, a portable Artec 3D laser scanner is used to get the wood surface’s 3D point cloud, as illustrated in Figure1. This scanner is small and portable with an adjustable flash lamp and with a 3D scan resolution of 0.5 mm. It is used conveniently with a number of data storage formats. This scanner is equipped with software system Artec Studio 9 to read the scanner data and then display the scanned object’s surface. The object’s surface is calibrated with the instrument’sXOY plane automatically by this software and then the object’s surface is stored as a file with OBJ format. For example, Figure 2 illustrates the scanned wood surface in the Artec Studio 9. Each scanned point contains its X, Y, and Z coordinate and its RGB color information. The point’s X, Y, and Z coordinates are used in the defect detection, while its RGB information is used in the species recognition.Figure 1
A portable Artec 3D laser scanner.Figure 2
Scanned wood surface in the Artec Studio 9.


## 2.2. Defect Segmentation

In this section, two steps need to be executed to segment different defects. First, every point’sZ coordinate is compared with the set threshold to determine whether this point is a depressed defect (i.e., cavity, worm tunnel, and crack) point. Second, the retained defect points are processed with a deep preferred search algorithm to segment different defects. The defect points which belong to the same defect will be marked with the same number and displayed with the same color. A detailed flow graph is illustrated in Figure 3, and different defects are displayed with different colors, as illustrated in Figure 4.Figure 3
The flow graph on wood defect segmentation.Figure 4
The segmented defects displayed with different colors.


## 2.3. Defect Measurement

For every defect such as every cavity or worm tunnel, we propose an integration scheme to calculate its surface area and volume. To achieve this goal, we need to extend each defect point into a small surface. As illustrated in Figure5, every three adjacent defect points form a triangle plane, while each defect point is the vertex of six triangle planes. Therefore, we should extend each defect point into a regular hexagon surface model, as illustrated in Figure 6. In Figure 6, the point O is the current processed defect point with six adjacent points A~F. We draw six midnormals on OA,OB,…,OF, and these six midnormals intersect each other at the six vertices P, Q, R, S, N, and T. These six cross-points form a small purple regular hexagon. In fact, we finally extend each defect point into this small purple regular hexagon PQRSNT.Figure 5
Wood surface’s grid graph in the Artec Studio 9 without color information.Figure 6
A defect point is extended into a purple regular hexagonPQRSNT.As for the surface area computation of every defect, we should firstly calculate the area of the small purple regular hexagonPQRSNT. Define L as the mean distance value of parallel opposing sides such as PQ and SN in PQRSNT, and this distance L can be approximated as the mean length value of six sides OA,OB,OC,…,OF. After we calculate every defect point’s surface area (i.e., the area ofPQRSNT), then we can summarize all defect point’s areas of one defect to get one defect’s total surface area, as illustrated in (1)S=∑i=1n32·Li2.As for the volume computation of every defect, we should also similarly extend a defect pointO into regular hexagonPQRSNT. In this way, we can summarize all defect point’s volumes of one defect to get one defect’s total volume, as illustrated in (2)V=∑i=1nSi·zi=∑i=1n32·Li2·zi.In (2), the corresponding volume for every defect point O is approximated as the volume of the regular hexagonal prism, as illustrated in Figure 7. The height h is approximated as zi, which is the absolute value of Z coordinate of the ith defect point.Figure 7
The regular hexagonal prism model for volume calculation.


## 2.4. Species Identification

Wood species identification is performed with wood surface’s color information. Each scanned point contains itsX, Y, and Z coordinate and its RGB color information. The point’s RGB color information is used here to calculate the color moment features for subsequent species identification. Obviously the wood surface’s defect points will disturb the precise calculations of color moment features and these defect points should be deleted. Fortunately, in Section 2.2, we have successfully extracted these defect points and therefore the disturbance from defect points can be overcome effectively.The following three color moments are used for RGB three channels, and we can get 9 classification features. As for the classifier design, the BP neural network is used.(3)α=1n∑i=1nPi,β=1n∑i=1nPi-α21/2,γ=1n∑i=1nPi-α31/3.


## 3. Results and Discussions

### 3.1. Defect Detection

We select many wood products which have cavity, worm tunnel, or crack for experiments (one example is illustrated in Figure8). The Artec 3D scanner is used to get the wood surface’s point cloud data, and subsequent defect segmentation and measurement are performed by use of C language programming. One detailed defect detection result is illustrated in Figure 9.Figure 8
The detected wood specimen.Figure 9
The detailed wood defect’s measurement results.In order to evaluate our defect detection scheme’s measurement accuracy objectively, a simulation experiment is designed here. We select some standard wood boards without any defects on their smooth surfaces and then we use electric drills to drill some pores with different sizes on board surfaces. These drilled pores are the standard cylinder pores with diameter4mm~20mm and height 1mm~5mm. We use our scheme to calculate the surface areas and volumes of these cylinder pores and the standard surface areas and volumes are calculated with cylinder’s area and volume formulas. By this way, we can objectively determine our scheme’s measurement errors and detailed errors are illustrated in Tables 1 and 2. By comparisons, we can see that our measurement accuracy decreases gradually when the cylinder’s height increases. The main measurement error is from the scanning error of Artec scanner, which performs the surface scanning and its scanning error will increase when the depressed defect’s height increases. But within the cylinder defect’s height 3 mm, our scheme’s measurement is good with the relative errors less than 5%.Table 1
Volume measurement error for cylinder cavity.
Relative error (%) D = 4 mm D = 6 mm D = 8 mm D = 10 mm D = 13 mm D = 16 mm D = 19 mm H = 1.0 mm (%) 3.0 3.0 3.0 3.1 3.0 3.0 3.0 H = 1.5 mm (%) 3.2 3.2 3.2 3.2 3.2 3.2 3.2 H = 2.0 mm (%) 3.5 3.5 3.5 3.5 3.5 3.4 3.5 H = 2.5 mm (%) 3.9 3.9 3.9 3.9 4.0 3.8 3.8 H = 3.0 mm (%) 4.8 5.0 4.8 4.8 4.8 4.9 5.0Table 2
Surface area measurement error for cylinder cavity.
Relative error (%) D = 4 mm D = 6 mm D = 8 mm D = 10 mm D = 13 mm D = 16 mm D = 19 mm H = 1.0 mm (%) 2.7 2.9 2.7 2.7 2.7 2.7 2.7 H = 1.5 mm (%) 2.9 2.9 2.9 2.9 2.9 2.8 2.9 H = 2.0 mm (%) 3.3 3.5 3.3 3.3 3.6 3.3 3.3 H = 2.5 mm (%) 3.8 3.8 3.8 3.8 3.7 3.7 3.7 H = 3.0 mm (%) 4.5 4.5 4.7 4.8 4.8 4.9 5.0


### 3.2. Species Recognition

In this section, we perform the wood species identification experiments on five wood species includingBetula platyphylla, Populus davidiana, Pinus sylvestris, Picea jezoensis, andLarix gmelinii (i.e.,BP, PD, PS, PJ,andLG) in northeast region of China with 2000 specimens for each wood species (1000 specimens are used as training dataset and another 1000 specimens are used as test dataset). The Matlab 6.5 programming tool is used here and its neural network toolbox is used for BP network’s training and identification. The training frequency is 4000 for BP network and its node number is 19 in its hidden layer. The network’s training function is trainbr. For each wood species, radial section (RS) and tangential section (TS) are performed, respectively. The detailed results are illustrated in Tables 3 and 4, where we can see that the recognition accuracy of our scheme with defect points deleted is better than that of ordinary color moment-based scheme.Table 3
Pattern recognition accuracy comparisons for our scheme and ordinary color moment-based scheme (RS).
Scheme BP PD PS PJ LG Our scheme 95% 95% 96% 97% 96% Ordinary scheme 87% 85% 79% 89% 89%Table 4
Pattern recognition accuracy comparisons for our scheme and ordinary color moment-based scheme (TS).
Scheme BP PD PS PJ LG Our scheme 97% 95% 95% 94% 94% Ordinary scheme 88% 88% 81% 87% 85%


## 3.1. Defect Detection

We select many wood products which have cavity, worm tunnel, or crack for experiments (one example is illustrated in Figure8). The Artec 3D scanner is used to get the wood surface’s point cloud data, and subsequent defect segmentation and measurement are performed by use of C language programming. One detailed defect detection result is illustrated in Figure 9.Figure 8
The detected wood specimen.Figure 9
The detailed wood defect’s measurement results.In order to evaluate our defect detection scheme’s measurement accuracy objectively, a simulation experiment is designed here. We select some standard wood boards without any defects on their smooth surfaces and then we use electric drills to drill some pores with different sizes on board surfaces. These drilled pores are the standard cylinder pores with diameter4mm~20mm and height 1mm~5mm. We use our scheme to calculate the surface areas and volumes of these cylinder pores and the standard surface areas and volumes are calculated with cylinder’s area and volume formulas. By this way, we can objectively determine our scheme’s measurement errors and detailed errors are illustrated in Tables 1 and 2. By comparisons, we can see that our measurement accuracy decreases gradually when the cylinder’s height increases. The main measurement error is from the scanning error of Artec scanner, which performs the surface scanning and its scanning error will increase when the depressed defect’s height increases. But within the cylinder defect’s height 3 mm, our scheme’s measurement is good with the relative errors less than 5%.Table 1
Volume measurement error for cylinder cavity.
Relative error (%) D = 4 mm D = 6 mm D = 8 mm D = 10 mm D = 13 mm D = 16 mm D = 19 mm H = 1.0 mm (%) 3.0 3.0 3.0 3.1 3.0 3.0 3.0 H = 1.5 mm (%) 3.2 3.2 3.2 3.2 3.2 3.2 3.2 H = 2.0 mm (%) 3.5 3.5 3.5 3.5 3.5 3.4 3.5 H = 2.5 mm (%) 3.9 3.9 3.9 3.9 4.0 3.8 3.8 H = 3.0 mm (%) 4.8 5.0 4.8 4.8 4.8 4.9 5.0Table 2
Surface area measurement error for cylinder cavity.
Relative error (%) D = 4 mm D = 6 mm D = 8 mm D = 10 mm D = 13 mm D = 16 mm D = 19 mm H = 1.0 mm (%) 2.7 2.9 2.7 2.7 2.7 2.7 2.7 H = 1.5 mm (%) 2.9 2.9 2.9 2.9 2.9 2.8 2.9 H = 2.0 mm (%) 3.3 3.5 3.3 3.3 3.6 3.3 3.3 H = 2.5 mm (%) 3.8 3.8 3.8 3.8 3.7 3.7 3.7 H = 3.0 mm (%) 4.5 4.5 4.7 4.8 4.8 4.9 5.0


## 3.2. Species Recognition

In this section, we perform the wood species identification experiments on five wood species includingBetula platyphylla, Populus davidiana, Pinus sylvestris, Picea jezoensis, andLarix gmelinii (i.e.,BP, PD, PS, PJ,andLG) in northeast region of China with 2000 specimens for each wood species (1000 specimens are used as training dataset and another 1000 specimens are used as test dataset). The Matlab 6.5 programming tool is used here and its neural network toolbox is used for BP network’s training and identification. The training frequency is 4000 for BP network and its node number is 19 in its hidden layer. The network’s training function is trainbr. For each wood species, radial section (RS) and tangential section (TS) are performed, respectively. The detailed results are illustrated in Tables 3 and 4, where we can see that the recognition accuracy of our scheme with defect points deleted is better than that of ordinary color moment-based scheme.Table 3
Pattern recognition accuracy comparisons for our scheme and ordinary color moment-based scheme (RS).
Scheme BP PD PS PJ LG Our scheme 95% 95% 96% 97% 96% Ordinary scheme 87% 85% 79% 89% 89%Table 4
Pattern recognition accuracy comparisons for our scheme and ordinary color moment-based scheme (TS).
Scheme BP PD PS PJ LG Our scheme 97% 95% 95% 94% 94% Ordinary scheme 88% 88% 81% 87% 85%


## 4. Conclusions

In this paper, we have proposed a simultaneous wood defect and wood species detection scheme based on 3D scanning and signal processing. It can measure the wood surface’s depressed defects quantitatively in terms of area and volume. Moreover, we also find that wood defects usually disturb the wood species identification. Therefore, based on the wood defect’s detection results, an improved wood species identification based on color moments is also proposed by deleting those defect points.For example, the measurement errors for wood defect’s areas and volumes can be approximately less than 5% if the defect’s height is less than 3.0 mm. Moreover, the improved wood species recognition scheme can achieve a recognition accuracy of 95% approximately for 5 wood species. Therefore, our wood quality detection scheme is portable and efficient which can be applied in the practical wood processing factory. In fact, our scheme may be further used in other detection fields such as the surface detections of online industrial products.



---

*Source: 7049523-2016-12-19.xml*