Visual inspection method of connector automatic assembly production line

By using visual inspection methods to perform image segmentation and connected component analysis on the automated connector assembly line, the problem of template matching being unable to accurately identify small pin abnormalities was solved, achieving high-precision quality inspection and improved safety.

CN121783980APending Publication Date: 2026-04-03DONGGUAN HAICI ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing automated connector assembly lines, template matching cannot accurately identify abnormal arrangements of tiny pins, resulting in low quality inspection accuracy and affecting the safety and production efficiency of connectors.

Method used

Visual inspection methods are used to calculate the morphological conformity, discriminant coefficient, length anomaly, and spacing anomaly of connected components through image segmentation and connected component analysis. Abnormal connected components are screened out, and an anomaly evaluation index is calculated to assess the quality of the connector.

Benefits of technology

This improves the accuracy of connector quality inspection, enhances the efficiency of the production process, and ensures the safety and production efficiency of connectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121783980A_ABST
    Figure CN121783980A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of visual inspection, in particular to a visual inspection method for an automatic connector assembly production line, and the method comprises the steps: collecting a to-be-detected connector image and a standard connector image; respectively segmenting the to-be-tested connector image and the standard connector image, and extracting all connected domains in the to-be-tested connector image and the standard connector image; calculating the form conformity of each connected domain, determining the discrimination coefficient of each connected domain, and obtaining each target connected domain in the to-be-detected connector image and the standard connector image; obtaining the length anomaly degree of any target connected domain; calculating the spacing deviation of any target connected domain, and determining the spacing anomaly of any target connected domain; acquiring a connected abnormal set; and calculating an abnormal evaluation index of the to-be-tested connector image, and evaluating the quality of the connector. According to the invention, the defect detection of the contact pin in the connector can be improved, and the quality detection precision of the connector is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual inspection technology, specifically to a visual inspection method for an automated connector assembly production line. Background Technology

[0002] Connectors are components used to connect two or more electrical or electronic systems, devices, or parts, enabling the transmission of signals or electricity. In automated connector assembly lines, visual inspection methods are crucial for ensuring connector product quality and improving production efficiency, thereby enhancing inspection effectiveness.

[0003] Currently, the visual inspection process for connectors mainly relies on template matching. However, the pins in connectors are small and closely arranged, making it difficult to accurately identify abnormal arrangements of these small pins through template matching. This affects the detection of pin defects in connectors, resulting in low quality inspection accuracy and impacting the safety and production efficiency of connectors. Summary of the Invention

[0004] To address the aforementioned technical problems, a visual inspection method for an automated connector assembly production line is provided to resolve existing issues.

[0005] The solution to the technical problem of this application is to provide a visual inspection method for an automated connector assembly production line, including the following steps:

[0006] Collect surface images of the connector to be tested after assembly and the connector that has passed assembly, and record them as the image of the connector to be tested and the standard connector image, respectively; segment the image of the connector to be tested and the standard connector image, and extract all connected components in the image of the connector to be tested and the standard connector image;

[0007] For the connector image under test, the shape conformity of each connected component is calculated by considering the aspect ratio of its minimum bounding rectangle and the difference between the area of ​​the connected component and the area of ​​its minimum bounding rectangle. Combined with the positional distribution of different connected components, the discrimination coefficient of each connected component is determined. Based on the discrimination coefficient, all connected components in the connector image under test are filtered to obtain each target connected component in the connector image under test. Correspondingly, all target connected components in the standard connector image are obtained.

[0008] The deviation of the length of the minimum bounding rectangle of any target connected component in the image of the connector under test from that of the other target connected components, and the difference between the length of the minimum bounding rectangle of the target connected component and that of the standard connector image are analyzed to obtain the length anomaly of the target connected component.

[0009] Analyze the spacing difference between any target connected component and its neighboring target connected components, calculate the spacing deviation of any target connected component, and determine the spacing anomaly degree of any target connected component by combining the coordinate differences of pixels in any target connected component.

[0010] Based on the length anomaly and the spacing anomaly, all target connected components in the image of the connector under test are filtered to obtain a set of connectivity anomalies. Based on the proportion of the number of target connected components in the set of connectivity anomalies to the anomalies of all target connected components in the standard connector image, the anomaly evaluation index of the image of the connector under test is calculated to evaluate the quality of the connector.

[0011] Preferably, the step of segmenting the image of the connector under test and the standard connector image respectively, and extracting all connected components in the image of the connector under test and the standard connector image, includes:

[0012] A threshold segmentation algorithm is used to obtain a segmentation threshold for the image of the connector under test. The region in the image of the connector under test whose gray value is greater than the segmentation threshold is recorded as the region to be analyzed. All connected components in the region to be analyzed in the image of the connector under test are extracted. Similarly, for the standard connector image, all connected components in the region to be analyzed in the standard connector image are obtained.

[0013] Preferably, the calculation of the morphological conformity of each connected component includes:

[0014] Calculate the ratio of the length to the width of the minimum bounding rectangle of each connected component in the image of the connector under test, and denot it as the aspect ratio;

[0015] The difference between the area of ​​the minimum bounding rectangle of each connected component in the image of the connector under test and the area of ​​the connected component is denoted as the area difference.

[0016] The ratio of the aspect ratio to the area difference is used as the morphological conformity of each connected region in the image of the connector under test.

[0017] Preferably, determining the discriminant coefficient for each connected component includes:

[0018] Calculate the distance between the centroid of each connected component in the image of the connector under test and the centroids of all other connected components. The sum of the distances between each connected component in the image of the connector under test and all other connected components is taken as the relative distribution distance of each connected component in the image of the connector under test.

[0019] The discriminant coefficient is the normalized result of the ratio of the morphological conformity to the relative distribution distance.

[0020] Preferably, the step of obtaining each target connected component in the image of the connector under test includes: recording each connected component in the image of the connector under test whose discrimination coefficient is greater than or equal to a preset first threshold as a target connected component.

[0021] Preferably, obtaining the length anomaly of any target connected component includes:

[0022] The length of the minimum bounding rectangle of any target connected region in the image of the connector under test is denoted as the extension length.

[0023] The extension length of the connected region corresponding to any target connected region in the standard connector image is denoted as the standard extension length, and the difference between the extension length of any target connected region and the standard extension length is denoted as the length difference.

[0024] The average of the differences between the extension lengths of any target connected component and all other target connected components is taken as the relative length deviation of any target connected component.

[0025] The length anomaly is the normalized result of fusing the relative length deviation and the length difference.

[0026] Preferably, calculating the spacing deviation of any target connected component includes:

[0027] Obtain the position coordinates of all vertices in the minimum bounding rectangle of any target connected component;

[0028] The pixel at the center between the two vertices with the largest y-coordinates is taken as the upper endpoint of any target connected component; the pixel at the center between the two vertices with the smallest y-coordinates is taken as the lower endpoint of any target connected component.

[0029] The spacing deviation H of the p-th target connected component in the image of the connector under test p The calculation formula is: H p =|ds p-1,p -ds p,p+1 |×|dx p-1,p -dx p,p+1 |, where ds p-1,p Let ds be the distance between the upper endpoints of the p-th target connected component and the (p-1)-th target connected component in the image of the connector under test. p,p+1 Let dx be the distance between the upper endpoints of the p-th target connected component and the (p+1)-th target connected component in the image of the connector under test. p-1,p Let dx be the distance between the lower endpoints of the p-th target connected component and the (p-1)-th target connected component in the image of the connector under test. p,p+1 Let be the distance between the lower endpoints of the p-th target connected component and the (p+1)-th target connected component in the image of the connector under test.

[0030] Preferably, determining the spacing anomaly of any target connected component includes:

[0031] The difference between the x-coordinate of the upper endpoint and the x-coordinate of the lower endpoint of any target connected domain is denoted as the positional deviation.

[0032] The spacing anomaly is the normalized result of fusing the spacing deviation and the position deviation.

[0033] Preferably, the process of obtaining the connectivity anomaly set is as follows:

[0034] Number all target connected components in the image of the connector to be tested;

[0035] The indices of the target connected components whose length anomalies are greater than or equal to a preset second threshold are used to form a length anomaly set.

[0036] The indices of the target connected components whose spacing anomalies are greater than or equal to a preset second threshold are used to form a spacing anomaly set.

[0037] The union of the length anomaly set and the spacing anomaly set is denoted as the connectivity anomaly set.

[0038] Preferably, the calculation of the anomaly evaluation index of the image of the connector under test to evaluate the quality of the connector includes:

[0039] Obtain the total number of all target connected components in the standard connector image; use the ratio of the number of all elements in the connectivity anomaly set to the total number as the anomaly evaluation index of the connector image under test.

[0040] If the anomaly assessment index is greater than the preset third threshold, the connector is a defective product; otherwise, the connector is a qualified product.

[0041] This application has at least the following beneficial effects:

[0042] This application performs image segmentation based on the grayscale changes in the image of the connector under test, selects the possible locations of the pins, extracts connected components, and calculates the morphological conformity of each connected component. Its beneficial effect is that it reflects the similarity between the morphology of the corresponding connected component in the image of the connector under test and the morphology represented by the pin, thus indicating the probability that the corresponding connected component in the image of the connector under test is the connected component to which the pin belongs. The discriminant coefficient of each connected component is calculated, and all connected components in the image of the connector under test are filtered to obtain each target connected component. Its beneficial effect is that it considers the distance between different connected components in the image of the connector under test, reflecting the close distribution between different pins in the connector. The discriminant coefficient further indicates that the corresponding connected component in the image of the connector under test is the pin. The probability of a pin belonging to a connected component is analyzed, and connected components are filtered to identify those that correspond to the pin. By analyzing the length and spacing differences of different target connected components in the image of the connector under test, the length anomaly and spacing anomaly are calculated. The beneficial effect is that it takes into account the possibility of height inconsistencies and skewness in the arrangement of different pins represented by different target connected components in the image of the connector under test, thereby filtering out abnormal target connected components, analyzing the proportion of abnormal target connected components, calculating the anomaly evaluation index, and evaluating the quality of the connector. The beneficial effect is that it can improve the detection of defects in the pins of the connector, improve the accuracy of the quality inspection of the connector, help improve the safety of the connector, and make the connector production process more efficient. Attached Figure Description

[0043] The visual inspection method for an automated connector assembly line according to this application will be further described in detail below with reference to the accompanying drawings.

[0044] Figure 1 A flowchart illustrating the steps of a visual inspection method for an automated connector assembly line provided in this application embodiment;

[0045] Figure 2 A flowchart illustrating the steps of a method for obtaining a target connected component in an image of a connector under test, as provided in an embodiment of this application.

[0046] Figure 3 A flowchart illustrating the steps of the method for obtaining the anomaly assessment index provided in this application embodiment. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the visual inspection method for an automated connector assembly production line proposed in this application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit the scope of this application.

[0048] Unless otherwise defined, 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 application pertains.

[0049] Please see Figure 1 The diagram illustrates a flowchart of a visual inspection method for an automated connector assembly line according to an embodiment of this application. The method includes the following steps:

[0050] Step 1: Collect images of the connector surface to be tested after assembly, and images of the connector surface after successful assembly, which are recorded as the image of the connector to be tested and the image of the standard connector, respectively.

[0051] Automated connector assembly lines utilize automation technology to efficiently and precisely assemble connectors. Common connectors typically consist of contact terminals and a plastic housing. The contact terminals are usually made of conductive materials such as copper or gold-plated copper. Connectors contain one or more sets of pins, which are normally arranged neatly according to a specific pattern. However, during the assembly process, pin misalignment or skew can occur, affecting the safe and reliable operation of the circuit. Therefore, real-time monitoring of connector samples during or after assembly is crucial for ensuring connector manufacturing quality.

[0052] The surface images of the connectors to be inspected after assembly on the production line are captured by an industrial camera and recorded as the image of the connector to be inspected. The surface images of the qualified connectors are recorded as the standard connector images. When capturing images, it is necessary to ensure that all pins in the connector can be captured clearly and completely, and all captured connector images are processed by grayscale conversion and noise reduction.

[0053] In this embodiment, wavelet transform algorithm is used for noise reduction. Wavelet transform algorithm is a well-known technology and will not be described in detail here. As other implementation methods, implementers can use other methods of existing technology, such as median filtering, etc. This embodiment does not impose any special restrictions on this.

[0054] At this point, we have obtained the images of the connector under test and the standard connector.

[0055] Step 2: For the connector image under test, calculate the shape conformity of each connected component by considering the aspect ratio of its minimum bounding rectangle and the difference between the area of ​​the connected component and the area of ​​its minimum bounding rectangle. Combine this with the positional distribution of different connected components to determine the discrimination coefficient of each connected component. Based on the discrimination coefficient, filter all connected components in the connector image under test to obtain each target connected component in the connector image under test. Correspondingly, obtain all target connected components in the standard connector image.

[0056] Furthermore, the flowchart of the method for obtaining the target connected component in the image of the connector under test provided in this application embodiment is as follows: Figure 2 As shown.

[0057] To detect abnormal pin arrangement in a connector, it is necessary to first select the area belonging to the pins in the image of the connector under test. Since the pins are generally made of metal, there is a difference in grayscale values ​​between the pins and the plastic shell. Specifically, the area containing the pins is brighter and has a higher grayscale value than the plastic shell. Image segmentation is performed on the connector image to obtain the area containing the pins, which is denoted as the region to be analyzed.

[0058] A threshold segmentation algorithm is used to obtain a segmentation threshold for the image of the connector under test. The region in the image of the connector under test whose gray value is greater than the segmentation threshold is recorded as the region to be analyzed.

[0059] In this embodiment, a gray-level histogram construction method is used, with the maximum valley in the gray-level histogram serving as the segmentation threshold. The construction of the gray-level histogram is a well-known technique and will not be elaborated upon here. Secondly, the above image segmentation is based on the gray-level differences between different regions of the image. There may be interference from other regions with similar gray levels to the region to be analyzed. Therefore, it is necessary to analyze the morphological characteristics of the pins to filter the regions where the pins are located. The pins in the region to be analyzed generally exhibit a long rectangular needle-like shape, with multiple pins closely arranged. The morphological conformity is calculated by analyzing the morphological characteristics of the connected components corresponding to the pins in the region to be analyzed. Specifically:

[0060] Extract all connected components within the region to be analyzed in the image of the connector under test;

[0061] Calculate the ratio of the length to the width of the minimum bounding rectangle of each connected component in the image of the connector under test, and denot it as the aspect ratio;

[0062] It should be noted that the extraction of connected components and the minimum bounding rectangle are well-known techniques, and will not be elaborated upon here.

[0063] The difference between the area of ​​the minimum bounding rectangle of each connected component in the image of the connector under test and the area of ​​the connected component is denoted as the area difference.

[0064] In this embodiment, the difference between the area of ​​the minimum bounding rectangle of each connected region in the image of the connector under test and the area of ​​the connected region is calculated and denoted as the area difference.

[0065] The ratio of the aspect ratio to the area difference is used as the morphological conformity of each connected component in the image of the connector under test.

[0066] It should be noted that since pins are usually long rectangles, the larger the aspect ratio, the more it conforms to the characteristics of a pin. Secondly, the smaller the difference between the area of ​​the smallest bounding rectangle of the corresponding connected region in the image of the connector under test and the area of ​​the connected region itself, that is, the smaller the area difference, the more the corresponding connected region conforms to the rectangular shape, and the greater the shape conformity. The more the corresponding connected region in the image of the connector under test conforms to the shape characteristics of a pin, the greater the probability that it is a pin.

[0067] Furthermore, the distribution of different connected components in the image of the connector under test is analyzed, and the connected components to which the pins belong are filtered, specifically:

[0068] Calculate the distance between the centroid of each connected component in the image of the connector under test and the centroids of all other connected components. The sum of the distances between each connected component in the image of the connector under test and all other connected components is taken as the relative distribution distance of each connected component in the image of the connector under test.

[0069] In this embodiment, the Euclidean distance between the centroid of each connected region in the image of the connector under test and the centroids of the other connected regions is calculated. The calculation of the Euclidean distance is a well-known technique and will not be described in detail here.

[0070] The normalized result of the ratio of the morphological conformity to the relative distribution distance is used as the discriminant coefficient of each connected component in the image of the connector under test.

[0071] In this embodiment, the method for calculating the discriminant coefficient of each connected component in the image of the connector under test is as follows:

[0072]

[0073] Among them, V q Let F be the discriminant coefficient of the q-th connected component in the image of the connector under test. q O represents the morphological conformity of the q-th connected component in the image of the connector under test. q Let O be the centroid of the q-th connected component in the image of the connector under test. h Let be the centroid of the h-th connected component in the image of the connector under test, Q be the number of all connected components in the image of the connector under test, d() be the Euclidean distance calculation, and norm[] be the normalization function. In this embodiment, the sigmoid function is used for normalization. The sigmoid function is a well-known technique and will not be described in detail here.

[0074] The connected components in the image of the connector under test whose discrimination coefficient is greater than or equal to a preset first threshold are denoted as each target connected component;

[0075] In this embodiment, the preset first threshold value is 0.85. In other implementation methods, the implementer can set it according to the actual situation.

[0076] For the standard connector image, the same acquisition method as that used for each target connected component in the connector image under test is adopted to obtain all connected components in the standard connector image.

[0077] It should be noted that since the pins in the connector are relatively closely distributed, the smaller the overall distance of the corresponding connected regions, that is, the smaller the relative distribution distance, the greater the probability that the corresponding connected region is a pin, the larger the resulting discrimination coefficient, and the more likely the corresponding connected region is to be the connected region to which the pin belongs.

[0078] Thus, the connected components of each target in the image of the connector under test and the standard connector image are obtained respectively.

[0079] Step 3: Analyze the deviation of the length of the minimum bounding rectangle of any target connected region in the image of the connector under test from that of the other target connected regions, and the difference between the length of the minimum bounding rectangle of the target connected region and that of the standard connector image, to obtain the length anomaly of the target connected region; analyze the change in the spacing difference between the target connected region and its adjacent target connected regions, calculate the spacing deviation of the target connected region, and determine the spacing anomaly of the target connected region by combining the coordinate differences of the pixels in the target connected region.

[0080] In a qualified connector, the pins are arranged neatly according to a certain pattern, and the extension length of all the pins is consistent. However, if there are abnormalities such as skewness or misalignment of some pins during the connector assembly process, the pin arrangement will be uneven, meaning the extension lengths will be inconsistent. Based on the above analysis, the length anomaly degree is calculated as follows:

[0081] The length of the minimum bounding rectangle of any target connected region in the image of the connector under test is denoted as the extension length of the target connected region.

[0082] The extension length of any target connected region in the image of the connector under test corresponding to the connected region in the standard connector image is denoted as the standard extension length.

[0083] The difference between the extension length of any target connected component and the standard extension length is denoted as the length difference;

[0084] It should be noted that the greater the length difference, the more likely there is an anomaly in the extension length of the pins of the corresponding target connected region in the image of the connector under test.

[0085] The average of the differences between the extension lengths of any target connected component and all other target connected components is taken as the relative length deviation of any target connected component.

[0086] In this embodiment, the mean of the absolute values ​​of the differences between the extension lengths of any target connected component and all other target connected components is taken as the relative length deviation of the target connected component.

[0087] The normalized result of the product of the relative length deviation and the length difference is used as the length anomaly of any target connected component in the image of the connector under test.

[0088] In this embodiment, the sigmoid function is used for normalization. The sigmoid function is a well-known technique and will not be described in detail here.

[0089] It should be noted that the larger the relative length deviation, the greater the possibility that the pin extension length of the corresponding target connected region in the image of the connector under test is abnormal. The greater the length anomaly, the more likely the corresponding target connected region in the image of the connector under test is to have a pin with an abnormal extension length.

[0090] Furthermore, in a qualified connector, the spacing between multiple pins is basically the same. However, if the pins in the connector are misaligned or if any pins are missing from assembly, the uniformity of the pin spacing will be off. The spacing deviation is calculated as follows:

[0091] Obtain the position coordinates of all vertices in the minimum bounding rectangle of any target connected component in the image of the connector under test;

[0092] The pixel at the center between the two vertices with the largest y-coordinates is taken as the upper endpoint of any target connected component; the pixel at the center between the two vertices with the smallest y-coordinates is taken as the lower endpoint of any target connected component.

[0093] The formula for calculating the spacing deviation of any target connected component in the image of the connector under test is as follows:

[0094] H p =|ds p-1,p -ds p,p+1 |×|dx p-1,p -dx p,p+1 |

[0095] Among them, H p Let ds be the spacing deviation of the p-th target connected component in the image of the connector under test. p-1,p Let ds be the distance between the upper endpoints of the p-th target connected component and the (p-1)-th target connected component in the image of the connector under test. p,p+1 Let dx be the distance between the upper endpoints of the p-th target connected component and the (p+1)-th target connected component in the image of the connector under test. p-1,pLet dx be the distance between the lower endpoints of the p-th target connected component and the (p-1)-th target connected component in the image of the connector under test. p,p+1 Let be the distance between the lower endpoints of the p-th target connected component and the (p+1)-th target connected component in the image of the connector under test.

[0096] Secondly, if adjacent pins in the image of the connector under test exhibit continuous tilting, the spacing difference between the upper and lower endpoints of adjacent target connected regions will be consistent, indicating uniform pin spacing. However, the pins are actually tilted. Therefore, the difference in the abscissas of the upper and lower endpoints of the target connected regions in the image of the connector under test is analyzed, and the spacing anomaly is calculated in conjunction with the spacing deviation. Specifically:

[0097] The difference between the x-coordinate of the upper endpoint and the x-coordinate of the lower endpoint of any target connected domain is denoted as the positional deviation.

[0098] In this embodiment, the absolute value of the difference between the x-coordinate of the upper endpoint and the x-coordinate of the lower endpoint of any target connected domain is denoted as the positional deviation.

[0099] The normalized result of the product of the spacing deviation and the position deviation is used as the spacing anomaly degree of any target connected component.

[0100] In this embodiment, the sigmoid function is used for normalization. The sigmoid function is a well-known technique and will not be described in detail here.

[0101] It should be noted that the larger the spacing deviation, the greater the difference in spacing between the corresponding target connected region and its adjacent target connected regions in the image of the connector under test, reflecting an abnormality in the arrangement spacing of the pins; the larger the position deviation, the greater the tilt of the corresponding target connected region in the image of the connector under test, the greater the resulting spacing anomaly, indicating that the corresponding target connected region in the image of the connector under test is more likely to belong to an abnormally arranged pin.

[0102] Thus, the length anomaly and spacing anomaly of any target connected region in the image of the connector under test are obtained.

[0103] Step 4: Based on the length anomaly and the spacing anomaly, filter all target connected components in the image of the connector under test to obtain a set of connectivity anomalies; based on the anomaly ratio of the target connected components in the set of connectivity anomalies, calculate the anomaly evaluation index of the image of the connector under test to evaluate the quality of the connector.

[0104] Furthermore, since the length anomaly and the spacing anomaly represent the abnormalities in the extension length and skewness of different pins, respectively, the pins on the connector may simultaneously exhibit both length inconsistencies and skewness. Therefore, based on the length anomaly and the spacing anomaly, the target connected components are filtered, specifically as follows:

[0105] Number all target connected components in the image of the connector under test; form a length anomaly set by the serial numbers of the target connected components in the image of the connector under test whose length anomaly degree is greater than or equal to a preset second threshold.

[0106] The indexes of the target connected components in the image of the connector under test whose spacing anomaly degree is greater than or equal to a preset second threshold are used to form a spacing anomaly set.

[0107] The union of the length anomaly set and the spacing anomaly set is denoted as the connectivity anomaly set.

[0108] In this embodiment, the preset second threshold value is 0.9. As for other implementation methods, the implementer can set it according to the actual situation.

[0109] Obtain the total number of all target connected components in the standard connector image; use the ratio of the number of all elements in the connectivity anomaly set to the total number as the anomaly evaluation index of the connector image under test.

[0110] It should be noted that the larger the anomaly assessment index, the more abnormal pins exist in the connector, and the worse the manufacturing quality of the corresponding connector. The flowchart of the method for obtaining the anomaly assessment index provided in this application embodiment is shown below. Figure 3 As shown.

[0111] Furthermore, based on the aforementioned anomaly assessment index, the quality of the connector is evaluated, specifically as follows:

[0112] If the anomaly assessment index is greater than the preset third threshold, the connector is a defective product; otherwise, the connector is a qualified product.

[0113] In this embodiment, the third threshold is preset to 0. In other implementation methods, the implementer can set it according to the actual situation.

[0114] By monitoring the quality of assembled connectors in real time, the operating parameters of the assembly line can be adjusted in real time to optimize the operation of the production line and improve the assembly efficiency of connectors.

[0115] It should be understood that, although Figure 1The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0116] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application. Therefore, any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of this application, without departing from the content of the technical solution of this application, shall fall within the protection scope of the technical solution of this application.

Claims

1. A visual inspection method for an automated connector assembly production line, characterized in that, The method includes the following steps: Collect surface images of the connector to be tested after assembly and the connector that has passed assembly, and record them as the image of the connector to be tested and the standard connector image, respectively; segment the image of the connector to be tested and the standard connector image, and extract all connected components in the image of the connector to be tested and the standard connector image; For the connector image under test, the shape conformity of each connected component is calculated by considering the aspect ratio of its minimum bounding rectangle and the difference between the area of ​​the connected component and the area of ​​its minimum bounding rectangle. Combined with the positional distribution of different connected components, the discrimination coefficient of each connected component is determined. Based on the discrimination coefficient, all connected components in the connector image under test are filtered to obtain each target connected component in the connector image under test. Correspondingly, all target connected components in the standard connector image are obtained. The deviation of the length of the minimum bounding rectangle of any target connected component in the image of the connector under test from that of the other target connected components, and the difference between the length of the minimum bounding rectangle of the target connected component and that of the standard connector image are analyzed to obtain the length anomaly of the target connected component. Analyze the spacing difference between any target connected component and its neighboring target connected components, calculate the spacing deviation of any target connected component, and determine the spacing anomaly degree of any target connected component by combining the coordinate differences of pixels in any target connected component. Based on the length anomaly and the spacing anomaly, all target connected components in the image of the connector under test are filtered to obtain a set of connectivity anomalies. Based on the proportion of the number of target connected components in the set of connectivity anomalies to the anomalies of all target connected components in the standard connector image, the anomaly evaluation index of the image of the connector under test is calculated to evaluate the quality of the connector.

2. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The step of segmenting the image of the connector under test and the standard connector image, and extracting all connected components in the image of the connector under test and the standard connector image, includes: A threshold segmentation algorithm is used to obtain a segmentation threshold for the image of the connector under test. The region in the image of the connector under test whose gray value is greater than the segmentation threshold is recorded as the region to be analyzed. All connected components in the region to be analyzed in the image of the connector under test are extracted. Similarly, for the standard connector image, all connected components in the region to be analyzed in the standard connector image are obtained.

3. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The calculation of the morphological conformity of each connected component includes: Calculate the ratio of the length to the width of the minimum bounding rectangle of each connected component in the image of the connector under test, and denot it as the aspect ratio; The difference between the area of ​​the minimum bounding rectangle of each connected component in the image of the connector under test and the area of ​​the connected component is denoted as the area difference. The ratio of the aspect ratio to the area difference is used as the morphological conformity of each connected region in the image of the connector under test.

4. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The determination of the discriminant coefficient for each connected component includes: Calculate the distance between the centroid of each connected component in the image of the connector under test and the centroids of all other connected components. The sum of the distances between each connected component in the image of the connector under test and all other connected components is taken as the relative distribution distance of each connected component in the image of the connector under test. The discriminant coefficient is the normalized result of the ratio of the morphological conformity to the relative distribution distance.

5. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The step of obtaining each target connected component in the image of the connector under test includes: recording each connected component in the image of the connector under test whose discrimination coefficient is greater than or equal to a preset first threshold as a target connected component.

6. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The process of obtaining the length anomaly of any target connected component includes: The length of the minimum bounding rectangle of any target connected region in the image of the connector under test is denoted as the extension length. The extension length of the connected region corresponding to any target connected region in the standard connector image is denoted as the standard extension length, and the difference between the extension length of any target connected region and the standard extension length is denoted as the length difference. The average of the differences between the extension lengths of any target connected component and all other target connected components is taken as the relative length deviation of any target connected component. The length anomaly is the normalized result of fusing the relative length deviation and the length difference.

7. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The calculation of the spacing deviation of any target connected component includes: Obtain the position coordinates of all vertices in the minimum bounding rectangle of any target connected component; The pixel at the center between the two vertices with the largest y-coordinates is taken as the upper endpoint of any target connected component; the pixel at the center between the two vertices with the smallest y-coordinates is taken as the lower endpoint of any target connected component. The spacing deviation H of the p-th target connected component in the image of the connector under test p The calculation formula is: H p =|ds p-1,p -ds p,p+1 |×|dx p-1,p -dx p,p+1 |, where ds p-1,p Let ds be the distance between the upper endpoints of the p-th target connected component and the (p-1)-th target connected component in the image of the connector under test. p,p+1 Let dx be the distance between the upper endpoints of the p-th target connected component and the (p+1)-th target connected component in the image of the connector under test. p-1,p Let dx be the distance between the lower endpoints of the p-th target connected component and the (p-1)-th target connected component in the image of the connector under test. p,p+1 Let be the distance between the lower endpoints of the p-th target connected component and the (p+1)-th target connected component in the image of the connector under test.

8. The visual inspection method for an automated connector assembly line as described in claim 7, characterized in that, Determining the spacing anomaly of any target connected component includes: The difference between the x-coordinate of the upper endpoint and the x-coordinate of the lower endpoint of any target connected domain is denoted as the positional deviation. The spacing anomaly is the normalized result of fusing the spacing deviation and the position deviation.

9. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The process of obtaining the connectivity anomaly set is as follows: Number all target connected components in the image of the connector to be tested; The indices of the target connected components whose length anomalies are greater than or equal to a preset second threshold are used to form a length anomaly set. The indices of the target connected components whose spacing anomalies are greater than or equal to a preset second threshold are used to form a spacing anomaly set. The union of the length anomaly set and the spacing anomaly set is denoted as the connectivity anomaly set.

10. The visual inspection method for an automated connector assembly line as described in claim 1, characterized in that, The calculation of the anomaly assessment index of the image of the connector under test, used to evaluate the quality of the connector, includes: Obtain the total number of all target connected components in the standard connector image; use the ratio of the number of all elements in the connectivity anomaly set to the total number as the anomaly evaluation index of the connector image under test. If the anomaly assessment index is greater than the preset third threshold, the connector is a defective product; otherwise, the connector is a qualified product.