CN114817609A - Automatic sorting method for colors of solid wood floor based on lifting tree - Google Patents

Automatic sorting method for colors of solid wood floor based on lifting tree Download PDF

Info

Publication number
CN114817609A
CN114817609A CN202210396144.8A CN202210396144A CN114817609A CN 114817609 A CN114817609 A CN 114817609A CN 202210396144 A CN202210396144 A CN 202210396144A CN 114817609 A CN114817609 A CN 114817609A
Authority
CN
China
Prior art keywords
solid wood
wood floor
color
image
color depth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210396144.8A
Other languages
Chinese (zh)
Other versions
CN114817609B (en
Inventor
刘�英
庄子龙
丁奉龙
倪超
杨雨图
谢超
周海燕
姜东�
倪晓宇
缑斌丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Forestry University
Original Assignee
Nanjing Forestry University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Forestry University filed Critical Nanjing Forestry University
Priority to CN202210396144.8A priority Critical patent/CN114817609B/en
Publication of CN114817609A publication Critical patent/CN114817609A/en
Application granted granted Critical
Publication of CN114817609B publication Critical patent/CN114817609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Spectrometry And Color Measurement (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method for automatically sequencing colors of solid wood floors based on a lifting tree, which comprises the following steps: collecting and preprocessing a plurality of solid wood floor surface images; carrying out color space transformation on the solid wood floor image; establishing a color depth sequence of the solid wood floor image; setting the color depth value of each solid wood floor image; extracting a color characteristic vector of the solid wood floor image; establishing a solid wood floor color regression tree mathematical model and optimizing parameters of the solid wood floor color regression tree mathematical model; calculating the color depth value of the solid wood floor image to be measured through the optimal regression tree mathematical model; and performing online sequencing on the colors of the solid wood floor images according to the color depth values of the solid wood floor images. The method extracts the color characteristic vectors of the solid wood floors by taking the preliminarily established color depth sequence of the solid wood floors as priori knowledge, and then regresses the color characteristic vectors of the solid wood floors by using a gradient lifting decision tree, so that the stepless classification of the colors of the solid wood floors is realized, and meanwhile, the automatic ordering of the color depths of the solid wood floors can be realized.

Description

Automatic sorting method for colors of solid wood floor based on lifting tree
Technical Field
The invention relates to a computer-aided sorting method, in particular to an automatic sorting method of colors of solid wood floors based on a lifting tree.
Background
The color of the solid wood floor is an important evaluation index of the surface of the solid wood floor, whether the product quality problem caused by large color change exists on the same floor or not needs to be considered when the solid wood floor is produced, and the color coordination and consistency of the solid wood floors in the area also need to be fully considered when the solid wood floor is laid.
Traditional manual color sorting mode relies on manual identification more, and manual color sorting is difficult to realize long-time continuous sorting, and easily produces the confusion along with operating time's increase. Therefore, it is desirable to provide a method for automatically sorting colors and automatically sorting shades of solid wood floors.
Disclosure of Invention
The invention aims to solve the technical problem of providing an automatic sorting method of colors of solid wood floors based on a lifting tree, which takes the preliminary establishment of a color depth sequence of the solid wood floors as prior knowledge, extracts color features of the solid wood floors, and then uses a gradient lifting decision tree to carry out regression on the color features of the solid wood floors so as to realize the stepless classification of the colors of the solid wood floors and simultaneously realize the automatic sorting of the color depths of the solid wood floors.
In order to achieve the technical purpose, the technical scheme adopted by the invention is as follows:
a method for automatically sequencing colors of solid wood floors based on a lifting tree is characterized by comprising the following steps:
step 1, collecting a plurality of solid wood floor surface images and preprocessing the solid wood floor surface images;
step 2, carrying out color space transformation on the plurality of preprocessed solid wood floor images to change the solid wood floor images into Lab color space and HSV color space;
and step 3: carrying out color depth comparison on a plurality of solid wood floor images in an RGB color space, and sequencing the plurality of solid wood floor images from light to deep in sequence to obtain a color depth sequence of the solid wood floor images;
and 4, step 4: setting the color depth value of each solid wood floor image according to the color depth sequence of the solid wood floor image;
and 5: respectively extracting a first moment and a second moment of an RGB color space of the solid wood floor image, background colors of all channels, a first moment and a second moment of a Lab color space, background colors of all channels, a first moment and a second moment of an HSV color space and background colors of all channels, totaling 27 color characteristic values, and forming the 27 color characteristic values into a color characteristic vector of the solid wood floor image;
step 6: dividing the extracted data sets of the color characteristic vectors of all the solid wood floor images into a test set, a verification set and a training set;
and 7: establishing a solid wood floor color regression tree mathematical model based on a gradient lifting decision tree, taking the color characteristic vector of the solid wood floor image in the training set as the input of the regression tree mathematical model, taking the color depth value of the solid wood floor image in the training set as the output of the regression tree mathematical model, further training the regression tree mathematical model to obtain a trained regression tree mathematical model, inputting the color feature vectors of the images of the verified and concentrated solid wood floors into the trained regression tree mathematical model, obtaining the color depth value of the corresponding solid wood floor image, calculating the root mean square error between the color depth value of the solid wood floor image obtained by the regression of the verification set and the color depth value of the corresponding solid wood floor image set in the step 4, optimizing the hyperparameter of the regression tree mathematical model which is trained by taking the minimized root mean square error as a reference to obtain an optimized optimal regression tree mathematical model;
and 8: inputting the color characteristic vectors of all to-be-detected solid wood floor images into an optimal regression tree mathematical model, and calculating to obtain color depth values of a plurality of solid wood floor images;
and step 9: and (4) carrying out online sequencing on the colors of the solid wood floor images according to the color depth values of the plurality of solid wood floor images obtained in the step (8).
As a further improved technical solution of the present invention, the step 3 specifically comprises:
3.1, loading a solid wood floor image file list to be sequenced;
3.2, calculating the total quantity of the solid wood floors to be sorted to be N;
3.3, firstly selecting two solid wood board images, setting the number P of the sequenced solid wood floor images as 2, displaying the selected two solid wood board images in an image display area, comparing the color depth of the two solid wood board images, and sequencing the two solid wood floor images from light to dark in sequence to obtain the color depth sequence of the most initial solid wood floor image;
3.4, judging whether the N solid wood floor images are all sequenced, namely, ending the process when P is equal to N, otherwise, recording the color depth sequence of the sequenced solid wood floor images as a current sequence, and executing the step 3.5;
3.5, displaying the solid wood floor images with the indexes of the P/2 th upward whole positions in the current sequence on the left side of the image display area, adding one to the number P of the sequenced solid wood floor images, randomly loading one solid wood floor image from all the unordered solid wood floor images, and displaying the solid wood floor images on the right side of the image display area;
3.6, comparing the color depth of the solid wood floor image displayed on the right side of the image display area with the color depth of the solid wood floor image displayed on the left side of the image display area, if the color of the solid wood floor image displayed on the left side of the image display area is deeper than the color of the solid wood floor image displayed on the right side of the image display area, executing the step 3.7, otherwise, executing the step 3.8;
3.7, recording the color depth sequence of the solid wood floor image in front of the solid wood floor image displayed on the left side of the image display area as a subsequence in the current sequence; if the subsequence has no solid wood floor image, arranging the solid wood floor image displayed on the right side of the image display area in front of the solid wood floor image displayed on the left side of the image display area in the current sequence, and executing the step 3.4, and if the subsequence has a solid wood floor image, executing the step 3.9;
3.8, recording the color depth sequence of the solid wood floor image behind the solid wood floor image displayed on the left side of the image display area as a subsequence in the current sequence; if the subsequence has no solid wood floor image, arranging the solid wood floor image displayed on the right side of the image display area behind the solid wood floor image displayed on the left side of the image display area in the current sequence, and executing the step 3.4, and if the subsequence has a solid wood floor image, executing the step 3.9;
3.9, calculating the number Q of the solid wood floor images in the subsequence, redisplaying the solid wood floor images with the indexes of the Q/2 th rounded-up part in the subsequence on the left side of the image display area, and executing the step 3.6.
As a further improved technical solution of the present invention, the step 4 specifically comprises:
4.1, judging whether the color depth change of the color depth sequence of the solid wood floor image is uniform, if so, executing the step 4.2, otherwise, executing the step 4.3;
4.2, setting the color depth value of the solid wood floor image as [0,1], setting the color depth value of the solid wood floor image with the deepest color in the color depth sequence of the solid wood floor image as 1, setting the color depth value of the solid wood floor image with the shallowest color in the color depth sequence of the solid wood floor image as 0, and setting the index of a certain solid wood floor image in the color depth sequence of the solid wood floor image as the Rth sheet, wherein the color depth value of the solid wood floor image is (R-1)/(N-1), and N is greater than 1;
4.3, setting the color depth value of the solid wood floor image as [0,1], wherein the color depth value of the solid wood floor image with the deepest color in the color depth sequence of the solid wood floor image is recorded as 1, removing the solid wood floor image with the deepest color from the color depth sequence of the solid wood floor image to obtain the color depth sequence of the remaining solid wood floor image, setting B demarcation points in the color depth sequence of the remaining solid wood floor image, dividing the color depth sequence of the remaining solid wood floor image into B +1 section sequences, enabling the color depth of the solid wood floor image in each section sequence to be uniformly changed, indexing in the color depth sequence of the remaining solid wood floor image that u solid wood floor images exist in the o-th section sequence, and indexing in the o-th section that the color depth value of the f-th solid wood floor image is:
Figure BDA0003599030800000031
the invention has the beneficial effects that:
(1) and in the pairwise comparison method, only the depths of two solid wood floor images need to be compared each time, so that the blurring caused under the condition of mass solid wood floor images is reduced, and the reliability of the primary arrangement of the color sequence of the solid wood floor is improved.
(2) Reduce the unbalanced problem of gathering solid wood floor sample through setting up the demarcation point, prevent that the too much solid wood floor colour that causes of close colour solid wood floor from judging regional distortion, improve the solid wood floor colour degree of depth and judge the accuracy.
(3) And inputting the color characteristic vectors of the solid wood floor images by using the gradient lifting decision tree model to carry out regression, and finally obtaining the color depth values of the solid wood floor images, wherein the solid wood floor images with the same depth values are the solid wood floors with the same color, so that the color sorting of the solid wood floors is realized, the solid wood floor images are automatically sorted by taking the color depth values as scales, and the solid wood floor images are automatically sorted according to the color depth. The larger the color depth value is, the darker the color of the solid wood floor image is.
(4) Compared with the existing manual color sorting, the method reduces the manual labor force, solves the problem that the long-time continuous sorting is difficult to realize by the manual color sorting, can realize the stepless sorting of the colors of the solid wood floors, and can always keep high accuracy.
Drawings
Fig. 1 is a flow chart of color shade contrast.
Fig. 2 is an interface diagram of an image display area.
Fig. 3 is a schematic diagram of dividing demarcation points in a color shade sequence of a solid wood floor image.
Fig. 4 is an overall algorithm flow chart of the method.
Detailed Description
The following further description of embodiments of the invention is made with reference to the accompanying drawings:
fig. 4 is a flow chart of the method, and as shown in fig. 4, a method for automatically sorting colors of a real wood floor based on a lifting tree comprises the following steps:
step 1, collecting N solid wood floor surface images as samples and preprocessing the solid wood floor surface images; the preprocessing comprises the steps of carrying out edge detection on the solid wood floor, extracting four corner points of the edge, carrying out rectangle correction, removing the background in the picture, and finally obtaining a complete background-free image of the solid wood floor.
And 2, carrying out color space transformation on the N preprocessed solid wood floor images to change the images into Lab color space and HSV color space. The method specifically comprises the following steps:
2.1 Lab color space transformation method:
2.1.1, firstly carrying out XYZ color space conversion:
Figure BDA0003599030800000041
2.1.2 Lab color space conversion was then performed:
L =116f(Y/Y n )-16
a =500[f(X/X n )-f(Y/Y n )];
b =200[f(Y/)-f(Z/Z n )]
wherein:
Figure BDA0003599030800000051
wherein: y is n 、X n 、X n Are all constants;
2.2, HSV space color conversion method:
Figure BDA0003599030800000052
Figure BDA0003599030800000053
Figure BDA0003599030800000054
V=C max
and step 3: and carrying out color depth comparison on the N solid wood floor images in an RGB color space, and sequencing the N solid wood floor images from light to deep in sequence to obtain a color depth sequence of the solid wood floor images.
The step 3 specifically comprises the following steps: as shown in figure 1 of the drawings, in which,
3.1, loading a solid wood floor image file list to be sequenced;
3.2, calculating the total quantity N of the solid wood floors to be sorted;
3.3, firstly selecting two solid wood board images, setting the number P of the sequenced solid wood floor images as 2, displaying the two selected solid wood board images in an image display area as shown in figure 2, carrying out color depth comparison on the two solid wood board images, and sequencing the two solid wood floor images from light to dark in sequence to obtain a color depth sequence of the most initial solid wood floor image;
3.4, judging whether the N solid wood floor images are all sequenced, namely, ending the process when P is equal to N, otherwise, recording the color depth sequence of the sequenced solid wood floor images as a current sequence, and executing the step 3.5;
3.5, displaying the solid wood floor images (namely, the left images of the display area as shown in fig. 2) with the indexes of P/2 th rounding up in the current sequence on the left side of the image display area, adding one to the number P of the sequenced solid wood floor images, randomly loading one solid wood floor image from all the unordered solid wood floor images, and displaying the solid wood floor image on the right side of the image display area (namely, the right images of the display area as shown in fig. 2);
3.6, comparing the color depth of the solid wood floor image displayed on the right side of the image display area with the color depth of the solid wood floor image displayed on the left side of the image display area, if the color of the solid wood floor image displayed on the left side of the image display area is deeper than the color of the solid wood floor image displayed on the right side of the image display area, executing the step 3.7, otherwise, executing the step 3.8;
3.7, recording a color shade sequence of the solid wood floor images in front of the solid wood floor images displayed on the left side of the image display area in the current sequence as a subsequence (namely recording the color shade sequence of the solid wood floor images with lighter colors than the solid wood floor images displayed on the left side of the image display area in the current sequence as a subsequence); if the subsequence has no solid wood floor image, arranging the solid wood floor image displayed on the right side of the image display area in front of the solid wood floor image displayed on the left side of the image display area in the current sequence, and executing the step 3.4, and if the subsequence has a solid wood floor image, executing the step 3.9;
3.8, recording the color depth sequence of the solid wood floor image behind the solid wood floor image displayed on the left side of the image display area in the current sequence as a subsequence (namely recording the color depth sequence of the solid wood floor image which is darker than the color of the solid wood floor image displayed on the left side of the image display area in the current sequence as a subsequence); if the subsequence has no solid wood floor image, arranging the solid wood floor image displayed on the right side of the image display area behind the solid wood floor image displayed on the left side of the image display area in the current sequence, and executing the step 3.4, and if the subsequence has a solid wood floor image, executing the step 3.9;
3.9, calculating the number Q of the solid wood floor images in the subsequence, redisplaying the solid wood floor images with the indexes of the Q/2 th rounded-up part in the subsequence on the left side of the image display area, and executing the step 3.6.
And 4, step 4: and setting the color depth value of each solid wood floor image according to the color depth sequence of the solid wood floor image.
The step 4 specifically comprises the following steps:
4.1, judging whether the color depth change of the color depth sequence of the solid wood floor image is uniform, if so, executing the step 4.2, otherwise, executing the step 4.3;
4.2, setting the color depth value of the solid wood floor image as [0,1], setting the color depth value of the solid wood floor image with the deepest color in the color depth sequence of the solid wood floor image as 1, setting the color depth value of the solid wood floor image with the shallowest color in the color depth sequence of the solid wood floor image as 0, and setting the index of a certain solid wood floor image in the color depth sequence of the solid wood floor image as the Rth sheet, wherein the color depth value of the solid wood floor image is (R-1)/(N-1), and N is greater than 1;
4.3, setting the color depth value of the solid wood floor image as [0,1], wherein the color depth value of the solid wood floor image with the deepest color in the color depth sequence of the solid wood floor image is recorded as 1, removing the solid wood floor image with the deepest color from the color depth sequence of the solid wood floor image to obtain the color depth sequence of the rest solid wood floor image, setting B demarcation points in the color depth sequence of the rest solid wood floor image, wherein the demarcation point is a demarcation point of a large color class of the solid wood floor, the color depth sequence of the rest solid wood floor images is divided into B +1 section sequences, when the demarcation point is set, the color depth change of the solid wood floor images in each section sequence is ensured to be uniform, if u solid wood floor images exist in the sequence of the o-th section indexed in the color depth sequence of the rest solid wood floor images, the color depth value of the f-th solid wood floor image indexed in the o-th section is as follows:
Figure BDA0003599030800000071
where the color depth values are rounded to leave two decimal points.
For example, if there is a sample of the color depth sequence of the solid wood floor image with non-uniform color depth variation as shown in fig. 3, the label setting can be performed by setting a non-uniform interpolation method as shown in fig. 3, wherein the demarcation point is a demarcation point of the large category of the solid wood floor color, the color depth sequence of the solid wood floor image between the solid wood floor image with the lightest color and the 1 st demarcation point (i.e. the demarcation point 1 in fig. 3) is divided into a first zone sequence, the solid wood floor image with the lightest color is included in the first zone sequence, the color depth value of the solid wood floor image in the first zone sequence is uniformly interpolated in the interval of [0,0.33] according to the number of the solid wood floor images in the first zone sequence, the solid wood floor image color depth sequence between the 1 st demarcation point and the 2 nd demarcation point (i.e. the demarcation point 2 in fig. 3) is divided into a second zone sequence, and the color depth values of the wood floor images in the second zone sequence are uniformly interpolated in a (0.33, 0.67) zone according to the number of the wood floor images in the second zone sequence, the wood floor image color depth sequence from the 2 nd demarcation point to the solid floor image with the darkest color is divided into a third zone sequence, the third zone sequence does not contain the solid floor image with the darkest color, and the color depth values of the wood floor images in the third zone sequence are uniformly interpolated in a (0.67,1) zone according to the number of the solid floor images in the third zone sequence.
And 5: respectively extracting a first moment and a second moment of an RGB color space of the solid wood floor image, background colors of all channels, a first moment and a second moment of a Lab color space, background colors of all channels, a first moment and a second moment of an HSV color space and background colors of all channels, totaling 27 color characteristic values, and forming the 27 color characteristic values into a color characteristic vector of the solid wood floor image; the 27 color feature values include the first moment and the second moment of each of the nine channels RGB, Lab, and HSV, and the background color (i.e., the pixel value corresponding to the peak value of the color histogram) of each channel.
The step 5 specifically comprises the following steps:
5.1, the first-order color moment of the solid wood floor image adopts a first-order origin moment, and the calculation mode is as follows:
Figure BDA0003599030800000072
5.2, the second-order color moment of the solid wood floor image adopts the square root of the second-order center distance, and the calculation mode is as follows:
Figure BDA0003599030800000073
wherein p is ab The pixel value of a pixel point of the a-th row and the b-th column, and W is the number of the pixel points;
and 5.3, the background color of the solid wood floor image adopts the component with the most proportion color component in the image, and the calculation mode is the average value of three values with the most occurrence times in the pixel values.
Step 6: and (3) extracting the color feature vector data sets of all the solid wood floor images according to the following steps of 1: 1: and 3, dividing the test set, the verification set and the training set.
And 7: establishing a solid wood floor color regression tree mathematical model based on a gradient lifting decision tree, taking the color characteristic vector of the solid wood floor image in the training set as the input of the regression tree mathematical model, taking the color depth value of the solid wood floor image in the training set (namely, the color depth value obtained by calculation in the step 4) as the output of the regression tree mathematical model, further training the regression tree mathematical model to obtain the trained regression tree mathematical model, inputting the color characteristic vector of the solid wood floor image in the verification set into the trained regression tree mathematical model to obtain the color depth value of the corresponding solid wood floor image, calculating the root mean square error between the color depth value of the solid wood floor image obtained by the verification set and the color depth value of the corresponding solid wood floor image set in the step 4, and tuning the root mean square error as the super parameter of the trained regression tree mathematical model, and obtaining the optimized optimal regression tree mathematical model.
7.1, let the training data set be:
T={(x 1 ,y 1 ),(x 2 ,y 2 ),…(x i ,y i ),…(x N ,y N )};
wherein x i Is the color characteristic vector, y, of the ith solid wood floor image i And 4, setting the color depth value of the ith solid wood floor image in the step 4.
7.2, dividing the space formed by the color characteristic vectors of all the solid wood floor images into K mutually-disjoint color space areas C 1 ,C 2 ,…,C k And there is a certain constant c on each region j Then a regression tree can be built:
Figure BDA0003599030800000081
7.3, establishing a lifting tree model:
Figure BDA0003599030800000082
7.4, loss function using root mean square error as model:
Figure BDA0003599030800000083
let the residual r of the current model fitting data be y-g m-1 (x) Then the above formula can be written as:
Figure BDA0003599030800000084
7.5 solving for g using the Forward distribution Algorithm M (x):
Figure BDA0003599030800000085
g m (x)=g m-1 (x)+T(x;θ m );
In the mth step of forward distribution algorithm, the current model g is given m-1 (x) The m tree is obtained by the following calculation
Figure BDA0003599030800000091
Figure BDA0003599030800000092
7.6, calculating residual errors for each feature vector:
Figure BDA0003599030800000093
to r i Fitting the regression tree to obtain leaf node regions C of the mth tree mj ,j=1,2,…,J;
J is calculated as 1,2, …, J;
Figure BDA0003599030800000094
7.7 updating regression Tree model g m (x):
g m (x)=g m-1 (x)+∑c mj I;
7.8 iterating M times to obtain regression tree mathematical model, i.e. lifting tree model
Figure BDA0003599030800000095
Figure BDA0003599030800000096
And 8: inputting the color characteristic vectors of all to-be-detected solid wood floor images into an optimal regression tree mathematical model, and calculating to obtain color depth values of a plurality of solid wood floor images; the solid wood floor images with the same color depth value are the solid wood floor images with the same color, so that automatic color sorting is realized.
And step 9: and (4) carrying out online sequencing on the colors of the solid wood floor images according to the color depth values of the plurality of solid wood floor images obtained in the step (8). Namely, the color depth values are sequenced from small to large in sequence to obtain the color depth sequence of the solid wood floor image.
The scope of the present invention includes, but is not limited to, the above embodiments, and the present invention is defined by the appended claims, and any alterations, modifications, and improvements that may occur to those skilled in the art are all within the scope of the present invention.

Claims (3)

1. A method for automatically sequencing colors of solid wood floors based on a lifting tree is characterized by comprising the following steps:
step 1, collecting a plurality of solid wood floor surface images and preprocessing the solid wood floor surface images;
step 2, carrying out color space transformation on the plurality of preprocessed solid wood floor images to change the solid wood floor images into Lab color space and HSV color space;
and step 3: carrying out color depth comparison on a plurality of solid wood floor images in an RGB color space, and sequencing the plurality of solid wood floor images from light to deep in sequence to obtain a color depth sequence of the solid wood floor images;
and 4, step 4: setting the color depth value of each solid wood floor image according to the color depth sequence of the solid wood floor image;
and 5: respectively extracting a first moment and a second moment of an RGB color space of the solid wood floor image, background colors of all channels, a first moment and a second moment of a Lab color space, background colors of all channels, a first moment and a second moment of an HSV color space and background colors of all channels, totaling 27 color characteristic values, and forming the 27 color characteristic values into a color characteristic vector of the solid wood floor image;
step 6: dividing the extracted data sets of the color characteristic vectors of all the solid wood floor images into a test set, a verification set and a training set;
and 7: establishing a solid wood floor color regression tree mathematical model based on a gradient lifting decision tree, taking the color characteristic vector of the solid wood floor image in the training set as the input of the regression tree mathematical model, taking the color depth value of the solid wood floor image in the training set as the output of the regression tree mathematical model, further training the regression tree mathematical model to obtain a trained regression tree mathematical model, inputting the color feature vectors of the images of the verified and concentrated solid wood floors into the trained regression tree mathematical model, obtaining the color depth value of the corresponding solid wood floor image, calculating the root mean square error between the color depth value of the solid wood floor image obtained by the regression of the verification set and the color depth value of the corresponding solid wood floor image set in the step 4, optimizing the hyperparameter of the regression tree mathematical model which is trained by taking the minimized root mean square error as a reference to obtain an optimized optimal regression tree mathematical model;
and 8: inputting the color characteristic vectors of all to-be-detected solid wood floor images into an optimal regression tree mathematical model, and calculating to obtain color depth values of a plurality of solid wood floor images;
and step 9: and (4) carrying out online sequencing on the colors of the solid wood floor images according to the color depth values of the plurality of solid wood floor images obtained in the step (8).
2. The method for automatically sorting colors of solid wood floors based on a lifting tree according to claim 1, wherein the step 3 is specifically:
3.1, loading a solid wood floor image file list to be sequenced;
3.2, calculating the total quantity of the solid wood floors to be sorted to be N;
3.3, firstly selecting two solid wood board images, setting the number P of the sequenced solid wood floor images as 2, displaying the selected two solid wood board images in an image display area, comparing the color depth of the two solid wood board images, and sequencing the two solid wood floor images from light to dark in sequence to obtain the color depth sequence of the most initial solid wood floor image;
3.4, judging whether the N solid wood floor images are all sequenced, namely, ending the process when P is equal to N, otherwise, recording the color depth sequence of the sequenced solid wood floor images as a current sequence, and executing the step 3.5;
3.5, displaying the solid wood floor images with the indexes of the P/2 th upward whole positions in the current sequence on the left side of the image display area, adding one to the number P of the sequenced solid wood floor images, randomly loading one solid wood floor image from all the unordered solid wood floor images, and displaying the solid wood floor images on the right side of the image display area;
3.6, comparing the color depth of the solid wood floor image displayed on the right side of the image display area with the color depth of the solid wood floor image displayed on the left side of the image display area, if the color of the solid wood floor image displayed on the left side of the image display area is deeper than the color of the solid wood floor image displayed on the right side of the image display area, executing the step 3.7, otherwise, executing the step 3.8;
3.7, recording the color depth sequence of the solid wood floor image in front of the solid wood floor image displayed on the left side of the image display area as a subsequence in the current sequence; if the subsequence has no solid wood floor image, arranging the solid wood floor image displayed on the right side of the image display area in front of the solid wood floor image displayed on the left side of the image display area in the current sequence, and executing the step 3.4, and if the subsequence has a solid wood floor image, executing the step 3.9;
3.8, recording the color depth sequence of the solid wood floor image behind the solid wood floor image displayed on the left side of the image display area as a subsequence in the current sequence; if the subsequence has no solid wood floor image, arranging the solid wood floor image displayed on the right side of the image display area behind the solid wood floor image displayed on the left side of the image display area in the current sequence, and executing the step 3.4, and if the subsequence has a solid wood floor image, executing the step 3.9;
3.9, calculating the number Q of the solid wood floor images in the subsequence, redisplaying the solid wood floor images with the indexes of the Q/2 th rounded-up part in the subsequence on the left side of the image display area, and executing the step 3.6.
3. The method for automatically sorting colors of solid wood floors based on a lifting tree according to claim 2, wherein the step 4 is specifically:
4.1, judging whether the color depth change of the color depth sequence of the solid wood floor image is uniform, if so, executing the step 4.2, otherwise, executing the step 4.3;
4.2, setting the color depth value of the solid wood floor image as [0,1], setting the color depth value of the solid wood floor image with the deepest color in the color depth sequence of the solid wood floor image as 1, setting the color depth value of the solid wood floor image with the shallowest color in the color depth sequence of the solid wood floor image as 0, and setting the index of a certain solid wood floor image in the color depth sequence of the solid wood floor image as the Rth sheet, wherein the color depth value of the solid wood floor image is (R-1)/(N-1), and N is greater than 1;
4.3, setting the color depth value of the solid wood floor image as [0,1], wherein the color depth value of the solid wood floor image with the deepest color in the color depth sequence of the solid wood floor image is recorded as 1, removing the solid wood floor image with the deepest color from the color depth sequence of the solid wood floor image to obtain the color depth sequence of the remaining solid wood floor image, setting B demarcation points in the color depth sequence of the remaining solid wood floor image, dividing the color depth sequence of the remaining solid wood floor image into B +1 section sequences, enabling the color depth of the solid wood floor image in each section sequence to be uniformly changed, indexing in the color depth sequence of the remaining solid wood floor image that u solid wood floor images exist in the o-th section sequence, and indexing in the o-th section that the color depth value of the f-th solid wood floor image is:
Figure FDA0003599030790000031
CN202210396144.8A 2022-04-15 2022-04-15 Automatic sorting method for colors of solid wood floor based on lifting tree Active CN114817609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210396144.8A CN114817609B (en) 2022-04-15 2022-04-15 Automatic sorting method for colors of solid wood floor based on lifting tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210396144.8A CN114817609B (en) 2022-04-15 2022-04-15 Automatic sorting method for colors of solid wood floor based on lifting tree

Publications (2)

Publication Number Publication Date
CN114817609A true CN114817609A (en) 2022-07-29
CN114817609B CN114817609B (en) 2022-11-25

Family

ID=82536684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210396144.8A Active CN114817609B (en) 2022-04-15 2022-04-15 Automatic sorting method for colors of solid wood floor based on lifting tree

Country Status (1)

Country Link
CN (1) CN114817609B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663422A (en) * 2012-03-27 2012-09-12 江南大学 Floor layer classification method based on color characteristic
CN111862028A (en) * 2020-07-14 2020-10-30 南京林业大学 Wood defect detecting and sorting device and method based on depth camera and depth learning
CN112070847A (en) * 2020-09-10 2020-12-11 深兰人工智能芯片研究院(江苏)有限公司 Wood floor color sorting method and device
CN113012156A (en) * 2021-05-10 2021-06-22 南京林业大学 Intelligent solid wood board color classification method
CN114241356A (en) * 2021-11-23 2022-03-25 北京滴普科技有限公司 Wood board color identification method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663422A (en) * 2012-03-27 2012-09-12 江南大学 Floor layer classification method based on color characteristic
CN111862028A (en) * 2020-07-14 2020-10-30 南京林业大学 Wood defect detecting and sorting device and method based on depth camera and depth learning
CN112070847A (en) * 2020-09-10 2020-12-11 深兰人工智能芯片研究院(江苏)有限公司 Wood floor color sorting method and device
CN113012156A (en) * 2021-05-10 2021-06-22 南京林业大学 Intelligent solid wood board color classification method
CN114241356A (en) * 2021-11-23 2022-03-25 北京滴普科技有限公司 Wood board color identification method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
庄子龙等: "基于多层感知机的木材颜色分类", 《林业机械与木工设备》 *

Also Published As

Publication number Publication date
CN114817609B (en) 2022-11-25

Similar Documents

Publication Publication Date Title
US8129990B2 (en) Image processing apparatus and computer program product
CN106446964B (en) A kind of gradient lifting decision tree update method of increment type
CN110807760B (en) Tobacco leaf grading method and system
US11605163B2 (en) Automatic abnormal cell recognition method based on image splicing
CN108229576B (en) Cross-magnification pathological image feature learning method
US7577280B2 (en) Measurement of mitotic activity
CN108074243A (en) A kind of cellular localization method and cell segmentation method
El Khoury et al. Color and sharpness assessment of single image dehazing
CN110849828A (en) Saffron crocus classification method based on hyperspectral image technology
CN108038839A (en) Twisted-pair feeder lay real-time detection method on a kind of flow production line
CN105654469A (en) Infant stool color automatic analysis method and system
CN108875118A (en) A kind of blast furnace molten iron silicon content prediction model accuracy estimating method and apparatus
CN109741315B (en) Non-reference image quality objective evaluation method based on deep reinforcement learning
CN114612385B (en) Zipper selvedge defect identification method based on template matching
CN114817609B (en) Automatic sorting method for colors of solid wood floor based on lifting tree
CN113408573B (en) Method and device for automatically classifying and classifying tile color numbers based on machine learning
CN110751660B (en) Color image segmentation method
Ji et al. Apple color automatic grading method based on machine vision
Lv et al. Acquisition of fruit region in green apple image based on the combination of segmented regions
CN114766706B (en) Tobacco impurity removing and grading method
CN103020995B (en) A kind of object feature comparison method being applicable to search for target in video
CN115546141A (en) Small sample Mini LED defect detection method and system based on multi-dimensional measurement
CN111709427B (en) Fruit segmentation method based on sparse convolution kernel
CN115082773A (en) Solid wood floor sorting method and system
CN111563536B (en) Bamboo strip color self-adaptive classification method based on machine learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant