CN114897825A - Solid wood floor sorting method and system based on computer vision - Google Patents

Solid wood floor sorting method and system based on computer vision Download PDF

Info

Publication number
CN114897825A
CN114897825A CN202210505240.1A CN202210505240A CN114897825A CN 114897825 A CN114897825 A CN 114897825A CN 202210505240 A CN202210505240 A CN 202210505240A CN 114897825 A CN114897825 A CN 114897825A
Authority
CN
China
Prior art keywords
solid wood
wood floor
detected
defect
rgb image
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.)
Withdrawn
Application number
CN202210505240.1A
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202210505240.1A priority Critical patent/CN114897825A/en
Publication of CN114897825A publication Critical patent/CN114897825A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/772Determining representative reference patterns, e.g. averaging or distorting patterns; Generating dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to a solid wood floor sorting method and a system based on computer vision, which comprises the following steps: according to the solid wood floor image, if the solid wood floor has no shape defect, determining a characteristic value corresponding to each internal defect in the solid wood floor image and the number of internal defect types of each pixel point; calculating the defect degree of the solid wood floor according to the characteristic value corresponding to each internal defect and the number of internal defect types to which each pixel belongs to obtain a defect degree matrix of the solid wood floor, and further obtaining a multi-scale characteristic primitive dictionary of the solid wood floor; obtaining an optimal weighted feature element dictionary of the solid wood floor according to the multi-scale feature element dictionary and the optimal weight vector; and determining the defect grade of the solid wood floor according to the optimal weighted feature element dictionary. According to the invention, the defect grade of the solid wood floor is determined by constructing the multi-scale feature element dictionary of the solid wood floor, so that the detection efficiency is improved, and meanwhile, the defect degree of the solid wood floor can be more accurately determined.

Description

Solid wood floor sorting method and system based on computer vision
Technical Field
The application relates to the technical field of computer vision, in particular to a solid wood floor sorting method and system based on computer vision.
Background
The solid wood floor is well pursued by consumers in the field of home decoration due to the characteristics of natural patterns, easy assembly and light weight. However, since the solid wood flooring is affected by the characteristics of the wood, the storage process, and the like, a series of problems such as swelling, warping, hard rot, cracks, dead knots, slipknots, and substandard moisture content may occur, and therefore, the solid wood flooring is strictly sorted before being shipped out to distinguish the quality of the product. The traditional sorting process is completed by workers of a solid wood floor production line, and the workers determine the shape of the solid wood floor and perform defect detection through operations such as observation, weighing, measurement and the like.
Compared with the speed of manually checking the solid wood floors, the production speed of the solid wood floors can be relatively higher, so that the solid wood floors can be stacked by the manual checking method, the inventory cost is increased, the supply chain time is prolonged, the enterprise revenue is influenced, and the sorting accuracy of the solid wood floors is lower for defect types which are difficult to distinguish in the solid wood floors.
Disclosure of Invention
The invention aims to provide a method for sorting the quality of a solid wood floor through image recognition, which is used for solving the problems of low speed and low accuracy of the existing manual verification.
In order to solve the technical problem, the invention provides a solid wood floor sorting method based on computer vision, which comprises the following steps:
acquiring an RGB image of a solid wood floor to be detected, and preprocessing the acquired RGB image of the solid wood floor to be detected to obtain a preprocessed RGB image of the solid wood floor to be detected;
determining whether the solid wood floor to be detected has shape defects according to the preprocessed RGB image of the solid wood floor to be detected, and if the solid wood floor to be detected does not have shape defects, determining characteristic values respectively corresponding to n internal defects in the solid wood floor to be detected and the type number of the internal defects belonging to each pixel point in the RGB image according to the preprocessed RGB image of the solid wood floor to be detected;
calculating the defect degree of the solid wood floor to be detected according to the characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected and the predetermined optimal weights respectively corresponding to the n internal defects;
obtaining a defect degree matrix of the solid wood floor to be detected according to the defect degree of the solid wood floor to be detected and the type number of the internal defects of each pixel point in the RGB image, and obtaining a multi-scale feature element dictionary of the solid wood floor to be detected according to the defect degree matrix of the solid wood floor to be detected;
obtaining an optimal weighted feature element dictionary of the solid wood floor to be detected according to the multi-scale feature element dictionary of the solid wood floor to be detected and a predetermined optimal weight vector;
and determining the defect grade of the solid wood floor to be detected according to the optimal weighted feature element dictionary of the solid wood floor to be detected.
Further, the process of determining the optimal weight vector includes:
acquiring M solid wood floor images, determining defect degree matrixes corresponding to the M solid wood floor images, and determining multi-scale feature element dictionaries corresponding to the M solid wood floor images according to the defect degree matrixes corresponding to the M solid wood floor images;
constructing a target function according to the defect degree matrix and the multi-scale feature element dictionary which correspond to the M solid wood floor images respectively and the weight vectors to be detected;
and solving the constructed objective function to obtain a weight vector to be detected, and taking the weight vector to be detected as an optimal weight vector.
Further, the expression of the constructed objective function E is:
E=min‖(A-D·X)‖ 2
where E is the target function, min () is the function to find the minimum, | () | 2 And solving a function of the two-norm error, wherein A is a defect degree matrix corresponding to each of the M solid wood floor images, D is a multi-scale feature element dictionary corresponding to each of the M solid wood floor images, and X is a weight vector to be detected.
Further, the step of determining the characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected according to the preprocessed RGB image of the solid wood floor to be detected comprises the following steps:
determining the number of pixels of n internal defects corresponding to the RGB image and the total number of all pixels in the RGB image according to the preprocessed RGB image of the solid wood floor to be detected;
and determining characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected according to the number of the pixel points of the n internal defects corresponding to the RGB image and the total number of all the pixel points in the RGB image.
Further, the expression of the defect degree of the solid wood floor to be detected is as follows:
Figure BDA0003637224370000021
wherein, F 0 For detecting the defect degree of the solid wood floor, w k Is the optimal weight, x, corresponding to the kth internal defect k The characteristic value is corresponding to the kth internal defect in the solid wood floor to be detected.
Further, the step of obtaining the defect degree matrix of the solid wood floor to be detected comprises the following steps:
obtaining the defect degree weight of each pixel point in the RGB image according to the type number of the internal defects to which each pixel point in the RGB image belongs;
obtaining defect degree index values of all pixel points in the RGB images according to the defect degree of the solid wood floor to be detected and the defect degree weights of all pixel points in the RGB images;
and obtaining a defect degree matrix of the solid wood floor to be detected according to the defect degree index values of all the pixel points in the RGB image.
Further, the expression corresponding to the defect degree index value of each pixel point in the RGB image is:
F x,y =F 0 ·P x,y
wherein, F x,y Is a pixel point with x and y coordinates in an RGB imageIndex value of defect degree of (F) 0 For detecting the degree of defects in the wood floor, P x,y And the defect degree weight of the pixel point with the coordinate of x and y in the RGB image is obtained.
Further, the expression of the optimal weighted feature element dictionary of the solid wood floor to be detected is as follows:
Y 0 =D 0 ·X 0
wherein, Y 0 Dictionary of optimal weighted feature elements for wood floors to be tested, D 0 Dictionary of multi-scale feature elements for wood flooring to be tested, X 0 Is the optimal weight vector.
Further, the step of determining the defect grade of the solid wood floor to be detected according to the optimal weighted feature element dictionary of the solid wood floor to be detected comprises the following steps:
and inputting the optimal weighted feature element dictionary into a defect classification network trained in advance to obtain the probability of each defect grade of the solid wood floor to be detected, and taking the defect grade with the maximum probability as the defect grade of the solid wood floor to be detected.
The invention also provides a computer vision-based solid wood floor sorting system, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor is coupled with the memory, and the processor realizes the computer vision-based solid wood floor sorting method when executing the computer program.
Compared with the prior art, the invention has the following beneficial effects:
the method comprises the steps of obtaining RGB images of the solid wood floor, preprocessing the RGB images of the solid wood floor, judging whether the solid wood floor has shape defects or not, calculating characteristic values of all internal defects corresponding to the solid wood floor without the shape defects, obtaining the number of internal defect types to which all pixel points in the RGB images belong, and then calculating the defect degree of the solid wood floor, so that the multi-scale feature primitive dictionary of the solid wood floor is obtained. And obtaining an optimal weighted feature element dictionary of the solid wood floor according to the multi-scale feature element dictionary of the solid wood floor and the optimal weight vector obtained in advance, and finally determining the defect grade of the solid wood floor according to the optimal weighted feature element dictionary. The method carries out image recognition through a computer, constructs the multi-scale feature primitive dictionary aiming at various defect features, and obtains the defect grade of the solid wood floor by utilizing the optimal weight vector of the multi-scale feature primitive dictionary which is learned by utilizing a neural network in advance.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flow chart of a method for sorting solid wood floors based on computer vision provided by an embodiment of the invention;
fig. 2 is a schematic diagram of implementing keypoint extraction based on SIFT keypoint matching according to the embodiment of the present invention;
fig. 3 is a schematic diagram of performing singular value decomposition on a defect degree matrix according to an embodiment of the present invention.
Detailed Description
To further explain the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the embodiments, structures, features and effects of the technical solutions according to the present invention will be given with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
In order to make the present invention more comprehensible to those skilled in the art, the present invention is described below with reference to examples and the accompanying drawings.
It should be noted that the present invention is applied in a production line of solid wood floors or a quality inspection line of solid wood floors.
The embodiment provides a solid wood floor sorting method based on computer vision, and a corresponding flow chart is shown in fig. 1, and specifically includes the following steps:
(1) the method comprises the steps of obtaining RGB images of the solid wood floor to be detected, preprocessing the obtained RGB images of the solid wood floor to be detected, and obtaining the preprocessed RGB images of the solid wood floor to be detected.
On the production line of the solid wood floor or the quality inspection line of the solid wood floor, a camera is arranged to be parallel to the solid wood floor, RGB images of the solid wood floor to be detected are shot through the camera, and the shot RGB images are preprocessed. The pretreatment process comprises the following steps: cutting the shot RGB image of the solid wood floor to be detected, then using bilateral filtering to carry out edge-preserving noise reduction treatment on the cut RGB image, and then enhancing the RGB image after edge-preserving noise reduction treatment.
It should be noted that, because the embodiment is applied to the solid wood floor sorting process, the shot solid wood floor may not occupy the whole image, and the subsequent calculation is complicated, in order to facilitate the calculation, the RGB image needs to be cut first. The edge characteristics of the solid wood floor are important sorting bases, so that the edge characteristics of the image are very important to be reserved, and the edge-preserving and noise-reducing processing is performed on the image to highlight the texture edges of the RGB image. The image enhancement is to improve the RGB image quality and facilitate subsequent feature extraction and classification. The ways of image enhancement are numerous, such as: histogram equalization, gamma transformation, Laplace transformation, CNN convolutional neural network, and the like, in this embodiment, a RetinexNet low-illumination image enhancement network is used to enhance an RGB image.
(2) And determining whether the solid wood floor to be detected has shape defects according to the preprocessed RGB image of the solid wood floor to be detected, and if the solid wood floor to be detected does not have shape defects, determining characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected and the type number of the internal defects belonging to each pixel point in the RGB image according to the preprocessed RGB image of the solid wood floor to be detected.
And (2.1) determining whether the solid wood floor to be detected has shape defects according to the preprocessed RGB image of the solid wood floor to be detected.
And (2) carrying out characteristic point matching on the preprocessed solid wood floor RGB image to be detected in the step (1) and the intact solid wood floor RGB image (namely the RGB image of the solid wood floor without shape defects and internal defects) to determine whether the solid wood floor to be detected has shape defects. Since the shape of the solid wood flooring may be irregular bulges, roto-warps, etc., and these shapes are unacceptable, the solid wood flooring in which these shape defects occur cannot be used. According to the shape of the solid wood floor, the solid wood floor is divided into the solid wood floor with qualified shape and the solid wood floor with unqualified shape, and the solid wood floor with the shapes is determined as the solid wood floor with unqualified shape. In order to select the unqualified solid wood floors, the deformation degree of the solid wood floors is detected by performing three-dimensional reconstruction by using a SIFT feature point matching method, and the accuracy of solid wood floor sorting can be improved by using the method. The steps of detecting the deformation degree of the solid wood floor by SIFT feature point matching are as follows:
a. extracting characteristic points: the method includes the steps of firstly, carrying out initialization operation for constructing a scale space to simulate the multi-scale property of image data, and taking extreme points with excessively large or excessively small pixel values as feature points to be extracted because extracted feature points are some prominent points which cannot disappear due to factors such as illumination, scale and rotation. The method specifically comprises the following steps: as shown in fig. 2, the pixel point in the middle in the scale space is used as a detection point, and if the middle detection point is compared with 26 pixel points, which are 26 pixel points corresponding to 8 adjacent pixel points in the same scale and 9 × 2 pixel points in the upper and lower adjacent scales, to be the maximum value or the minimum value of the pixel value, that is, the middle detection point is an extreme point in the scale, the middle detection point is used as a feature point to be extracted, so that all feature points meeting the conditions in the solid wood floor image to be detected and the intact solid wood floor image can be found.
b. Description of characteristic points: through the steps, a plurality of characteristic points can be extracted from the solid wood floor image to be detected and the intact solid wood floor image, and firstly, a main direction is respectively calculated for the characteristic points to be extracted, and the method specifically comprises the following steps: and taking the feature point as a center, determining the direction parameter by utilizing the gradient of the neighborhood pixels of the feature point, obtaining the main direction of each feature point by adopting a gradient histogram statistical method, and further calculating according to the direction to enable the operator to have rotation invariance. Since the process of calculating the main direction of the feature point is the prior art, it is not described here. So far, the characteristic points of the solid wood floor image to be detected and the intact solid wood floor image have been detected, and each characteristic point has three information: the position, the scale and the direction respectively correspond to the translation, the scaling and the rotation invariance of the feature point, so that an SIFT feature region can be determined.
c. Matching the characteristic points: in order to enhance the robustness of matching, each feature point is described by using 16 seeds, and SIFT feature vectors are generated. The process described using 16 seeds is prior art and will not be described here. And simultaneously generating SIFT feature vectors of the solid wood floor image to be detected and the intact solid wood floor image, and matching the SIFT feature vectors by adopting the Euclidean distance between the feature points after the SIFT feature vectors of the two solid wood floor images are generated so as to judge the similarity of the feature points in the solid wood floor image to be detected and the intact solid wood floor image. The method comprises the following specific steps: and taking a certain characteristic point in the non-deformation solid wood floor image, finding out two characteristic points of which the Euclidean distance from the characteristic point to be detected in the solid wood floor image is the nearest and the second nearest, calculating a value obtained by dividing the nearest Euclidean distance by the second nearest Euclidean distance, and if the obtained value is smaller than a proportional threshold value R, receiving the pair of matching points, namely, the characteristic point is successfully matched under the scale.
Because the solid wood floor needs to be assembled when being installed and used subsequently, the requirement on the shape precision is high, and the set proportion threshold value R is 0.4. The proportion threshold value can be adjusted according to the reality, the proportion threshold value R is reduced, the number of SIFT matching points is reduced, and the obtained judgment result is more accurate. The solid wood floor to be detected, which is obtained by dividing the nearest euclidean distance by the next nearest euclidean distance and has a value smaller than 0.4, is judged to be a solid wood floor without shape defects, that is, a qualified solid wood floor, otherwise, the solid wood floor is an unqualified solid wood floor, and the unqualified solid wood floor has serious shape defects and cannot be used, so that the following steps of the embodiment only describe the qualified solid wood floor.
It should be noted that, the above description only provides one specific method for determining whether the solid wood floor to be detected is qualified according to the SIFT feature vector, and as other embodiments, other methods in the prior art may also be used to determine whether the solid wood floor has a shape defect.
(2.2) according to the preprocessed RGB image of the solid wood floor to be detected, determining the number of pixels of the n internal defects corresponding to the RGB image and the total number of all pixels in the RGB image, and according to the number of pixels of the n internal defects corresponding to the RGB image and the total number of all pixels in the RGB image, determining the characteristic values corresponding to the n internal defects in the solid wood floor to be detected respectively.
In the step, the qualified solid wood floor image to be detected after the solid wood floor is screened is further judged so as to judge whether the solid wood floor meets the requirement by considering other factors. Because the internal defect type of solid wood floor is more, judges comparatively complicatedly, and n is 5 in this embodiment, only considers five kinds of common internal defects that hard rot, crackle, dead knot, slipknot, moisture content do not reach standard. The concrete judgment of the five internal defects of the solid wood floor is as follows:
1. hard rot: the solid wood floor suffers from the hard rot and is characterized in that the color of the diseased part is changed to be black, the ratio of the number of the pixel points corresponding to the region with the hard rot to the total number of all the pixel points in the RGB image can represent the severity of the hard rot, and the higher the ratio is, the more serious the hard rot is, and the higher the defect degree is. The number of the pixel points corresponding to the hard rot disease area of the solid wood floor can be obtained by global thresholding, and because the color of the hard rot disease area is darker,the gray value of the pixel point is low, the color of the non-diseased area is normal, the gray value of the pixel point is high, and the gray value difference of the pixel points of all the diseased parts and the non-diseased parts is large, so that the selection of the threshold value is determined by the gray value corresponding to the trough between the two leftmost wave crests in the gray histogram of the image obtained by the preprocessed RGB image of the solid wood floor to be detected, the pixel point corresponding to the gray value smaller than the trough is marked as 1, and the pixel point corresponding to the value of the gray value larger than or equal to the trough is marked as 0. Through the operation, a binary image marked as 1 and 0 can be generated, the area marked as 1 is taken as a hard rot diseased area, and the ratio of the number of pixel points corresponding to the hard rot diseased area to the total number of all pixel points in the RGB image is x 1 Characterization, x 1 Namely, the characteristic value of the corresponding hard rot defect in the solid wood floor is obtained, and all pixel points of the RGB image of the solid wood floor to be detected, which are preprocessed, corresponding to the hard rot diseased area are marked as a defect type I.
2. Cracking: the cracks are the cracked parts of the surface of the solid wood floor, which are similar to straight lines, and the more the number of the pixel points corresponding to the cracked part areas is, the higher the defect degree is. Since the Sobel edge detection has the transverse sliding window and the longitudinal sliding window, crack features can be extracted by utilizing the Sobel edge detection, and texture features extracted by the Sobel edge detection are divided by utilizing a connected domain. The process of extracting crack features by Sobel edge detection is prior art and is not described herein again. Obtaining pixel points of a crack area through the dividing step, and taking the ratio of the number of the pixel points corresponding to the crack part area to the total number of all the pixel points in the RGB image as x 2 Characterization, x 2 Namely, the characteristic value of the crack defect corresponding to the solid wood floor is obtained, and all pixel points of the crack area corresponding to the RGB image of the solid wood floor to be detected after pretreatment are marked as a defect type II.
3. And (3) dead knot: the dead knot has the characteristics that a hole is left when the wood tissue of the dead knot part and the wood on the periphery are separated, and the defect degree is higher when the number of the pixel points corresponding to the dead knot part area is more. Firstly, a Convolutional Neural Network (CNN) is trained by utilizing a dead knot image, and then the preprocessed CNN is usedAnd inputting the RGB image of the solid wood floor to be detected into the trained CNN convolutional neural network to detect the dead knot characteristics of the solid wood floor, and outputting the probability that the target area in the RGB image belongs to the dead knot. In the present embodiment, the dead end threshold T0 is set to 80%, and when the probability that the target region in the output RGB image belongs to the dead end is greater than the dead end threshold T0, it is determined that the target region belongs to the dead end, otherwise, the target region is considered not to belong to the dead end. If the target area is judged to belong to the dead knot, calculating the quantity of connected domain pixel points of the dead knot area, namely the target area, and taking the ratio of the quantity of the pixel points corresponding to the dead knot area to the total quantity of all the pixel points in the RGB image as x 3 Characterization, x 3 Namely, the characteristic value of the corresponding dead knot defect in the solid wood floor is obtained, and all pixel points of the corresponding dead knot region of the preprocessed RGB image of the solid wood floor to be detected are marked as a defect type III.
4. Slipknot: and (3) in the same way as the detection of the knot, firstly, the slipknot image is utilized to train the CNN convolutional neural network, then, the preprocessed RGB image of the solid wood floor to be detected is input into the trained CNN convolutional neural network to detect the slipknot characteristics of the solid wood floor, and the output is the probability that the target area in the RGB image belongs to the slipknot. In this embodiment, the kink threshold T1 is set to 80%, and when the probability that a target region in an output RGB image belongs to a kink is greater than the kink threshold T1, it is determined that the target region belongs to a kink, otherwise, the target region is considered not to belong to a kink. If the target area is judged to belong to the slipknot, calculating the number of connected domain pixel points of the target area, namely the slipknot area, and taking the ratio of the number of the pixel points corresponding to the slipknot area to the total number of all the pixel points in the RGB image as x 4 Characterization, x 4 Namely, the characteristic value of the corresponding slip joint defect in the solid wood floor, and marking all pixel points of the corresponding slip joint area of the RGB image of the solid wood floor to be detected after pretreatment as a defect type IV.
5. The water content does not reach the standard: the surface color tone of the solid wood floor is influenced by the water content of the solid wood floor, and the solid wood floor with higher water content has darker color tone and is darker; the lower the water content, the lighter the color tone of the solid wood floor is, the brighter the solid wood floor appears, and the illumination may also affect the brightness of the solid wood floor, so the Lab color space related to both brightness and color tone is selected in this embodiment to characterize the water content of the solid wood floor. And carrying out Lab color space conversion on the solid wood floor image to be detected, and carrying out color difference comparison on the solid wood floor image to be detected and the solid wood floor image with the standard water content to obtain each pixel point with the water content not reaching the standard of the solid wood floor to be detected. The method comprises the following specific steps:
according to the industry regulations, the water content W of solid wood floors should satisfy: w is more than or equal to 8% and less than or equal to 13%. Firstly, preprocessing the solid wood floor image, and defining that the values of L, a and b are respectively L for the solid wood floor with the standard water content of 8 percent in the embodiment aiming at the solid wood floor with the standard water content 8 ,a 8 ,b 8 (ii) a For a standard moisture content solid wood floor with 13% moisture content, the present embodiment defines the L, a and b values as L respectively 13 ,a 13 ,b 13 (ii) a Defining the L, a and b values of pixel points in the RGB image of the solid wood floor to be detected as L respectively e ,a e ,b e . For the convenience of calculation, the value range of L is defined as [0,100 ] in this embodiment]The value ranges of a and b are both [0,255%]And the higher the water content, the larger the corresponding L, a, b value. Utilize the colour difference formula in the Lab color space, differentiate the solid wood floor water content, then the pixel that the well water content is up to standard needs to satisfy the formula and is:
(L 8 ) 2 +(a 8 ) 2 +(b 8 ) 2 ≤(L e ) 2 +(a e ) 2 +(b e ) 2 ≤(L 13 ) 2 +(a 13 ) 2 +(b 13 ) 2
the meaning of each symbol in the formula is as above, if the Lab value of the pixel point of the RGB image does not satisfy the formula, the water content of the solid wood floor area represented by the pixel point is judged not to reach the standard, otherwise, the water content of the solid wood floor area represented by the pixel point is judged to reach the standard. The ratio of the number of the pixel points corresponding to the area with the unqualified water content to the total number of all the pixel points in the RGB image is x 5 Characterization, x 5 Namely the characteristic value of the defect that the water content in the solid wood floor does not reach the standard, and the preprocessed RGB image of the solid wood floor to be detectedAnd marking all pixel points of the corresponding region with the water content not meeting the standard as a defect type V.
And (2.3) determining the type number of the internal defects of each pixel point in the RGB image of the solid wood floor to be detected.
Because each internal defect explains the defect degree of the solid wood floor only at the image level, certain pixel points in the image area should have corresponding defect types, and individual pixel points may not only belong to one type of defect types, and the type number of the internal defect to which each pixel point of the RGB image of the solid wood floor to be detected belongs can be determined according to the defect type to which each pixel point of the image of the solid wood floor belongs. The method specifically comprises the following steps:
defining the type number set of the internal defects of the solid wood floor image pixel points as follows: p ═ P 0 ,P 1 ,P 2 ,P 3 ,P 4 ,P 5 In which P is 0 Representing pixel points not belonging to any defect, P 1 Representing pixel points belonging to only one type of defect, P 2 The representative pixel points belong to two types of defects, and by analogy, the type number of the internal defects to which each pixel point in the RGB image of the solid wood floor to be detected belongs can be determined, namely, each pixel point in the RGB image of the solid wood floor to be detected corresponds to one value in the type number set.
(3) And calculating the defect degree of the solid wood floor to be detected according to the characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected and the optimal weights respectively corresponding to the n predetermined internal defects.
The five internal defects of hard rot, cracks, dead knots, loose knots and substandard water content can be fused as new indexes: five-dimensional defect index. And each RGB image of the solid wood floor to be detected has a five-dimensional defect index, namely X ═ X 1 ,x 2 ,x 3 ,x 4 ,x 5 }. Because the distribution of the five-dimensional defect indexes of the RGB images of the solid wood floor to be detected accords with the Gaussian mixture model, and in fact, the vast majority of data distribution in the nature accords with the theorem, the Gaussian mixture model can be used for each internal defect of the RGB images of the solid wood floor to be detectedAssigning the weight corresponding to the trap, and obtaining the optimal weight corresponding to each internal defect by using an EM (effective magnetic field) algorithm, wherein the specific steps are as follows:
firstly, acquiring a plurality of solid wood floor RGB images, and acquiring five-dimensional defect indexes corresponding to each solid wood floor RGB image according to the steps (1) and (2).
Secondly, based on the five-dimensional defect indexes corresponding to the RGB images of each solid wood floor, the weight of each defect index in the five-dimensional defect indexes is assigned by Gaussian mixture modeling, and the weight of the kth defect index in the five-dimensional defect indexes is set as alpha k
Figure BDA0003637224370000101
Then, an optimal value of the weight of each defect index, namely the optimal weight corresponding to each internal defect, is obtained by an EM algorithm, and the optimal weight corresponding to each internal defect is as follows: w ═ W 1 ,w 2 ,w 3 ,w 4 ,w 5 And the optimal weight value corresponding to each internal defect and the five-dimensional defect index X ═ X 1 ,x 2 ,x 3 ,x 4 ,x 5 And f, corresponding to each other. Since the detailed process of obtaining the optimal weight corresponding to each internal defect by using the gaussian mixture model and the EM algorithm is the prior art, it is not described herein again.
After obtaining the optimal weights corresponding to the n kinds of internal defects respectively, calculating the defect degree of the solid wood floor to be detected by combining the characteristic values corresponding to the n kinds of internal defects respectively in the solid wood floor to be detected:
Figure BDA0003637224370000102
wherein, F 0 As the degree of defects of the solid wood floor to be detected, w k Is the optimal weight, x, corresponding to the k-th internal defect k The characteristic value is corresponding to the kth internal defect in the solid wood floor to be detected.
The method for obtaining the integral defect degree of the solid wood floor according to the weight of each internal defect of the solid wood floor can enable the defect degree of the obtained solid wood floor to be more accurate.
(4) Obtaining a defect degree matrix of the solid wood floor to be detected according to the defect degree of the solid wood floor to be detected and the type number of the internal defects of each pixel point in the RGB image, and obtaining a multi-scale feature element dictionary of the solid wood floor to be detected according to the defect degree matrix of the solid wood floor to be detected.
And (4.1) obtaining the defect degree weight of each pixel point in the RGB image according to the type number of the internal defects to which each pixel point in the RGB image belongs.
For a certain pixel point in the RGB image, the more defect types the pixel point belongs to, the higher the defect degree corresponding to the pixel point is, that is, the higher the weight of contribution to the defect degree of the solid wood floor is. According to the type number P of the internal defects of each pixel point obtained in the step (2.3) 0 If the representative pixel point does not belong to any defect, the contribution weight is 0; p 1 If the representative pixel point only belongs to a certain type of defect, the contribution weight is 1; p 2 If the representative pixel points belong to two types of defects, the contribution weight is 2, and so on, then normalization processing is carried out on the number of the pixel points belonging to the defect types, and the weight of the contribution of different defect types of each pixel point to the defect degree, namely the defect degree weight, is obtained, and is respectively P 0 =0、P 1 =0.2、P 2 =0.4、P 3 =0.6、p 4 =0.8、P 5 1. In this embodiment, only five internal defects are considered, and the defect degree weight of each pixel point is specifically obtained and can be determined according to actual conditions.
And (4.2) obtaining a defect degree index value of each pixel point in the RGB image according to the defect degree of the solid wood floor to be detected and the defect degree weight of each pixel point in the RGB image, and obtaining a defect degree matrix of the solid wood floor to be detected according to the defect degree index value of each pixel point in the RGB image.
For the defect degree index value of each pixel point in the RGB image, the defect degree weight of each pixel point in the RGB image to which the defect degree index value belongs can be used for carrying out weighted expression on the defect degree of the solid wood floor to be detected, so that the defect degree index is refined from the image level to the pixel level, and the formula for obtaining the defect degree index value of each pixel point is as follows:
F x,y =F 0 ·P x,y
wherein, F x,y The defect degree index value F of the pixel point with the coordinates of x and y in the RGB image 0 For detecting the degree of defects in the wood floor, P x,y And the defect degree weight of the pixel point with the coordinate of x and y in the RGB image is obtained. So far, the defect degree index value F of each pixel point in the RGB image can be used x,y Obtaining a defect degree matrix F of the solid wood floor to be detected new And detecting the defect degree matrix F of the solid wood floor new The dimension of the detection matrix is the same as that of the RGB image of the solid wood floor to be detected, and the defect degree matrix F of the solid wood floor to be detected new And the value of each position element corresponds to the defect degree index value of each pixel point at the corresponding position one by one.
And (4.3) obtaining the multi-scale feature element dictionary of the solid wood floor to be detected according to the defect degree matrix of the solid wood floor to be detected.
The method comprises the steps of generating a defect degree matrix of a multi-scale space through a defect degree matrix of the solid wood floor to be detected, carrying out singular value decomposition on the defect degree matrix of the multi-scale space to obtain each orthogonal matrix, a characteristic matrix and an orthogonal transpose matrix in the multi-scale space, then obtaining each characteristic element in the multi-scale space according to each orthogonal matrix, characteristic matrix and orthogonal transpose matrix in the multi-scale space, and further obtaining a multi-scale characteristic element dictionary of the solid wood floor to be detected according to each characteristic element in the multi-scale space. The method comprises the following specific steps:
the physiological vision has the characteristics of large and small distance, clear distance and fuzzy distance, and when the target object is detected, because the fuzzy degree of the shot target object image is uncertain, the embodiment reduces the error of object identification by constructing different scale spaces. In order to make the subsequently extracted index, i.e. the feature primitive dictionary, have scale invariance, soFirstly, the defect degree matrix F of the solid wood floor to be detected is treated new A multi-scale space is constructed, and 4 scale spaces are constructed in the embodiment and are respectively { S } 1 ,S 2 ,S 3 ,S 4 And each scale space is provided with a defect degree matrix, and the defect degree matrixes of different scale spaces represent different fuzzy levels. Since the gaussian kernel function is the only linear kernel function capable of performing the scale transformation, the defect degree matrix F of the solid wood floor to be detected is obtained by using the gaussian kernel function in this embodiment new Varying degrees of blurring are performed. The parameter of the Gaussian kernel function formula is sigma i =2 i Where i represents the number of the scale space, in this embodiment, i ═ {1,2,3,4}, where the larger i represents the stronger gaussian blurring effect, and the higher the blurring level of the defect degree matrix. Through the operation, four defect degree matrixes with different scales can be obtained, the dimensionality of the defect degree matrix is the same as that of the RGB image of the solid wood floor to be detected, and the dimensionality of the RGB image corresponds to the number of pixel points of the RGB image. In this embodiment, since the dimension of the RGB image of the solid wood floor to be detected is 256 × 256, the dimension of the defect degree matrix is also 256 × 256, and if the dimension of the RGB image of the solid wood floor to be detected is changed in an actual situation, the dimension of the defect degree matrix is also changed accordingly.
Next, singular value decomposition is performed on four different defect degree matrices of the RGB image, in this embodiment, the process of performing singular value decomposition on the defect degree matrix is as follows: as shown in FIG. 3, a defect level matrix is represented by A 0 An orthogonal matrix after singular value decomposition is represented by U, a feature matrix is represented by sigma, an orthogonal transpose matrix is represented by V, and a defect degree matrix A 0 The dimensions of the orthogonal matrix U, the feature matrix Σ, and the orthogonal transpose matrix V are all 256 × 256, and the corresponding matrices are respectively expressed as:
Figure BDA0003637224370000121
Figure BDA0003637224370000122
Figure BDA0003637224370000123
Figure BDA0003637224370000124
wherein, in the feature matrix sigma after singular value decomposition, except sigma on diagonal 1,1 ,∑ 2,2 ,···,∑ 256,256 All other positions are 0, sigma on the diagonal 1,1 ,∑ 2,2 ,···,∑ 256,256 That is, the singular values, 256 singular values are shared in each feature matrix Σ in this embodiment. The combination of each singular value and the column vector of the orthogonal matrix U and the row vector of the orthogonal transpose matrix V at the corresponding position forms a feature element, and the first feature element d 1 For example, the feature cell d obtained 1 The expression of (a) is:
Figure BDA0003637224370000125
wherein, d 1 In order to obtain the first feature cell,
Figure BDA0003637224370000126
represents the first column, Σ, of the orthogonal matrix U 1, Representing the first singular value, [ v ] on the feature matrix ∑ 1,1 … v 1,256 ]Representing the first row of the orthogonal transpose matrix V, the resulting feature cell d 1 Has a dimension of 256 × 256. So far, each feature element in each scale space can be obtained, each feature element in each scale space on the RGB image is combined, and then a multi-scale feature element dictionary of the RGB image is obtained, and the feature element dictionary of the RGB of the solid wood floor to be detected is represented as follows:
D 0 ={d 1 ,d 2 ,d 3 ,……,d k }
wherein D is 0 And d represents each characteristic element reconstructed by using singular values after singular value decomposition. Since there are k feature primitives in each feature primitive dictionary, there are k elements in each feature primitive dictionary, where k is 4 × 256 in this embodiment, and 4 represents the number of multiscale spaces.
(5) And obtaining the optimal weighted feature element dictionary of the solid wood floor to be detected according to the multi-scale feature element dictionary of the solid wood floor to be detected and the predetermined optimal weight vector.
And (5.1) determining an optimal weight vector.
(5.1.1) obtaining M solid wood floor images, determining defect degree matrixes corresponding to the M solid wood floor images, and determining multi-scale feature element dictionaries corresponding to the M solid wood floor images according to the defect degree matrixes corresponding to the M solid wood floor images.
Shooting M RGB images of the solid wood floor by a camera, and determining the multi-scale feature element dictionaries corresponding to the M solid wood floors according to the RGB images of the M solid wood floors and the methods of the steps (1) to (4). In order to take account of both the calculation amount and the accuracy, so that the calculation amount is small and the obtained result is accurate, M is set to 1000 in this embodiment, which may be specifically adjusted according to the actual situation. Each multi-scale feature primitive dictionary of 1000 RGB images contains k 4 256 elements, each element being a matrix of 256.
And (5.1.2) constructing a target function according to the defect degree matrix and the multi-scale feature primitive dictionary which correspond to the M solid wood floor images respectively and each weight vector to be detected.
Because the multi-scale feature primitive dictionary only decomposes each defect degree matrix and does not properly express the weight of each element in the multi-scale feature primitive dictionary, the scheme sets a weight vector to perform weighted expression on each element in the multi-scale feature primitive dictionary, the dimension of the weight vector to be detected corresponds to the number of elements in the multi-scale feature primitive dictionary one by one, namely the number of elements in the multi-scale feature primitive dictionary is 4 x 256, and the vector dimension of the weight vector to be detected is also 4 x 256. For better explanation, in this embodiment, an objective function E is constructed through the multi-scale feature primitive dictionaries corresponding to the M pieces of solid wood floor images and the weight vector to be detected, so as to measure a difference between the multi-scale feature primitive dictionaries of the weighted expressions corresponding to the M pieces of solid wood floor images and the defect degree matrices corresponding to the M pieces of solid wood floor images, and an expression of the obtained objective function E is as follows:
E=min‖(A-D·X)‖ 2
where E is the target function, min () is the function to find the minimum, | () | 2 In order to solve a function of a two-norm error, A is a defect degree matrix corresponding to each of M solid wood floor images, the matrix dimension of one defect degree matrix is 256 × 256, D is a multi-scale feature element dictionary corresponding to each of the M solid wood floor images, each multi-scale feature element dictionary comprises 4 × 256 elements, the matrix dimension of each element is 256 × 256, X is a weight vector to be detected, and the vector dimension is 4 × 256.
The operation process of the objective function E is as follows:
a solid wood floor is taken as an example for explanation: obtaining a defect degree matrix A according to a solid wood floor image 1 Further obtain a multi-scale feature primitive dictionary D 1 Respectively comparing 4X 256 values in the weight vector X to be detected with the multi-scale feature primitive dictionary D 1 Multiplying and accumulating 4 x 256 elements in one-to-one correspondence to obtain a matrix D formed by a weighted expression multi-scale feature element dictionary 1 X, matrix D 1 X dimension 256 × 256, obtaining a defect degree matrix A from the solid wood floor image 1 Matrix D formed by multi-scale feature element dictionary with weighted expression 1 The difference of X is made to obtain the minimum value, and the objective function value E is obtained 1
By using the method, the target function corresponding to the M solid wood floor images can be obtained according to the defect degree matrixes corresponding to the M solid wood floor images, the multi-scale feature element dictionary of the weighted expression corresponding to the M solid wood floor images and the weight vector to be detected.
(5.1.3) solving the constructed objective function to obtain a weight vector to be detected, and taking the weight vector to be detected as an optimal weight vector.
In this embodiment, a CNN convolutional neural network is used to iteratively solve the constructed objective function, and the optimization method is a first-order optimization algorithm Adam, so as to obtain a weight vector X to be detected. In the process of iterative solution, according to M objective function values corresponding to M solid wood floor images respectively, after the iteration is carried out for 1000 times or the M objective function values are all smaller than 0.1, the iteration is stopped, and the weight vector X to be detected obtained at the moment is used as X 0 Is shown by X 0 Is the optimal weight vector sought.
And (5.2) obtaining the optimal weighted feature element dictionary of the solid wood floor to be detected according to the multi-scale feature element dictionary of the solid wood floor to be detected and the determined optimal weight vector.
So far, after the optimal weight vector is solved, for any one solid wood floor image, the optimal weighted feature primitive dictionary can be used for representing, and then the expression of the optimal weighted feature primitive dictionary of the solid wood floor to be detected in the embodiment is as follows:
Y 0 =D 0 ·X 0
wherein, Y 0 Dictionary of optimal weighted feature elements for wood flooring to be tested, D 0 Dictionary of multi-scale feature elements for wood floors to be tested, X 0 And the optimal weight vector is obtained, and the construction of the optimal weighted feature element dictionary of the solid wood floor to be detected is completed.
It should be noted that the multi-scale feature primitive dictionary D 0 The method comprises the information of the RGB images in different scale spaces, and compared with the original solid wood floor image to be detected, the method completes the deficiency of multi-scale information in the RGB image of the original solid wood floor to be detected. But multiscale feature primitive dictionary D 0 The Gaussian blur technology is used in the construction process, and the use of the Gaussian blur technology can result in multi-scale feature basesMeta dictionary D 0 The problem of loss of high frequency information, which leads to a multi-scale feature primitive dictionary D 0 The original RGB image of the solid wood floor to be detected cannot be well represented, so that a multi-scale feature element dictionary D is required 0 Regularization, so this embodiment employs an optimal weight vector X 0 Dictionary D for multi-scale feature elements 0 Correcting to finally obtain the optimal weighted feature element dictionary Y of the solid wood floor to be detected 0 The method comprises the multi-scale information in the RGB image of the solid wood floor to be detected, and the optimal weight vector X is obtained through the step 0 After the regularization, the accuracy of obtaining the defect grade of the solid wood floor through the convolutional neural network CNN can be improved.
(6) And inputting the optimal weighted feature element dictionary into a defect classification network trained in advance to obtain the probability of each defect grade of the solid wood floor to be detected, and taking the defect grade with the maximum probability as the defect grade of the solid wood floor to be detected.
The purpose of this step is to train a convolutional neural network CNN to classify the solid wood floor. Firstly, a training set of the convolutional neural network CNN is obtained, and the step of obtaining the training set is as follows: the optimal weight vector X obtained by the learning of the step (5) is utilized 0 Obtaining each optimal weighting characteristic element dictionary of 1000 solid wood floor images with different defect grades and an optimal weighting characteristic element dictionary of a perfect solid wood floor image, then calculating the Euclidean distance between each optimal weighting characteristic element dictionary of 1000 solid wood floor images with different defect grades and the optimal weighting characteristic element dictionary of the perfect solid wood floor image, subtracting the minimum Euclidean distance from the maximum Euclidean distance to obtain a number L, dividing the number L by the defect grade number to be segmented to divide the solid wood floor into different defect grades, wherein each defect grade corresponds to an Euclidean distance interval range, and the larger the Euclidean distance is, the more serious the defect degree of the solid wood floor is, and the higher the corresponding defect grade is. And making labels for the 1000 solid wood floor images according to the defect levels corresponding to the 1000 solid wood floor images, training the CNN convolutional neural network by utilizing a training set with the labels, and taking the cross entropy as a targetAnd (4) taking a first-order optimization algorithm Adam as an optimization method to obtain a trained defect classification network.
Then, the optimal weighted feature element dictionary Y corresponding to the solid wood floor to be detected 0 And inputting the obtained data into a defect classification network trained in advance to obtain the probability that the solid wood floor to be detected belongs to each defect grade. And selecting the defect grade with the maximum probability as the defect grade of the solid wood floor to be detected, and formulating a corresponding label for the RGB image of the solid wood floor to be detected.
The embodiment also provides a computer vision-based solid wood floor sorting system, which comprises a processor and a memory, wherein the processor is used for processing instructions stored in the memory so as to realize the computer vision-based solid wood floor sorting method. Since the method for sorting solid wood floor based on computer vision is described in detail in the above, it is not described herein again.
It should be noted that: the sequence of the above embodiments of the present invention is only for description, and does not represent the advantages or disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A solid wood floor sorting method based on computer vision is characterized by comprising the following steps:
acquiring an RGB image of a solid wood floor to be detected, and preprocessing the acquired RGB image of the solid wood floor to be detected to obtain a preprocessed RGB image of the solid wood floor to be detected;
determining whether the solid wood floor to be detected has shape defects according to the preprocessed RGB image of the solid wood floor to be detected, and if the solid wood floor to be detected does not have shape defects, determining characteristic values respectively corresponding to n internal defects in the solid wood floor to be detected and the type number of the internal defects belonging to each pixel point in the RGB image according to the preprocessed RGB image of the solid wood floor to be detected;
calculating the defect degree of the solid wood floor to be detected according to the characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected and the predetermined optimal weights respectively corresponding to the n internal defects;
obtaining a defect degree matrix of the solid wood floor to be detected according to the defect degree of the solid wood floor to be detected and the type number of the internal defects of each pixel point in the RGB image, and obtaining a multi-scale feature primitive dictionary of the solid wood floor to be detected according to the defect degree matrix of the solid wood floor to be detected;
obtaining an optimal weighted feature primitive dictionary of the solid wood floor to be detected according to the multi-scale feature primitive dictionary of the solid wood floor to be detected and a predetermined optimal weight vector;
and determining the defect grade of the solid wood floor to be detected according to the optimal weighted feature element dictionary of the solid wood floor to be detected.
2. The computer vision based solid wood floor sorting method according to claim 1, wherein the determination of the optimal weight vector comprises:
acquiring M solid wood floor images, determining defect degree matrixes corresponding to the M solid wood floor images, and determining multi-scale feature element dictionaries corresponding to the M solid wood floor images according to the defect degree matrixes corresponding to the M solid wood floor images;
constructing a target function according to the defect degree matrix and the multi-scale feature element dictionary which correspond to the M solid wood floor images respectively and the weight vectors to be detected;
and solving the constructed objective function to obtain a weight vector to be detected, and taking the weight vector to be detected as an optimal weight vector.
3. The method for sorting the solid wood floor based on the computer vision according to the claim 2, wherein the expression of the constructed objective function E is:
E=min‖(A-D·X)‖ 2
where E is the target function, min () is the function to find the minimum, | () | 2 And solving a function of the two-norm error, wherein A is a defect degree matrix corresponding to each of the M solid wood floor images, D is a multi-scale feature element dictionary corresponding to each of the M solid wood floor images, and X is a weight vector to be detected.
4. The method for sorting the solid wood floors based on the computer vision as claimed in claim 1, wherein the step of determining the characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected according to the preprocessed RGB image of the solid wood floor to be detected comprises:
determining the number of pixel points of n corresponding internal defects in the RGB image and the total number of all pixel points in the RGB image according to the preprocessed RGB image of the solid wood floor to be detected;
and determining characteristic values respectively corresponding to the n internal defects in the solid wood floor to be detected according to the number of the pixel points of the n internal defects corresponding to the RGB image and the total number of all the pixel points in the RGB image.
5. The method for sorting solid wood floors based on computer vision according to claim 1, wherein the expression of the degree of defects of the solid wood floors to be detected is as follows:
Figure FDA0003637224360000021
wherein, F 0 For detecting the defect degree of the solid wood floor, w k Is the optimal weight, x, corresponding to the kth internal defect k The characteristic value is corresponding to the kth internal defect in the solid wood floor to be detected.
6. The computer vision based solid wood floor sorting method according to claim 1, wherein the step of obtaining a defect degree matrix of the solid wood floor to be detected comprises:
obtaining the defect degree weight of each pixel point in the RGB image according to the type number of the internal defects to which each pixel point in the RGB image belongs;
obtaining defect degree index values of all pixel points in the RGB images according to the defect degree of the solid wood floor to be detected and the defect degree weights of all pixel points in the RGB images;
and obtaining a defect degree matrix of the solid wood floor to be detected according to the defect degree index values of all the pixel points in the RGB image.
7. The method for sorting the solid wood floor based on the computer vision as claimed in claim 6, wherein the expression corresponding to the index value of the defect degree of each pixel point in the RGB image is as follows:
F x,y =F 0 ·P x,y
wherein, F x,y The defect degree index value F of the pixel point with the coordinates of x and y in the RGB image 0 For detecting the degree of defects in the wood floor, P x,y And the defect degree weight of the pixel point with the coordinate of x and y in the RGB image is obtained.
8. The computer vision-based real wood floor sorting method according to claim 1, wherein the expression of the optimal weighted feature element dictionary of the real wood floor to be detected is as follows:
Y 0 =D 0 ·X 0
wherein, Y 0 Dictionary of optimal weighted feature elements for wood floors to be tested, D 0 Dictionary of multi-scale feature elements for wood floors to be tested, X 0 Is the optimal weight vector.
9. The computer vision-based solid wood floor sorting method according to claim 1, wherein the step of determining the defect level of the solid wood floor to be detected according to the optimal weighted feature element dictionary of the solid wood floor to be detected comprises:
and inputting the optimal weighted feature element dictionary into a defect classification network trained in advance to obtain the probability of each defect grade of the solid wood floor to be detected, and taking the defect grade with the maximum probability as the defect grade of the solid wood floor to be detected.
10. A computer vision based solid wood floor sorting system comprising a memory and a processor and a computer program stored in the memory and run on the processor, the processor being coupled to the memory, the processor when executing the computer program implementing the computer vision based solid wood floor sorting method according to any one of claims 1-9.
CN202210505240.1A 2022-05-10 2022-05-10 Solid wood floor sorting method and system based on computer vision Withdrawn CN114897825A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210505240.1A CN114897825A (en) 2022-05-10 2022-05-10 Solid wood floor sorting method and system based on computer vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210505240.1A CN114897825A (en) 2022-05-10 2022-05-10 Solid wood floor sorting method and system based on computer vision

Publications (1)

Publication Number Publication Date
CN114897825A true CN114897825A (en) 2022-08-12

Family

ID=82722652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210505240.1A Withdrawn CN114897825A (en) 2022-05-10 2022-05-10 Solid wood floor sorting method and system based on computer vision

Country Status (1)

Country Link
CN (1) CN114897825A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115359054A (en) * 2022-10-19 2022-11-18 福建亿榕信息技术有限公司 Power equipment defect detection method based on pseudo defect space generation
CN116309378A (en) * 2023-02-24 2023-06-23 杭州珍林网络技术有限公司 Electronic product intelligent detection system based on artificial intelligence

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115359054A (en) * 2022-10-19 2022-11-18 福建亿榕信息技术有限公司 Power equipment defect detection method based on pseudo defect space generation
CN116309378A (en) * 2023-02-24 2023-06-23 杭州珍林网络技术有限公司 Electronic product intelligent detection system based on artificial intelligence
CN116309378B (en) * 2023-02-24 2024-04-26 杭州珍林网络技术有限公司 Electronic product intelligent detection system based on artificial intelligence

Similar Documents

Publication Publication Date Title
CN110349126B (en) Convolutional neural network-based marked steel plate surface defect detection method
CN108765412B (en) Strip steel surface defect classification method
CN109509187B (en) Efficient inspection algorithm for small defects in large-resolution cloth images
CN109255344B (en) Machine vision-based digital display type instrument positioning and reading identification method
Yu et al. Automatic grading of apples based on multi-features and weighted K-means clustering algorithm
CN114897825A (en) Solid wood floor sorting method and system based on computer vision
CN109978848B (en) Method for detecting hard exudation in fundus image based on multi-light-source color constancy model
CN115841447A (en) Detection method for surface defects of magnetic shoe
CN110415260B (en) Smoke image segmentation and identification method based on dictionary and BP neural network
CN109087330A (en) It is a kind of based on by slightly to the moving target detecting method of smart image segmentation
CN111986125A (en) Method for multi-target task instance segmentation
CN109859199B (en) Method for detecting quality of freshwater seedless pearls through SD-OCT image
CN115375690B (en) Classification and identification method for greasy tongue coating
Mousavirad et al. Design of an expert system for rice kernel identification using optimal morphological features and back propagation neural network
CN109409227A (en) A kind of finger vena plot quality appraisal procedure and its device based on multichannel CNN
Bappy et al. Real estate image classification
CN115272838A (en) Information fusion technology-based marine plankton automatic identification method and system
CN111027570B (en) Image multi-scale feature extraction method based on cellular neural network
CN115170548A (en) Leather defect automatic detection method and device based on unsupervised learning
CN116559111A (en) Sorghum variety identification method based on hyperspectral imaging technology
CN115223164A (en) Melon maturity detection method and system based on artificial intelligence
Dong et al. Fusing multilevel deep features for fabric defect detection based NTV-RPCA
CN114863198A (en) Crayfish quality grading method based on neural network
CN114154552A (en) Method, device, medium and equipment for detecting grading and color separation of ceramic tiles
Kusanti et al. Combination of otsu and canny method to identify the characteristics of solo batik as Surakarta traditional batik

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220812