Connector size detection method and system based on industrial vision

By constructing a connector size detection method based on industrial vision, and utilizing the difference in optical reflection energy integral and the structural torsional continuity coefficient, the problems of high false negative rate in two-dimensional detection and high cost in three-dimensional measurement are solved, and efficient detection and automated isolation of pin micro-torsional deformation are achieved.

CN122335699APending Publication Date: 2026-07-03ALLPASS ELECTRONIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALLPASS ELECTRONIC CO LTD
Filing Date
2026-03-26
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing connector pin inspection technologies, two-dimensional vision inspection cannot effectively identify pin micro-torsional deformation, resulting in a high rate of missed detections. Furthermore, three-dimensional measurement technology has high hardware costs and long processing time, making it difficult to adapt to the high-frequency continuous inspection requirements of production lines.

Method used

By acquiring a two-dimensional grayscale image of the connector, preprocessing and target region segmentation are used to extract the horizontal one-dimensional grayscale sequence of the pins and perform smoothing. The optical reflection energy integral difference and structural torsional continuity coefficient are calculated to construct a comprehensive micro-torsional defect index, thereby realizing connector size detection based on industrial vision.

Benefits of technology

It effectively identifies micro-torsional deformation of pins, reduces the false negative rate, adapts to the production line inspection cycle, and realizes automated identification and isolation of defective products, avoiding the problems of high cost and high time consumption, and balancing detection accuracy and system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335699A_ABST
    Figure CN122335699A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of computer vision and image processing technology, specifically relating to a connector size inspection method and system based on industrial vision. The method includes: determining the effective detection area of ​​the pin through preprocessing and target region segmentation; extracting the original one-dimensional grayscale sequence of the pin's lateral direction and smoothing it to obtain a smooth one-dimensional grayscale sequence; calculating the optical reflection energy integral difference between the two ends of the pin's physical center based on the smooth one-dimensional grayscale sequence to construct a lateral optical reflection asymmetry index; extracting the absolute value of the sum of differences between adjacent rows and the sum of the absolute values ​​of the differences within the evaluation window to construct a structural torsional continuity coefficient; and correlating the maximum value of this index with the structural torsional continuity coefficient to obtain a comprehensive micro-torsion defect index, thereby achieving industrial vision inspection of connector dimensions. This invention effectively solves the problem that traditional two-dimensional inspection techniques struggle to identify pin micro-torsion and have a high false negative rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology. More specifically, this invention relates to a connector size detection method and system based on industrial vision. Background Technology

[0002] In connector manufacturing, the leads are typically high-precision metal stampings. During lead cutting, stamping, or injection molding with a plastic base, the leads are highly susceptible to asymmetric mechanical stress, causing minute torsional deformation around their longitudinal axis. This microscopic deformation results in uneven contact surfaces when the leads are surface-mounted or mated with printed circuit boards, potentially leading to metal fatigue, poor soldering, or even physical breakage. This severely impacts the assembly stability and electrical connection reliability of high-density electronic devices.

[0003] Currently, automated visual inspection of connector physical dimensions in industrial production sites typically employs two-dimensional edge detection algorithms or grayscale template matching technology. These technologies primarily extract the pixel coordinates of the two-dimensional orthogonal projection outer contour of the pins by calculating the grayscale gradient, and then measure the pin width and pin spacing.

[0004] However, when a metal pin undergoes micro-torsional deformation, the change in the width of its orthogonal projection outer contour under the top view of an industrial camera is only at the sub-pixel level, and the contour edge still exhibits parallel straight line characteristics at the pixel scale. Traditional detection methods rely solely on extracting the contour edge coordinates for geometric dimension calculation, without deeply exploring and utilizing the optical high-reflection characteristics of the metal surface inside the pin, resulting in a high rate of missed detection of three-dimensional micro-torsional deformation of the pin.

[0005] While using 3D structured light measurement technology to directly acquire the spatial distribution of pin surface normals can achieve 3D topography detection, it suffers from high hardware deployment costs, large point cloud data processing volumes, and excessively long processing times. This makes it unsuitable for the high-speed, continuous, dynamic acquisition processes required in connector production lines, hindering its large-scale application in engineering practice. Therefore, effectively evaluating the 3D micro-torsional deformation of pins using 2D imaging information while controlling hardware costs has become a pressing technical challenge in the field of industrial vision inspection. Summary of the Invention

[0006] The purpose of this invention is to solve the technical problem in existing connector pin inspection technology that two-dimensional vision inspection, which relies solely on contour edge extraction, cannot effectively identify pin micro-torsional deformation and has a high rate of missed detection. This invention provides a connector size inspection method and system based on industrial vision.

[0007] In a first aspect, the present invention provides a connector size detection method based on industrial vision, comprising: acquiring a two-dimensional grayscale image of the connector; determining an effective detection area for the pins through preprocessing and target region segmentation; extracting a one-dimensional original grayscale sequence of the pins in the horizontal direction within the effective detection area and smoothing it to obtain a one-dimensional smoothed grayscale sequence; extracting the effective starting horizontal pixel coordinates and effective ending horizontal pixel coordinates of the pin area to locate the physical center of the pin; calculating the optical reflection energy integral difference between the two ends of the physical center of the pin based on the one-dimensional smoothed grayscale sequence; and performing a ratio normalization operation on the optical reflection energy integral difference and a denominator bias term including the environmental substrate energy deviation constant to construct... A transverse optical reflection asymmetry index is established. Within a defined longitudinal evaluation window, the absolute value of the sum of differences between adjacent rows of transverse optical reflection asymmetry indices and the sum of the absolute values ​​of these differences are extracted. The absolute value of the sum of these differences is used as the numerator, and the denominator, consisting of the sum of the absolute values ​​of these differences and the inherent measurement noise fluctuation constant, is used as the denominator. A ratio calculation is performed to construct a structural torsional continuity coefficient characterizing the continuity of the spatial structure. The maximum value of the transverse optical reflection asymmetry index within the longitudinal evaluation window is extracted, and the maximum value is correlated with the structural torsional continuity coefficient to obtain a comprehensive micro-torsional defect index. Based on the comprehensive micro-torsional defect index, connector size detection based on industrial vision is achieved.

[0008] Two-dimensional grayscale images of connectors are acquired using industrial vision. After preprocessing and segmentation, the pin detection area is determined, and a horizontal one-dimensional grayscale sequence is extracted and smoothed. Subsequently, the physical center of the pin is located using start and end coordinates. The difference in the integral of optical reflection energy on both sides is calculated and compared with a denominator bias term containing the environmental substrate energy deviation constant to construct a horizontal optical reflection asymmetry index. Simultaneously, within the vertical window, the index difference is compared with a denominator bias term containing the measurement noise constant to construct a structural torsional continuity coefficient. Finally, the maximum index value and this coefficient are fused to obtain a comprehensive micro-torsional defect index to complete the detection. This invention breaks away from the traditional detection approach that relies solely on outer contour extraction. It mines the internal optical reflection features of the pins and transforms the three-dimensional micro-torsional deformation of the pins into two-dimensional grayscale distribution features, enabling the differentiation between real deformation and random interference in the field. This overcomes the shortcomings of traditional detection methods in recognizing micro-torsional deformation and is suitable for the detection needs of industrial production lines.

[0009] Preferably, the step of acquiring a two-dimensional grayscale image of the connector and determining the effective detection area of ​​the pins through preprocessing and target region segmentation includes: acquiring a top-view grayscale image of the connector using an industrial camera and a coaxial light source system; performing bilateral filtering on the top-view grayscale image to obtain a preprocessed image; inputting the preprocessed image into a symmetric convolutional neural network model to output a probability distribution matrix; applying a fixed numerical threshold to the probability distribution matrix for binarization; and then generating a mask image to determine the effective detection area of ​​the pins.

[0010] By adopting the above scheme, bilateral filtering can eliminate noise interference in the image while preserving the image boundary features. Symmetrical convolutional neural networks can achieve accurate segmentation of the target area of ​​connector pins. Subsequent binarization processing further clarifies the effective detection area. The final generated mask image can accurately define the detection range of the pins, eliminate interference from irrelevant areas such as the background, and define a clear target area for subsequent operations to extract the grayscale sequence of the pins, ensuring the targeted nature of subsequent image processing steps.

[0011] Preferably, the relationship for constructing the lateral optical reflectance asymmetry index is as follows: ; in, The index representing the lateral optical reflectance asymmetry of the target row. This indicates the horizontal pixel coordinates of the pin. The horizontal pixel coordinates of the pin. Indicates the valid starting horizontal pixel coordinates of the target row pin region. Indicates the valid terminating horizontal pixel coordinates of the target row pin region. Indicates the physical center pixel coordinates of the target row pin. This represents the gray value at the horizontal pixel coordinate position in a one-dimensional smooth grayscale sequence. Represents the environmental base energy deviation constant. The first pixel coordinate to the right of the physical center pixel coordinate of the target row pin.

[0012] By constructing a dimensionlessly consistent integral ratio formula, the inherent differences in reflectivity between different batches of metal materials and the global environmental interference caused by fluctuations in light source intensity can be effectively reduced, ensuring the stability of optical characteristic evaluation.

[0013] Preferably, the relationship for constructing the structural torsional continuity coefficient characterizing the continuity of the spatial structure is as follows:

[0014] in, Indicates the structural torsional continuity coefficient. This represents the vertical pixel coordinates of the pin. Indicates the starting row of the longitudinal evaluation window. Indicates the end row of the longitudinal evaluation window. This indicates the lateral optical reflectance asymmetry index of the current row. This indicates the lateral optical reflectance asymmetry index of the adjacent next row. This represents the inherent measurement noise fluctuation constant. Indicates the end row of the longitudinal assessment window The pixel coordinates of the previous row.

[0015] Preferably, the step of extracting the maximum value of the transverse optical reflection asymmetry index within the longitudinal evaluation window and performing a correlation calculation with the structural torsional continuity coefficient to obtain the comprehensive micro-torsional defect index includes: multiplying the maximum value of the transverse optical reflection asymmetry index within the longitudinal evaluation window with the structural torsional continuity coefficient, and using the product as the comprehensive micro-torsional defect index.

[0016] Preferably, the physical center pixel coordinates are half of the sum of the effective starting horizontal pixel coordinates and the effective ending horizontal pixel coordinates, and the discrete pixel coordinates are obtained by rounding down this value.

[0017] Preferably, the step of realizing connector size detection based on industrial vision according to the comprehensive micro-torsion defect index includes: comparing the comprehensive micro-torsion defect index with a preset statistical safety tolerance threshold; when the comprehensive micro-torsion defect index is greater than the statistical safety tolerance threshold, generating a non-conforming product digital mark, sending a rejection control command to the controller through the electrical communication interface, and physically isolating the defective product.

[0018] By establishing clear judgment criteria, the system standardizes the assessment of micro-torsion defects in connectors. Relying on automated command transmission and physical isolation, it enables the accurate identification and separation of defective products, preventing unqualified products from entering subsequent processes. At the same time, it adapts to the continuous testing rhythm of industrial production lines, ensuring the orderly connection between the testing process and the production process.

[0019] Preferably, the environmental substrate energy deviation constant is obtained by measuring the cumulative average value of the dark current grayscale of the entire row of the industrial camera under lens shading conditions.

[0020] Preferably, extracting the one-dimensional original grayscale sequence of the pin's horizontal direction within the effective detection area of ​​the pin and smoothing it to obtain a one-dimensional smooth grayscale sequence includes: constructing a polynomial fitting function within a set sliding data window, using the pixel's horizontal coordinate as the independent variable and the grayscale value of the one-dimensional original grayscale sequence as the dependent variable; solving for the best fitting coefficient of the polynomial fitting function using the least squares method; reconstructing the grayscale value of the center pixel within the sliding data window based on the solved polynomial fitting function; and traversing the pin area to complete the smoothing process of the one-dimensional original grayscale sequence to obtain a one-dimensional smooth grayscale sequence.

[0021] By combining polynomial fitting and least squares method to smooth the grayscale sequence, random grayscale fluctuations caused by the surface roughness of the metal pins can be filtered out. While preserving the original shape of the pin's high-light reflection characteristics, invalid interference is eliminated, making the processed grayscale sequence more consistent with the true optical reflection characteristics of the pins. This provides reliable basic data for subsequent optical feature extraction and related index construction, ensuring the smooth progress of subsequent detection steps.

[0022] Secondly, the present invention provides a connector size detection system based on industrial vision, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned connector size detection method based on industrial vision is implemented.

[0023] By adopting the above technical solution, the above-mentioned industrial vision-based connector size detection method is generated into a computer program and stored in a memory for loading and execution by a processor. This allows for the creation of terminal devices based on the memory and processor, facilitating their use.

[0024] The technical solution of the present invention has the following beneficial technical effects: By constructing a transverse optical reflection asymmetry index and a structural torsional continuity coefficient, a comprehensive micro-torsional defect index is obtained by fusing the two, which is then used for connector pin inspection. This invention can transform the three-dimensional micro-torsional deformation of the pins into two-dimensional grayscale distribution characteristics. By explicitly configuring two types of compensation constants—the environmental substrate energy deviation constant and the inherent measurement noise fluctuation constant—as denominator bias terms, and combining them with a mathematical framework of nonlinear ratio normalization, it not only avoids operational anomalies such as division by zero from the underlying logic but also accurately removes isolated optical clutter, thus effectively distinguishing between real deformation and optical interference. It has high detection sensitivity for micron-level micro-deformations, low computational consumption, and can adapt to the inspection cycle of the production line, enabling automated identification and isolation of defective products. This invention effectively solves the problems of traditional two-dimensional inspection technology's difficulty in identifying pin micro-torsional deformation and high false negative rates, while overcoming the problems of high hardware cost and long processing time in three-dimensional measurement technology, achieving a balance between detection accuracy and system efficiency. Attached Figure Description

[0025] Figure 1 This is a flowchart of the connector size detection method based on industrial vision in this invention; Figure 2 This is a comparison chart of existing technology testing results; Figure 3 This is a diagram showing the detection results of the lateral optical reflection asymmetry of the present invention; Figure 4 This is a batch testing result diagram of the present invention. Detailed Implementation

[0026] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0027] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0028] This invention discloses a connector size detection method based on industrial vision, referring to... Figure 1 This includes the following steps: S1. Obtain a two-dimensional grayscale image of the connector. Determine the effective detection area of ​​the pin through preprocessing and target area segmentation. Extract the one-dimensional original grayscale sequence of the pin in the horizontal direction within the effective detection area of ​​the pin and perform smoothing to obtain a one-dimensional smooth grayscale sequence.

[0029] In the specific implementation of this step, the system's main control unit calls upon an industrial camera and coordinates with a coaxial light source system to acquire a high-resolution top-view grayscale image of the connector, i.e., a two-dimensional grayscale image of the connector. After image acquisition, the image processor performs bilateral filtering on the original two-dimensional grayscale image, eliminating the inherent high-frequency shot noise of the sensor while preserving the sharpness gradient of the metal boundary, thus obtaining a preprocessed image.

[0030] The preprocessed image is input into a pre-trained encoder-decoder symmetric convolutional neural network, which outputs a probability distribution matrix pixel by pixel. The system applies a fixed numerical threshold to the probability distribution matrix for binarization, generating a mask image that accurately covers the effective reflective area of ​​the metal pin, thereby determining the effective detection area of ​​the pin.

[0031] Within the effective detection area of ​​the pin (such as the effective connected domain boundary defined by the mask image in this embodiment), the system extracts the horizontal pixel data line by line along the longitudinal extension axis of the pin to form a one-dimensional original grayscale sequence of the pin's horizontal direction.

[0032] To address the issue of random specular jitter caused by the micro-roughness of the surface of metal stamping parts, the system employs a local polynomial least squares fitting filtering algorithm to smooth the one-dimensional original grayscale sequence. Within a 5×5 sliding data window, a polynomial fitting function is constructed with a sliding step of one pixel, the horizontal coordinate of the pixel as the independent variable, and the grayscale value of the one-dimensional original grayscale sequence as the dependent variable. Specifically, a quadratic polynomial fitting function is used when the pin surface roughness is less than or equal to 0.8 μm, and a cubic polynomial fitting function is used when the pin surface roughness is greater than 0.8 μm. The best fitting coefficients of this polynomial fitting function are solved using the least squares method. The grayscale value of the center pixel within the sliding data window is reconstructed based on the solved polynomial fitting function. The smoothing process of the one-dimensional original grayscale sequence is then completed by traversing the pin region, resulting in a smoothed one-dimensional grayscale sequence.

[0033] This step effectively filters out environmental interference and random data jitter caused by surface roughness through multi-level image preprocessing and high-precision polynomial fitting smoothing algorithm. While filtering out high-frequency noise caused by surface roughness, it maintains the true physical width of the metal high-reflection peak without phase shift, providing a reliable data foundation for the subsequent extraction of underlying optical features.

[0034] S2. Extract the effective starting horizontal pixel coordinates and effective ending horizontal pixel coordinates of the pin area to locate the physical center of the pin. Calculate the optical reflection energy integral difference between the two ends of the physical center of the pin based on the one-dimensional smooth grayscale sequence. Perform a ratio normalization operation on the optical reflection energy integral difference and the denominator bias term containing the environmental substrate energy deviation constant to construct the lateral optical reflection asymmetry index.

[0035] A properly structured connector pin has a highly symmetrical physical shape. Under coaxial light source illumination, the lateral highlight distribution of the pin is symmetrical about the pin centerline. When the pin undergoes a slight twist, the metal surface normal vector will deflect, and the highlight energy will shift unidirectionally to the tilted side. Based on this optical characteristic, this step constructs a lateral optical reflection asymmetry index to reflect the degree of pin micro-twist deformation.

[0036] The system extracts the effective start and end horizontal pixel coordinates of the pin area in the target row, calculates their average and rounds down to obtain the physical center pixel coordinates of the pin in the target row. These physical center pixel coordinates are discrete pixel coordinates. Then, the lateral optical reflection asymmetry index of the target row is obtained according to the following formula: ; In the formula, The value of the lateral optical reflection asymmetry index is the target row. The larger the value, the more severe the deflection of the normal vector on the pin surface, and the more obvious the corresponding micro-torsion defect. The horizontal pixel coordinates of the pin are the index variables for traversing the horizontal pixels of the pin. The horizontal pixel coordinates of the pin. The valid starting horizontal pixel coordinates for the target row pin region; The valid termination horizontal pixel coordinates of the target row pin region; The physical center pixel coordinates of the target row pin; The gray value at the horizontal pixel coordinate in a one-dimensional smooth grayscale sequence represents the optical reflection intensity of that pixel. The environmental substrate energy deviation constant is obtained by measuring the cumulative average value of the dark current grayscale of the entire row of an industrial camera under lens shading conditions. The first pixel coordinate to the right of the physical center pixel coordinate of the target row pin is given; the numerator represents the absolute value of the difference between the optical reflection energy integrals on the left and right sides of the physical center of the pin, which directly reflects the degree of offset of the highlight energy in the lateral direction of the pin; the denominator represents the sum of the total gray integral of the target row pin area and the environmental substrate energy deviation constant, which is used to normalize the difference in the numerator and eliminate the interference of factors such as the overall attenuation of the light source and exposure differences.

[0037] To verify the rationality of the above calculation logic, this embodiment provides calculation data under real working conditions: assuming the effective starting horizontal pixel coordinates of a single row of a micro-torsion pin. A value of 10 indicates the effective termination of the horizontal pixel coordinate. The value is 50, and the calculated physical center pixel coordinates are... The value is 30, in the left half of the region ( Gray-scale integral The right half of the region ( Gray-scale integral The total grayscale points of this bank The pre-calibrated environmental base energy deviation constant is 50. Substituting the above into the relation, we get: The lateral optical reflection asymmetry index of the target row .

[0038] From a dimensional perspective, both the numerator and denominator are gray-scale integrals. The lateral optical reflectance asymmetry index obtained by dividing the two is a dimensionless pure value, which effectively eliminates the offset effect of the overall attenuation of the light source on the detection results. By adding the environmental substrate energy deviation constant to the denominator, it is possible to prevent division-to-zero anomalies under extreme failure conditions.

[0039] This step measures the relative shift characteristics of specular energy through rigorous discrete integral calculations, transforming the hidden three-dimensional torsional deformation into intuitive and stable two-dimensional dimensionless distribution parameters.

[0040] S3. Within the set longitudinal evaluation window, extract the absolute value of the sum of the differences of the transverse optical reflection asymmetry index of adjacent rows and the sum of the absolute values ​​of the differences. Use the absolute value of the sum of the differences as the numerator and the denominator bias term formed by the sum of the absolute values ​​of the differences and the inherent measurement noise fluctuation constant as the denominator. Perform ratio calculation to construct the structural torsional continuity coefficient characterizing the continuity of the spatial structure.

[0041] Considering that oil stains and cutting dust adhering to the pin surface in industrial environments can cause drastic and isolated numerical jumps in the lateral optical reflection asymmetry index, while the metal mechanical torsion of the pin exhibits an asymptotic and continuous trend in the longitudinal physical space, this step constructs a structural torsional continuity coefficient within a set longitudinal evaluation window to isolate isolated optical clutter interference. The relationship of the structural torsional continuity coefficient is as follows: ; In the formula, This represents the structural torsional continuity coefficient, used to distinguish between mechanical torsional deformation and optical interference. A value close to or equal to 1 indicates mechanical torsional deformation, while a value close to or equal to 0 indicates optical interference. The vertical pixel coordinates representing the pin's orientation are index variables used to traverse each row within the vertical evaluation window, with the traversal interval being... ; Indicates the starting row of the longitudinal evaluation window; Indicates the end row of the longitudinal assessment window; Indicates the lateral optical reflectance asymmetry index of the current row; The index representing the lateral optical reflection asymmetry of the adjacent next row; This represents the inherent measurement noise fluctuation constant, used to smooth the interference of inherent measurement noise on the continuity coefficient. The calibration method for this constant is as follows: Select no fewer than 500 qualified connector samples, repeatedly test each sample and traverse its pin area, and count the adjacent rows of all qualified samples. The noise distribution of the difference is calculated, and its arithmetic mean is taken. In this embodiment, 500 qualified connector samples are specifically selected. The calibration.

[0042] To verify the anti-interference effectiveness of the above calculation logic, this embodiment provides calculation data under two conditions: actual pin torsional deformation and pin surface contamination interference. The vertical evaluation window is set to 5 rows, and the inherent measurement noise fluctuation constant is used. The value is 0.02. Operating Condition 1: Asymmetry of Lateral Optical Reflection in Each Row: , , , , The difference in the lateral optical reflection asymmetry index between adjacent rows is 0.05. Substituting this into the formula, we obtain the structural torsional continuity coefficient. This value is close to 1, indicating that the pin exhibits a clear characteristic of continuous structural change, namely mechanical torsional deformation.

[0043] Operating Condition 2: Asymmetry Indicators of Lateral Optical Reflection in Each Row: , , , , The differences in the lateral optical reflection asymmetry index between adjacent rows are 0.3, -0.3, 0.05, and -0.05, respectively. Substituting these values ​​into the formula yields the structural torsional continuity coefficient. A value of 0 indicates the presence of optical interference.

[0044] By constructing a nonlinear proportional coefficient model that integrates the physical laws of the deformation continuity of metallic materials, false alarms caused by local shading or dirt on the pin surface can be suppressed, significantly improving the reliability of the system's detection decisions.

[0045] S4. Extract the maximum value of the transverse optical reflection asymmetry index within the longitudinal evaluation window, correlate the maximum value with the structural torsional continuity coefficient to obtain the comprehensive micro-torsion defect index, and realize connector size detection based on industrial vision according to the comprehensive micro-torsion defect index.

[0046] The maximum value of the lateral optical reflection asymmetry index represents the maximum depth offset caused by pin micro-torsion. Multiplying this maximum value by the structural torsion continuity coefficient yields the comprehensive micro-torsion defect index. Since both the maximum value of the lateral optical reflection asymmetry index and the structural torsion continuity coefficient are dimensionless, the resulting comprehensive micro-torsion defect index is also dimensionless. Furthermore, the calculation process is simple, computationally efficient, and adaptable to the high-speed inspection cycle requirements of high-frequency continuous dynamic acquisition in connector production lines.

[0047] The system's defect determination module compares the comprehensive micro-torsion defect index with a preset safety tolerance threshold. When the comprehensive micro-torsion defect index is greater than the safety tolerance threshold, the system marks the inspected connector as a non-conforming product, generates a non-conforming product digital mark, and sends a rejection control command to the controller through the electrical communication interface. The controller then controls the actuator to complete the physical isolation of the defective product. When the comprehensive micro-torsion defect index is less than or equal to the safety tolerance threshold, the inspected connector is determined to be a qualified product.

[0048] This step establishes a high-precision defect judgment scale by positively coupling the extreme value of the transverse optical reflection asymmetry index with the structural torsional continuity coefficient. This enables effective detection and automated isolation of micro-deformations of high-precision connectors on complex and dynamic industrial production lines.

[0049] like Figure 2 As shown, the projected outer contour widths of both good and defective pins fluctuate around the threshold line, and the difference between the two values ​​is not significant, making it impossible to effectively distinguish them. This reflects the limitations of traditional two-dimensional detection technology in identifying pin micro-torsional deformation and the tendency to miss detections.

[0050] like Figure 3 As shown, the lateral optical reflection asymmetry of defective pins gradually increases with the longitudinal extension position, with significant fluctuations, while the index of good pins remains at a low level and fluctuates gently. The difference between the two is obvious, which can effectively distinguish between real micro-torsional deformation and optical interference, demonstrating the ability of this invention to identify pin micro-torsional deformation.

[0051] As attached Figure 4 As shown, the comprehensive micro-torsion defect index of most of the inspected pins is below the safety tolerance threshold, and only the index of a single pin exceeds the threshold. This enables accurate identification and automated judgment of defective pins in batch inspection scenarios, which is suitable for the needs of large-scale production line applications.

[0052] This invention also discloses an industrial vision-based connector size detection system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the industrial vision-based connector size detection method according to this invention.

[0053] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0054] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A connector size detection method based on industrial vision, characterized in that, include: A two-dimensional grayscale image of the connector is acquired. The effective detection area of ​​the pin is determined by preprocessing and target area segmentation. The one-dimensional original grayscale sequence of the pin in the horizontal direction is extracted within the effective detection area of ​​the pin and smoothed to obtain a one-dimensional smooth grayscale sequence. Extract the effective starting horizontal pixel coordinates and effective ending horizontal pixel coordinates of the pin area to locate the physical center of the pin. Calculate the optical reflection energy integral difference between the two ends of the physical center of the pin based on the one-dimensional smooth grayscale sequence. Perform a ratio normalization operation on the optical reflection energy integral difference and the denominator bias term containing the environmental substrate energy deviation constant to construct the lateral optical reflection asymmetry index. Within the set longitudinal evaluation window, the absolute value of the sum of the differences of the transverse optical reflection asymmetry index of adjacent rows and the sum of the absolute values ​​of the differences are extracted. The absolute value of the sum of the differences is used as the numerator, and the denominator bias term formed by the sum of the absolute values ​​of the differences and the inherent measurement noise fluctuation constant is used as the denominator. The ratio is calculated to construct the structural torsional continuity coefficient characterizing the continuity of the spatial structure. The maximum value of the lateral optical reflection asymmetry index within the longitudinal evaluation window is extracted. The maximum value is then correlated with the structural torsional continuity coefficient to obtain the comprehensive micro-torsion defect index. Based on the comprehensive micro-torsion defect index, connector size detection based on industrial vision is achieved.

2. The connector size detection method based on industrial vision according to claim 1, characterized in that, The process of obtaining a two-dimensional grayscale image of the connector and determining the effective detection area of ​​the pins through preprocessing and target area segmentation includes: obtaining a top-view grayscale image of the connector through an industrial camera and a coaxial light source system, and performing bilateral filtering on the top-view grayscale image to obtain a preprocessed image. The preprocessed image is input into the output probability distribution matrix of the symmetric convolutional neural network model. The probability distribution matrix is ​​binarized by applying a fixed numerical threshold, and then a mask image is generated to determine the effective detection area of ​​the pin.

3. The connector size detection method based on industrial vision according to claim 1, characterized in that, The relationship for constructing the lateral optical reflectance asymmetry index is as follows: ; in, The index representing the lateral optical reflectance asymmetry of the target row. This indicates the horizontal pixel coordinates of the pin. The horizontal pixel coordinates of the pin. Indicates the valid starting horizontal pixel coordinates of the target row pin region. Indicates the valid terminating horizontal pixel coordinates of the target row pin region. Indicates the physical center pixel coordinates of the target row pin. This represents the gray value at the horizontal pixel coordinate position in a one-dimensional smooth grayscale sequence. Represents the environmental base energy deviation constant. The first pixel coordinate to the right of the physical center pixel coordinate of the target row pin.

4. The connector size detection method based on industrial vision according to claim 1, characterized in that, The relationship for constructing the structural torsional continuity coefficient, which characterizes the continuity of the spatial structure, is as follows: in, Indicates the structural torsional continuity coefficient. This represents the vertical pixel coordinates of the pin. Indicates the starting row of the longitudinal evaluation window. Indicates the end row of the longitudinal evaluation window. This indicates the lateral optical reflectance asymmetry index of the current row. This indicates the lateral optical reflectance asymmetry index of the adjacent next row. This represents the inherent measurement noise fluctuation constant. Indicates the end row of the longitudinal assessment window The pixel coordinates of the previous row.

5. The connector size detection method based on industrial vision according to claim 1, characterized in that, The step of extracting the maximum value of the transverse optical reflection asymmetry index within the longitudinal evaluation window and performing a correlation calculation with the structural torsional continuity coefficient to obtain the comprehensive micro-torsional defect index includes: multiplying the maximum value of the transverse optical reflection asymmetry index within the longitudinal evaluation window with the structural torsional continuity coefficient, and using the product as the comprehensive micro-torsional defect index.

6. The connector size detection method based on industrial vision according to claim 3, characterized in that, The physical center pixel coordinates are obtained by taking half of the sum of the effective starting horizontal pixel coordinates and the effective ending horizontal pixel coordinates, and then rounding down the value to obtain the discrete pixel coordinates.

7. The connector size detection method based on industrial vision according to claim 5, characterized in that, The method of realizing connector size detection based on industrial vision according to the comprehensive micro-torsion defect index includes: comparing the comprehensive micro-torsion defect index with a preset statistical safety tolerance threshold for determination; When the comprehensive micro-torsion defect index exceeds the statistical safety tolerance threshold, a non-conforming product digital mark is generated, a rejection control command is sent to the controller through the electrical communication interface, and the defective product is physically isolated.

8. The connector size detection method based on industrial vision according to claim 3, characterized in that, The environmental substrate energy deviation constant is obtained by measuring the cumulative average value of the dark current grayscale of the entire row of an industrial camera under lens shading conditions.

9. The connector size detection method based on industrial vision according to claim 1, characterized in that, Extracting the one-dimensional original grayscale sequence of the pin in the horizontal direction within the effective detection area of ​​the pin and smoothing it to obtain a one-dimensional smooth grayscale sequence includes: constructing a polynomial fitting function with the pixel horizontal coordinate as the independent variable and the grayscale value of the one-dimensional original grayscale sequence as the dependent variable within a set sliding data window. The best fitting coefficients of the polynomial fitting function are obtained by solving the least squares method. The gray value of the center pixel in the sliding data window is reconstructed based on the solved polynomial fitting function. The pin area is traversed to complete the smoothing process of the one-dimensional original gray-scale sequence, resulting in a one-dimensional smooth gray-scale sequence.

10. A connector size inspection system based on industrial vision, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the connector size detection method based on industrial vision according to any one of claims 1-9.