Surface defect detection method based on machine vision
By dividing the area of the detection object and marking the center detection area, and identifying defects in combination with machine vision technology, the problems of low defect detection accuracy and efficiency in the existing technology are solved, and more efficient and accurate defect detection is achieved.
Patent Information
- Application Number
- CN202510128165.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, defects at different locations cannot be accurately evaluated, resulting in low detection accuracy and efficiency.
By dividing the object to be detected, dividing it into an area to be detected with equal area, and marking the central detection area, using machine vision technology to identify defects, identify standard defects based on the defect location and size, and adjust the judgment criteria, and conducting differentiated detection.
It improves the accuracy and efficiency of defect detection, can judge the severity of defects more objectively and accurately, comprehensively evaluate the severity of defects and the integrity of the object, and significantly improves the surface defect detection efficiency and quality control level in industrial production.
Smart Images

Figure CN120064114A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection, and particularly to a surface defect detection method based on machine vision. Background Art
[0002] With the rapid development of industrial production and the continuous improvement of automation level, product quality inspection has become a key link to ensure product quality and production efficiency. Traditional manual inspection methods have many problems such as strong subjectivity, low inspection efficiency, and high missed inspection rate, and it is difficult to meet the urgent needs of modern industrial production for accurate and efficient inspection. Machine vision, as an advanced automated inspection technology, is gradually becoming an effective way to solve the pain points of traditional inspection.
[0003] The patent document with the publication number CN115575321A discloses a wooden board surface defect detection system and method based on mechanical vision, including: an image acquisition unit that acquires a detection image of the area where the wooden board passes through. This image is an annular image of the wooden board surface, and the annular image is segmented at a preset angle value to obtain several segmented images and then sent to the server unit for analysis; the server unit is used to receive the segmented image information and perform defect analysis, and send a control instruction to the conveying unit according to the analysis result; the moving unit is used to drive the lighting unit to move, and is composed of an annular frame and a moving member arranged on the annular frame; the lighting unit obliquely irradiates the image detection area of the wooden board in an annular moving manner and forms an annular moving irradiation light, and is carried on the moving member; the conveying unit is used to carry the wooden board for intermittent movement and starts after receiving the control instruction from the server unit.
[0004] Thus, the following problems can be seen: In the prior art, it is impossible to accurately evaluate defects at different positions, resulting in low detection accuracy and efficiency. Summary of the Invention
[0005] For this reason, the present invention provides a surface defect detection method based on machine vision to overcome the problems of low accuracy and efficiency in defect detection in the prior art by dividing the object to be detected and adaptively detecting defects at different positions.
[0006] To achieve the above object, the present invention provides a surface defect detection method based on machine vision, including:
[0007] Dividing the object to be detected into several equal-area detection regions according to the actual size of the object to be detected according to a preset region division rule, and marking the detection region near the center of the object to be detected as the central detection region;
[0008] Obtain the image to be detected of the object to be detected and identify it to determine whether there is a defect to be verified, determine the defect depth of the defect to be verified, and when the defect depth is less than the standard defect depth, determine the object to be detected as the first detection object or the second detection object according to whether the defect to be verified is in the central detection area;
[0009] Obtain the defect length and defect width of the defect to be verified and preset a first standard defect;
[0010] For the first detection object, determine whether the defect is serious based on the defect length, the defect width and the first standard defect, apply pressure to the central detection area based on a preset pressure when the defect is not serious, and determine whether the first detection object is qualified according to whether the defect to be verified changes after the pressure application is completed;
[0011] The first standard defect includes a first standard length and a first standard width;
[0012] For the second detection object, determine the defect distance between the defect to be verified and the central detection area, determine a second standard defect based on the defect distance, the first standard defect and a preset determination parameter, and determine whether the second detection object is qualified based on the defect length and the defect width and the corresponding second standard defect;
[0013] The second standard defect includes a second standard length and a second standard width;
[0014] After determining that the second detection object is qualified, apply pressure to the central detection area using a preset pressure, determine whether the defect to be verified changes after the pressure application is completed, and determine an adjustment parameter based on the judgment result and the determination parameter.
[0015] Further, the process of determining the object to be detected as the first detection object or the second detection object according to whether the defect to be verified is in the central detection area includes:
[0016] Perform image segmentation on the image to be detected according to the same rule as the area division to obtain a number of segmented images;
[0017] Determine the central segmented image corresponding to the central detection area in the segmented images;
[0018] Determine whether the defect to be verified exists in the central segmented image, and determine whether the defect to be verified is in the central detection area based on the determination result;
[0019] When it is determined that the defect to be verified is in the central detection area, determine the object to be detected as the first detection object;
[0020] When it is determined that the defect to be verified is not in the central detection area, the object to be detected is determined as the second detection object.
[0021] Further, determining the defect distance between the defect to be verified and the central detection area includes:
[0022] Determining the shortest connection line length between the defect to be verified and the regional boundary of the central detection area as the defect distance.
[0023] Further, the process of determining the second standard defect based on the defect distance, the first standard defect, and a preset determination parameter includes:
[0024] Calculating the product of the defect distance and the determination parameter to obtain a defect adjustment coefficient;
[0025] Calculating the defect adjustment number obtained by multiplying the first standard defect by the defect adjustment coefficient, and calculating the sum of the first standard defect and the defect adjustment number to obtain the second standard defect. The defect adjustment number includes a defect adjustment length and a defect adjustment width.
[0026] Further, the process of determining whether the second detection object is qualified based on the defect length and the defect width and the corresponding second standard defect includes:
[0027] If the defect length is less than or equal to the second standard length and the defect width is less than or equal to the second standard width, it is determined that the object to be detected is qualified;
[0028] If the defect length is greater than the first standard width or the defect width is greater than the first standard width, it is determined that the object to be detected is unqualified.
[0029] Further, determining the adjustment parameter based on the judgment result and the determination parameter includes:
[0030] If either the defect length or the defect width changes, the determination parameter is reduced and adjusted according to a preset adjustment value to obtain the adjustment parameter.
[0031] Further, the process of determining whether the defect is serious based on the defect length and the defect width and a preset first standard defect includes:
[0032] Obtaining the size to be processed of the defect to be verified in the image to be detected, where the size to be processed includes a length to be processed and a width to be processed;
[0033] Obtaining the image size of the image to be detected, and determining the image ratio based on the actual size and the image size;
[0034] Based on the image ratio and the size to be processed, determining the defect length and the defect width;
[0035] Compare the defect length and the defect width with the corresponding first standard defect, and determine whether the defect is serious based on the comparison result.
[0036] Further, the process of determining whether the defect is serious based on the comparison result includes:
[0037] Determine that the defect is not serious if the defect length is less than or equal to the first standard length and the defect width is less than or equal to the first standard width;
[0038] Determine that the defect is serious if either the defect length is greater than the first standard width or the defect width is greater than the first standard width.
[0039] Further, the process of determining whether the first test object is qualified according to whether the defect to be verified changes after the pressure application is completed includes:
[0040] After applying a preset pressure to the central detection area for a preset time until the end, obtain the pressure application length and the pressure application width after the pressure application is completed;
[0041] Compare the pressure application length, the pressure application width with the corresponding defect length and defect width to obtain a comparison result;
[0042] Determine that the object to be detected is qualified when the pressure application length is equal to the defect length and the pressure application width is equal to the defect width.
[0043] Further, the process of determining whether there is a defect to be verified includes:
[0044] Take a picture of the object to be detected to obtain an object image;
[0045] Preprocess the object image, including denoising and enhancing the contrast, to obtain the image to be detected;
[0046] Use a deep learning algorithm to identify the image to be detected to determine whether there is the defect to be verified.
[0047] Compared with the prior art, the beneficial effects of the present invention are that by dividing the object to be detected into equal-sized detection areas and specifically marking the central detection area, the defect detection becomes more systematic and standardized. It is not only convenient for accurately positioning the defect, but also can adopt a differential detection strategy according to the defect position. By setting standard defects and adjusting the judgment criteria, different surface defect detections are carried out on different detection objects, and the severity of the defect can be judged more objectively and accurately, comprehensively evaluating the severity of the defect and the integrity of the object, and greatly improving the surface defect detection efficiency and quality control level in industrial production.
[0048] Furthermore, by segmenting the image to be detected according to the same rules as the object area division, the specific area where the defect is located can be accurately positioned, providing an accurate spatial reference for subsequent defect determination. According to whether the defect is located in the central detection area, the object to be detected can be accurately divided into the first detection object and the second detection object, enabling subsequent defect determination and processing to adopt differential detection strategies for defects in different positions, improving the flexibility and accuracy of detection.
[0049] Furthermore, by calculating the shortest connection line length between the defect and the boundary of the central detection area, the relative position of the defect on the surface of the detection object can be accurately quantified, reflecting the spatial distribution characteristics of the defect relative to the object's central area, and providing more accurate positioning information for subsequent defect evaluation.
[0050] Furthermore, by introducing a defect adjustment coefficient, the intelligence and dynamism of the defect determination standard are realized. The calculation method of the defect adjustment coefficient enables the detection method to adapt to defects of different types and positions. By multiplying the defect distance by the determined parameter, the determination standard can be dynamically adjusted according to the actual distribution characteristics of the defect, greatly enhancing the versatility and flexibility of the detection method, making the defect evaluation more refined and comprehensive, and being able to more accurately characterize the severity of the defect.
[0051] Furthermore, by simultaneously considering the length and width of the defect and comparing it with the dynamically adjusted second standard defect, the defect detection process becomes more intelligent, capable of more comprehensively evaluating the impact of the defect on product quality and more accurately distinguishing between substantial defects and minor defects.
[0052] Furthermore, by applying pressure to verify the change of the defect to be verified, the stability of the defect and its response to the applied external pressure can be effectively judged. By timely adjusting the parameters, different changes in defects can be flexibly responded to, further optimizing the determination of the standard defect, thereby improving the sensitivity and accuracy of defect detection, avoiding the occurrence of missed detections or misjudgments, and being beneficial to high-precision and high-reliability industrial product quality control.
[0053] Furthermore, by obtaining the actual size of the defect to be verified and combining it with the overall size of the image to be detected, the proportional relationship of the image is calculated, effectively solving the difference between the image size and the actual physical size, ensuring the accuracy of the defect size. By combining the image ratio with the size to be processed, the true length and width of the defect can be accurately determined. By comparing with the preset standard defect, it can be judged whether the defect exceeds the predetermined standard threshold, improving the overall reliability of defect detection.
[0054] Furthermore, by considering both the length and width dimensions of the defect simultaneously, the one-sidedness that may be brought about by single-dimension judgment is avoided, and the actual situation of the defect can be characterized more comprehensively. By presetting clear judgment criteria, the defect assessment is transformed into a quantifiable and repeatable technical process, improving the objectivity and consistency of detection.
[0055] Furthermore, by applying a preset pressure to the central detection area and precisely measuring the changes in the length and width of the defect before and after applying the pressure, the deformation characteristics and structural integrity of the defect can be judged more accurately. When the applied pressure length and width are exactly the same as the original defect size, it indicates that the defect is a surface defect and will not undergo obvious deformation due to pressure, thus determining that the detected object is qualified. By combining machine vision recognition and pressure testing, the surface defects of the product can be evaluated more comprehensively and accurately, significantly improving the accuracy and reliability of defect detection.
[0056] Furthermore, by preprocessing the object image for denoising and contrast enhancement, the interference of image noise can be effectively eliminated, and the clarity and contrast of image details can be improved. Combining defect recognition with deep learning algorithms can adapt to detection objects with different materials, different surface textures, and defect types, significantly enhancing the accuracy and reliability of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is a flowchart of the surface defect detection method based on machine vision provided by an embodiment of the present invention;
[0058] Figure 2 is a logical decision diagram for determining whether a second detected object is qualified in an embodiment of the present invention;
[0059] Figure 3 is a logical decision diagram for determining adjustment parameters in an embodiment of the present invention.
[0060] Figure 4 is a logical decision diagram for determining whether a first detected object is qualified in an embodiment of the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0061] In order to make the objectives and advantages of the present invention clearer, the present invention will be further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0062] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and do not limit the protection scope of the present invention.
[0063] It should be noted that in the description of the present invention, the terms indicating the direction or positional relationship such as "upper", "lower", "left", "right", "inner", "outer", etc. are based on the direction or positional relationship shown in the drawings. This is only for convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention.
[0064] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and defined, the terms "installation", "connection", "connection" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0065] Please refer to Figure 1 , as Figure 1 shown, which is a flowchart of a surface defect detection method based on machine vision provided by an embodiment of the present invention;
[0066] Specifically, an embodiment of the present invention provides a surface defect detection method based on machine vision, including:
[0067] Dividing the object to be detected into several equal-area regions to be detected according to the actual size of the object to be detected according to a preset region division rule, and marking the region to be detected near the center of the object to be detected as the central detection region;
[0068] Obtaining and identifying the image to be detected of the object to be detected to determine whether there is a defect to be verified, determining the defect depth of the defect to be verified, and when the defect depth is less than the standard defect depth, determining the object to be detected as the first detection object or the second detection object according to whether the defect to be verified is in the central detection region;
[0069] Obtaining the defect length and defect width of the defect to be verified and presetting a first standard defect;
[0070] For the first detection object, determining whether the defect is serious based on the defect length, the defect width and the first standard defect, applying pressure to the central detection region based on a preset pressure when the defect is not serious, and determining whether the first detection object is qualified according to whether the defect to be verified changes after the pressure application is completed;
[0071] The first standard defect includes a first standard length and a first standard width;
[0072] For the second detection object, determine the defect distance between the defect to be verified and the defect in the central detection area, determine the second standard defect based on the defect distance, the first standard defect, and a preset determination parameter, and determine whether the second detection object is qualified based on the defect length and the defect width and the corresponding second standard defect;
[0073] The second standard defect includes a second standard length and a second standard width;
[0074] After determining that the second detection object is qualified, apply a preset pressure to the central detection area, and after the pressure application is completed, determine whether the defect to be verified has changed, and determine the adjustment parameter based on the judgment result and the determination parameter.
[0075] Specifically, the object to be detected can be an object such as a wooden board or a stone slab that has a certain load-bearing and fixing function. In this embodiment, it is a wooden board. The central part is the geometric center part of the object to be detected, and the defect to be verified is a crack on the surface of the wooden board or a cut caused by processing errors.
[0076] The defect depth is the vertical depth caused by the defect to be verified in the object to be detected. The standard defect depth is the maximum depth that can ensure normal operation during the use of the object to be detected. The setting range is generally 0.2 cm - 0.5 cm. The preset standard depth in this embodiment is 0.3 cm. The defect length is the maximum length of the defect to be verified, and the defect width is the maximum width of the defect to be verified. The preset pressure is the pressure applied to the object to be detected for detection after fixing the edge of the object to be detected. The setting range is generally 100 N - 500 N. The preset pressure in this embodiment is 250 N.
[0077] The first standard defect, that is, the first standard length and the first standard width, is the maximum length and the maximum width of the defect that does not affect the normal use of the object to be detected. The setting range of the first standard length is generally 0.2 cm - 0.8 cm. The first standard length in this embodiment is 0.5 cm. The setting range of the first standard width is generally 0.05 cm - 0.2 cm. The first standard width in this embodiment is 0.12 cm. The defect distance is the shortest straight-line distance between the defect to be verified and the regional boundary of the central detection area. The determination parameter is the quantitative relationship between the defect length and the defect width that do not affect the normal use when the defect to be verified is not in the central area and when it is in the central area. It is generally set between 0.004 - 0.008. The determination parameter in this embodiment is 0.005.
[0078] In this embodiment, specifically, the preset area division rule is to divide the area into a 3x3 grid. For a wooden board with a size of 10 cm × 10 cm, it is divided into nine detection areas of 3.3 cm × 3.3 cm, and the ninth detection area located at the geometric center of the wooden board is marked as the central detection area.
[0079] First, divide the object to be detected into areas to determine the position of the central detection area that needs to bear the maximum load in the object to be detected, identify whether there are defects to be verified in the object to be detected, determine the area position of the defects to be verified on the object to be detected, and determine the depth of the defects to be verified in the object to be detected. When the defect depth reaches the standard, for the first detection object with the defect to be verified in the central detection area, compare the defect length and width with the corresponding first standard defect to determine whether the first detection object is qualified. For the second detection object with the defect to be verified not in the central detection area, calculate the corresponding second standard defect through the defect distance between the defect to be verified and the central detection area, the first standard defect, and the determined parameters, and determine whether the second detection object is qualified.
[0080] Specifically, by dividing the object to be detected into equal-sized detection areas and specifically marking the central detection area, defect detection becomes more systematic and standardized. This not only facilitates the precise positioning of defects but also enables the adoption of differentiated detection strategies based on the defect position. By setting standard defects and adjusting the judgment criteria, different surface defect detections can be carried out on different detection objects, enabling a more objective and accurate judgment of the severity of defects, comprehensively evaluating the severity of defects and the integrity of the object, and significantly improving the surface defect detection efficiency and quality control level in industrial production.
[0081] Specifically, the process of determining the object to be detected as the first detection object or the second detection object according to whether the defect to be verified is in the central detection area includes:
[0082] Perform image segmentation on the image to be detected according to the same rule as the area division to obtain a number of segmented images;
[0083] Determine the central segmented image corresponding to the central detection area in the segmented images;
[0084] Determine whether the defect to be verified exists in the central segmented image, and based on the determination result, determine whether the defect to be verified is in the central detection area;
[0085] When it is determined that the defect to be verified is in the central detection area, determine the object to be detected as the first detection object;
[0086] When it is determined that the defect to be verified is not in the central detection area, determine the object to be detected as the second detection object.
[0087] In a specific implementation process, the surface defects of a 10 cm × 10 cm wooden board are detected. The image to be detected, which is a photograph of the wooden board, is divided into 3 × 3, namely, 9 equal-sized divided images a, b, c, d, e, f, g, h, and i. Each divided image has a size of 3.3 cm × 3.3 cm. The area to be detected corresponding to the divided image e is the central detection area. If the defect to be verified in the rake is in the divided image e, it is determined that the defect to be verified is in the central detection area.
[0088] Specifically, by segmenting the image to be detected according to the same rules as the object area division, the specific area where the defect is located can be accurately positioned, providing an accurate spatial reference for subsequent defect determination. According to whether the defect is located in the central detection area, the object to be detected can be accurately divided into the first detection object and the second detection object, enabling subsequent defect determination and processing to adopt differentiated detection strategies for defects in different positions, improving the flexibility and accuracy of detection.
[0089] Please continue to refer to Figure 2 , as Figure 2 shown, which is the logical decision diagram for determining whether the second detection object is qualified in the embodiment of the present invention;
[0090] Specifically, determining the defect distance between the defect to be verified and the central detection area includes:
[0091] Determining the shortest connection line length between the defect to be verified and the regional boundary of the central detection area as the defect distance.
[0092] Specifically, determining the shortest connection length among the straight connection lines from any point of the defect to be detected to the regional boundary of the central detection area as the defect distance.
[0093] Specifically, by calculating the shortest connection line length between the defect and the boundary of the central detection area, the relative position of the defect on the surface of the detection object can be accurately quantified, reflecting the spatial distribution characteristics of the defect relative to the central area of the object, and providing more accurate positioning information for subsequent defect evaluation.
[0094] Specifically, the process of determining the second standard defect based on the defect distance, the first standard defect, and the preset determination parameter includes:
[0095] Calculating the product of the defect distance and the determination parameter to obtain a defect adjustment coefficient;
[0096] Calculating the defect adjustment number obtained by multiplying the first standard defect by the defect adjustment coefficient, and calculating the sum of the first standard defect and the defect adjustment number, the second standard defect can be obtained. The defect adjustment number includes a defect adjustment length and a defect adjustment width.
[0097] In the specific implementation process, the defect distance of the defect to be verified is 40 cm, the first standard length in the first standard defect is 0.5 cm, the first standard width is 0.12 cm, and the preset determination parameter is 0.005. Then, the defect adjustment coefficient is calculated as 40×0.005, which is 0.2. The defect adjustment length is 0.1 cm, and the defect adjustment width is 0.024 cm. Then, the calculated second standard length is 0.1 cm + 0.5 cm, which is 0.6 cm, and the second standard width is 0.12 cm + 0.024 cm, which is 0.144 cm.
[0098] Specifically, by introducing the defect adjustment coefficient, the defect determination standard is realized to be intelligent and dynamic. The calculation method of the defect adjustment coefficient enables the detection method to adapt to defects of different types and positions. Through the product of the defect distance and the determination parameter, the determination standard can be dynamically adjusted according to the actual distribution characteristics of the defects, greatly enhancing the versatility and flexibility of the detection method, making the defect evaluation more refined and comprehensive, and being able to more accurately characterize the severity of the defects.
[0099] Specifically, the process of determining whether the second detection object is qualified based on the defect length and the defect width and the corresponding second standard defect includes:
[0100] If the defect length is less than or equal to the second standard length and the defect width is less than or equal to the second standard width, it is determined that the object to be detected is qualified;
[0101] If the defect length is greater than the first standard width or the defect width is greater than the first standard width, it is determined that the object to be detected is unqualified.
[0102] In the specific implementation process, the second standard length is 0.6 cm and the second standard width is 0.144 cm. The defect length of a defect to be verified is 0.55 cm and the defect width is 0.16 cm. Then, the defect length of 0.55 cm is less than the second standard length of 0.6 cm, and the defect width of 0.16 cm is greater than the second standard width of 0.144 cm. It is determined that the object to be detected is unqualified.
[0103] Specifically, by considering both the defect length and the width and comparing them with the dynamically adjusted second standard defect, the defect detection process is made more intelligent, the impact of defects on product quality can be evaluated more comprehensively, and substantial defects and minor defects can be more accurately distinguished.
[0104] Please continue to refer to Figure 3 , as Figure 3 shown, which is the logical decision diagram for adjusting the determination parameter in the embodiment of the present invention;
[0105] Specifically, determining the adjustment parameter based on the judgment result and the determined parameter includes:
[0106] If any of the defect length and the defect width changes, the determined parameter is reduced according to a preset adjustment value to obtain the adjustment parameter.
[0107] Specifically, the adjustment value is the amplitude for adjusting the determined parameter, generally set between 0.0002 and 0.001. In this embodiment, the adjustment value is 0.0005. In a specific implementation, if the defect length changes after applying pressure when the second detection object is qualified, the original determined parameter 0.005 is reduced by 0.0005, which is 0.0045.
[0108] Specifically, verifying the change of the defect to be verified through pressure can effectively judge the stability of the defect and its response to the applied external pressure. By timely adjusting the parameters, it can flexibly cope with the changes of different defects, further optimize the determination of standard defects, thereby improving the sensitivity and accuracy of defect detection, avoiding the occurrence of missed detection or misjudgment, and being conducive to high-precision and high-reliability industrial product quality control.
[0109] Please continue to refer to Figure 4 , such as Figure 4 shown, which is the logic decision diagram for determining whether the first detection object is qualified in the embodiment of the present invention;
[0110] Specifically, the process of determining whether the defect is serious based on the defect length and the defect width and the preset first standard defect includes:
[0111] Obtain the to-be-processed size of the defect to be verified in the to-be-detected image, where the to-be-processed size includes the to-be-processed length and the to-be-processed width;
[0112] Obtain the image size of the to-be-detected image, and determine the image ratio based on the actual size and the image size;
[0113] Based on the image ratio and the to-be-processed size, determine the defect length and the defect width;
[0114] Compare the defect length and the defect width with the corresponding first standard defect, and determine whether the defect is serious based on the comparison result.
[0115] The length and width of the image to be processed are both 10 cm, and the actual size of the wooden board is 100 cm. Then, the image ratio is determined as the ratio of 10 cm to the actual size of 100 cm, which is 1:10. In the image to be detected, the size of the defect to be verified in the central detection area is identified as 0.04 cm in length and 0.01 cm in width. Then, the defect length is determined as 0.04 cm divided by the image ratio of 1:10, which is 0.4 cm, and the defect width is determined as 0.01 cm divided by the image ratio of 1:10, which is 0.1 cm.
[0116] Specifically, by obtaining the actual size of the defect to be verified and combining it with the overall size of the image to be detected, the ratio relationship of the image is calculated, effectively solving the difference between the image size and the actual physical size, ensuring the accuracy of the defect size. By combining the image ratio with the size to be processed, the true length and width of the defect can be accurately determined. Comparing with the preset standard defect, it can be judged whether the defect exceeds the predetermined standard threshold, improving the overall reliability of defect detection.
[0117] Specifically, the process of determining whether the defect is serious based on the comparison result includes:
[0118] If the defect length is less than or equal to the first standard length and the defect width is less than or equal to the first standard width, it is determined that the defect is not serious;
[0119] If the defect length is greater than the first standard width or the defect width is greater than the first standard width, it is determined that the defect is serious.
[0120] In the specific implementation process, the first standard length in the preset first standard defect is 0.5 cm, and the first standard width is 0.12 cm. The defect length of the defect to be verified in the central detection area is 0.4 cm, and the defect width is 0.1 cm. Then, the defect length is less than the first standard length, and the defect width is less than the first standard width, so it is determined that the defect is not serious.
[0121] Specifically, by considering both the length and width dimensions of the defect simultaneously, the one-sidedness that may be brought by single-dimensional judgment is avoided, and the actual situation of the defect can be described more comprehensively. By presetting clear judgment criteria, the defect evaluation is transformed into a quantifiable and repeatable technical process, improving the objectivity and consistency of detection.
[0122] Specifically, the process of determining whether the first detection object is qualified according to whether the defect to be verified changes after the pressure application includes:
[0123] After applying the preset pressure to the central detection area until the preset time, obtain the pressure application length and pressure application width after the pressure application is completed;
[0124] Compare the pressing length, the pressing width with the corresponding defect length and defect width to obtain a comparison result;
[0125] Determine that the object to be detected is qualified when the pressing length is equal to the defect length and the pressing width is equal to the defect width.
[0126] In a specific implementation process, use a preset pressure of 250 N to press the central detection area of the wooden board for a preset time of 30 minutes, then obtain the pressing length and pressing width of the defect to be verified after pressing. The obtained pressing length is 0.4 cm and the pressing width is 0.1 cm. The defect length before pressing is 0.4 cm and the defect width is 0.1 cm. Then the pressing length is equal to the defect length, and the pressing width is equal to the defect width, so it is determined that the object to be detected is qualified.
[0127] Specifically, by applying a preset pressure to the central detection area and accurately measuring the changes in the length and width of the defect before and after pressing, the deformation characteristics and structural integrity of the defect can be judged more accurately. When the pressing length and width are exactly the same as the original defect size, it indicates that the defect is a surface defect and will not deform significantly due to pressure. Therefore, it is determined that the detected object is qualified. By combining machine vision recognition and pressure testing, the surface defects of the product can be evaluated more comprehensively and accurately, significantly improving the accuracy and reliability of defect detection.
[0128] Specifically, the process of determining whether there is a defect to be verified includes:
[0129] Take a picture of the object to be detected to obtain an object image;
[0130] Preprocess the object image, including denoising and enhancing the contrast, to obtain the image to be detected;
[0131] Use a deep learning algorithm to identify the image to be detected to determine whether there is the defect to be verified.
[0132] Specifically, use an image sensor such as a high-resolution camera to take a picture of the object to be detected to obtain an object image, use Gaussian filtering, etc. to denoise the object image, use histogram equalization, etc. to enhance the contrast of the image to obtain the image to be detected, and use a deep learning algorithm such as a pre-trained convolutional neural network to identify the defect to be verified in the image to be detected.
[0133] Specifically, by preprocessing the object image for denoising and contrast enhancement, the interference of image noise can be effectively eliminated, and the clarity and contrast of image details can be improved. Combining the defect recognition of the deep learning algorithm can adapt to detection objects with different materials, different surface textures and defect types, significantly improving the accuracy and reliability of defect detection.
[0134] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, those skilled in the art can easily understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0135] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A surface defect detection method based on machine vision, characterized in that: include: According to the actual size of the object to be detected, the object to be detected is divided into a number of detection areas of equal area according to the preset area division rules, and the detection area close to the center of the object to be detected is marked as the central detection area; Obtain the image of the object to be inspected and identify it to determine whether there are defects to be verified. Determine the defect depth of the defect to be verified, and when the defect depth is less than the standard defect depth, determine whether the object to be detected is the first detection object or the second detection object according to whether the defect to be verified is located in the central detection area; Obtaining the defect length and defect width of the defect to be verified and presetting a first standard defect; For the first inspection object, determining whether the defect is serious based on the defect length, the defect width and the first standard defect, applying pressure to the central inspection area based on a preset pressure when the defect is not serious, and determining whether the first inspection object is qualified based on whether the defect to be verified changes after the pressure is applied; The first standard defect includes a first standard length and a first standard width; For the second inspection object, determining the defect distance between the defect to be verified and the central inspection area, determining the second standard defect based on the defect distance, the first standard defect and the preset determination parameters, and determining whether the second inspection object is qualified based on the defect length and the defect width and the corresponding second standard defect; The second standard defect includes a second standard length and a second standard width; After determining that the second inspection object is qualified, a preset pressure is used to apply pressure to the central inspection area, and after the pressure is applied, it is determined whether the defect to be verified has changed, and the adjustment parameter is determined based on the judgment result and the determined parameter.
2. The surface defect detection method based on machine vision according to claim 1, characterized in that: The process of determining whether the object to be inspected is the first inspection object or the second inspection object according to whether the defect to be verified is located in the central inspection area includes: Performing image segmentation on the image to be detected according to the same rule as the region division to obtain a plurality of segmented images; Determining a central segmented image in the segmented images corresponding to the central detection area; Determine whether the defect to be verified exists in the central segmented image, and determine whether the defect to be verified is located in the central detection area based on the determination result; When it is determined that the defect to be verified is in the central detection area, determining the object to be detected as a first detection object; When it is determined that the defect to be verified is not located in the central detection area, the object to be detected is determined as a second detection object.
3. The surface defect detection method based on machine vision according to claim 2, characterized in that: Determining the defect distance between the defect to be verified and the central inspection area includes: The shortest connecting line length between the defect to be verified and the area boundary of the central detection area is determined as the defect distance.
4. The surface defect detection method based on machine vision according to claim 3 is characterized in that: The process of determining the second standard defect based on the defect distance, the first standard defect and the preset determination parameters includes: Calculating the product of the defect distance and the determined parameter to obtain a defect adjustment coefficient; A defect adjustment number is calculated by multiplying the first standard defect by the defect adjustment coefficient, and the sum of the first standard defect and the defect adjustment number is calculated to obtain the second standard defect, where the defect adjustment number includes a defect adjustment length and a defect adjustment width.
5. The surface defect detection method based on machine vision according to claim 4 is characterized in that: The process of determining whether the second inspection object is qualified based on the defect length and the defect width and the corresponding second standard defect includes: If the defect length is less than or equal to the second standard length, and the defect width is less than or equal to the second standard width, the object to be inspected is determined to be qualified; If either the defect length is greater than the first standard width or the defect width is greater than the first standard width, the object to be inspected is determined to be unqualified.
6. The surface defect detection method based on machine vision according to claim 5, characterized in that: Determining the adjustment parameter based on the judgment result and the determined parameter includes: If any one of the defect length and the defect width changes, the determined parameter is reduced and adjusted according to a preset adjustment value to obtain an adjustment parameter.
7. The surface defect detection method based on machine vision according to claim 6, characterized in that: The process of determining whether a defect is serious based on the defect length and defect width and the preset first standard defect includes: Obtaining a size to be processed of the defect to be verified in the image to be detected, where the size to be processed includes a length to be processed and a width to be processed; Acquire the image size of the image to be detected, and determine the image ratio based on the actual size and the image size; Determine the defect length and the defect width based on the image ratio and the size to be processed; The defect length and the defect width are compared with a corresponding first standard defect, and whether the defect is serious is determined based on the comparison result.
8. The surface defect detection method based on machine vision according to claim 7, characterized in that: The process of determining whether a defect is serious based on the comparison results includes: If the defect length is less than or equal to the first standard length, and the defect width is less than or equal to the first standard width, it is determined that the defect is not serious; If either the defect length is greater than the first standard width or the defect width is greater than the first standard width, the defect is determined to be serious.
9. The surface defect detection method based on machine vision according to claim 8, characterized in that: After the pressure is applied, the process of determining whether the first inspection object is qualified according to whether the defect to be verified has changed includes: After applying pressure to the central detection area using a preset pressure for a preset time, the pressure length and pressure width after the pressure application is completed are obtained; Comparing the pressure length and the pressure width with the corresponding defect length and defect width to obtain a comparison result; When the pressure-applied length is equal to the defect length and the pressure-applied width is equal to the defect width, the object to be inspected is determined to be qualified.
10. The surface defect detection method based on machine vision according to claim 9, characterized in that: The process of determining whether there is a defect to be verified includes: photographing the object to be detected to obtain an image of the object; Preprocessing the object image, including denoising and contrast enhancement, to obtain the image to be detected; A deep learning algorithm is used to identify the image to be inspected to determine whether the defect to be verified exists.
Citation Information
Patent Citations
Wood board surface defect detection system and method based on mechanical vision
CN115575321A
Cited By
Plastic film surface defect detection method based on machine vision
CN120976210A
A Machine Vision-Based Method for Detecting Surface Defects in Plastic Films
CN120976210B
Soft blister film surface defect detection method based on machine vision
CN121904014A