A method and system for detecting cable tie defects in a cable tie machine

Through the Otsu threshold method combined with the edge regularity and grayscale change characteristics of the connecting domain and structural similarity analysis, the misjudgment problem of the cable ties surface image affected by light is solved, and the accuracy of cable ties defect detection is improved.

CN120107257BActive Publication Date: 2025-08-15DONGGUAN XUTIAN MASCH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510585594.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-15
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

In the prior art, since the cable ties surface image is affected by light, the Otsu threshold method may mistake the light-affected area for defects during segmentation, reducing the accuracy of the cable ties defect identification.

Method used

The Otsu threshold method is used to threshold segment the cable ties surface image to obtain defect evaluation indicators in the connectivity domain. Through the edge regularity and grayscale change characteristics of the connectivity domain, combined with structural similarity analysis, the real scratch defect area is screened to avoid the identification of false defects.

Benefits of technology

Improve the accuracy of cable tie defect detection, effectively identify scratch defect areas, and avoid misjudgment under the influence of light.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107257B_ABST
    Figure CN120107257B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to a method and system for detecting cable tie defects in a cable tie machine. The method comprises the following steps: acquiring a cable tie surface image, performing threshold segmentation on the cable tie surface image, and obtaining each connected domain; obtaining the relative direction of each edge pixel point in each connected domain, obtaining a defect assessment index for each connected domain based on changes in the relative direction and changes in the grayscale in the connected domain; correcting the defect assessment index for each connected domain in the cable tie surface image, and obtaining a corrected defect assessment index for each connected domain in the cable tie surface image; and obtaining a scratch defect area based on the corrected defect assessment index of each connected domain in the cable tie surface image. The scratch defect area identified by the present invention is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for detecting cable tie defects in a cable tie machine. Background Art

[0002] Cable ties are primarily used to bundle and secure various items, ensuring they do not become loose or scatter during transportation and storage. In strapping machines, cable ties are the primary strapping material. By placing the product to be strapped on top of an inductive sensor in the center of the strapping area, the machine automatically completes the strapping, gluing, and cutting operations. Therefore, the quality of the cable tie significantly impacts strapping efficiency. For example, scratches on a cable tie can expose it to external forces during the strapping process, making them more susceptible to stress concentration points and increasing the risk of breakage. Therefore, cable tie defect detection in strapping machines is essential.

[0003] When the Otsu threshold method is used to segment the surface defects of the cable ties of the cable tie machine, the surface image of the cable tie may be affected by light, resulting in a variety of grayscale value distributions on the surface of the cable tie. The Otsu threshold method performs threshold segmentation on the image based on the distribution of grayscale values. Therefore, when the Otsu threshold method is used to segment the surface image of the cable tie, the segmentation results may not all be defects, that is, the area affected by light may also be segmented out and mistakenly identified as a defect, reducing the accuracy of defect identification. Summary of the Invention

[0004] In order to solve the technical problem that the surface of the cable tie has multiple grayscale value distributions due to the influence of light, the use of the Otsu threshold method to segment the cable tie surface image may also segment the light-affected area and mistakenly identify it as a defect, the present invention provides a cable tie defect detection method and system for a cable tie machine.

[0005] In a first aspect, the present invention provides a method for detecting defects in a cable tie for a cable tie machine, which adopts the following technical solution:

[0006] A method for detecting defects in a cable tie for a cable tie machine, comprising the steps of:

[0007] Collect the surface image of the cable tie, perform threshold segmentation on the surface image of the cable tie, obtain each connected domain; obtain the defect evaluation index of each connected domain , represents the defect assessment index of the i-th connected domain; Represents the number of edge pixels in the i-th connected domain; Represents the fitting value of the relative direction of the jth edge pixel on the i-th connected domain; Represents the relative direction of the jth edge pixel on the i-th connected domain; Represents the standard deviation of the grayscale values of all pixels in the i-th connected domain;

[0008] Obtain the structural similarity between each connected domain and its matching area; obtain the correction defect evaluation index of each connected domain , represents the corrected defect evaluation index of the i-th connected domain; represents the defect assessment index of the i-th connected domain; tanh() represents the normalization function; Represents the structural similarity between the i-th connected domain and its matching region;

[0009] A scratch defect area is obtained according to the modified defect evaluation index.

[0010] The innovation of the present invention lies in segmenting and identifying the scratch defect areas of the cable tie surface image through the Otsu threshold method, which can improve the efficiency of the cable tie defect detection method. Then, the connected domains obtained by the Otsu threshold segmentation method are evaluated based on the changing characteristics of the scratch defect areas and the relationship between adjacent cable tie surface images, so as to judge the real defects in the segmentation results, which can effectively improve the accuracy of cable tie defect identification and avoid the appearance of false defect areas in the segmentation results.

[0011] Preferably, performing threshold segmentation on the cable tie surface image to obtain each connected domain includes:

[0012] The Otsu threshold method is used to perform threshold segmentation on the surface image of each cable tie to obtain the connected domains of each cable tie surface image. The number of pixels M is preset, and the connected domains with a number of pixels less than M are eliminated.

[0013] Subsequently, the features of the connected domain are analyzed to screen out the scratch defect areas.

[0014] Preferably, obtaining the relative direction of the j-th edge pixel point on the i-th connected component includes:

[0015] ;

[0016] Where, Represents the relative direction of the jth edge pixel point in the i-th connected component; Represents the position coordinates of the next edge pixel point in the counterclockwise direction of the j-th edge pixel point of the i-th connected component; Represents the position coordinates of the jth edge pixel point in the i-th connected component; || represents the absolute value symbol.

[0017] The more stable the relative directions of all edge pixels on the connected domain are, the more likely the connected domain is to be a scratch defect area.

[0018] Preferably, obtaining the fitting value of the relative direction of the j-th edge pixel point on the i-th connected component includes:

[0019] Any edge pixel point on the i-th connected domain is recorded as the starting point, and the edge pixel points on the i-th connected domain are traversed in sequence in a counterclockwise direction to obtain the edge pixel point sequence of the i-th connected domain. The least squares method is used to perform curve fitting on the relative directions corresponding to all pixels in the edge pixel point sequence of the i-th connected domain to obtain the fitting value of the relative direction of each edge pixel point on the i-th connected domain.

[0020] Preferably, obtaining the structural similarity between each connected region and its matching region includes:

[0021] Get the left and right areas of the cable tie surface image; get the matching area of each connected domain;

[0022] The SSIM algorithm is used to obtain the structural similarity between the i-th connected domain and its matching region, and it is recorded as the structural similarity between the i-th connected domain and its matching region.

[0023] Preferably, the obtaining of the left and right areas of the cable tie surface image includes:

[0024] The pixel point at the upper right corner of the current cable tie surface image is used as the coordinate origin, and a rectangular coordinate system is constructed for the current cable tie surface image to obtain the horizontal coordinate of each pixel point of the current cable tie surface image, and obtain the straight line y= ,in Represents the maximum horizontal coordinate of all pixel points of the current cable tie surface image; divides the current cable tie surface image into two left and right areas according to the straight line; and divides each cable tie surface image into two left and right areas.

[0025] Preferably, obtaining the matching area of each connected domain includes:

[0026] If the maximum horizontal coordinate of all pixels in the i-th connected domain of the current cable tie surface image is less than , the area obtained by matching the i-th connected domain of the current cable tie surface image to the right area of the previous cable tie image of the current cable tie surface image is recorded as the matching area of the i-th connected domain of the current cable tie surface image;

[0027] If the minimum horizontal coordinate of all pixels in the i-th connected domain of the current cable tie surface image is greater than , the area obtained by matching the i-th connected domain of the current cable tie surface image to the left area of the next cable tie image of the current cable tie surface image is recorded as the matching area of the i-th connected domain of the current cable tie surface image.

[0028] This facilitates the subsequent acquisition of the structural similarity between each connected domain and its matching area, and the correction of the defect assessment index.

[0029] Preferably, obtaining the scratch defect area includes:

[0030] A defect determination threshold T is preset. If the corrected defect assessment index of any connected domain is greater than or equal to the defect determination threshold T, the connected domain is determined to be a scratch defect region of the current cable tie surface image, and each scratch defect region of the current cable tie surface image is obtained; each scratch defect region of each cable tie image is obtained.

[0031] The identified scratch defect area is more accurate.

[0032] Preferably, collecting the surface image of the cable tie includes:

[0033] The preset image acquisition interval is 2.5s. The cable ties are placed on a conveyor belt with a length of 0.5 meters and a speed of 0.1m / s. The high-resolution camera should be placed directly above the conveyor belt. While the conveyor belt is running, the RGB image of the surface of each cable tie is collected.

[0034] The semantic segmentation algorithm is used to segment the RGB image of each cable tie surface to obtain the image of each cable tie region, and the cable tie region image is converted to grayscale to obtain the surface image of each cable tie.

[0035] In a second aspect, the present invention provides a cable tie defect detection system for a cable tie machine, which adopts the following technical solution:

[0036] A cable tie defect detection system for a cable tie machine includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the cable tie defect detection method for the cable tie machine is implemented.

[0037] By adopting the above technical solution, the above-mentioned method for detecting defects of a strapping machine is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.

[0038] The present invention has the following technical effects: the purpose of the present invention is to segment and identify the scratch defect area of the cable tie surface image through the Otsu threshold method, which can improve the efficiency of the cable tie defect detection method, and then evaluate the various connected domains obtained by the Otsu threshold segmentation method through the change characteristics of the scratch defect area and the relationship between adjacent cable tie surface images, so as to judge the real defects in the segmentation result, which can effectively improve the accuracy of cable tie defect identification and avoid the appearance of false defect areas in the segmentation result. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding numbers represent the same or corresponding parts.

[0040] Figure 1 This is a flow chart of a method for detecting cable tie defects in a cable tie machine according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.

[0042] It should be understood that when the terms "first," "second," and the like are used in the claims, description, and drawings of the present invention, they are merely used to distinguish between different objects, rather than to describe a specific order. The terms "comprise" and "comprising" used in the description and claims of the present invention indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or combinations thereof.

[0043] The embodiment of the present invention discloses a method for detecting defects of a cable tie used in a cable tie machine, referring to Figure 1 , including steps S1 to S4:

[0044] S1: Collect the image of the cable tie surface.

[0045] In this embodiment of the present invention, the interval for capturing images is preset to 2.5 seconds. The cable ties of the strapping machine are placed on a conveyor belt with a length of 0.5 meters and a speed of 0.1 m / s. The high-resolution camera is placed directly above the conveyor belt. When the conveyor belt is running, the RGB image of the surface of each cable tie is captured until there are no more ties on the conveyor belt. The camera stops. The cable tie can be photographed twice every 0.25 meters.

[0046] The semantic segmentation algorithm is used to segment the RGB image of each cable tie surface to obtain the image of each cable tie region, and the cable tie region image is converted to grayscale to obtain the surface image of each cable tie.

[0047] S2: Perform threshold segmentation on the cable tie surface image to obtain each connected domain; obtain the relative direction of each edge pixel point of each connected domain, and obtain the defect assessment index of each connected domain based on the change of the relative direction and the grayscale change in the connected domain.

[0048] It should be noted that when the Otsu threshold method is used to segment the surface defects of the cable ties of the cable tie machine, the surface image of the cable tie may be affected by light, resulting in multiple grayscale value distributions on the surface of the cable tie. The Otsu threshold method performs threshold segmentation on the image through the distribution of grayscale values. Therefore, when the Otsu threshold method is used to segment the surface image of the cable tie, the segmentation results may not all be defects, that is, the area affected by light may also be segmented out and mistakenly regarded as a defect. Therefore, in order to improve the accuracy of the Otsu threshold method in segmenting the surface defects of the cable tie, the present invention proposes a cable tie defect detection method and system for the cable tie machine, which evaluates the segmentation results of the Otsu threshold method through the changing characteristics of the defect area on the cable tie surface and the relationship between adjacent cable tie surface images, thereby screening out the real defect area and improving the accuracy of the cable tie defect detection method for the cable tie machine.

[0049] It should be further explained that it is known that the grayscale value at the location of the scratch defect on the surface of the cable tie is different from the surrounding grayscale value. Therefore, each cable tie image can be threshold segmented according to the Otsu threshold method. Then, each connected domain obtained by segmentation is more likely to be a scratch defect area, and is easily affected by noise when acquiring the image. Therefore, in order to improve the efficiency of subsequent analysis and processing, it is necessary to remove the noise. The defect is often a relatively large connected domain, and the noise is a relatively small connected domain. Therefore, according to the size of the connected domain area, the noise can be removed.

[0050] In an embodiment of the present invention, the Otsu threshold method is used to perform threshold segmentation on the surface image of each cable tie to obtain each connected domain of the surface image of each cable tie, and the number of pixels M is preset. The connected domains with a number of pixels less than M are eliminated. In an embodiment of the present invention, the preset number of pixels M=10. In other embodiments, the implementer can preset the value of the number of pixels M according to the specific implementation method.

[0051] It should be noted that the scratch defect area appears as an irregular jagged edge in the cable tie surface image, and the grayscale changes in the scratch defect area are relatively chaotic; however, there may be a lighting-affected area in the obtained connected domain, and the edge changes in the lighting-affected area are smooth, that is, relatively regular, and the grayscale changes in the lighting-affected area are relatively consistent. Therefore, the defect assessment index of each connected domain can be calculated based on the edge regularity and the chaos of the grayscale value. The connected domain with lower regularity and higher chaos has a higher defect assessment index.

[0052] Select any edge pixel point on the edge of the connected domain as the starting point, and start traversing each edge pixel point on the connected domain in a counterclockwise direction. During the traversal process, the sine value of the direction of the next pixel point relative to the current edge pixel point is calculated to obtain the relative direction of each edge pixel point in the connected domain. If the edge of the connected domain is more regular, the change of the relative direction of the edge pixel points of the connected domain will be more stable. When performing curve fitting on the relative direction corresponding to the edge pixel points on the connected domain with more regular edges, the fitting error will be smaller. The standard deviation of the grayscale values of all pixels in the connected domain can be used to directly represent the chaos of the grayscale change in the connected domain. The larger the standard deviation, the higher the chaos.

[0053] In the embodiment of the present invention, any cable tie surface image is recorded as the current cable tie surface image, and the relative direction of the j-th edge pixel point of the i-th connected domain of the current cable tie surface image is obtained:

[0054] ;

[0055] Where, Represents the relative direction of the jth edge pixel point in the i-th connected component; Represents the position coordinates of the next edge pixel point in the counterclockwise direction of the j-th edge pixel point of the i-th connected component; Represents the position coordinates of the jth edge pixel point of the i-th connected component; || represents the absolute value symbol; Represents the sine value of the horizontal angle between the next edge pixel in the counterclockwise direction of the j-th edge pixel of the i-th connected component and the j-th edge pixel.

[0056] In an embodiment of the present invention, any edge pixel point on the i-th connected domain is recorded as a starting point, and the edge pixel points on the i-th connected domain are traversed in sequence in a counterclockwise direction to obtain an edge pixel point sequence of the i-th connected domain. The relative directions corresponding to all pixels in the edge pixel point sequence of the i-th connected domain are curve fitted using the least squares method to obtain a fitting value of the relative direction of each edge pixel point on the i-th connected domain.

[0057] Get the defect assessment index of the i-th connected domain:

[0058] ;

[0059] Where, represents the defect assessment index of the i-th connected domain; Represents the number of edge pixels in the i-th connected domain; Represents the fitting value of the relative direction of the jth edge pixel on the i-th connected domain; Represents the relative direction of the jth edge pixel on the i-th connected domain; Represents the standard deviation of the grayscale values of all pixels in the i-th connected domain; The larger the value of , the more chaotic the grayscale change in the i-th connected domain is, the larger the defect evaluation index of the i-th connected domain is, and the more likely the i-th connected domain is to be a scratch defect area; The larger the value of , the more irregular the edge of the i-th connected domain is, the larger the defect evaluation index of the i-th connected domain is, and the more likely the i-th connected domain is to be a scratch defect area.

[0060] S3: Correcting the defect assessment index of each connected domain of the cable tie surface image to obtain a corrected defect assessment index of each connected domain of the cable tie surface image.

[0061] It should be noted that the conveyor belt length is 0.5 meters, the speed is 0.1 m / s, and the preset image acquisition interval is 2.5 seconds. Therefore, the cable tie can be photographed twice every 0.25 meters, which means that there is overlapping part between adjacent cable tie images. Due to the change in shooting angle, the connected domain caused by illumination appears differently in adjacent cable tie surface images, but the shape of the connected domain in the scratch defect area does not change. Therefore, the structural similarity of the overlapping part of the connected domain between adjacent cable tie images can be used to correct the defect assessment index to reduce the defect assessment index of the connected domain caused by illumination and improve the accuracy of the defect assessment index calculation. Among them, the higher the structural similarity, the more likely the connected domain is a true defect area, and the higher the defect assessment index.

[0062] In the embodiment of the present invention, the pixel point at the upper right corner of the current tie surface image is used as the coordinate origin, a rectangular coordinate system is constructed for the current tie surface image, and the horizontal coordinate of each pixel point of the current tie surface image is obtained to obtain the straight line y= ,in Represents the maximum horizontal coordinate of all pixels of the current cable tie surface image; divides the current cable tie surface image into two left and right areas according to the straight line; similarly, divides each cable tie surface image into two left and right areas.

[0063] If the maximum horizontal coordinate of all pixels in the i-th connected domain of the current cable tie surface image is less than , the area obtained by matching the i-th connected domain of the current cable tie surface image to the right area of the previous cable tie image of the current cable tie surface image is recorded as the matching area of the i-th connected domain of the current cable tie surface image; the structural similarity between the i-th connected domain and its matching area is obtained using the SSIM algorithm, and recorded as the structural similarity between the i-th connected domain and its matching area;

[0064] If the minimum horizontal coordinate of all pixels in the i-th connected domain of the current cable tie surface image is greater than , the area obtained by matching the i-th connected domain of the current cable tie surface image to the left area of the next cable tie image of the current cable tie surface image is recorded as the matching area of the i-th connected domain of the current cable tie surface image; the structural similarity between the i-th connected domain and its matching area is obtained using the SSIM algorithm, and recorded as the structural similarity between the i-th connected domain and its matching area;

[0065] If there is a connected domain with a horizontal coordinate equal to , the i-th connected domain of the current cable tie surface image is divided into two target regions according to the straight line, which are recorded as the two target regions of the i-th connected domain of the current cable tie surface image. According to the matching region acquisition method, the matching region of each target region of the i-th connected domain of the current cable tie surface image is obtained;

[0066] The SSIM algorithm is used to obtain the structural similarity between each target region of the i-th connected domain and the matching region of its target region; and the mean of the structural similarities between all target regions of the i-th connected domain and the matching region of its target region is recorded as the structural similarity between the i-th connected domain and its matching region;

[0067] In an embodiment of the present invention, the correction defect assessment index of the i-th connected domain is obtained:

[0068] ;

[0069] Where, represents the corrected defect evaluation index of the i-th connected domain; represents the defect assessment index of the i-th connected domain; tanh() represents the normalization function; Represents the structural similarity between the i-th connected domain and its matching region; The larger the value of , the more likely the i-th connected domain is to be a scratch defect area, and the larger the value of the corrected defect evaluation index of the i-th connected domain.

[0070] S4: Obtaining a scratch defect area according to the corrected defect evaluation index of each connected domain of the cable tie surface image.

[0071] It should be noted that, since the corrected defect assessment indexes of each connected domain of the current cable tie surface image have been obtained, it is necessary to obtain the scratch defect area of the current cable tie surface image based on the corrected defect assessment indexes.

[0072] In an embodiment of the present invention, a defect determination threshold T is preset to 0.75. In other embodiments, the implementer may preset the value of T based on specific implementation circumstances. If the corrected defect assessment index of any connected domain is greater than or equal to the defect determination threshold T, the connected domain is determined to be a scratch defect region of the current cable tie surface image, and each scratch defect region of the current cable tie surface image is obtained. Similarly, each scratch defect region of each cable tie image is obtained. When a scratch defect region exists in any cable tie image, the system immediately sends a signal to remind the staff to process this section of the cable tie.

[0073] An embodiment of the present invention further discloses a cable tie defect detection system for a cable tie machine, comprising a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a cable tie defect detection method for a cable tie machine according to the present invention is implemented.

[0074] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and will not be described in detail here.

[0075] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory, dynamic random access memory, static random access memory, enhanced dynamic random access memory, high bandwidth memory, hybrid memory cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium may be part of, accessible to, or connectable to the device.

[0076] While several embodiments of the present invention have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Numerous modifications, variations, and alternatives will occur to those skilled in the art without departing from the concept and spirit of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in practicing the present invention.

[0077] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting defects in a cable tie for a cable tie machine, characterized in that: Including steps: Collect the surface image of the cable tie, perform threshold segmentation on the surface image of the cable tie, obtain each connected domain; obtain the defect evaluation index of each connected domain , represents the defect assessment index of the i-th connected domain; Represents the number of edge pixels in the i-th connected domain; Represents the fitting value of the relative direction of the jth edge pixel on the i-th connected domain; Represents the relative direction of the jth edge pixel on the i-th connected domain; Represents the standard deviation of the grayscale values of all pixels in the i-th connected domain; Choose any edge pixel point on the edge of the connected domain as the starting point, and start traversing each edge pixel point on the connected domain in a counterclockwise direction. During the traversal process, calculate the sine value of the direction of the next pixel point relative to the current edge pixel point, and then obtain the relative direction of each edge pixel point in the connected domain; Obtain the structural similarity between each connected domain and its matching area, including: obtaining the left and right areas of the cable tie surface image; obtaining the matching area of each connected domain; using the SSIM algorithm to obtain the structural similarity between the i-th connected domain and its matching area, and record it as the structural similarity between the i-th connected domain and its matching area; obtaining the correction defect evaluation index of each connected domain , represents the corrected defect evaluation index of the i-th connected domain; represents the defect assessment index of the i-th connected domain; tanh() represents the normalization function; Represents the structural similarity between the i-th connected domain and its matching region; A scratch defect area is obtained according to the modified defect evaluation index.

2. A method for detecting defects in a cable tie for a cable tie machine according to claim 1, characterized in that: The threshold segmentation is performed on the surface image of the cable tie to obtain each connected domain, including: The Otsu threshold method is used to perform threshold segmentation on the surface image of each cable tie to obtain the connected domains of each cable tie surface image. The number of pixels M is preset, and the connected domains with a number of pixels less than M are eliminated.

3. A method for detecting defects in a cable tie for a cable tie machine according to claim 1, characterized in that: The acquisition of the relative direction of the j-th edge pixel point on the i-th connected component includes: ; Where, Represents the relative direction of the jth edge pixel point in the i-th connected component; Represents the position coordinates of the next edge pixel point in the counterclockwise direction of the j-th edge pixel point of the i-th connected component; Represents the position coordinates of the jth edge pixel point in the i-th connected component; || represents the absolute value symbol.

4. A method for detecting cable tie defects for a cable tie machine according to claim 1, characterized in that: The acquisition of the fitting value of the relative direction of the j-th edge pixel point on the i-th connected component includes: Any edge pixel point on the i-th connected domain is recorded as the starting point, and the edge pixel points on the i-th connected domain are traversed in sequence in a counterclockwise direction to obtain the edge pixel point sequence of the i-th connected domain. The least squares method is used to perform curve fitting on the relative directions corresponding to all pixels in the edge pixel point sequence of the i-th connected domain to obtain the fitting value of the relative direction of each edge pixel point on the i-th connected domain.

5. A method for detecting cable tie defects for a cable tie machine according to claim 1, characterized in that: The obtaining of the left and right areas of the cable tie surface image includes: The pixel point at the upper right corner of the current cable tie surface image is used as the coordinate origin, and a rectangular coordinate system is constructed for the current cable tie surface image to obtain the horizontal coordinate of each pixel point of the current cable tie surface image, and obtain the straight line y= ,in Represents the maximum horizontal coordinate of all pixel points of the current cable tie surface image; divides the current cable tie surface image into two left and right areas according to the straight line; and divides each cable tie surface image into two left and right areas.

6. A method for detecting defects in a cable tie for a cable tie machine according to claim 1, characterized in that: The obtaining of the matching area of each connected component includes: If the maximum horizontal coordinate of all pixels in the i-th connected domain of the current cable tie surface image is less than , the area obtained by matching the i-th connected domain of the current cable tie surface image to the right area of the previous cable tie image of the current cable tie surface image is recorded as the matching area of the i-th connected domain of the current cable tie surface image; If the minimum horizontal coordinate of all pixels in the i-th connected domain of the current cable tie surface image is greater than , the area obtained by matching the i-th connected domain of the current cable tie surface image to the left area of the next cable tie image of the current cable tie surface image is recorded as the matching area of the i-th connected domain of the current cable tie surface image.

7. A method for detecting cable tie defects for a cable tie machine according to claim 1, characterized in that: The obtaining of the scratch defect area comprises: A defect determination threshold T is preset. If the corrected defect assessment index of any connected domain is greater than or equal to the defect determination threshold T, the connected domain is determined to be a scratch defect region of the current cable tie surface image, and each scratch defect region of the current cable tie surface image is obtained; each scratch defect region of each cable tie image is obtained.

8. The method for detecting cable tie defects for a cable tie machine according to claim 1, wherein: The collecting of the cable tie surface image includes: The preset image acquisition interval is 2.5s. The cable ties are placed on a conveyor belt with a length of 0.5 meters and a speed of 0.1m / s. The high-resolution camera should be placed directly above the conveyor belt. While the conveyor belt is running, the RGB image of the surface of each cable tie is collected. The semantic segmentation algorithm is used to segment the RGB image of each cable tie surface to obtain the image of each cable tie region, and the cable tie region image is converted to grayscale to obtain the surface image of each cable tie.

9. A cable tie defect detection system for a cable tie machine, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for detecting defects of a cable tie for a cable tie machine according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • High-voltage power supply element defect identification method based on computer vision

    CN119863467A