Color Classification and Texture Recognition System of Solid Wood Panels
←
→
Page content transcription
If your browser does not render page correctly, please read the page content below
Article Color Classification and Texture Recognition System of Solid Wood Panels Zhengguang Wang † , Zilong Zhuang † , Ying Liu *, Fenglong Ding and Min Tang College of Mechanical and Electronic Engineering, Nanjing Forestry University, Nanjing 210037, China; nanlinwzg@njfu.edu.cn (Z.W.); zzl0702@njfu.edu.cn (Z.Z.); dfl@njfu.edu.cn (F.D.); tangmin@njfu.edu.cn (M.T.) * Correspondence: liuying@njfu.edu.cn † These authors contributed equally to this work. Abstract: Solid wood panels are widely used in the wood flooring and furniture industries, and paneling is an excellent material for indoor decoration. The classification of colors helps to improve the appearance of wood products assembled from multiple panels due to the differences in surface colors of solid wood panels. Traditional wood surface color classification mainly depends on workers’ visual observations, and manual color classification is prone to visual fatigue and quality instability. In order to reduce labor costs of sorting and to improve production efficiency, in this study, we introduced machine vision technology and an unsupervised learning technique. First-order color moments, second-order color moments, and color histogram peaks were selected to extract feature vectors and to realize data dimension reduction. The feature vector set was divided into different clusters by the K-means algorithm to achieve color classification and, thus, the solid wood panels with similar surface color were classified into one category. Furthermore, during twice clustering based on second-order color moment, texture recognition was realized on the basis of color classification. A Citation: Wang, Z.; Zhuang, Z.; Liu, sample of beech wood was selected as the research object, not only was color classification completed, Y.; Ding, F.; Tang, M. Color but texture recognition was also realized. The experimental results verified the effectiveness of the Classification and Texture technical proposal. Recognition System of Solid Wood Panels. Forests 2021, 12, 1154. Keywords: solid wood board; color feature; unsupervised learning; color classification; texture https://doi.org/10.3390/f12091154 recognition Academic Editors: Michele Brunetti, Michela Nocetti and Alexander Petutschnigg 1. Introduction Received: 31 July 2021 Solid wood panels are widely used in solid wood furniture [1], wood flooring, and Accepted: 23 August 2021 other industries because of their gloss finish, good decoration performance, effective sound Published: 26 August 2021 absorption, high strength, easy processing, durability, and long service life. Moreover, waste wooden products can be degraded naturally and will hardly produce pollution. The Publisher’s Note: MDPI stays neutral surface parameters of solid wood panels include color [2], texture [3], gloss [4], roughness, with regard to jurisdictional claims in deformation rate, planeness, etc., which are directly related to the visual beauty and published maps and institutional affil- decorative performance of wood products and are closely related to the quality evaluation iations. 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. Copyright: © 2021 by the authors. In actual production, solid wood panels always need to be spliced together to form larger Licensee MDPI, Basel, Switzerland. wood panels. It is preferable that panels with similar colors are spliced together to meet This article is an open access article the needs of individual customers. Traditionally, the surface color classification of solid distributed under the terms and wood has mainly been based on manual observation, which is significantly influenced by conditions of the Creative Commons human factors and has low efficiency and, therefore, cannot meet society’s needs in terms of Attribution (CC BY) license (https:// processing automation and intelligence and human–computer interaction. The emergence creativecommons.org/licenses/by/ of new detection technologies that depend on machines overcomes the shortcomings of 4.0/). Forests 2021, 12, 1154. https://doi.org/10.3390/f12091154 https://www.mdpi.com/journal/forests
Forests 2021, 12, 1154 2 of 18 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 require- ments, 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
Forests 2021, 12, 1154 3 of 18 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 characteris- tics 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. 2. Materials and Methods 2.1. Panels A sample of beech wood was selected as the research object for the surface color cluster analysis of solid wood panels. The experiments were carried out on beech from Europe, which can adapt to a wide range of climate and temperature. The wood panels needed for the experiment were purchased from the wood merchants in Nanjing, Jiangsu Province and can be bought in the market. The density of the beech was 0.70 g/cm3 and the moisture content was 10.2%. After chord cutting, longitudinal cutting, planning, and polishing, a 1000 mm × 100 mm × 10 mm (length × width × height) smooth surface panel was obtained. 2.2. Imaging In actual production, color classification is performed on the image of a solid wood floor panel through several processing steps. The structure of the image acquisition system built in this study is shown in Figure 1. There were four main components to the acquisition system, namely the transmission device, a CCD camera, a camera fixing device, and a control device. The core device of the CCD camera in the image acquisition system was a Linea LA-GC-02K05B color line scan camera (Teledyne DALSA Co., Waterloo, ON, Canada). The specific parameters of this device are shown in Table 1. The camera adopts high-sensitivity CMOS (complementary metal oxide semiconductor) technology; the line frequency can reach up to 26 KHz, with high acquisition speed, low noise, high single-line resolution, and high sensitivity. To improve the imaging quality of the acquired image, it was necessary to reduce the influence of light conditions on the acquisition effect during the data acquisition process, thus ensuring uniform illumination and minimizing the light reflection in the data acquisition area. Therefore, a linear light source LCOL-304-w (HZN, shanghai, China) was selected to meet the requirement of uniform illumination in the single-line area required by the linear CCD camera. The transmission belt in the image acquisition system consists
Forests 2021, 12, 1154 4 of 18 of two parts rotating at a uniform speed. They dragged the wood panels into the data acquisition area, and then sent the solid wood panels completing the image acquisition to the storage area. The control and sensing device included sensors and a control panel. The wood transmission speed and the start and stop of data acquisition were controlled 021, 12, x FOR PEER REVIEW through the control panel. When collecting data, the scanning frequency was set to 1280 4 o lines for processing once, and after collecting data on the front of each sheet, a 2048 × 18,000 pixel image of the solid wood panel with a depth of 8 bit was obtained. Figure 1.Figure Image1. Image acquisition acquisition device:(1) device: (1)transmission transmission device, (2) transmission device, belt, (3) control (2) transmission panel, belt, (3) control pa (4) CCD camera holder, (5) CCD camera, (6) sample solid wood floor panel, (7) photoelectric sensor, (4) CCD camera holder, (5) CCD camera, (6) sample solid wood floor panel, (7) photoelectric sen and (8) pressure wheel. and (8) pressure wheel. Table 1. Specific parameters of the CCD camera. The core device Parameter Name of the CCD camera in the image Parameter Parameter acquisition Name system Parameterwas a Linea L GC‐02K05B color Modelline scanLinea camera (Teledyne DALSA LA-GC-02K05B Spectrum Co., Waterloo,Color ON, Canada). ◦C specific parameters of this device are shown in Table 1. The camera adopts Sensor Technology CMOS Operating temperature 0–65 high‐sensi Resolution 2048 × 2 Pixel depth 8 bit ity CMOS (complementary Pixel Size metal 7.04 ×oxide 7.04 µmsemiconductor) technology;Upthe Horizontal frequency line to 26 frequency KHz reach up to 26 KHz, with high acquisition speed, low noise, high single‐line resolut and high2.3.sensitivity. PreprocessingTo improve the imaging quality of the acquired image, it was ne Images sary to reduce the influence The three-channel ofimage color lightofconditions the BMP formaton collected the acquisition by the imageeffect during the d acquisition system was converted into a gray image, and morphological acquisition process, thus ensuring uniform illumination and minimizing the operations such as erosion and light ref dilation were carried out. The canny edge operator was applied to detect the boundary of tion in the thepanel. dataThe acquisition area. closed operation usedTherefore, a convolutiona kernel linear of 7light source × 7, the numberLCOL‐304‐w of iterations (HZ shanghai, wasChina) was 1, and then selected used adaptivetobinarization. meet the requirement of uniform Finally, the boundary of the woodillumination in the image in the was found and the panel image was cut out. Canny edge gle‐line area required by the linear CCD camera. The transmission belt in the detection [28] technology is image applied in image processing [29] and has been widely used in traffic accident detection [30], quisition system consists of two parts rotating at a uniform speed. They dragged the w crack automatic segmentation [31], intelligent traffic management [32], and other fields. panels into the data The solid wood acquisition panel image was area, and then extracted sent from the thebackground, black solid wood and panels completing the influence image acquisition of the background to thewasstorage removed.area. The control One example and is of the results sensing shown indevice Figure 2.included sens and a control panel. The wood transmission speed and the start and stop of data acqu tion were controlled through the control panel. When collecting data, the scanning quency was set to 1280 lines for processing once, and after collecting data on the fron each sheet, a 2048 × 18,000 pixel image of the solid wood panel with a depth of 8 bit w obtained. Table 1. Specific parameters of the CCD camera. Parameter Name Parameter Parameter Name Paramete
OR PEER REVIEW 5 of 18 other Forests 2021, fields. The solid wood panel image was extracted from the black background, and5 of 18 12, 1154 the influence of the background was removed. One example of the results is shown in Figure 2. (a) (b) Figure 2. Example ofFigure the result: (a) original 2. Example image; of the result: (b) image (a) original with image; the background (b) image removed. with the background removed. 2.4. Color Features of Solid Wood Panel Images 2.4. Color Features of Solid TheWood generalPanel Images descriptive methods of measuring color features include color histograms, color moments, The general descriptive color sets,ofcolor methods aggregation measuring vectors, color color correlation features graphs,histo‐ include color etc. Since color distribution information is mainly concentrated in low-order moments, only the grams, color moments, color sets, color aggregation vectors, color correlation graphs, etc. first-order moments (mean), second-order moments (variance), and third-order moments Since color distribution information (skewness) of colors areissufficient mainlytoconcentrated express the color indistribution low‐order in moments, the image. Inonly addition, the first‐order moments (mean), color sets second‐order are an approximation moments of the (variance), color histograms and aggregation and color third‐ordervectors mo‐ are ments (skewness) ofan colors areofsufficient evolution to expresstherefore, the color histograms; the color distribution color in the image. histograms describe In color features that are more extensive and representative. The first-order addition, color sets are an approximation of the color histograms and color aggregation color moment µi and the second-order color moment σi are mathematically defined as follows: vectors are an evolution of the color histograms; therefore, color histograms describe color features that are more extensive and representative. The 1 first‐order N color moment and the second‐order color moment are mathematicallyNdefined µi = ∑ pi,j as follows: (1) j =1 1 !1 1, N 2 2 (1) (2) N ∑ i,j σi = p − µi j =1 where pi,j is the pixel value at the image coordinate, and its actual meaning represents the pixel mean and variance of a picture. Color sorting is mainly 1 used to ensure a consistent appearance of the solid(2) wood , panel to meet consumer psychology needs. The RGB color space is the most basic and most commonly applied color space in computer digital image processing. The hue and saturation in the HSV color space are directly related to humans’ perceptions of color. where , is the pixel value The hue at the image and saturation coordinate, components directly and its actual correspond meaning to humans’ represents perceptions and their the pixel mean andpsychological variance ofresponses a picture. to color and, therefore, are widely used in color classification. Color sortingLab color space is mainly can be used to directly ensureused to compare appearance a consistent and analyze different of thecolors solidbywood using the geometric distance in the color space, which can be effectively panel to meet consumer psychology needs. The RGB color space is the most basic and and conveniently used to measure the smaller color difference. The distribution range of the wood color is narrow. most commonly applied color space in computer digital image processing. The hue and The color characteristics in the Lab color space are used to represent the surface color of saturation in the HSV color wood, whichspace are directly is beneficial relatedand for comparing to humans’ classifyingperceptions wood surface of color. The colors. hue and saturation components The calculationdirectly formulascorrespond to humans’ of the first-order color momentperceptions and theircolor and the second-order moment are shown in Equations (1) and (2). The average psychological responses to color and, therefore, are widely used in color classification.value of wood image pixels Lab color space can be directly used to compare and analyze different colors by using the geometric distance in the color space, which can be effectively and conveniently used to measure the smaller color difference. The distribution range of the wood color is narrow.
Forests 2021, 12, x FOR PEER REVIEW 6 of 18 Forests 2021, 12, 1154 6 of 18 The calculation formulas of the first-order color moment and the second-order color moment are shown in Equations (1) and (2). The average value of wood image pixels de- scribes thethe describes overall overallcolor color distribution distributionofofwood woodimages imagesandandthe thevariance variancedescribes describes the the uni- formity uniformity of the image distribution in the color domain. The color histogram of threecolor of the image distribution in the color domain. The color histogram of three spaces of solid color spaces woodwood of solid panelpanel image is shown image is shownin Figure 3, which in Figure shows 3, which thethe shows numbers numbersof of pixels with pixelseach withvalue in theinR,the each value G, R, B, G, H,B,S,H, V,S,L,V,a,L,and b channels, a, and respectively. b channels, respectively. (a) Color histogram of RGB color space (b) Color histogram of HSV color space (c) Color histogram of Lab color space Figure 3. 3. Color Colorhistogram histogramofofbeech beechpanel panelinin RGB, RGB, HSV, HSV, andand LabLab color color space. space. 2.5. Solid Wood Panel Clustering 2.5. Solid Wood Panel Clustering Traditional artificial methods are not very effective for color classification of solid Traditional artificial methods are not very effective for color classification of solid wood panel surface colors, while supervised learning consumes a lot of manpower and wood panel surface colors, while supervised learning consumes a lot of manpower and material resources for label setting. In this study, an unsupervised learning clustering material algorithmresources for label was introduced setting. to solve theIn thisclassification color study, an unsupervised learning problem of solid woodclustering panels. al- gorithm was introduced to solve the color classification problem of solid wood panels. 2.5.1. Dataset 2.5.1.The Dataset images of solid wood panels collected by the image acquisition system had high resolutions and were The images large of solid in size. wood The collected panels original image by thesize imageof each collected acquisition imagehad system washigh 2048 * 18,000 pixels and contained a variety of information such as color, resolutions and were large in size. The original image size of each collected image texture, and was defects in the image. As shown in Figure 4, a variety of complex information co-exists 2048 * 18,000 pixels and contained a variety of information such as color, texture, and in an de- image, fects inwhich makesAs the image. color classification shown in Figuredifficult. Therefore, 4, a variety in thisinformation of complex study, the larger imagein an co-exists was divided into blocks, and each large image was divided into 3 × 3 = 9 subgraphs. image, which makes color classification difficult. Therefore, in this study, the larger Due image to the small area of each subgraph, the surface color information was more centralized was divided into blocks, and each large image was divided into 3 × 3 = 9 subgraphs. Due and unified. Such a dataset was conducive to the classification of the solid wood panel to the small area of each subgraph, the surface color information was more centralized surface colors. and unified. Such a dataset was conducive to the classification of the solid wood panel A sample of beech wood was selected as the research object for the surface color surface colors. cluster analysis of solid wood. A total of 200 samples of beech wood were preprocessed and segmented to obtain the dataset of 200 × 3 × 3 = 1800.
Forests Forests2021, 2021,12, 12,x1154 FOR PEER REVIEW 7 7ofof18 18 Figure 4. Original image and divided graph. Figure 4. Original image and divided graph. 2.5.2. Clustering Based on Color Features A sample of beech wood was selected as the research object for the surface color clus‐ Firstly, as previously mentioned, the solid wood panel images were preprocessed. ter analysis of solid wood. A total of 200 samples of beech wood were preprocessed and Then, the first-order color moments, second-order color moments, and color histogram segmented to obtain the dataset of 200 × 3 × 3 = 1800. peaks of the R, G, B, L, a, b, H, S, and V nine color channels of each solid wood panel image were extracted, and a total of 27 color features were used for clustering. Finally, 2.5.2. Clustering Based on Color Features the k-means clustering algorithm was selected to realize the clustering of surface color Firstly, as previously characteristics of solid wood. mentioned, the solid wood panel images were preprocessed. Then,Thethe steps first‐order of the color moments, algorithm are tosecond‐order divide the data color intomoments, K groups,and color histogram to randomly select K peaks objects as the initial clustering center, then to calculate the distance between each panel of the R, G, B, L, a, b, H, S, and V nine color channels of each solid wood object image were and each extracted, seed clusteringandcenter, a total and of 27tocolor features assign were used each object to thefor clustering. nearest Finally, clustering the center. k‐means clustering algorithm was selected to realize the clustering Clustering centers and the objects assigned to them represent a clustering. The cluster of surface color char‐ acteristics of solid wood. center is recalculated based on the existing objects in the cluster when each sample is The steps assigned. Thisofprocess the algorithm is repeatedare tountil divide the dataare no objects into K groups,to reassigned todifferent randomly select K clustering objects centersasorthe wheninitial the clustering clustering center, centers then do notto change. calculate the distance between each object and each The seed clustering K-means center, clustering and toisassign method widelyeachusedobject and istostable the nearest clustering and effective. center. However, Clustering centers and the objects assigned to them represent a clustering. the algorithm needs to specify the K value in advance. Since the clustering is unsupervised, The cluster center is recalculated the optimal based on K value cannot be the existing objects determined based on in the the classification cluster when results. each sample Thereishave as‐ signed. This process been studies on the is repeated optimal until no K value objects [33,34]. In are thisreassigned to different study, the contour clustering coefficient cen‐ method wasorselected ters when the to determine the K value clustering centers do not ofchange. the clustering of the solid wood panel images. The The coreK‐means index of this methodmethod clustering is the silhouette is widely coefficient used and is[35]. Theand stable silhouette coefficient effective. However, of a sample the algorithm Xi is defined pointneeds to specify as the follows: K value in advance. Since the clustering is unsuper‐ vised, the optimal K value cannot be determined based on the classification results. There have been studies on the optimal K value b−a S = [33,34]. In this study, the contour coefficient (3) method was selected to determine the K value( a, max ofbthe ) clustering of the solid wood panel images. where aThe core is the index distance average of this methodbetween is the silhouette Xi and coefficient other samples in [35]. The silhouette the same co‐ cluster, called efficient cohesion, of and a sample wherepoint Xi isaverage b is the defineddistance as follows:between X and all samples in the nearest i cluster is as follows: cluster, called separation. The definition of nearest S (3) max , 1 n P∑ 2 j = arg min where a is the average distanceCbetween Xi | P −samples Xi | (4) Ck and other ∈Ck in the same cluster, called cohesion, and where b is the average distance between Xi and all samples in the nearest cluster, where Pcalled is theseparation. sample in aThe definition cluster Ck . of nearest cluster is as follows: In fact, after taking the average distance 1 of Xi to all samples of a certain cluster as the distance from the point to thearg min one | cluster, | closest to Xi is selected as (4) cluster the nearest cluster. ∈ whereThe P isaverage contour the sample in a coefficient cluster Ck. is obtained by calculating the contour coefficient of all samples and then by calculating the average value. The closer the distance between the
In fact, after taking the average distance of Xi to all samples of a certain cluster as the distance from the point to the cluster, one cluster closest to Xi is selected as the nearest cluster. Forests 2021, 12, 1154 The average contour coefficient is obtained by calculating the contour coefficient 8 of 18 of all samples and then by calculating the average value. The closer the distance between the samples in one cluster, the farther the distance between the samples in different clusters, the greater samples the cluster, in one averagethecontour coefficient, farther the and thethe distance between better samplesthein clustering result. The different clusters, the maxi‐ greater mum the average average contour contour coefficient, coefficient and K is thethebest better the clustering clustering result. number. The maximum Using the dataset pro‐ average duced in contour coefficient this scheme K is the bestthat and considering clustering number. the K value canUsing rangethe dataset from 2 to produced 10, each K value was clustered and the corresponding contour coefficient was obtained. K in this scheme and considering that the K value can range from 2 to 10, each valuethe Then, wasrelation‐ clustered and the corresponding contour coefficient was obtained. Then, the relationship ship between the K value and contour coefficient was plotted, and the K value with the between the K value and contour coefficient was plotted, and the K value with the largest largest contourcontour coefficient coefficient was The was selected. selected. pythonThe python implementation implementation is shown is shown in Figure 5, andinthe Figure 5, and the optimal optimal K value K value was 8. was 8. Figure 5. Contour coefficient and K value. Figure 5. Contour coefficient and K value. The best K value obtained by theoretical analysis was 8, but in actual production, it is oftenThe adjusted best Kaccording to different value obtained customer needs. by theoretical In order analysis was to 8, meet theactual but in actualproduction, needs, it the K value in the experiment was set to 3–11, and the dataset of solid wood was clustered is often adjusted according to different customer needs. In order to meet the actual needs, with the K different value in color feature combinations. the experiment was set to 3–11, and the dataset of solid wood was clustered In this study, three color features were selected and combined as “first-order color with different color feature combinations. moment’, “first-order color moment + second-order color moment’, “first-order color In this study, three color features were selected and combined as “first‐order color moment + color histogram peak”, “second-order color moment + color histogram peak”, moment’, “first‐order and “first-order color moment color moment + second‐order + second-order color+moment’, color moment “first‐order color histogram peak”. color mo‐ ment + color histogram peak”, “second‐order color moment + color histogram peak”, and 3. Results color moment + second‐order color moment + color histogram peak”. “first‐order 3.1. Color Classification of Solid Wood Panels 3. Results 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 3.1. Color Classification of Solid Wood Panels columns in each figure represents the number of clusters (K value), and five rows represent five Figure 6 shows color feature that, under combinations. Asthe five color a single imagefeature was not combinations, the representative, in solid order to wood reflect panels inthe the dataset real were clustered classification into effect of the three, four,clustering unsupervised five, six, algorithm and sevenoncategories. the surfaceThecolornumber ofofcolumns the solid in woodeach figure panel, ninerepresents images weretherandomly number of clusters selected from(Keach value), and five clustering rows rep‐ result and spliced together to form a new image to represent the overall performance resent five color feature combinations. As a single image was not representative, in order of this class. toUnder thethe reflect combination of five color real classification features, effect of thefor each K value, clustering unsupervised there were five × K images. algorithm on the sur‐ Finally, images under each color feature combination were arranged in order from light face color of the solid wood panel, nine images were randomly selected from each clus‐ to dark. tering result and spliced together to form a new image to represent the overall perfor‐ mance 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.
Forests 2021, 12, 1154 9 of 18 Forests 2021, 12, x FOR PEER REVIEW 9 of 18 (a) K = 3 (b) K = 4 (c) K = 5 (d) K = 6 (e) K = 7 Figure Figure6.6.KK= =3–7 3–7clustering clusteringresult resultimages. images.
Forests 2021, 12, x FOR PEER REVIEW 10 of 18 Forests 2021, 12, 1154 10 of 18 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 It can be seen from each row of the above figures that, under a certain color feature different, the clustering results were able to sort solid wood panel surface colors from light combination, although the number of clustering the centers, namely the K value, were to dark on the whole. With an increase in K value, the difference in surface color infor‐ different, the clustering results were able to sort solid wood panel surface colors from mation of dark light to the solid on thewood whole. panel Withinaneach classingradually increase K value, the decreases. differenceFrom each column, in surface color it caninformation be seen that thesolid of the surface woodcolor panelinformation in each class of solid wood gradually panels decreases. in each From class was each column, it cha‐ otic, that some contained obvious texture information, and that some classified can be seen that the surface color information of solid wood panels in each class was chaotic, the panels with thatdifferent depthsobvious some contained into one class information, texture (the last column and thatof some each classified graph isthe thepanels most with obvious). Thedifferent key to depths the aboveinto problems one class (the last column is that, due tooftheeach graph low is the setting, K value most obvious). The keyinitial the different to the above clustering problems centers mayislead that, to duethe to the low K value instability setting, of the the different clustering initial results, clustering which produces centers may lead to the instability of the clustering results, which produces multiple local multiple local optimal values. optimal values. When the clustering center was selected as the theoretical optimal value, i.e., K = 8, it When the clustering center was selected as the theoretical optimal value, i.e., K = 8, it cancan bebeseen seenfrom fromFigure Figure 77that thatthe theclustering clustering results results improved improved compared compared with thewith the previ‐ previous ousfive five KK values. values. As Asthe the number number of clusters of clusters increased increased as the Kasvalue the Kincreased, value increased, the simi‐ the similarity larity of color information on the surface of solid wood panel in each of color information on the surface of solid wood panel in each class continually increased class continually increased and the and the difference difference of color information of color information on the surfaceon ofthesolid surface woodofpanel solidinwood panel in adjacent classes gradually decreased. adjacent classes gradually decreased. Figure Figure7.7.KK==88clustering resultimages. clustering result images. Table Table 2 2shows showsthe thenumber number ofof solid solidwood woodpanel panelimages imagesin each cluster in each under cluster five color under five color feature combinations. It can be seen that, for the dataset of 1800 images, when K = 8, feature combinations. It can be seen that, for the dataset of 1800 images, when K = 8, therethere were only 11 images in the least number of classes and that their surface color information were only 11 images in the least number of classes and that their surface color information was very similar. was very similar. Table 2. K = 8 number of images in each cluster. Features 1 2 3 4 5 6 7 8 Mean 362 330 328 251 239 152 109 29 Mean + variance 393 388 319 247 231 111 100 11 Mean + histogram 381 348 307 272 207 160 90 35 Variance + histogram 377 366 313 289 191 165 87 12
Forests 2021, 12, 1154 11 of 18 Table 2. K = 8 number of images in each cluster. Features 1 2 3 4 5 6 7 8 Mean 362 330 328 251 239 152 109 29 Mean + variance 393 388 319 247 231 111 100 11 Mean + histogram 381 348 307 272 207 160 90 35 Variance + histogram 377 366 313 289 191 165 87 12 Mean + variance + histogram 384 358 311 266 190 163 82 46 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 Figures 8–10 appeared to be obvious classes of image texture information. Fourthly, from Forests 2021, 12, x FOR PEER REVIEWTables 3–5, the number in the last column changed a little, and the number in the previous 12 of 18 columns changed slightly. Figure 8. K == 99 clustering clustering result result images.
Forests 2021, 12, 1154 12 of 18 Forests 2021, 12, x FOR PEER REVIEW 12 of 18 Table 3. K = 9 number of images in each cluster. Features 1 2 3 4 5 6 7 8 9 Mean 325 312 304 242 239 182 109 77 10 Mean + variance 384 325 305 253 221 110 103 88 11 mean + histogram 371 336 308 232 197 178 90 79 9 Variance + histogram 349 343 284 231 228 154 114 86 11 Mean + variance + histogram 375 345 309 244 190 160 92 76 9 Table 4. K = 10 number of images in each cluster. Features 1 2 3 4 5 6 7 8 9 10 Mean 288 269 258 232 209 191 166 95 81 11 Mean + variance 316 301 265 243 205 179 108 94 78 11 Mean + histogram 310 299 295 229 221 137 154 77 69 9 Variance + histogram 363 335 289 259 194 176 86 80 11 7 Mean + variance + histogram 304 287 284 228 208 178 146 77 77 11 Table 5. K = 11 number of images in each cluster. Features 1 2 3 4 5 6 7 8 9 10 11 Mean 265 265 256 235 199 179 146 122 68 55 10 Mean + variance 300 298 262 226 205 175 108 96 75 44 11 Mean + histogram 274 270 257 214 209 170 149 125 77 46 9 Variance + histogram 316 312 244 243 189 152 109 85 73 66 11 Mean + variance + histogram 316 300 287 243 201 148 136 72 48 40 9 Figure 8. K = 9 clustering result images. Figure Figure9.9.KK==10 10 clustering resultimages. clustering result images. It can be seen from Figures 8–10 that different color feature combinations have dif- ferent 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.
Forests 2021, 12, 1154 13 of 18 Forests 2021, 12, x FOR PEER REVIEW 13 of 18 Figure 10. Figure 10. K = 11 clustering result images. When K ≥ 9, there was almost no change in the clustering results of the last class of It can be seen from Figures 8–10 that different color feature combinations have dif‐ images, that is, the clustering centers of these images did not change. With an increase in K ferent effects on clustering. Color and texture are important characteristics that affect the value, the similarity of the images was higher and higher. Therefore, the K value, in this appearance of wood products. Color classification and texture recognition are conducive study, should be set to nine. to improving the effect of solid wood panel sorting. When K 3.2. Texture ≥ 9, thereRecognition Information was almost no change in the clustering results of the last class of images, Forthat is, the clustering the classes with obviouscenters of these texture images did information not change. in Lines With 2, 4, and 5 inan increase Figures in 8–10, K value, the similarity of the images was higher and higher. Therefore, the K value, we found that their color feature combinations had second-order color moments. In total, in this study, 166 should images in be theset to nine.category of “mean” combination in Table 4 were selected as seventh datasets, and the second-order color moments were used to extract feature vectors for 3.2. Textureclustering secondary Information ofRecognition these images, K = 2. For the classes In Figure with 11, nine obvious selected randomly texture information images wereintaken Linesfrom 2, 4, 166 andimages 5 in Figures of the8–10, first we found that their color feature combinations had second‐order color moments. clustering, where b and c are the results of the second clustering—in b, the texture was In total, 166 images relatively in theand smooth seventh category the color of “mean” information combination was unified, while in Table in c, 4 wereinformation the texture selected as datasets, was and the Itsecond‐order prominent. can be seen color moments that the were used second-order to moment color extract feature had a vectors for significant secondary influence on clustering of these the texture images, recognition ofKsolid = 2. wood. 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 infor‐ mation was prominent. It can be seen that the second‐order color moment had a signifi‐ cant influence on the texture recognition of solid wood. Figure 11. Second-order color moment result images: (a) the first clustering result images, (b) the second clustering result images with smooth outer surface, (c) the second clustering result images Figure with 11. Second‐order obvious color moment result images: (a) the first clustering result images, (b) the texture information. second clustering result images with smooth outer surface, (c) the second clustering result images with obvious texture The images information. 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) wereThe images selected of solid as the wood datasets, panels and for thevectors the feature first eight categories extracted of second-order by the the “mean + histo‐ color gram” combination moments in Table were used for 3 (theclustering the second last category haddatasets. of these fewer images and was relatively
Forests 2021, 12, x FOR PEER REVIEW 14 of 18 Forests 2021, 12, 1154 14 of 18 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 are shown shown inin Figure Figure 12. 12. The second clustering divided divided each each relatively smooth, result of the first clustering into two categories; one category was relatively smooth, with with uniform color information, and the other category had prominent texture information information and and complexsurface more complex surfaceinformation. information.After Afterthe the overall overall color color classification classification of the of the images images in in the the dataset dataset waswas completed, completed, the the second‐order second-order color color moment moment effectively effectively identified identified the the tex‐ texture ture information information in each in each class class and further and further optimized optimized the clustering the clustering results. results. Figure 12. Two‐clustering result images. Two-clustering result images. When When the the clustering clustering center center K K== 99 was was selected, selected, the the clustering clustering results results of of the the surface surface information information of solid wood panels met the production requirements; therefore, the optimal of solid wood panels met the production requirements; therefore, the optimal K K value value in in this this experiment experiment was was nine. In actual nine. In actual production, production, ifif only only aa rough rough classification classification ofof surface surface color color of of solid solid wood wood panels panels isis needed, needed, aa smaller smaller KK value value can can be be selected. selected. InIn order order to to achieve achieve aa more more detailed detailed color color classification, classification, an an appropriate appropriate feature feature combination combination can can be be selected along with an increase of the K value of clustering center. If we selected along with an increase of the K value of clustering center. If we want to identifywant to identify the the texture texture information, information, we we can can choose choose “twice “twice clustering” clustering” and and further further refine refine the the results results of of the the first clustering. In practical applications, different processing methods can be selected first clustering. In practical applications, different processing methods can be selected to to meet meet thethe personalized personalized needs needs of of different different customers. customers. In In this experiment, the data in the last column this experiment, the data in the last column in in Tables Tables 3–5 3–5 corresponded corresponded to to the the darkest color class darkest color class in in aagraph graphwith withthe thesame sameKKvalue. value.TheThetypes types and and numbers numbers of of images images in in these categories basically did not change with a change in color feature combination these categories basically did not change with a change in color feature combination and and K value. We found that these specific images were quite different from other images, 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 which may have been caused by pests, diseases, or special growth environments and can be treated as exceptions. be treated as exceptions. From Figures 8–10, it can be seen that, after sorting the clustering results from light to From Figures 8–10, it can be seen that, after sorting the clustering results from light dark, the classification of solid wood surface color was realized. The larger the K value, the to dark, the classification of solid wood surface color was realized. The larger the K value, smaller the difference between grades and the more detailed the classification. It can be the smaller the difference between grades and the more detailed the classification. It can seen from Figure 12 that the texture information was recognized by using texture sensitive be seen from Figure 12 that the texture information was recognized by using texture sen‐ color features. After color classification and texture recognition, the panels with similar sitive color features. After color classification and texture recognition, the panels with sim‐ surface information were spliced together to realize the coordination and consistency of ilar surface information were spliced together to realize the coordination and consistency the appearance of the spliced panel, as shown in Figure 13. of the appearance of the spliced panel, as shown in Figure 13.
ests 2021, 12, x FOR Forests PEER 2021, 12, REVIEW 1154 15 of 18 15 of 18 (a) No clustering (b) After clustering Figure 13. The result Figure 13.images: (a) no The result classification, images: (b) after clustering. (a) no classification, (b) after clustering. 4. Discussion4. Discussion The above The aboveverified sections sectionsthe verified the effectiveness effectiveness of solidofwoodsolid wood surface surface color color sortingsorting based on machine vision and unsupervised learning algorithm. based on machine vision and unsupervised learning algorithm. By creating new datasets By creating new datasets and and analyzing the effect of different color feature combinations, a new classificationmethod for analyzing the effect of different color feature combinations, a new classification method formulti-level multi‐levelcolor colorsorting sortingof solid wood of solid woodplates was was plates proposed, and texture proposed, recognition was and texture recognition was realized. In this study, the problem of setting the K value in advancesolved realized. In this study, the problem of setting the K value in advance was was through theoretical analysis and experimental summary. solved through theoretical analysis and experimental summary. Based on learning style, machine learning can be divided into supervised learning Based on learning style, machine learning can be divided into supervised learning and unsupervised learning. At present, the supervised learning classification algorithms and unsupervised learning. At present, the supervised learning classification algorithms that are widely used mainly include decision tree, k-nearest neighbor (KNN) algorithm, that are widely used mainly include decision tree, k‐nearest neighbor (KNN) algorithm, support vector machine (SVM) algorithm, naive Bayesian Model (NBM), deep learning, support vector machine (SVM) algorithm, naive Bayesian Model (NBM), deep learning, and other methods. However, the surface information of solid wood panels is complex, and other methods. However, the surface information of solid wood panels is complex, it it is difficult to label categories manually, and the cost of manual category labeling is too 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 high to obtain enough prior knowledge for supervised learning. Unsupervised learning technology can effectively solve this problem. technology can effectively solve this problem. In this paper, the feature vectors of solid wood panel images were extracted based on In this paper, the feature vectors of solid wood panel images were extracted based color features for clustering, which realized data dimensionality reduction, which can not on color features for clustering, only reduce which the difficulty ofrealized databut calculation, dimensionality reduction, also save processing which time [36].canIn the field of not only reduce the difficulty of calculation, but also save processing machine learning, there are also Hough transform method and wavelet and time [36]. In the fieldlocal binary of machinepattern learning, there are method foralso Hough feature transform method and wavelet and local binary extraction. pattern method Compared for feature with extraction. the supervised learning method, the unsupervised learning method Compared appliedwith to the the supervised learningofmethod, color classification solid wood the unsupervised panels can overcomelearning themethod disadvantages of applied to difficult the colormanual classification category of labeling solid wood andpanels high cost canofovercome the disadvantages manual category labeling, because the of difficult supervised manual category learning labeling and needs algorithm high costenoughof manual category labeling, prior knowledge becauselearning. for supervised the supervised learning algorithm needs enough prior knowledge Feature vectors were extracted based on the selected color features. On for supervised learn‐ the one hand, ing. sufficient information of solid wood panels can be obtained; on the other hand, it can reduce Featurethevectors dimensionwere extracted based on of data, reduce thethe selectedofcolor difficulty features.and calculation, On the one hand, improve the processing sufficient information of solid according speed. In addition, wood panels to thecanclustering be obtained; on the results other hand, of different coloritfeatures, can re‐ we made duce the dimension it clear which of data, color reduce feature the wasdifficulty suitable for ofcolor calculation, and improve classification and which thecolor pro‐feature was cessing speed. In addition, suitable for texture according to the clustering results of different color features, recognition. we made it clearInwhich termscolor feature was results, of experimental suitablefrom for color classificationeffect, the classification and which color scheme the technical feature wasproposed suitable for texture recognition. in this paper can realize more detailed classification with the increase of K value. In terms Thisofisexperimental results, by difficult to complete from the classification supervised effect, the learning method. Duetechnical scheme to the fact that the surface proposed ininformation this paper can realize of solid morepanels wood detailed wasclassification complex and with the increase there of K value. were similarities between the This is difficult to complete panels, with the by supervised increase of thelearning number method. Due to the of classifications, thefact that the surface difference between different informationclasses of solid wood panels decreased. It is was complex difficult and theresuch to distinguish weresmall similarities differencesbetweenin thetheprogress of panels, with manual category the increase labeling, of the number andofmanual labelingthe classifications, cannot provide difference a training between set, test set, and different verification classes decreased. It isset for theto difficult supervised distinguish learning such smallalgorithm. differences in the progress of
You can also read