1. Introduction
Solid wood panels are widely used in solid wood furniture [
1], wood flooring, and other industries because of their gloss finish, good decoration performance, effective sound absorption, high strength, easy processing, durability, and long service life. Moreover, waste wooden products can be degraded naturally and will hardly produce pollution. The surface parameters of solid wood panels include color [
2], texture [
3], gloss [
4], roughness, deformation rate, planeness, etc., which are directly related to the visual beauty and decorative performance of wood products and are closely related to the quality evaluation of wood products. Therefore, it is theoretically and practically important to achieve automatic and intelligent detection and sorting of solid wood panel colors.
Color is an important surface characteristic parameter of solid wood panels, as well as an important index to evaluate the quality, grade, and market value of wood products. In actual production, solid wood panels always need to be spliced together to form larger wood panels. It is preferable that panels with similar colors are spliced together to meet the needs of individual customers. Traditionally, the surface color classification of solid wood has mainly been based on manual observation, which is significantly influenced by human factors and has low efficiency and, therefore, cannot meet society’s needs in terms of processing automation and intelligence and human–computer interaction. The emergence of new detection technologies that depend on machines overcomes the shortcomings of manual sorting. Lu [
5] researched an automatic color sorting system for hardwood edge-glued panel parts, capable of sorting red oak panel parts into a number of color classes at plant production speeds and the test results showed that the qualified rate exceeded 91%. Schmitt [
6] improved the existing system based on fuzzy language rules and constructed a fuzzy language rule classifier for wood color classification. The results obtained with the new method showed a real improvement in the recognition rate compared to a Bayesian classifier. In a study by Mária [
7], a new wood color measurement method was verified using digital images in CIE L* a* b* color space birch color measurement and analysis. Syafinaz [
8] studied the relationship between wood color and formaldehyde emissions from plywood of seven tropical hardwood species. Anton [
9] determined the chemical properties of logs and wood samples after boiling, analyzed the wood, and isolated holocellulose and Sievetz cellulose by attenuated total reflection Fourier transform infrared spectroscopy (ATR-FTIR). It was found that the qualitative and quantitative changes in hemicellulose extracts during the cooking of birch were closely related to the measured pH value and wood color.
In recent years, machine vision technology [
10,
11] and machine learning algorithms [
12,
13] have become popular solutions for signal processing and have been applied to color image classification. At present, the main direction of wood color classification is to select the appropriate color features and to construct accurate classifiers [
14]. Rong-Hui [
15] extracted eight color features of images in HSV (hue, saturation, and value), HSL (hue, saturation, and luminance), and HSI (hue, saturation, and intensity) color spaces and used the k-NN algorithm to realize the classification of farmland images in different environments. Xing [
16] proposed a wood color classification method based on wood image features and a support vector machine (SVM). The hue and color vector angle (CVA) of the Bessel color system were used to characterize the wood color of the sample, which could quickly and accurately estimate the wood color grade. Vahid [
17] evaluated and compared the performance of an artificial neural network, i.e., SVM, and the Naive Bayes (NB) classifier in thermally treated wood classifications. Using color brightness parameters as the unique feature, the accuracies of the SVM and NB models were 0.960 and 0.949, respectively. The application of unsupervised learning [
18,
19] technology in wood detection is helpful to improve the quality and efficiency of wood processing. Lin [
20] applied the k-means algorithm to the surface color clustering of solid wood panels, and used the clustering results for online classification, the experimental results verified the feasibility of the proposed mechanism. In addition, K-means algorithm has been applied in many aspects, such as color image segmentation [
21], data analysis [
22], multi-objective programming [
23], and so on.
However, in actual production, due to long panel and high image resolution requirements, computational complexity increases and the color difference is small; therefore, it is difficult to find general classification rules. In view of these difficulties, in this study, we divided the solid wood panel into blocks, and since the surface information of small area panels is relatively uniform, it is conducive to classification. Due to the large and complex surface information of solid wood panels, RGB (red, green, blue), HSV (hue, saturation, value) and Lab (laboratory) color spaces commonly used in the field of machine vision technology were selected to extract feature vectors based on first-order color moments, second-order color moments, and color histogram peaks. Mohseni [
24] selected a color histogram with three channels in the RGB and HSV color space as a single feature to identify induced emotions and studied the influence of picture vision on human emotions. In this study, to describe the color characteristics of solid wood panels, first-order and second-order color moments, as well as a color histogram peak, were selected and extracted from the R, G, B, L, a, b, H, S, and V channels of a solid wood panel image, resulting in 27 extracted feature vectors that were used for the clustering study of solid wood panels. This reduced the data dimension and ensured that enough information was extracted for clustering. The K-means unsupervised learning method was used to realize the color clustering of solid wood panels. The K-means clustering algorithm is usually used when we have unlabeled data (without defined categories) and it clusters the given data into K-clusters based on the K-centroids [
25]. Then, the influence of different color characteristics on the clustering results was analyzed to find the best feature combination. Through theoretical analysis and experiments to find the optimal K value, a twice clustering method was proposed to identify texture information and to optimize the clustering results.
The overall objective of this study was to realize color classification and texture recognition of solid wood panels. In this paper, beech wood panels were selected as the research object, and the image characteristics of beech wood panels were analyzed. Based on the analysis, we proposed a new technical proposal for the color classification of wood panels. The framework included image acquisition, image preprocessing, feature extraction, unsupervised clustering, color classification, and texture recognition. The image preprocessing algorithm was used to subtract the superfluous background of the images of solid wood panels. Then, feature vectors were extracted from the processed images based on the first-order color moments, second-order color moments, and color histogram peaks. In the research of clustering, the feature vector sets were partitioned into different clusters by the K-means algorithm to realize color classification. Finally, texture recognition was realized based on color classification. Using machine vision technology [
26] and digital image processing technology [
27], in this study, we took a sample of beech wood as the research object and conduct clustering analysis on the color characteristics of the wood panel surface.
The rest of this paper is organized as follows.
Section 2 describes the materials and methods used in the sorting of solid wood panels.
Section 3 analyzes and shows the experimental results of color classification and texture recognition.
Section 4 discusses the advantages of this technical proposal in color classification and texture recognition of solid wood panels. Finally, the conclusion is given in
Section 5.
3. Results
3.1. Color Classification of Solid Wood Panels
Figure 6 shows that, under the five color feature combinations, the solid wood panels in the dataset were clustered into three, four, five, six, and seven categories. The number of columns in each figure represents the number of clusters (K value), and five rows represent five color feature combinations. As a single image was not representative, in order to reflect the real classification effect of the unsupervised clustering algorithm on the surface color of the solid wood panel, nine images were randomly selected from each clustering result and spliced together to form a new image to represent the overall performance of this class. Under the combination of five color features, for each K value, there were five × K images. Finally, images under each color feature combination were arranged in order from light to dark.
It can be seen from each row of the above figures that, under a certain color feature combination, although the number of clustering the centers, namely the K value, were different, the clustering results were able to sort solid wood panel surface colors from light to dark on the whole. With an increase in K value, the difference in surface color information of the solid wood panel in each class gradually decreases. From each column, it can be seen that the surface color information of solid wood panels in each class was chaotic, that some contained obvious texture information, and that some classified the panels with different depths into one class (the last column of each graph is the most obvious). The key to the above problems is that, due to the low K value setting, the different initial clustering centers may lead to the instability of the clustering results, which produces multiple local optimal values.
When the clustering center was selected as the theoretical optimal value, i.e., K = 8, it can be seen from
Figure 7 that the clustering results improved compared with the previous five K values. As the number of clusters increased as the K value increased, the similarity of color information on the surface of solid wood panel in each class continually increased and the difference of color information on the surface of solid wood panel in adjacent classes gradually decreased.
Table 2 shows the number of solid wood panel images in each cluster under five color feature combinations. It can be seen that, for the dataset of 1800 images, when K = 8, there were only 11 images in the least number of classes and that their surface color information was very similar.
The theoretical analysis has certain guiding significance, but in actual production, we should make appropriate adjustments according to the complicated information of the surface color of solid wood panel. Previous studies and analyses have found that, when the K value is less than the theoretical optimal, the clustering results only realize the rough classification of the solid wood panel surface color and the difference in the same type of panel is large, which cannot meet the actual needs. When the theoretical optimal K value is selected, the classification effect is improved and the difference of the same type of panel decreases. In order to find the K value that is most suitable for solid wood panel surface color classification, it is necessary to add a K value for further research.
It has been found that the similarity of the same kind of panel increases with an increase in K value, which is a positive correlation. In order to find the number of clustering centers most suitable for solid wood panels, we continued to increase the K values to 9, 10, and 11 and analyzed their classification effect.
The experimental results of K = 9, 10, and 11 showed the following: Firstly, the color of solid wood panels in each class could be sorted from light to dark, especially based on the first-order color moment or color histogram peak clustering, and the results were smoother and less hierarchical. Secondly, as the K value increased, the similarity of images in each class increased and the difference between classes decreased. Thirdly, Lines 2, 4, and 5 of
Figure 8,
Figure 9 and
Figure 10 appeared to be obvious classes of image texture information. Fourthly, from
Table 3,
Table 4 and
Table 5, the number in the last column changed a little, and the number in the previous columns changed slightly.
It can be seen from
Figure 8,
Figure 9 and
Figure 10 that different color feature combinations have different effects on clustering. Color and texture are important characteristics that affect the appearance of wood products. Color classification and texture recognition are conducive to improving the effect of solid wood panel sorting.
When K ≥ 9, there was almost no change in the clustering results of the last class of images, that is, the clustering centers of these images did not change. With an increase in K value, the similarity of the images was higher and higher. Therefore, the K value, in this study, should be set to nine.
3.2. Texture Information Recognition
For the classes with obvious texture information in Lines 2, 4, and 5 in
Figure 8,
Figure 9 and
Figure 10, we found that their color feature combinations had second-order color moments. In total, 166 images in the seventh category of “mean” combination in
Table 4 were selected as datasets, and the second-order color moments were used to extract feature vectors for secondary clustering of these images, K = 2.
In
Figure 11, nine randomly selected images were taken from 166 images of the first clustering, where b and c are the results of the second clustering—in b, the texture was relatively smooth and the color information was unified, while in c, the texture information was prominent. It can be seen that the second-order color moment had a significant influence on the texture recognition of solid wood.
The images of solid wood panels for the first eight categories of the “mean + histogram” combination in
Table 3 (the last category had fewer images and was relatively fixed) were selected as the datasets, and the feature vectors extracted by the second-order color moments were used for the second clustering of these datasets.
The experimental results are shown in
Figure 12. The second clustering divided each result of the first clustering into two categories; one category was relatively smooth, with uniform color information, and the other category had prominent texture information and more complex surface information. After the overall color classification of the images in the dataset was completed, the second-order color moment effectively identified the texture information in each class and further optimized the clustering results.
When the clustering center K = 9 was selected, the clustering results of the surface information of solid wood panels met the production requirements; therefore, the optimal K value in this experiment was nine. In actual production, if only a rough classification of surface color of solid wood panels is needed, a smaller K value can be selected. In order to achieve a more detailed color classification, an appropriate feature combination can be selected along with an increase of the K value of clustering center. If we want to identify the texture information, we can choose “twice clustering” and further refine the results of the first clustering. In practical applications, different processing methods can be selected to meet the personalized needs of different customers.
In this experiment, the data in the last column in
Table 3,
Table 4 and
Table 5 corresponded to the darkest color class in a graph with the same K value. The types and numbers of images in these categories basically did not change with a change in color feature combination and K value. We found that these specific images were quite different from other images, which may have been caused by pests, diseases, or special growth environments and can be treated as exceptions.
From
Figure 8,
Figure 9 and
Figure 10, it can be seen that, after sorting the clustering results from light to dark, the classification of solid wood surface color was realized. The larger the K value, the smaller the difference between grades and the more detailed the classification. It can be seen from
Figure 12 that the texture information was recognized by using texture sensitive color features. After color classification and texture recognition, the panels with similar surface information were spliced together to realize the coordination and consistency of the appearance of the spliced panel, as shown in
Figure 13.
4. Discussion
The above sections verified the effectiveness of solid wood surface color sorting based on machine vision and unsupervised learning algorithm. By creating new datasets and analyzing the effect of different color feature combinations, a new classification method for multi-level color sorting of solid wood plates was proposed, and texture recognition was realized. In this study, the problem of setting the K value in advance was solved through theoretical analysis and experimental summary.
Based on learning style, machine learning can be divided into supervised learning and unsupervised learning. At present, the supervised learning classification algorithms that are widely used mainly include decision tree, k-nearest neighbor (KNN) algorithm, support vector machine (SVM) algorithm, naive Bayesian Model (NBM), deep learning, and other methods. However, the surface information of solid wood panels is complex, it is difficult to label categories manually, and the cost of manual category labeling is too high to obtain enough prior knowledge for supervised learning. Unsupervised learning technology can effectively solve this problem.
In this paper, the feature vectors of solid wood panel images were extracted based on color features for clustering, which realized data dimensionality reduction, which can not only reduce the difficulty of calculation, but also save processing time [
36]. In the field of machine learning, there are also Hough transform method and wavelet and local binary pattern method for feature extraction.
Compared with the supervised learning method, the unsupervised learning method applied to the color classification of solid wood panels can overcome the disadvantages of difficult manual category labeling and high cost of manual category labeling, because the supervised learning algorithm needs enough prior knowledge for supervised learning.
Feature vectors were extracted based on the selected color features. On the one hand, sufficient information of solid wood panels can be obtained; on the other hand, it can reduce the dimension of data, reduce the difficulty of calculation, and improve the processing speed. In addition, according to the clustering results of different color features, we made it clear which color feature was suitable for color classification and which color feature was suitable for texture recognition.
In terms of experimental results, from the classification effect, the technical scheme proposed in this paper can realize more detailed classification with the increase of K value. This is difficult to complete by supervised learning method. Due to the fact that the surface information of solid wood panels was complex and there were similarities between the panels, with the increase of the number of classifications, the difference between different classes decreased. It is difficult to distinguish such small differences in the progress of manual category labeling, and manual labeling cannot provide a training set, test set, and verification set for the supervised learning algorithm.
Based on machine vision technology and the machine learning method, K-means unsupervised clustering algorithm completed the color classification and texture recognition of beech wood panels.
5. Conclusions
In this study, in order to solve the problems of solid wood panel surface color classification, including overcoming the low efficiency and high cost of manual classification, the high computational complexity of supervised learning method, and the difficulty in application, an unsupervised learning method was introduced and achieved good results.
The method involved the following: The preprocessed images were blocked, the dataset was expanded, and a new dataset was created. After this, clustering, solid wood panel surface color classification, and texture recognition were performed. Finally, the images in each class were spliced together according to the requirements. This completed the classification of the solid wood panel surface color and the color information of the large panel surface was more uniform.
The color features were selected and combined. According to these feature combinations, the feature vectors of nine color channels (R, G, B, L, a, b, H, S, and V) of a solid wood panel image were extracted, and therefore, the data dimension was reduced and the extraction of sufficient color information was ensured. The K-means clustering algorithm was used to divide the feature vector set into different clusters to complete the sorting of solid wood surface color.
For the beech panel, the optimal clustering center K value based on a theoretical analysis was eight, but in actual production, it was more suitable to set it to nine. The study on the effect of combination of different color features showed that the first-order color moment could be used as a better feature to describe the overall color distribution of wood images and that the color histogram described the proportion of different colors in the whole image. The second-order color moment described the uniformity of image distribution in the color domain. The color of normal wood does not change greatly. Texture is a region with different local color values and overall color, and therefore, it can represent the size of the texture region and the depth of the texture to a certain extent.
To achieve the best combination of color features and because there are neither uniform national standards nor industry standards for the color classification of solid wood panels, enterprises can make adjustments according to the actual needs of different customers. Generally, deciding which color grade a solid wood panel belongs to often depends on its background color rather than its texture color; the background color is the solid wood panel color that accounts for the largest proportion of color. In actual production, if only color classification from light to dark is needed, you can choose the “first-order color moment” or “first-order color moment + color histogram peak”. If texture recognition is required, you can choose the above “twice clustering” method.
The technical proposal has completed the color classification and texture recognition of beech wood panels and achieved good results. However, in actual production, enterprises often need to realize the color sorting of panels of multiple tree species, which requires an improvement to the generalization ability of this technical proposal. The next research direction is to analyze the surface color classification effect of this proposal on other tree species, modify it according to the actual situation, and verify the feasibility of the new proposal through experiments.