Sub-pixel-level calibration method for connector pin position deviation
By constructing the abnormal response feature field and calculating the second-order derivative zero intersection, the pin cap position offset problem caused by spring deformation coupling in the high-density connector pin array is solved, and accurate calibration at the sub-pixel level is achieved, improving image positioning accuracy and stability.
Patent Information
- Application Number
- CN202511000896.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-08-22
AI Technical Summary
The prior art cannot effectively identify and calibrate the needle cap position offset due to spring deformation coupling in high-density connector pin arrays, especially in multi-needle array structures, and traditional methods cannot accurately perceive the true needle position offset.
By constructing the abnormal response feature field of the pin array, identify the target image area with significant asymmetric features or behavioral mutations, calculate the second-order derivative zero intersection of the response abnormal features, and combine the stability difference of the diffusion rate change, the needle cap subpixel position deviation is inversely deduced.
The subpixel-level recognition and calibration of the needle cap image offset in the spring-pin pin array is realized, which improves the analytical accuracy and stability of image positioning, and solves the problem that traditional methods cannot effectively perceive the needle position offset under multi-pin coupling perturbation.
Smart Images

Figure CN120525868A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a sub-pixel level calibration method for connector pin position deviation. Background Art
[0002] Connector pins are widely used in various electronic assemblies, high-density interface modules and automated probe platforms, especially in communication equipment, semiconductor test substrates and precision connection interfaces. They have the characteristics of high reliability and flexible structure. As a typical structure, spring pins use an internal spring mechanism to achieve adaptive crimping during the docking process, effectively absorbing the tolerance between connectors. However, in a high-density multi-pin array structure, due to the nonlinear deformation of the spring mechanism during the crimping process, if the array platform is slightly warped and part of the needle body is obliquely pressed, it is easy to cause deformation coupling between the springs through adjacent syringes or injection-molded support walls, thereby causing part of the needle cap to be laterally offset.
[0003] For example, Chinese patent publication number CN116152147A discloses a method for detecting connector pin position deviation. The method includes the following steps: Step 1: preparing connector outer contour template images of different specifications according to different connector outer contour dimensions; Step 2: obtaining a connector pin image through an image acquisition system; Step 3: using the connector outer contour template image prepared in Step 1 to perform template matching on the acquired connector pin image, completing connector outer contour recognition and segmentation, extracting the ROI area in the image, filtering out background interference, and removing parts of the image that are not related to pin recognition; Step 4: performing threshold segmentation and morphological operations on the image identified in Step 3; Step 5: performing spot detection on the image processed in Step 4, finding the pin bright spots in the image, and calculating the coordinates of the bright spot centroid; Step 6: drawing center lines in the height and width directions of the image processed in Step 5, calculating the distances from each bright spot to the two center lines, and determining whether the pin position deviation is within the allowable range.
[0004] The above patents have the problem raised by this background technology: the existing position calibration method mainly relies on the mechanical alignment of the bottom or peripheral structure of the needle body, or obtains the center of the pin position through simple image recognition. In order to solve the above problems, this application designs a sub-pixel level calibration method for the connector pin position deviation. Summary of the Invention
[0005] The present invention addresses the shortcomings of existing technologies by providing a sub-pixel calibration method for connector pin position deviation. This method first extracts abnormal response features from the image to construct an abnormal response feature field for the pin array. This field then identifies target image regions with significant asymmetry or behavioral abrupt changes. Finally, the pin cap sub-pixel position deviation is inferred by calculating the zero-crossing points of the second-order derivative of the abnormal response feature within the target region and combining it with the stability difference between the left and right diffusivity changes.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A sub-pixel level calibration method for connector pin position deviation, wherein the pin is a spring pin comprising a pin cap, a spring, and a pin body, and the sub-pixel level calibration method comprises:
[0008] Acquire an image area of a needle cap of the spring needle in a compressed state;
[0009] Processing the needle cap image region to identify target image regions where response behavior exhibits asymmetric directional mutation, discontinuous response energy density, or reverse feedback of the main direction offset;
[0010] Determining a zero-crossing point in the target image region along the transverse direction of the pin body by using the gradient distribution of an abnormal image response feature and the asymmetry of the zero-crossing position of its second-order derivative, and reconstructing the zero-crossing point to obtain sub-pixel position coordinates, wherein the abnormal response feature includes at least one image indicator that varies uniformly along the compression direction in the pin array;
[0011] Calibration is performed based on the deviation of the sub-pixel position coordinates relative to the designed position of the pin.
[0012] Processing the needle cap image region includes:
[0013] extracting abnormal response features of the needle cap image area;
[0014] constructing an abnormal response feature field according to the abnormal response feature;
[0015] A target image region is generated in the abnormal response feature field.
[0016] The abnormal response feature includes one of the following:
[0017] The offset between the point with the maximum brightness in the pin cap image area and the geometric center of the area;
[0018] The image gradient blur difference along the compression direction at the edge of the needle cap image area;
[0019] The deflection angle of the main direction gradient of the needle cap image area relative to the average direction of the array.
[0020] Constructing an abnormal response feature field according to the abnormal response feature includes:
[0021] Performing one-dimensional projection on the abnormal response feature in the compression direction to obtain a local directional response curve;
[0022] Normalizing the local directional response curve, calculating its variation trend residual along the compression direction in the pin array, and calculating a response consistency score based on the variation trend residual;
[0023] Mapping the response consistency score to a position in the pin cap image region that matches the corresponding pin cap to generate an initial response consistency map within the pin array;
[0024] Multi-scale directional filtering is performed on the initial response consistency map to generate an abnormal response feature field.
[0025] Generating a target image area in the abnormal response feature field includes:
[0026] sequentially calculating the directional vector field of the needle cap in the abnormal response characteristic field;
[0027] Counting the identification direction of the directional vector field in the needle cap arrangement direction through a sliding window;
[0028] generating a direction-consistent mutation region according to the identified direction;
[0029] The direction consistency mutation area is marked as the target image area.
[0030] The zero-crossing point is determined by the asymmetry of the gradient distribution of the image response abnormal feature and the zero-crossing position of its second-order derivative, including:
[0031] Extracting a response abnormality characteristic curve perpendicular to the pin arrangement direction in the target image area;
[0032] Calculating the first-order derivative of the response abnormality characteristic curve to obtain a transverse gradient distribution of the image response abnormality characteristic;
[0033] calculating a second-order derivative based on the lateral gradient distribution and identifying a location where the sign changes as a candidate second-order derivative zero-crossing point;
[0034] Calculate a symmetric residual function with the corresponding needle cap geometric center as the symmetry axis according to the second-order derivative zero-crossing candidate point;
[0035] The difference values of the second-order derivative zero-crossing candidate points on both sides of the neighborhood are calculated according to the symmetric residual function, and the second-order derivative zero-crossing candidate points whose difference values are greater than a preset difference threshold are taken as zero-crossing points.
[0036] Reconstructing the zero-crossing point to obtain sub-pixel position coordinates includes:
[0037] Taking the zero crossing point as the center, multiple sub-pixel sampling points are extracted on both sides;
[0038] Calculating a first response diffusion rate curve and a second response diffusion rate curve according to the response abnormality characteristics of the sub-pixel sampling point;
[0039] performing stability evaluation on the first response diffusivity curve and the second response diffusivity curve, and calculating a function stability value;
[0040] The coordinates corresponding to the minimum stable value of the function are used as the sub-pixel position coordinates of the zero crossing point.
[0041] Performing stability evaluation on the first response diffusivity curve and the second response diffusivity curve to calculate a function stability value includes:
[0042] The diffusion rate variation range between adjacent sub-pixel sampling points is calculated, and the variance of the diffusion rate variation range is counted within the sliding window, and the variance is used as the function stability value.
[0043] Calibration is performed based on the deviation of the sub-pixel position coordinates relative to the designed position of the pin, including:
[0044] Calculate the difference between the sub-pixel position coordinates and the designed position to obtain a local pin position deviation vector;
[0045] Determine whether the local pin position deviation vector is greater than a set deviation threshold, and if so, determine that the pin is a deviation pin;
[0046] A compensation instruction is generated according to the local pin position deviation vector and fed back to the alignment adjustment link of the pin module.
[0047] When the response anomaly feature is projected one-dimensionally in the compression direction, it also includes:
[0048] A dynamic weight coefficient is set according to the type of the response abnormality feature, and the response abnormality feature is assigned a value according to the dynamic weight coefficient, wherein the dynamic weight coefficient is adjusted according to the statistical stability and distribution discreteness of each response abnormality feature along the compression direction in the pin array.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] The present invention constructs an analysis model based on image response anomaly characteristics, achieving sub-pixel recognition and calibration of the pin cap image offset phenomenon caused by crimping deformation coupling in a spring pin array, solving the problem that existing technologies cannot effectively perceive the true pin position offset under multi-pin coupling disturbances. Compared with traditional center of gravity detection or edge positioning methods, the present invention accurately extracts the pin cap offset center reflecting the local response coupling effect by extracting the lateral response anomaly characteristic curve in the target image area and combining it with the zero-crossing point symmetry change behavior of its second-order derivative. On this basis, the diffusion rate curve stability function is further introduced to perform sub-pixel reconstruction of the position, effectively enhancing the analytical accuracy and stability of image positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0052] Figure 1 This is a schematic diagram of a pin structure according to an embodiment of the present invention;
[0053] Figure 2 A schematic flow chart of a sub-pixel calibration method for connector pin position deviation according to an embodiment of the present invention;
[0054] Figure 3 This is a flow chart for constructing an abnormal response characteristic field according to an embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram of the zero-crossing point positioning principle of an embodiment of the present application;
[0056] Figure 5 Schematic diagram of the process of determining the zero-crossing point according to an embodiment of the present application;
[0057] Figure 6 Schematic diagram of the principle of zero-crossing point reconstruction according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0059] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It will be understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0060] This application is mainly applicable to high-precision plug-in systems based on spring pins, and is used to solve the problem of pin position deviation caused by spring deformation coupling between pin bodies during the crimping process of multi-pin arrays. Its application scenarios include but are not limited to:
[0061] Semiconductor chip testing tooling, high-speed interface connector detection modules, packaging and crimping platforms for high-frequency communication components, and automated assembly of micro wearable device connection components.
[0062] The selection of application scenarios is determined based on the functions of the spring module. The characteristics of the selected application scenarios include:
[0063] The connector structure used is a high-density array of spring pins, most of which are hidden, with only the pin caps exposed;
[0064] During the crimping process, there are random disturbances caused by lateral or oblique coupling forces in multiple pins;
[0065] Abnormal responses are mainly manifested in non-structural changes such as grayscale shift, blurred outlines, and center of gravity drift in the image;
[0066] The required image analysis accuracy must reach the sub-pixel level to support subsequent posture compensation and calibration.
[0067] It is easy to understand that the insertion pin described in this application should be understood to include a spring pin structure. Unless otherwise clearly defined in the context, it can refer to a spring pin assembly consisting of a pin cap, a spring and a pin body.
[0068] See also Figure 1 , this figure is a schematic diagram of a pin structure provided in an embodiment of the present application.
[0069] like Figure 1 As shown, the pin includes a pin cap, a spring, a pin body and a housing, wherein:
[0070] The pin cap is configured at the upper end of the pin and is the contactable end of the pin. It is usually hemispherical or cylindrical. In this application, only the pin cap portion is exposed on the surface of the connector pin.
[0071] The shell is integrally configured on the outside of the pin body and the spring structure, and is used for guiding, limiting and structural support. It should be noted that the shell in this application is an insulating shell;
[0072] The spring is arranged inside the housing. Figure 1 The spring is shown to be embedded in the needle body, and in some cases can also be sleeved on the outside of the needle body to provide a compressible elastic stroke to achieve the up and down movement of the needle cap;
[0073] The needle body is connected between the needle cap and the spring, extends to the lower end of the shell, and serves as the supporting main shaft of the spring needle.
[0074] It should be noted that Figure 1 The figure only shows a simplified structural diagram of a pin unit, which is used to illustrate its basic components and compression characteristics, and does not show the array arrangement of the pins in the actual module.
[0075] Understandably, in practical applications, pins are typically densely packed in a regular array within a uniformly molded, injection-molded housing. While individual pins are independent, their housings are often integrated as a single unit, with the physical spacing between pins often dense and the rigid walls between the structures often continuous.
[0076] Next, in conjunction with the accompanying drawings, a sub-pixel level calibration method for connector pin position deviation provided in an embodiment of the present application is introduced.
[0077] See also Figure 2 , which is a flow chart of a sub-pixel calibration method for connector pin position deviation provided by an embodiment of the present application, Figure 2 The method shown includes the following steps S1-S5, and the specific steps are as follows:
[0078] S1: Obtain the pin cap image area in the pin compression state;
[0079] In this embodiment, the pin cap image area can be captured by a preset image sensor after the pin array completes the crimping action, and the resolution and accuracy of the image sensor can be set by those skilled in the art according to specific needs.
[0080] It should be noted that due to the characteristics of the pin and to avoid interference introduced by the outer shell or needle body, the needle cap image area only includes the exposed part of the needle cap. During the acquisition process, backlight and directional lighting must be used to enhance the image edge contrast so that the structural response characteristics of the needle cap show high separability and directional consistency in the image.
[0081] S2: Process the needle cap image area to generate the target image area;
[0082] In this embodiment, at least one abnormal response feature is extracted from the needle cap image region, including but not limited to the offset between the maximum brightness point and the geometric center, the edge blur gradient difference, or the main direction deflection angle. Each abnormal response feature is projected along the pin crimping direction to construct an initial response feature field, and its directional consistency trend is calculated using a sliding window. Combining the degree of local directional mutation and statistical anomaly scores, regions within the image exhibiting abnormal response behavior are identified and located, marking them as target image regions.
[0083] S3: determining the zero crossing point according to the target image area;
[0084] In this embodiment, the zero-crossing point refers to the position where the sign of the second-order derivative of the abnormal image response feature changes, that is, the switching point where the local response behavior changes from enhancement to weakening (or vice versa).
[0085] It's understandable that if we consider the abnormal response curve in an image to be a hill or valley line, the zero-crossing point is analogous to an inflection point where an uphill slope turns downhill, or vice versa, rather than the peak or valley floor itself. Its location often strongly corresponds to the boundary of abrupt changes in image behavior caused by structural perturbations. In other words, the needle cap deviation corresponding to the zero-crossing point arises from the overall deviation of the needle body.
[0086] S4: reconstruct the zero crossing point to obtain the sub-pixel position coordinates;
[0087] In this embodiment, based on a determined zero-crossing point, sub-pixel-level response anomaly features are sampled in the left and right neighborhoods. Diffusion curves are constructed for each side to assess the local stability of the response changes. The local variance of the diffusivity variation series is calculated using a sliding window approach, serving as the stability function. The point corresponding to the minimum stable value is used as the sub-pixel coordinate of the zero-crossing point.
[0088] S5: Calibrate based on the deviation of the sub-pixel position coordinates relative to the designed pin position;
[0089] In actual connector production and automated testing, high-density arrays of spring-loaded pins must meet the contact reliability and micron-level offset tolerance requirements of precision applications. Especially during the pin crimping process, due to the compressible nature of the spring structure, the simultaneous insertion of individual pins is susceptible to factors including, but not limited to, platform warpage, inconsistent spring constants, and slight differences in crimping posture, resulting in slight deviations in the compression trajectory of the spring pins in certain areas.
[0090] It's easy to understand that although this deflection is slight, it will appear as an abnormal response on the image plane, indicating a shift in the center of gravity of the pin cap, which in turn causes positioning errors. It's impossible to accurately determine whether the pin has actually shifted, let alone whether it's caused by a disturbance in the array's internal structure.
[0091] In this example, we first extract abnormal response features from the image to construct an abnormal response feature field for the pin array. We then identify target image regions with significant asymmetry or behavioral abrupt changes. Finally, we calculate the zero-crossing points of the second-order derivative of the abnormal response feature within the target region and combine it with the stability difference between the left and right diffusion rates to infer the sub-pixel position deviation of the pin cap.
[0092] It should be noted that the pin cap offset of interest in this application specifically refers to regionally and directionally consistent deviations in behavior caused by the mechanical coupling effect between multiple pins in the array structure during the crimping process. Therefore, the methods used in this application are based on analysis of pin behavior patterns at the array and local group levels. If a pin experiences isolated pin cap offset due to manufacturing process issues, cap processing defects, or spring damage, it lacks consistent behavioral characteristics and will not be included in the target image area.
[0093] In an example, the specific steps of S2 are as follows:
[0094] S2.1: extracting abnormal response features of the needle cap image area;
[0095] The abnormal response characteristics include one or more of the following:
[0096] The offset between the point with the maximum brightness in the pin cap image area and the geometric center of the area;
[0097] The image gradient blur difference along the compression direction at the edge of the needle cap image area;
[0098] The deflection angle of the main direction gradient of the needle cap image area relative to the average direction of the array;
[0099] In this embodiment, the abnormal response feature is an indicator for reflecting abnormal image behavior caused by the internal structure disturbance of the array when the pin is in a compressed state.
[0100] Specifically, on the one hand, under different imaging conditions, certain indicators cannot be stably extracted due to image quality or contrast limitations. Retaining multiple feature dimensions can enhance overall robustness. On the other hand, the collaboration of multiple features can enhance the ability to discriminate abnormal behaviors and improve the accuracy of subsequent target area recognition and calibration.
[0101] It is easy to understand that the present application can use existing methods to extract response abnormality features. For example, at the implementation level, image processing methods such as a brightness centroid offset algorithm based on center distance, an edge clarity evaluation method based on gradient blur kernel analysis, or a gradient deflection angle extraction method based on principal component analysis and directional field statistics can be used to extract the above-mentioned response abnormality features. The present application does not impose any restrictions on this.
[0102] S2.2: Constructing an abnormal response feature field based on the abnormal response feature;
[0103] Specifically, because the pin array may be affected by various factors during the crimping process, some pin caps may exhibit abnormal response behavior in the image. Therefore, it is necessary to extract the most representative and interference-sensitive response features from multiple response anomaly features and construct a scene with their distribution patterns across the entire image to achieve regional focus on the abnormal behavior.
[0104] See also Figure 3 , Figure 3 This is a flowchart for constructing an abnormal response characteristic field according to an embodiment of the present application. As an example, the steps for constructing an abnormal response characteristic field are as follows:
[0105] S2.2.1: Perform a one-dimensional projection of the abnormal response feature in the compression direction to obtain a local directional response curve;
[0106] Specifically, the compression direction is the direction of the spring pressure applied to the pin array, and it is also the principal axis along which the response behavior of each pin exhibits coordinated variations in imaging. Because the pins in the actual structure are arranged in a regular linear pattern, the spatial variation of the response anomaly in the compression direction causes the corresponding pin caps to form a periodic and continuous orientation structure in the image.
[0107] In this embodiment, the projection axis is set to be parallel to the compression direction. The corresponding response anomaly characteristic value is extracted with the center of each needle cap as the unit, and the response anomaly characteristic value is accumulated and mapped to the projection track corresponding to its column number to form a local directional response curve constructed according to the needle column arrangement order. It should be noted that when the response anomaly characteristic is projected one-dimensionally in the compression direction, it also includes:
[0108] A dynamic weight coefficient is set according to the type of the response abnormality feature, and the response abnormality feature is assigned a value according to the dynamic weight coefficient, wherein the dynamic weight coefficient is adjusted according to the statistical stability and distribution discreteness of each response abnormality feature along the compression direction in the pin array.
[0109] S2.2.2: Normalize the local directional response curve, calculate its variation trend residual along the compression direction in the pin array, and calculate the response consistency score based on the variation trend residual;
[0110] Specifically, in order to make the local directional response curve applicable to pin array scenarios under different image brightness and contrast conditions and avoid the influence of image noise or device differences, it is necessary to normalize the local directional response curve so that it falls within a unified range.
[0111] Furthermore, larger residual values indicate that the needle cap's response behavior deviates further from the average trend of the entire row of needles, and smaller response consistency scores indicate a higher degree of abnormality. Those skilled in the art will appreciate that the trend residuals and response consistency scores of this application can be calculated using existing methods, such as spline fitting, and will not be further elaborated here.
[0112] S2.2.3: Mapping the response consistency scores to positions in the pin cap image region that match the corresponding pin caps to generate an initial response consistency map within the pin array;
[0113] Specifically, the geometric coordinates of the pin cap image region extraction process are used to assign the response consistency score of each pin cap to its corresponding position in the image. The resulting two-dimensional matrix is the initial response consistency map of the pin array.
[0114] Preferably, a Gaussian response kernel may be generated at each score value assignment point during the mapping process, so as to achieve score diffusion in a local range, thereby alleviating the discreteness and error sensitivity of the score map.
[0115] S2.2.4: Perform multi-scale directional filtering on the initial response consistency map to generate an abnormal response feature field;
[0116] Specifically, since abnormal responses often manifest as regional mutation behaviors with strong directionality and rapid scale changes in the pin array, it is difficult to accurately define the boundaries of the abnormal area based solely on the score map, and the initial score map needs to be subjected to fine-grained directional sensitivity enhancement processing.
[0117] In this embodiment, the initial response consistency map is convolved in multiple directions and at multiple scales using filters based on direction selectivity, including but not limited to Gabor filters and multi-scale Sobel variant operators, thereby obtaining the gradient response amplitude of each pixel in multiple directions.
[0118] Furthermore, based on the extracted gradient response amplitude, regions showing changes in multiple scale directions are screened out to generate an abnormal response feature field.
[0119] S2.3: generating a target image region in the abnormal response feature field;
[0120] Specifically, since the deflection behavior caused by the lateral disturbance during the compression of the needle cap will appear as a sudden change in directional response or symmetry destruction in the image, the area where the needle cap has an offset difference can be located by analyzing the abnormal response characteristic field.
[0121] In one example, the steps for generating the target image region are as follows:
[0122] S2.3.1: Calculate the directional vector field of the needle cap in the abnormal response characteristic field in sequence;
[0123] Specifically, to characterize the structural variation of the needle cap in the abnormal response feature field, it is necessary to extract numerical features with spatial directionality from the image space and express them in vector form. The directional vector field is a two-dimensional vector representation constructed based on the distribution direction and gradient of the abnormal response degree of the needle in local space. Essentially, it defines a response direction vector for each needle cap image region, which characterizes the principal axis direction of the abnormal response distribution of the needle cap within the neighborhood.
[0124] In this embodiment, based on the direction and magnitude of the gradient of each pixel in the abnormal response feature field, principal component analysis or structure tensor analysis is used to statistically analyze the gradient distribution within the needle cap region, and its principal direction vector is obtained as the directional vector. This vector not only contains the direction of the gradient in space but also preserves the topological information of the local response structure.
[0125] S2.3.2: Counting the identification direction of the directional vector field in the needle cap arrangement direction through a sliding window;
[0126] Specifically, to further evaluate the continuity and stability of directional changes in the pin array, a structured analysis of the directional vector field is required. In this embodiment, a sliding window statistical strategy is used to locally summarize the directional vectors. The window moves along the pin arrangement direction, and at each position, the dominant direction of all directional vectors within the window is extracted, i.e., the identification direction.
[0127] Those skilled in the art will appreciate that the direction identification calculation can be based on vector angle cosine consistency analysis, which determines the dominant direction by taking a weighted sum of the directional vectors within a window. Furthermore, a local vector consistency factor can be calculated to quantify the directional stability of the window.
[0128] S2.3.3: Generate a directionally consistent mutation region based on the identified direction;
[0129] Specifically, the directional consistency mutation region is the core basis for determining the concentrated distribution location of abnormal responses. It is generated based on the continuous change of the recognition direction along the pin arrangement direction. In this embodiment, a preset directional mutation threshold is set. When the difference in the recognition direction angle between two adjacent sliding windows exceeds this threshold and the directional consistency score decreases, the location is considered to have directional mutation behavior.
[0130] Furthermore, by spatially expanding the mutation locations, a complete regional outline can be constructed based on the identified directional mutation boundaries, forming a directional consistency mutation region. This region typically corresponds to the location in the pin array where the pins are offset due to uneven spring force or coupling between needle barrels. In the image, it appears as a group of pin cap image blocks with collectively deviated directional characteristics.
[0131] S2.3.4: Mark the direction consistency mutation region as the target image region;
[0132] For example, see the zero crossing point. Figure 4 , Figure 4 This is a schematic diagram of the zero-crossing point positioning principle of the embodiment of the present application. Figure 4 The supporting principle of the zero-crossing point extraction based on the shape characteristics of the needle cap response abnormal characteristic curve and its derivative behavior in the image space is shown.
[0133] Figure 4 (a) shows the grayscale distribution curve of the needle cap response characteristic along the lateral position. The asymmetry of the curve caused by spring coupling interference can be observed; this asymmetry will cause gradient imbalance in the corresponding first-order derivative and produce obvious sign change characteristics in the second-order derivative function.
[0134] Figure 4 (b) shows the curve shape of the above response characteristics after second-order derivative processing. A clear extreme symmetric structure can be observed in the middle of the curve, where the sign changes from positive to negative or negative to positive, which is the candidate area for the "zero crossing point". By further calculating the difference in the derivative change trend on the left and right sides within this area and comparing it with the set threshold, candidate points with significant asymmetry can be screened out. Ultimately, they are used as the positioning zero crossing points in this embodiment for subsequent sub-pixel reconstruction processing. Figure 4 Here F can be understood as the curve function, and x can be understood as the independent variable of the function.
[0135] It should be noted that the zero crossing point is defined as follows in this application:
[0136] During the multi-needle crimping process, spring deformation coupling causes abnormal diffusion behavior of the response, resulting in an offset of the needle cap in the image. The structural offset reflection point with asymmetric response, i.e., the zero crossing point, obtained through second-order derivative analysis, is essentially used to refer to the offset response center in the current needle cap image, i.e., the position that needs to be calibrated at the sub-pixel level.
[0137] It's easy to understand that the zero-crossing point is determined by analyzing the lateral second-order derivative trend of the image response anomaly, extracting the sign reversal point of the response gradient, and then combining it with the asymmetry of its neighborhood response to identify the representative structural offset position within the image region. In other words, this point is not the location with the highest brightness or the most obvious edge in the image, but rather a derived offset point of the response behavior's center of gravity. This corresponds to the deflection caused by spring deformation at the image level, and therefore serves as the starting point for sub-pixel position reconstruction.
[0138] See also Figure 5 , which is a flow chart of the zero-crossing point determination method provided in an embodiment of the present application. Figure 5 The method shown can be applied to S3 of the above method. The specific steps are as follows:
[0139] S3.1: Extracting a response abnormality characteristic curve perpendicular to the pin arrangement direction in the target image area;
[0140] Specifically, to more accurately capture the abnormal response characteristics of the pins in the image, it is necessary to extract a one-dimensional image intensity sequence from the target image region along the direction perpendicular to the pin arrangement, that is, the transverse direction of the pins. The transverse direction of the pins is orthogonal to the direction of pin compression and can represent the lateral response diffusion anomaly caused by coupling between the pins, facilitating subsequent differential analysis.
[0141] In this embodiment, by aligning the centers of the needle cap images, selecting several equally spaced transverse lines and sampling the grayscale values of the pixels on each line, a response anomaly characteristic curve is constructed. The response anomaly characteristic curve reflects the unevenness of the horizontal distribution of the needle cap images.
[0142] S3.2: Calculate the first-order derivative of the response abnormality characteristic curve to obtain a lateral gradient distribution of the image response abnormality characteristic;
[0143] Specifically, to analyze the lateral variation trend of the response curve, the gradient information is obtained by calculating its first-order derivative, a function curve describing the rate of change of the image's grayscale value. In this embodiment, a central difference or Savitzky–Golay smoothed derivative calculation method is used to process the abnormal response characteristic curve, balancing edge sharpness and smoothness. The gradient distribution can reflect the spatial discontinuity of the needle cap response and help identify deflection caused by spring coupling.
[0144] S3.3: Calculate a second-order derivative based on the lateral gradient distribution, and identify a location where the sign changes as a candidate second-order derivative zero-crossing point;
[0145] Specifically, the second-order derivative is used to characterize the rate of change of the image's grayscale gradient, that is, to describe the curvature of the image's response edge. When the second-order derivative changes from positive to negative, or negative to positive, it indicates a turning point in the function's concave-convex nature, known as a zero-crossing candidate.
[0146] In this embodiment, a second-order derivative curve is calculated based on the first-order derivative to identify the sign change point, and the point is marked as a candidate point according to the change trend of the response value at the position.
[0147] S3.4: Calculate a symmetric residual function with the corresponding needle cap geometric center as the symmetry axis based on the second-order derivative zero-crossing candidate point;
[0148] Specifically, to determine whether the candidate point truly reflects the response offset center in the needle cap image, its symmetry in the left and right image regions needs to be further evaluated.
[0149] In this embodiment, the symmetry axis is constructed with the candidate point's horizontal position in the image as the center. The difference in response values between pixels at the same distance to the left and right is calculated, and a symmetry residual function is constructed. The symmetry residual function is used to measure whether the point is at the location where symmetry is most severely violated, thereby inferring whether the point is the true response offset center.
[0150] S3.5: Calculate the difference between the second-order derivative zero-crossing candidate points on both sides of the neighborhood according to the symmetric residual function, and select the second-order derivative zero-crossing candidate points whose difference is greater than a preset difference threshold as zero-crossing points;
[0151] Specifically, after the symmetric residual function is calculated, the response difference of each candidate point within its neighborhood will be quantitatively counted. If the difference exceeds the set threshold, it can be considered that the candidate point reflects the true response structure perturbation center, that is, it is determined to be the final zero crossing point.
[0152] In this embodiment, the difference value can be obtained by comprehensive calculation of the amplitude of change of left and right response values, gradient mean difference, etc. This judgment standard helps to screen out false intersections caused by fluctuations in image texture itself, thereby improving the effectiveness of position calibration.
[0153] Taking zero-crossing point reconstruction as an example, please refer to Figure 6 To understand, Figure 6 This is a schematic diagram of the principle of zero-crossing point reconstruction in an embodiment of the present application. Figure 6 The diagram shows the process of performing sub-pixel sampling of image response anomaly features on both sides of the zero-crossing point, and constructing the first and second response diffusivity curves. In the diagram, the zero-crossing point is located in the middle of the two diffusivity curves, representing the core offset center of the current response anomaly structure.
[0154] The left and right sides of the curve correspond to sub-pixel sampling locations, and the response characteristic values of the sub-pixels on each side are used to fit the respective diffusion curves. Function fluctuation analysis is performed on the left and right diffusion curves, and the stability of their local variations is calculated to obtain the function stability value. Locations with smaller function stability values indicate the smoothest and most representative response variations in that area, and their corresponding coordinates can be used as the final sub-pixel positioning result.
[0155] In one example, reconstructing the zero-crossing point to obtain sub-pixel position coordinates includes:
[0156] S4.1: Extract multiple sub-pixel sampling points on the left and right sides of the zero-crossing point.
[0157] Specifically, although the zero-crossing point has been identified as the center of the response anomaly, its location in the original image is still limited to pixel-level accuracy and cannot meet the requirements of sub-pixel calibration. To achieve sub-pixel position reconstruction, this step requires constructing a more refined response data model within the neighborhood of the zero-crossing point.
[0158] In this embodiment, with the zero-crossing point as the center, interpolation sampling is performed at equal intervals on the left and right sides of the needle body along the lateral direction of the needle body (i.e., the main direction of abnormal response diffusion) to form a number of sub-pixel sampling points for obtaining more dense image response change information.
[0159] S4.2: Calculating a first response diffusion rate curve and a second response diffusion rate curve based on the response abnormality characteristics of the sub-pixel sampling point;
[0160] Specifically, the diffusion rate curve is used to characterize the spatial propagation trend of the response anomaly and is a key indicator for determining the extent to which abnormal behavior affects the needle cap position.
[0161] In this embodiment, sub-pixel sampling points are taken in the left and right directions with the zero crossing point as the center, and their image response abnormality feature values (such as gradient blur, local grayscale extremes or directional deviation angles, etc.) are extracted, and their change rates in respective directions are calculated and fitted into a continuous diffusion rate curve.
[0162] Furthermore, to ensure stability and physical interpretability, the diffusion rate is calculated using sliding window differencing combined with exponential smoothing to ensure the spatial continuity of the response curve. The resulting left and right curves are the first and second response diffusion rate curves, respectively, which reflect the anomalous diffusion rate and range of the response structure near the zero crossing point.
[0163] S4.3: Performing a stability assessment on the first response diffusivity curve and the second response diffusivity curve to calculate a function stability value, specifically calculating a diffusivity variation between adjacent sub-pixel sampling points, and calculating a variance of the diffusivity variation within a sliding window, using the variance as the function stability value;
[0164] Specifically, in order to determine the position that most likely represents the true response center of the needle cap from multiple sets of diffusivity data, function stability is used to make the judgment.
[0165] In this embodiment, local fluctuation analysis is performed on the diffusivity curves in both directions. Specifically, the absolute amplitude of the diffusivity difference between adjacent sampling points is calculated, and the variance of this difference within a fixed-length sliding window is calculated to obtain the local function stability value. This stability value reflects the consistency of the response diffusion behavior within the current region. A smaller variance indicates a more stable response, more continuous changes, and a higher likelihood of being close to the true center of the offset.
[0166] S4.4: The coordinates corresponding to the minimum stable value of the function are used as the sub-pixel position coordinates of the zero-crossing point;
[0167] Specifically, after completing the stability evaluation of the left and right diffusivity curves respectively, the corresponding coordinates of the minimum point of the function stability value can be used as the sub-pixel position reconstruction result.
[0168] In this embodiment, in order to avoid distortion caused by abnormal deflection of the left and right curves, their minimum stable values are normalized and compared. If the difference between the two is within the allowable range, the midpoint can be taken as the final coordinate; if the difference is large, the minimum point on the side with the strongest stability is preferentially selected.
[0169] In one example, calibration is performed based on sub-pixel position coordinates, including:
[0170] S5.1: Calculate the difference between the sub-pixel position coordinates and the designed position to obtain a local pin position deviation vector;
[0171] Specifically, to convert the pin cap offset response center identified in image space into actual assembly deviation, the sub-pixel position coordinates must be compared with the theoretical design position of each pin in the pin array. The theoretical design position is usually derived from preset data, that is, the known geometric coordinates of each pin in the ideal assembly state.
[0172] In this embodiment, by constructing a registration mapping relationship between the needle cap image coordinate system and the design geometric coordinate system, the sub-pixel coordinates extracted from the image are mapped to a reference system aligned with the design coordinates.
[0173] After completing the coordinate mapping, the Euclidean difference between the sub-pixel position extracted from the current pin cap image and its theoretical design position is calculated to construct a local pin position deviation vector. This vector not only contains the deviation magnitude information but also indicates the specific direction of the deviation.
[0174] S5.2: Determine whether the local pin position deviation vector is greater than a set deviation threshold. If so, determine that the pin is a deviation pin.
[0175] Specifically, although the manufacturing and assembly processes allow for a certain tolerance range for pins, deviations exceeding a set threshold will have a substantial impact on connection performance, electrical contact reliability, or long-term stability. Therefore, it is necessary to classify and screen the identified pin position deviations to determine whether they constitute identifiable abnormal behavior.
[0176] In this embodiment, the magnitude of the deviation vector is compared using a preset deviation threshold vector. This deviation threshold can be set based on the connection accuracy requirements of the pin's application scenario. For example, for high-speed signal connectors, the lateral tolerance should not exceed 0.05mm; for standard power pins, an error of less than 0.1mm is acceptable. Pins whose modulus of the deviation vector exceeds the set threshold are classified as deviated.
[0177] S5.3: Generate a compensation instruction based on the local pin position deviation vector and feed it back to the alignment adjustment link of the pin module;
[0178] Specifically, after identifying an abnormal pin, the deviation data in the image space needs to be converted into executable adjustment instructions to further correct its actual assembly state. In this embodiment, combining the structural characteristics of the pin module and the controllable drive mechanism, the deviation vector of the pin identified as deviating is numerically converted to generate compensation adjustment instructions containing direction and step size.
[0179] Those skilled in the art will appreciate that the specific conversion process needs to take into account the mapping relationship between the platform coordinate system and the image coordinate system, the precise adjustment resolution of the assembly platform, and the mechanical properties of the pin structure to ensure the feasibility of the compensation instructions.
[0180] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A sub-pixel calibration method for connector pin position deviation, characterized in that: The pin is a spring pin, and the spring pin includes a pin cap, a spring, and a pin body. The sub-pixel level calibration method includes: Acquire an image area of a needle cap of the spring needle in a compressed state; Processing the needle cap image region to identify target image regions where response behavior exhibits asymmetric directional mutation, discontinuous response energy density, or reverse feedback of the main direction offset; Determining a zero-crossing point in the target image region along the transverse direction of the pin body by using the gradient distribution of an abnormal image response feature and the asymmetry of the zero-crossing position of its second-order derivative, and reconstructing the zero-crossing point to obtain sub-pixel position coordinates, wherein the abnormal response feature includes at least one image indicator that varies uniformly along the compression direction in the pin array; Calibration is performed based on the deviation of the sub-pixel position coordinates relative to the designed position of the pin.
2. The sub-pixel calibration method for connector pin position deviation according to claim 1, characterized in that: Processing the needle cap image region includes: extracting abnormal response features of the needle cap image area; constructing an abnormal response feature field according to the abnormal response feature; A target image region is generated in the abnormal response feature field.
3. The sub-pixel calibration method for connector pin position deviation according to claim 2, characterized in that: The abnormal response feature includes one of the following: The offset between the point with the maximum brightness in the pin cap image area and the geometric center of the area; The image gradient blur difference along the compression direction at the edge of the needle cap image area; The deflection angle of the main direction gradient of the needle cap image area relative to the average direction of the array.
4. The sub-pixel calibration method for connector pin position deviation according to claim 2, characterized in that: Constructing an abnormal response feature field according to the abnormal response feature includes: Performing one-dimensional projection on the abnormal response feature in the compression direction to obtain a local directional response curve; Normalizing the local directional response curve, calculating its variation trend residual along the compression direction in the pin array, and calculating a response consistency score based on the variation trend residual; Mapping the response consistency score to a position in the pin cap image region that matches the corresponding pin cap to generate an initial response consistency map within the pin array; Multi-scale directional filtering is performed on the initial response consistency map to generate an abnormal response feature field.
5. The sub-pixel calibration method for connector pin position deviation according to claim 2, characterized in that: Generating a target image area in the abnormal response feature field includes: sequentially calculating the directional vector field of the needle cap in the abnormal response characteristic field; Counting the identification direction of the directional vector field in the needle cap arrangement direction through a sliding window; generating a direction-consistent mutation region according to the identified direction; The direction consistency mutation area is marked as the target image area.
6. The sub-pixel calibration method for connector pin position deviation according to claim 2, characterized in that: Determining the zero crossing point in the target image region along the transverse direction of the needle body by using the gradient distribution of the abnormal image response feature and the asymmetry of the zero crossing position of its second-order derivative includes: Extracting a response abnormality characteristic curve perpendicular to the pin arrangement direction in the target image area; Calculating the first-order derivative of the response abnormality characteristic curve to obtain a transverse gradient distribution of the image response abnormality characteristic; calculating a second-order derivative based on the lateral gradient distribution and identifying a location where the sign changes as a candidate second-order derivative zero-crossing point; Calculate a symmetric residual function with the corresponding needle cap geometric center as the symmetry axis according to the second-order derivative zero-crossing candidate point; The difference values of the second-order derivative zero-crossing candidate points on both sides of the neighborhood are calculated according to the symmetric residual function, and the second-order derivative zero-crossing candidate points whose difference values are greater than a preset difference threshold are taken as zero-crossing points.
7. The sub-pixel calibration method for connector pin position deviation according to claim 6, characterized in that: Reconstructing the zero-crossing point to obtain sub-pixel position coordinates includes: Taking the zero crossing point as the center, multiple sub-pixel sampling points are extracted on both sides; Calculating a first response diffusion rate curve and a second response diffusion rate curve according to the response abnormality characteristics of the sub-pixel sampling point; performing stability evaluation on the first response diffusivity curve and the second response diffusivity curve, and calculating a function stability value; The coordinates corresponding to the minimum stable value of the function are used as the sub-pixel position coordinates of the zero crossing point.
8. The sub-pixel calibration method for connector pin position deviation according to claim 7, characterized in that: Performing stability evaluation on the first response diffusivity curve and the second response diffusivity curve to calculate a function stability value includes: The diffusion rate variation range between adjacent sub-pixel sampling points is calculated, and the variance of the diffusion rate variation range is counted within the sliding window, and the variance is used as the function stability value.
9. The sub-pixel calibration method for connector pin position deviation according to claim 1, characterized in that: Calibration is performed based on the deviation of the sub-pixel position coordinates relative to the designed position of the pin, including: Calculate the difference between the sub-pixel position coordinates and the designed position to obtain a local pin position deviation vector; Determine whether the local pin position deviation vector is greater than a set deviation threshold, and if so, determine that the pin is a deviation pin; A compensation instruction is generated according to the local pin position deviation vector and fed back to the alignment adjustment link of the pin module.
10. The sub-pixel calibration method for connector pin position deviation according to claim 4, characterized in that: When the response anomaly feature is projected one-dimensionally in the compression direction, it also includes: A dynamic weight coefficient is set according to the type of the response abnormality feature, and the response abnormality feature is assigned a value according to the dynamic weight coefficient, wherein the dynamic weight coefficient is adjusted according to the statistical stability and distribution discreteness of each response abnormality feature along the compression direction in the pin array.
Citation Information
Patent Citations
Connector pin position deviation detection method
CN116152147A
Cited By
Electric connector pin detection method and device
CN121409959A