Wood surface defect recognition method based on feature extraction

Through feature extraction technology, the edge line and straight line segment characteristics in wood images are analyzed, and the wood surface defects are identified, which solves the problems of low detection accuracy and high misjudgment rate in the existing technology, and achieves more efficient and accurate wood surface defect detection .

CN118898606BActive Publication Date: 2024-12-13HANGZHOU ZHIJU COM SCIENTIFIC & TECHNOLOGICAL ACHIEVEMENTS TRANSFORMATION SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411389141.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2024-12-13
Estimated Expiration
2044-10-08

AI Technical Summary

Technical Problem

The prior art has low accuracy and great identification limitations in the detection of wood surface defects, especially because the misjudgment rate is high due to the texture characteristics of the wood itself, making it difficult to accurately identify defect areas.

Method used

Using a feature extraction method, by graying the wood image, detecting edge lines and straight lines, calculating edge concentration and discrete parameters of each pixel point, analyzing the straightness and distance characteristics of edge lines, and judging the possible defects. to identify wood surface defects.

Benefits of technology

It improves the accuracy and efficiency of wood surface defect detection, reduces interference from normal edge lines, enhances the ability to identify true defect edge lines, and improves the accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898606B_ABST
    Figure CN118898606B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and specifically to a method for identifying wood surface defects based on feature extraction, including: collecting an image of any wood surface, performing grayscale processing, obtaining a wood grayscale image, and obtaining a plurality of suspected defect edge lines in the wood grayscale image, obtaining the edge concentration of each pixel on each suspected defect edge line according to the distance between the pixels on all suspected defect edge lines and the grayscale value of the pixels, obtaining the defect possibility of each suspected defect edge line according to the difference in the edge concentration of all pixels on each suspected defect edge line, and judging whether the wood surface has defects according to the defect possibility of all suspected defect edge lines. The present invention improves the accuracy of defect edge line detection by analyzing the distance between edge lines in the image and the change in grayscale value at the edge line, thereby improving the accuracy of wood surface defect detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image data processing, and in particular to a method for identifying wood surface defects based on feature extraction. Background Art

[0002] Wood is not only a renewable biomaterial, but also an environmentally friendly material with little environmental pollution, natural degradation and recycling. There are many types of wood surface defects with complex shapes. In the production and processing of wood products, there are human differences in the manual detection of wood surface defects, and the efficiency of manual detection is low, which does not meet the needs of modern production. Therefore, the study of automatic recognition of wood surface defects has a positive effect on the production of wood products. The emergence of image processing technology provides an effective method for the automatic detection of wood surface defects. The method of segmenting wood defect images according to the grayscale characteristics of wood images can identify common wood surface defects such as knots and worm eyes to a certain extent, but it has the disadvantages of low accuracy and large recognition limitations. Wood is a textured object, and it is more reasonable to segment wood defect images based on wood texture features. In order to find the area of ​​wood defects, according to its obvious edge features, the use of edge detection technology is a common means, such as the Canny operator.

[0003] Existing problem: Wood itself has many wood grains, so using the Canny operator for image edge detection to find wood defect areas is too simple and the reference factor is too single. While detecting defect areas, some wood grain areas with large color changes will also be misjudged, thereby reducing the accuracy of wood surface defect detection results. Summary of the invention

[0004] The present invention provides a wood surface defect recognition method based on feature extraction to solve the existing problems.

[0005] The wood surface defect recognition method based on feature extraction of the present invention adopts the following technical scheme:

[0006] An embodiment of the present invention provides a method for identifying wood surface defects based on feature extraction, the method comprising the following steps:

[0007] An image of any wood surface is collected and grayed to obtain a wood gray image; and a suspected defect edge line is obtained according to edge lines and straight line segments in the wood gray image;

[0008] According to the distance between the pixels on all the suspected defect edge lines, the nearest distance of each pixel on each suspected defect edge line is obtained; according to the gray value of each pixel on each suspected defect edge line and the pixels on its eight neighborhoods, the discrete parameter of each pixel on each suspected defect edge line is obtained; according to the discrete parameters and the nearest distance of all the pixels on all the suspected defect edge lines, the edge concentration of each pixel on each suspected defect edge line is obtained;

[0009] On each suspected defect edge line, the defect possibility of each suspected defect edge line is obtained according to the difference in edge concentration of all pixels;

[0010] Whether there are defects on the wood surface is determined based on the defect possibilities of all suspected defect edge lines.

[0011] Furthermore, the step of obtaining the suspected defect edge line according to the edge line and the straight line segment in the wood grayscale image includes the following specific steps:

[0012] Use the Canny edge detection algorithm to obtain several edge lines in the wood grayscale image;

[0013] Using the Hough line detection algorithm, the straight line segments in the wood grayscale image are obtained; the pixel points on the straight line segments in the wood grayscale image are recorded as straight pixel points;

[0014] According to the number of straight pixels on each edge line, the straightness of each edge line is obtained;

[0015] According to the straightness of all edge lines, the suspected defect edge line is obtained.

[0016] Furthermore, the method of obtaining the straightness of each edge line according to the number of straight pixels on each edge line includes the following specific steps:

[0017] Record any edge line as the target line;

[0018] The number of straight pixels on the target line is counted, and the number of straight pixels is divided by the number of pixels on the target line, which is recorded as the straightness of the target line.

[0019] Furthermore, the method of obtaining the suspected defect edge line according to the straightness of all edge lines includes the following specific steps:

[0020] The edge line whose straightness is less than the preset straightness threshold is recorded as a suspected defect edge line.

[0021] Furthermore, the method of obtaining the shortest distance between each pixel on each suspected defect edge line according to the distance between the pixels on all suspected defect edge lines includes the following specific steps:

[0022] Any suspected defect edge line is recorded as the main line; other suspected defect edge lines that are not the main line are recorded as reference lines;

[0023] Record any pixel point on the subject line as the target point; record all pixel points on all reference lines as reference points;

[0024] The minimum value of the distances between the target point and all reference points is recorded as the closest distance to the target point.

[0025] Furthermore, the discrete parameters of each pixel on each suspected defect edge line are obtained according to the grayscale values ​​of each pixel on each suspected defect edge line and the pixels on its eight neighborhoods, including the following specific steps:

[0026] The variance of the grayscale values ​​of the target point and all pixels in the eight neighborhoods of the target point is recorded as the discrete parameter of the target point.

[0027] Furthermore, according to the discrete parameters and the nearest distances of all pixels on all suspected defect edge lines, the specific calculation formula corresponding to the edge concentration of each pixel on each suspected defect edge line is obtained as follows:

[0028]

[0029] Where R is the edge concentration of the target point, is the maximum value of the discrete parameters of all pixels on all suspected defect edge lines. is the minimum value of the discrete parameters of all pixels on all suspected defect edge lines. is the discrete parameter of the target point, L is the closest distance to the target point, is the maximum value of the closest distances among all pixels on all suspected defect edge lines. is an exponential function with a natural constant as base, is the base 2 logarithm.

[0030] Furthermore, on each suspected defect edge line, the defect possibility of each suspected defect edge line is obtained according to the difference in edge concentration of all pixels, and the specific steps include the following:

[0031] Select any two adjacent pixel points on the main line, and record the absolute value of the difference in edge concentration between the two adjacent pixel points as the first difference between the two adjacent pixel points;

[0032] The average of the first differences of all adjacent pixels on the subject line is recorded as the adjacent difference of the subject line;

[0033] Select any two pixel points on the main line, and record the absolute value of the difference in edge concentration between the two pixel points as the second difference between the two pixel points;

[0034] The mean of the second differences of all pixels on the subject line is recorded as the arbitrary difference of the subject line;

[0035] According to the adjacent differences and any differences of the main line, the defect possibility of the main line is obtained.

[0036] Furthermore, the specific calculation formula corresponding to the defect possibility of the main line is obtained according to the adjacent differences and any differences of the main line:

[0037]

[0038] Where P is the defect probability of the main line, is the adjacent difference of the main line, D is the arbitrary difference of the main line, is a linear normalization function.

[0039] Furthermore, judging whether there is a defect on the wood surface according to the defect possibility of all suspected defect edge lines includes the following specific steps:

[0040] The suspected defect edge line whose defect possibility is greater than the preset judgment threshold is recorded as the defect edge line;

[0041] When there is a defect edge line in the wood grayscale image, it is determined that there is a defect on the wood surface;

[0042] When there is no defect edge line in the wood grayscale image, it is determined that there is no defect on the wood surface.

[0043] The beneficial effects of the technical solution of the present invention are:

[0044] In the embodiment of the present invention, an image of any wood surface is collected and grayscaled to obtain a wood grayscale image, and several suspected defect edge lines in the wood grayscale image are obtained. The straight shape characteristics of the normal edge lines are used to remove the interference of a large number of normal edge lines, thereby improving the efficiency and accuracy of subsequent defect edge line detection. According to the distance between the pixels on all suspected defect edge lines and the grayscale value of the pixels, the edge concentration of each pixel on each suspected defect edge line is obtained. On each suspected defect edge line, according to the difference in the edge concentration of all pixels, the defect possibility of each suspected defect edge line is obtained. By analyzing the distance characteristics between the suspected defect edge lines and their local grayscale characteristics, the accuracy of detecting the real defect edge line is further improved. Finally, according to the defect possibility of all suspected defect edge lines, it is judged whether the wood surface has defects. So far, the present invention improves the accuracy of defect edge line detection by analyzing the distance between edge lines in the image and the grayscale value changes at the edge lines, thereby improving the accuracy of the wood surface defect detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 It is a flow chart of the steps of the wood surface defect identification method based on feature extraction of the present invention;

[0047] Figure 2 A schematic diagram of a wood surface image to be detected provided in this embodiment;

[0048] Figure 3 A schematic diagram of an edge image of a wood surface to be detected provided in this embodiment;

[0049] Figure 4 This is a schematic diagram of an edge image of a suspected defect on the wood surface to be detected provided in this embodiment. DETAILED DESCRIPTION

[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of the wood surface defect recognition method based on feature extraction proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0051] 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.

[0052] The specific scheme of the wood surface defect recognition method based on feature extraction provided by the present invention is described in detail below with reference to the accompanying drawings.

[0053] See also Figure 1 , which shows a flowchart of a method for identifying wood surface defects based on feature extraction provided by an embodiment of the present invention, the method comprising the following steps:

[0054] Step S001: collect an image of any wood surface, perform grayscale processing, and obtain a wood grayscale image; obtain a suspected defect edge line based on the edge line and straight line segment in the wood grayscale image.

[0055] It is known that when performing edge detection on a wood surface image, selecting different gradient thresholds will have different detection effects. When the gradient threshold is not selected appropriately, there will be many error areas in the recognition. Therefore, this embodiment further analyzes and recognizes defects based on edge detection.

[0056] In this embodiment, the wood is placed on the defect recognition platform, the mechanical arm is used to adjust the wood so that it is placed flat, a camera is placed above the defect recognition platform, and the camera is used to capture the image of the wood surface. Then, any image of the wood surface obtained is grayed to obtain a gray image of the wood. Figure 2 The following is a schematic diagram of a wood surface image to be detected provided in this embodiment. The grayscale conversion of the image is a well-known technology, and the specific method is not introduced here.

[0057] What needs to be explained is: Figure 2 There are raised wood grain areas and normal wood grain areas. The raised wood grain areas and normal areas are different not only in the edges, but also in color.

[0058] First, edge detection preprocessing is performed on the wood grayscale image. This embodiment uses the Canny edge detection algorithm to obtain a number of edge lines in the wood grayscale image. Figure 3A schematic diagram of an edge image of a wood surface to be detected provided in this embodiment. Figure 3 The medium white lines are the edges of the wood in the grayscale image.

[0059] according to Figure 3 It can be analyzed that the raised area of ​​the wood grain has obvious double edge features. The double edge features are manifested in that the distance between the two edge lines is closer than the distance between the normal edge lines, and the edge shape is relatively distorted, while the normal wood grain area is mostly straight. Therefore, the regular and straight characteristics of normal wood grain can be used to use image processing technology to remove the edges of normal wood grain.

[0060] The Hough line detection algorithm is used to obtain the straight line segments in the wood grayscale image. The pixel points on the straight line segments in the wood grayscale image are recorded as straight pixel points.

[0061] Among them, the Canny edge detection algorithm and the Hough line detection algorithm are both well-known technologies, and the specific methods are not introduced here.

[0062] Any edge line is recorded as a target line. The number of straight pixels on the target line is counted, and the number of straight pixels is divided by the number of pixels on the target line to record the straightness of the target line.

[0063] According to the above method, the straightness of each edge line is obtained, thereby extracting the straightness feature of each edge line from the wood grayscale image.

[0064] The straight threshold value set in this embodiment is 0.5, which is used as an example for description. In other implementations, it can be set to other values, which are not limited in this embodiment.

[0065] The edge lines whose straightness is less than the straightness threshold are recorded as suspected defective edge lines, thereby identifying the suspected defective edge lines from all edge lines according to the straightness characteristics of the edge lines. Figure 4 This is a schematic diagram of an edge image of a suspected defect on the wood surface to be detected provided in this embodiment. Figure 4 The white lines in the middle are the suspected defect edge lines in the wood grayscale image.

[0066] It should be noted that the edge line with a straightness less than or equal to the straightness threshold should be a normal wood texture edge, so it does not need to be analyzed later. And when there is no suspected defect edge line in the wood grayscale image, or there is only one suspected defect edge line, it means that there is no defect on the wood surface.

[0067] Step S002: According to the distance between the pixels on all the suspected defect edge lines, the nearest distance of each pixel on each suspected defect edge line is obtained; according to the grayscale value of each pixel on each suspected defect edge line and the pixels on its eight neighborhoods, the discrete parameters of each pixel on each suspected defect edge line are obtained; according to the discrete parameters and the nearest distance of all the pixels on all the suspected defect edge lines, the edge concentration of each pixel on each suspected defect edge line is obtained.

[0068] The reason for the raised wood grain is that the wood surface is damaged due to technical problems during the processing of wood, resulting in the formation of concave and convex wood grain on the wood surface. Because the surface is damaged, the internal wood is exposed, and the internal wood is darker in color, so the gray value can be used as one of the judgment criteria. For the area where the concave and convex wood grain is formed, the wood texture in the concave and convex area of ​​the wood grayscale image is more concentrated, that is, the edge lines are more concentrated, which will form a very obvious double edge. For the smooth part of the wood, there will be no double edge area. However, since some wood grains may be close, there is a certain possibility of misjudgment based only on the double edges. Therefore, the wood grain defect area can be judged based on the characteristics of the double edges combined with the gray value.

[0069] By identifying the suspected defect edge lines in the edge lines, the interference of many normal areas is reduced. Most of the suspected defect edge lines are real defect edge lines, but there may still be some normal edge lines among them, so the suspected defect edge lines need to be further screened.

[0070] Any suspected defect edge line is recorded as the main line, and other suspected defect edge lines that are not the main line are recorded as reference lines.

[0071] Record any pixel point on the subject line as the target point, and record all pixel points on all reference lines as reference points.

[0072] The distances between the target point and all reference points are counted, and the minimum value of the distances is recorded as the closest distance to the target point, thereby extracting the features of the closest distance of each pixel point on each suspected defect edge line.

[0073] The variance of the grayscale values ​​of the target point and all the pixels in the eight neighborhoods of the target point is recorded as the discrete parameter of the target point, thereby extracting the features of the discrete parameters of each pixel on each suspected defect edge line.

[0074] According to the above method, the closest distance and discrete parameters of each pixel point on each suspected defect edge line are obtained.

[0075] Because the wood grain protrusion has obvious double edge features in the image, and the distance between the two edges is very close, this embodiment screens out the real defective edges based on this feature. Since the difference between the grayscale values ​​near the edge caused by the wood grain protrusion is larger than that of other edges, and because it will cause the double edge phenomenon, the edge caused by the wood grain protrusion must have other edges close to it.

[0076] It can be seen that the calculation formula of the edge concentration R of the target point is:

[0077]

[0078] Where R is the edge concentration of the target point, is the maximum value of the discrete parameters of all pixels on all suspected defect edge lines. is the minimum value of the discrete parameters of all pixels on all suspected defect edge lines. is the discrete parameter of the target point, L is the closest distance to the target point, It is the maximum value of the closest distances of all pixels on all suspected defect edge lines. is an exponential function with a natural constant as the base. To present the inverse proportional relationship and normalization processing, the implementer can set the inverse proportional function and normalization function according to the actual situation. is the logarithm with base 2. Thus, according to the discrete parameters and the nearest distance of all pixels on all suspected defect edge lines, the edge concentration characteristics of each pixel on each suspected defect edge line are extracted.

[0079] What needs to be explained is: The larger it is, the more complex the grayscale values ​​of the pixels in the local area where the target point is located are. It is very likely that the wood grain protrusions cause the color of the wood in this area to change, resulting in irregular grayscale changes. express The normalized value of the inverse proportion of The probability of an event occurring is The greater the amount of information, the richer the gray value in the local area where the suspected defect edge line is located, and the greater the possibility that the suspected defect edge line is a defect edge. When it is between 0 and 1, the information is positive, and The smaller the value, the greater the amount of information. The larger L is, the more likely it is a defective edge. The double edge phenomenon caused by the wood grain bulge will make the distance between the two edges very close. Therefore, when L is smaller, the target point is more likely to be a defective edge point. The product of R and the amount of information represents the edge concentration of the target point. The larger R is, the greater the possibility that the target point is a defective edge point.

[0080] According to the above method, the edge concentration of each pixel point on each suspected defect edge line is obtained.

[0081] Step S003: On each suspected defect edge line, the defect possibility of each suspected defect edge line is obtained according to the difference in edge concentration of all pixels.

[0082] Therefore, the wood surface texture also has a certain disorder, that is, there may be a small number of pixels with large edge concentration on the normal edge line, so it is necessary to judge whether each suspected defect edge line is a real defect edge line based on the edge concentration of all pixels on all suspected defect edge lines.

[0083] Any two adjacent pixel points are selected on the main line, and the absolute value of the difference in edge concentration between the two adjacent pixel points is recorded as the first difference between the two adjacent pixel points.

[0084] Thus, the first difference of all adjacent pixel points on the main line is obtained. On the main line, the average of the first differences of all adjacent pixel points is recorded as the adjacent difference of the main line.

[0085] It should be noted that: when there is a bifurcation on the main line, there may be a pixel point with multiple adjacent pixel points, and the first difference between the pixel point and its adjacent pixel points is calculated respectively.

[0086] Any two pixel points are selected on the main line, and the absolute value of the difference in edge concentration between the two pixel points is recorded as the second difference between the two pixel points.

[0087] Thus, the second difference of all arbitrary two pixel points on the main line is obtained. On the main line, the average value of the second difference of all pixel points is recorded as the arbitrary difference of the main line.

[0088] It can be seen that the calculation formula for the defect probability P of the main line is:

[0089]

[0090] Where P is the defect probability of the main line, is the adjacent difference of the main line, D is the arbitrary difference of the main line, is a linear normalization function that normalizes the data value to the interval [0,1]. Based on the difference in edge concentration of all pixels on each suspected defect edge line, the defect possibility characteristics of each suspected defect edge line are extracted.

[0091] What needs to be explained is: is the adjacent difference of the main line, which reflects the similarity between consecutive adjacent pixels on the main line. The larger the value, the greater the local difference on the main line, and the greater the possibility of a defect. D is the random difference of the main line, which reflects the similarity between any pixel points on the main line. The larger the value, the greater the overall difference on the main line, and the greater the possibility of a defect. Therefore, The normalized value of the product of and D represents the defect possibility of the main line.

[0092] According to the above method, the defect possibility of each suspected defect edge line is obtained.

[0093] Step S004: judging whether there are defects on the wood surface according to the defect possibilities of all suspected defect edge lines.

[0094] The judgment threshold value set in this embodiment is 0.8, which is used as an example for description. Other values ​​may be set in other implementation modes, and this embodiment does not limit this.

[0095] The suspected defect edge line whose defect possibility is greater than the judgment threshold is recorded as the defect edge line, thereby identifying the defect edge line from all the suspected defect edge lines according to the defect possibility of each suspected defect edge line.

[0096] It should be noted that the suspected defect edge line whose defect possibility is less than or equal to the judgment threshold should be a normal edge line and does not require analysis.

[0097] When there is a defect edge line in the wood grayscale image, it is determined that there is a defect on the wood surface.

[0098] When there is no defect edge line in the wood grayscale image, it is determined that there is no defect on the wood surface, thereby identifying whether there is a defect on the wood surface based on the identified defect edge line.

[0099] So far, the present invention is completed.

[0100] In summary, in an embodiment of the present invention, an image of any wood surface is collected and grayscaled to obtain a wood grayscale image, and a plurality of suspected defect edge lines in the wood grayscale image are obtained. The edge concentration of each pixel on each suspected defect edge line is obtained according to the distance between the pixels on all suspected defect edge lines and the grayscale value of the pixels. On each suspected defect edge line, the defect possibility of each suspected defect edge line is obtained according to the difference in the edge concentration of all pixels. According to the defect possibility of all suspected defect edge lines, it is judged whether there is a defect on the wood surface. The present invention improves the accuracy of defect edge line detection by analyzing the distance between edge lines in the image and the change in grayscale value at the edge line, thereby improving the accuracy of the wood surface defect detection result.

[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A wood surface defect recognition method based on feature extraction, characterized in that: The approach includes the following steps: An image of any wood surface is collected and grayed to obtain a wood gray image; and a suspected defect edge line is obtained according to edge lines and straight line segments in the wood gray image; According to the distance between the pixels on all the suspected defect edge lines, the nearest distance of each pixel on each suspected defect edge line is obtained; according to the gray value of each pixel on each suspected defect edge line and the pixels on its eight neighborhoods, the discrete parameter of each pixel on each suspected defect edge line is obtained; according to the discrete parameters and the nearest distance of all the pixels on all the suspected defect edge lines, the edge concentration of each pixel on each suspected defect edge line is obtained; On each suspected defect edge line, the defect possibility of each suspected defect edge line is obtained according to the difference in edge concentration of all pixels on each suspected defect edge line; Judging whether there are defects on the wood surface according to the defect possibilities of all suspected defect edge lines; The specific steps of obtaining the closest distance between each pixel point on each suspected defect edge line according to the distance between the pixels on all suspected defect edge lines are as follows: Any suspected defect edge line is recorded as the main line; other suspected defect edge lines that are not the main line are recorded as reference lines; Record any pixel point on the subject line as the target point; record all pixel points on all reference lines as reference points; The minimum value of the distances between the target point and all reference points is recorded as the closest distance to the target point.

2. The method for identifying wood surface defects based on feature extraction according to claim 1 is characterized in that: The method of obtaining the suspected defect edge line according to the edge line and the straight line segment in the wood grayscale image includes the following specific steps: Use the Canny edge detection algorithm to obtain several edge lines in the wood grayscale image; Using the Hough line detection algorithm, the straight line segments in the wood grayscale image are obtained; the pixel points on the straight line segments in the wood grayscale image are recorded as straight pixel points; According to the number of straight pixels on each edge line, the straightness of each edge line is obtained; According to the straightness of all edge lines, the suspected defect edge line is obtained.

3. The method for identifying wood surface defects based on feature extraction according to claim 2 is characterized in that: The method of obtaining the straightness of each edge line according to the number of straight pixels on each edge line includes the following specific steps: Record any edge line as the target line; The number of straight pixels on the target line is counted, and the number of straight pixels is divided by the number of pixels on the target line, which is recorded as the straightness of the target line.

4. The method for identifying wood surface defects based on feature extraction according to claim 2 is characterized in that: The method of obtaining the suspected defect edge line according to the straightness of all edge lines includes the following specific steps: The edge line whose straightness is less than the preset straightness threshold is recorded as a suspected defect edge line.

5. The method for identifying wood surface defects based on feature extraction according to claim 1, characterized in that: The specific steps of obtaining the discrete parameters of each pixel on each suspected defect edge line according to the grayscale values ​​of each pixel on each suspected defect edge line and the pixel points on its eight neighborhoods are as follows: The variance of the grayscale values ​​of the target point and all pixels in the eight neighborhoods of the target point is recorded as the discrete parameter of the target point.

6. The method for identifying wood surface defects based on feature extraction according to claim 1, characterized in that: According to the discrete parameters and the nearest distances of all pixels on all suspected defect edge lines, the specific calculation formula corresponding to the edge concentration of each pixel on each suspected defect edge line is obtained as follows: Where R is the edge concentration of the target point, is the maximum value of the discrete parameters of all pixels on all suspected defect edge lines. is the minimum value of the discrete parameters of all pixels on all suspected defect edge lines. is the discrete parameter of the target point, L is the closest distance to the target point, is the maximum value of the closest distances among all pixels on all suspected defect edge lines. is an exponential function with a natural constant as base, is the base 2 logarithm.

7. The method for identifying wood surface defects based on feature extraction according to claim 1, characterized in that: The defect possibility of each suspected defect edge line is obtained according to the difference in edge concentration of all pixels on each suspected defect edge line, and the specific steps include the following: Select any two adjacent pixel points on the main line, and record the absolute value of the difference in edge concentration between the two adjacent pixel points as the first difference between the two adjacent pixel points; The average of the first differences of all adjacent pixels on the subject line is recorded as the adjacent difference of the subject line; Select any two pixel points on the main line, and record the absolute value of the difference in edge concentration between the two pixel points as the second difference between the two pixel points; The mean of the second differences of all pixels on the subject line is recorded as the arbitrary difference of the subject line; According to the adjacent differences and any differences of the main line, the defect possibility of the main line is obtained.

8. The method for identifying wood surface defects based on feature extraction according to claim 7 is characterized in that: The specific calculation formula corresponding to the defect possibility of the main line obtained according to the adjacent differences and any differences of the main line is: Where P is the defect probability of the main line, is the adjacent difference of the main line, D is the arbitrary difference of the main line, is a linear normalization function.

9. The method for identifying wood surface defects based on feature extraction according to claim 1, characterized in that: The specific steps of judging whether there are defects on the wood surface according to the defect possibilities of all suspected defect edge lines are as follows: The suspected defect edge line whose defect possibility is greater than the preset judgment threshold is recorded as the defect edge line; When there is a defect edge line in the wood grayscale image, it is determined that there is a defect on the wood surface; When there is no defect edge line in the wood grayscale image, it is determined that there is no defect on the wood surface.