A method for corresponding ordering and automatic calibration based on PCB front and back PCS positions
By acquiring PCS images of the front and back sides of the PCB board through a dual-camera synchronous triggering and timestamp alignment mechanism, and combining adaptive denoising and gradient detection technology, the spatial mapping matrix is calculated for dynamic calibration, and a fully automated closed loop is constructed. This solves the accuracy and efficiency problems of PCS position calibration on the front and back sides of the PCB board, and is suitable for high-precision automated production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI QIANLI INTELLIGENT TECH CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies for corresponding sorting and calibration of PCS positions on the front and back of PCBs are difficult to adapt to the needs of high-precision and automated production. They suffer from problems such as asynchronous acquisition, inaccurate registration, conversion errors, non-targeted compensation, and non-closed-loop processes, resulting in low accuracy of PCS position correspondence and poor calibration efficiency, which cannot meet the high-precision and automated requirements of the PCB manufacturing industry.
By acquiring multiple frames of heterogeneous images through a cross-workstation dual-camera synchronous triggering and timestamp alignment mechanism, and combining adaptive denoising and pixel-by-pixel offset compensation technology to restore the real pixel information of feature points, the system uses multi-scale gradient detection and sub-pixel interpolation optimization to capture accurate feature contours. Based on rigid body pose labels, the system calculates the spatial mapping matrix, performs dynamic projection transformation and distortion correction, realizes multi-dimensional deviation self-calculation and personalized compensation, and constructs a fully automated closed-loop system.
It significantly improves the initial positioning accuracy and calibration efficiency of PCS positions, meets the processing and positioning requirements of micro-sized PCS units, adapts to the large-scale, high-cycle production needs of PCB boards, has flexible production capabilities, and reduces the professional skills requirements and labor costs of operators.
Smart Images

Figure CN122453733A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent control technology for PCB manufacturing and visual inspection, and specifically relates to a method for corresponding sorting and automatic calibration based on the positions of PCS on the front and back sides of a PCB board. Background Technology
[0002] The following areas still need improvement in the PCB board front and back PCS position matching and calibration process: The PCB manufacturing industry is rapidly developing towards high density and miniaturization. Both sides of the PCB board integrate a large number of PCS units. Precise alignment and calibration of their positions are a core prerequisite for defect marking processes such as laser burning and inkjet coating, directly determining processing accuracy and product yield. However, existing technologies for aligning and calibrating the positions of PCS on both sides of the PCB board are still insufficient to meet the industry's high-precision, automated production demands, presenting several technical challenges in practical applications. Specific areas for improvement are as follows: The registration and sorting of PCS positions on the front and back sides often adopts simple coordinate mirroring or manual preset correspondence, without combining the rigid body characteristics of the PCB board to calculate the spatial rigid body transformation matrix. It lacks accurate spatial alignment of PCS feature points. When facing PCB boards of different specifications and different processing batches, the sorting adaptability is poor. Furthermore, the lack of threshold verification for coordinate to rigid body transformation deviation makes it easy for PCS sorting to be misaligned or mismatched, resulting in inconsistent positions of defective point markings on the front and back sides.
[0003] The process of converting PCS visual feature coordinates to equipment physical coordinates lacks real-time linkage with the equipment's motion axis system. It does not combine grating ruler displacement feedback data for dynamic projection conversion and distortion correction, and relies solely on fixed camera calibration parameters to complete the coordinate conversion. This makes it prone to physical coordinate positioning errors due to factors such as slight displacement deviations of the motion axis system and mechanical wear of the equipment, which cannot meet the processing and positioning requirements of micro-sized PCS units.
[0004] The existing calibration process lacks a multi-dimensional deviation self-compensation mechanism and can only perform simple compensation for single-axis reciprocating displacement. It does not perform quantitative analysis and fitting calculation of X / Y axis displacement deviation for PCS pose, and the generated compensation scheme lacks specificity. Furthermore, after calibration, it does not dynamically determine the process threshold from dimensions such as coordinate deviation and pose coincidence, making it impossible to accurately identify whether the calibration accuracy meets the standard, and the calibration quality is difficult to guarantee.
[0005] The overall process does not achieve a fully automated closed loop for sorting and calibration. From feature point extraction and coordinate registration to deviation compensation, multiple steps still require manual intervention and adjustment, which places high demands on the professional skills of operators. Furthermore, there is no automated accuracy re-verification mechanism. If the calibration accuracy does not meet the standards, manual parameter adjustment and calibration are required. The operation is cumbersome and inefficient, making it difficult to adapt to the large-scale, high-paced production rhythm of PCB boards.
[0006] In summary, existing technologies for the corresponding sorting and calibration of PCS positions on both sides of a PCB board suffer from problems such as asynchronous acquisition, inaccurate registration, conversion errors, lack of targeted compensation, and non-closed-loop processes. These issues result in low accuracy of PCS position correspondence and poor calibration efficiency, failing to meet the high-precision and automated requirements of the current PCB manufacturing industry for defect marking processes. There is an urgent need to develop an integrated method that can achieve synchronous acquisition, accurate registration, and dynamic calibration of PCS on both sides to solve the aforementioned technical pain points. Summary of the Invention
[0007] To address the aforementioned problems in the prior art, this invention provides a method for corresponding sorting and automatic calibration based on the positions of PCS on the front and back sides of a PCB board; The objective of this invention can be achieved through the following technical solutions: S1: By synchronously and heterogeneously imaging the front and back PCS, the real pixel information of the PCS feature points is restored; the corner gradient extremum detection is performed by robust feature point extraction, and the sub-pixel level feature contour of the PCS marker points is captured by combining the neighborhood pixel gray-level variance threshold screening; based on the extraction results, the front and back PCS feature coordinate set and pose association index of the rigid body pose label are obtained. S2: Based on the feature coordinate set and pose association index of the front and back PCS, perform spatial rigid body transformation matrix calculation on the feature points of the front and back to obtain the initial corresponding sorting relationship of the front and back PCS, calculate the coordinate pair rigid body transformation deviation value and compare it with a preset threshold to generate the corresponding sorting set of the front and back PCS. S3: Based on the corresponding sorted set, perform dynamic projection transformation and distortion correction on the feature coordinates of the PCS to obtain the physical coordinate set of the front and back PCS; perform quantitative analysis and fitting calculation of the axial displacement deviation of the corresponding PCS through multi-dimensional deviation self-solving to generate a coordinate compensation scheme for the PCS pose, and obtain the corresponding sorting relationship at the same time; determine the coordinate deviation and pose coincidence degree, and obtain the adaptive matching corresponding sorting and automatic calibration of the PCS position on the front and back of the PCB board based on the determination result.
[0008] As a preferred technical solution of the present invention, the specific process of restoring the true pixel information of PCS feature points includes: Based on the cross-workstation dual-camera synchronous triggering and timestamp alignment mechanism, multiple frames of heterogeneous original images of the front and back PCS are acquired. Adaptive Gaussian denoising and salt-and-pepper noise removal are performed on the multi-frame heterogeneous original images; The true grayscale value and spatial distribution information of PCS feature points are restored by a pixel-by-pixel offset compensation algorithm.
[0009] Specifically, the process of corner gradient extremum detection includes: The PCS marker features of the corresponding size are adapted by using a multi-scale gradient detection window. Perform Sobel gradient operator operations on the pixels within the window to calculate the gradient magnitude and direction angle in the X and Y directions, and obtain the pixel grayscale change characteristics; Local gradient extrema are screened using a non-maximum suppression algorithm, and corner regions of PCS markers are identified based on the spatial clustering density and distribution patterns of these extrema.
[0010] Specifically, the process of capturing the sub-pixel level feature contours of the PCS marker points includes: A quadratic polynomial interpolation algorithm is used to optimize pixel coordinates at the sub-pixel level. Feature edge points are obtained by combining the gray-level change rate threshold of neighboring pixels; The closed initial contour of the PCS marker is obtained by chain code tracing algorithm. The closed initial contour is then subjected to curve fitting and Gaussian smoothing for noise reduction to obtain the sub-pixel level feature contour of the PCS marker.
[0011] Specifically, the process of obtaining the front and back PCS feature coordinate sets and pose association index of the rigid body pose label includes: The centroid coordinates of the profile are calculated by least-squares ellipse fitting, forming the initial coordinate set of the front and back PCS. A two-way matching algorithm based on the gray-level histogram features of feature points and their spatial location distribution is used to establish a mapping relationship between the feature coordinates of the front and back PCS. Based on the mapping relationship, a structured pose association index table is generated, and feature coordinate data and rigid body pose label information are integrated to obtain the front and back PCS feature coordinate set and pose association index with rigid body pose labels.
[0012] Specifically, the process of solving the spatial rigid body transformation matrix includes: Based on the pose association index, extract the correspondence pairs of PCS feature points on the front and back sides; Applying the aforementioned correspondence to the input translation-rotation coupled spatial rigid body transformation model, the transformation matrix parameters are solved using an iterative least squares algorithm. Calculate the reprojection error of the transformation matrix, compare the error value with a preset error threshold, and obtain the comparison result; Based on the optimized parameters, the spatial rigid body transformation matrix is solved to obtain the transformation matrix of the position mapping relationship between the front and back PCS.
[0013] Specifically, the process of generating the sorted set of corresponding positive and negative PCS includes: Based on the spatial rigid body transformation matrix, the feature coordinates of the reverse PCS are transformed and mapped to obtain predicted coordinates that are consistent with the coordinate system of the front PCS. Calculate the Euclidean distance between the predicted coordinates and the corresponding actual coordinates of the frontal PCS to obtain the rigid body transformation deviation value; The deviation value is compared with a preset threshold to obtain a coordinate pair; Using the spatial relationship of the coordinate pairs, a corresponding sorted set of front and back PCS is generated and the corresponding serial numbers of the front and back PCS are obtained.
[0014] Specifically, the process of performing dynamic projection conversion and distortion correction includes: Based on the corresponding sorted set, analyze the spatial distribution pattern and density characteristics of PCS feature coordinates; By combining the real-time feedback of the grating ruler displacement data from the equipment's motion axis system, the mapping coefficient between visual coordinates and physical coordinates is dynamically updated; The initial physical coordinates are obtained by spatial projection transformation of the PCS feature coordinates through a visual-physical coordinate dynamic mapping model. By introducing radial and tangential distortion correction parameters of the camera, distortion error compensation is performed on the initial physical coordinates based on the camera calibration model to obtain the front and back PCS physical coordinate sets.
[0015] Specifically, the process of quantitative analysis and fitting calculation of the axial displacement deviation of the corresponding PCS includes: Based on the physical coordinate set of the front and back PCS, multiple feature sampling points are selected in the X and Y axis directions; The actual displacement data of the sampling point during the movement of the equipment is collected in real time by a grating ruler, and the deviation between the physical coordinate value and the actual displacement data is calculated. The deviation values are decomposed into time series to separate the corresponding error values for multi-dimensional quantitative analysis; Based on the quantitative analysis results, a deviation-position relationship model is established. The least squares fitting algorithm is used to optimize the deviation-position relationship model and generate a personalized coordinate compensation scheme.
[0016] Specifically, the process of obtaining the corresponding sorting relationship includes: The personalized coordinate compensation scheme is used to correct the deviation of the physical coordinate set point by point; Based on the corresponding sorted set, calculate the overlap index and deviation stability index of the corresponding coordinates of the corrected front and back PCS. Based on the calculation results, the coordinate data and sorting information are integrated and corrected to obtain the physical coordinate set and sorting relationship of the front and back PCS.
[0017] Specifically, the process of determining the coordinate deviation and pose coincidence includes: Based on the physical coordinate set and sorting relationship of the front and back PCS, calculate the absolute deviation value and relative deviation rate of the corresponding coordinates of the front and back PCS. The coordinate deviation data, PCS contour matching parameters and rigid body transformation consistency parameters are input into the multi-dimensional pose coincidence evaluation model to obtain the coincidence score. The score is compared with the preset process threshold to obtain a binary judgment result.
[0018] Specifically, the process of adaptively matching and automatically calibrating the positions of PCS on the front and back sides of the PCB board includes: Based on the binary determination result, the physical coordinates are corrected a second time, and a second determination process is executed to obtain the adaptive matching and corresponding sorting results of the PCS positions on the front and back of the PCB board and the automatic calibration parameters of the whole process.
[0019] The beneficial effects of this invention are as follows: by acquiring multiple frames of heterogeneous images of the front and back PCS through a cross-workstation dual-camera synchronous triggering and timestamp alignment mechanism, combined with adaptive denoising and pixel-by-pixel offset compensation technology to restore the real pixel information of feature points, and then capturing accurate feature contours through multi-scale gradient detection and sub-pixel interpolation optimization, a feature coordinate set and associated index with rigid body pose labels are finally generated. This completely solves the problem of feature extraction deviation caused by asynchronous acquisition, reflection and noise interference in traditional methods, and provides high-fidelity and high-precision basic data support for subsequent sorting and calibration, significantly improving the initial positioning accuracy of the front and back PCS positions.
[0020] Based on the feature coordinate set and pose association index, the spatial mapping matrix is solved by the translation-rotation coupled rigid body transformation model. Combined with the Euclidean distance deviation threshold, a precise corresponding sorting set is generated. Then, the coordinate transformation is completed by the visual-physical coordinate dynamic mapping model and camera distortion correction technology. At the same time, a personalized compensation scheme is generated by multi-dimensional deviation self-solving and least squares fitting. This achieves error-free transformation and dynamic deviation compensation from visual coordinates to physical coordinates, effectively solving the technical pain points of fixed error and lack of targeted compensation in traditional coordinate transformation. It ensures the accuracy and consistency of the corresponding sorting of the front and back PCS positions and meets the processing and positioning requirements of micro-sized PCS units.
[0021] A fully automated closed-loop system for acquisition, extraction, registration, conversion, compensation, and verification has been constructed. Through a multi-dimensional pose coincidence evaluation model, the accuracy is dynamically judged. For samples that do not meet the standards, a secondary correction and re-verification mechanism is automatically initiated. The entire calibration process can be completed without manual intervention. This not only significantly reduces the professional skills required of operators and labor costs, but also significantly improves calibration efficiency and quality stability. It is suitable for the large-scale, high-speed production needs of PCB boards, and is also compatible with PCB boards of different specifications and processing batches, possessing extremely strong flexible production capabilities. Attached Figure Description
[0022] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.
[0023] Figure 1 This is a flowchart illustrating a method for corresponding sorting and automatic calibration of PCS positions on the front and back sides of a PCB board according to the present invention. Figure 2 This is a flowchart of the spatial rigid body transformation and corresponding sorting in this invention. Detailed Implementation
[0024] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.
[0025] Please see Figure 1-2 A method for corresponding sorting and automatic calibration based on the positions of PCS on the front and back sides of a PCB board, comprising: S1: By synchronously and heterogeneously imaging the front and back PCS, the real pixel information of the PCS feature points is restored; the corner gradient extremum detection is performed by robust feature point extraction, and the sub-pixel level feature contour of the PCS marker points is captured by combining the neighborhood pixel gray-level variance threshold screening; based on the extraction results, the front and back PCS feature coordinate set and pose association index of the rigid body pose label are obtained. S2: Based on the feature coordinate set and pose association index of the front and back PCS, perform spatial rigid body transformation matrix calculation on the feature points of the front and back to obtain the initial corresponding sorting relationship of the front and back PCS, calculate the coordinate pair rigid body transformation deviation value and compare it with a preset threshold to generate the corresponding sorting set of the front and back PCS. S3: Based on the corresponding sorted set, perform dynamic projection transformation and distortion correction on the feature coordinates of the PCS to obtain the physical coordinate set of the front and back PCS; perform quantitative analysis and fitting calculation of the axial displacement deviation of the corresponding PCS through multi-dimensional deviation self-solving to generate a coordinate compensation scheme for the PCS pose, and obtain the corresponding sorting relationship at the same time; determine the coordinate deviation and pose coincidence degree, and obtain the adaptive matching corresponding sorting and automatic calibration of the PCS position on the front and back of the PCB board based on the determination result.
[0026] As a preferred technical solution of the present invention, the specific process of restoring the true pixel information of PCS feature points includes: Based on the cross-workstation dual-camera synchronous triggering and timestamp alignment mechanism, multiple frames of heterogeneous original images of the front and back PCS are acquired. Adaptive Gaussian denoising and salt-and-pepper noise removal are performed on the multi-frame heterogeneous original images; The true grayscale value and spatial distribution information of PCS feature points are restored by a pixel-by-pixel offset compensation algorithm.
[0027] In this embodiment, the dual cameras across workstations employ industrial-grade high-definition cameras. An external synchronization trigger module enables synchronized control of front and back image acquisition. The timestamp alignment mechanism, based on a high-precision clock synchronization protocol, ensures that the acquisition time difference between each frame of the front and back images is kept within a minimal range, avoiding feature point position deviations caused by asynchronous acquisition. The number of acquired heterogeneous original images is adaptively adjusted according to the density and distribution of PCS on the PCB board. The adaptive Gaussian denoising algorithm dynamically adjusts filtering parameters based on the noise distribution characteristics of the image, effectively filtering out high-frequency noise while preserving PCS feature details. Salt-and-pepper noise removal employs targeted median filtering to avoid interference from noise points on feature point recognition. The pixel-by-pixel offset compensation algorithm first detects the warping state of the PCB board, establishes a warping displacement model, then calculates the offset of each pixel based on the model and performs reverse compensation. Simultaneously, for reflective areas of the metal plating, pixel grayscale value analysis and neighbor pixel interpolation are used to eliminate grayscale distortion caused by reflection, fully restoring the true grayscale information and spatial distribution of PCS feature points.
[0028] Specifically, the process of corner gradient extremum detection includes: The PCS marker features of the corresponding size are adapted by using a multi-scale gradient detection window. Perform Sobel gradient operator operations on the pixels within the window to calculate the gradient magnitude and direction angle in the X and Y directions, and obtain the pixel grayscale change characteristics; Local gradient extrema are screened using a non-maximum suppression algorithm, and corner regions of PCS markers are identified based on the spatial clustering density and distribution patterns of these extrema.
[0029] In this embodiment, the size of the multi-scale gradient detection window is preset according to the actual size range of the PCS markers. The system adaptively selects a matching detection window based on the approximate size information of the PCS markers obtained during the image preprocessing stage, ensuring accurate gradient detection for markers of different sizes. The Sobel gradient operator calculates the grayscale gradient change along the X and Y axes for each pixel within the window, obtaining gradient magnitude and orientation angle data to comprehensively capture the grayscale change features of the pixel. The gradient magnitude reflects the intensity of the pixel's grayscale change, and the orientation angle reflects the direction of the grayscale change. The formula is as follows: X-axis gradient (horizontal edge detection): , Y-axis gradient (vertical edge detection): , Gradient magnitude (combined edge strength): , Gradient direction angle: , For the original PCS images acquired by the cross-station camera, a 3×3 pixel window is selected as the working area of the convolution kernel, and the Sobel operator operation is performed on each pixel in the window. Through G x and G y The formula calculates the gradient in the X and Y axes respectively, and then substitutes it into the gradient magnitude formula to obtain the edge intensity of each pixel. The larger the gradient magnitude, the more likely the pixel is to be the edge or corner of the PCS identifier point. By combining the gradient direction angle formula, the direction information of edge changes can be obtained, providing a basis for subsequent non-maximum suppression; Finally, pixels with gradient magnitudes greater than a preset threshold are selected as potential corner points for PCS markers, laying the foundation for sub-pixel level contour capture.
[0030] The non-maximum suppression algorithm filters local extrema of gradient magnitude, retaining pixels with the most significant gradient changes and eliminating redundant points in areas with gentle gradient changes. It then combines a preset grayscale variance threshold to further filter out pseudo-extrema caused by factors such as background noise and PCB surface texture, ensuring that all selected extrema are related to PCS markers. Finally, by analyzing the spatial clustering density and distribution pattern of extrema, the clustering regions of densely distributed extrema that conform to the shape characteristics of PCS markers are identified as corner regions of PCS markers.
[0031] Specifically, the process of capturing the sub-pixel level feature contours of the PCS marker points includes: A quadratic polynomial interpolation algorithm is used to optimize pixel coordinates at the sub-pixel level. Feature edge points are obtained by combining the gray-level change rate threshold of neighboring pixels; The closed initial contour of the PCS marker is obtained by chain code tracing algorithm. The closed initial contour is then subjected to curve fitting and Gaussian smoothing for noise reduction to obtain the sub-pixel level feature contour of the PCS marker.
[0032] In this embodiment, the quadratic polynomial interpolation algorithm subdivides and optimizes the pixel coordinates within the corner region, breaking through the precision limitations of pixel-level coordinates and improving the coordinate accuracy to the sub-pixel level, providing a foundation for accurate contour capture. The grayscale change rate threshold of neighboring pixels is dynamically adjusted based on the grayscale difference characteristics between the PCS marker and the background region. When the grayscale change rate of a pixel's neighboring region reaches the threshold, the pixel is determined to be a feature edge point of the PCS marker. This method can accurately distinguish the marker edge from background noise. The chain code tracing algorithm continuously tracks the feature edge points according to a preset search direction, connecting adjacent edge points in sequence to form a closed initial contour of the PCS marker. This process can completely preserve the edge morphology features of the marker. To address the jagged distortion and noise interference that may exist in the initial contour, a curve fitting algorithm is used to fit and optimize the contour. At the same time, Gaussian smoothing denoising is combined to eliminate irregular fluctuations in the contour, resulting in a PCS marker feature contour at the sub-pixel level.
[0033] Specifically, the process of obtaining the front and back PCS feature coordinate sets and pose association index of the rigid body pose label includes: The centroid coordinates of the profile are calculated by least-squares ellipse fitting, forming the initial coordinate set of the front and back PCS. A two-way matching algorithm based on the gray-level histogram features of feature points and their spatial location distribution is used to establish a mapping relationship between the feature coordinates of the front and back PCS. Based on the mapping relationship, a structured pose association index table is generated, and feature coordinate data and rigid body pose label information are integrated to obtain the front and back PCS feature coordinate set and pose association index with rigid body pose labels.
[0034] In this embodiment, the least squares ellipse fitting algorithm performs fitting operations on the sub-pixel-level feature contours of the PCS identifier points. By minimizing the fitting error, the centroid coordinates of the contours are accurately calculated. These centroid coordinates are the core feature coordinates of the PCS. The centroid coordinates of all PCS are integrated to form the initial coordinate group for both front and back PCS. Gray-level histogram feature extraction is performed on the pixel region surrounding the feature coordinates of each PCS. A gray-level histogram is constructed to obtain gray-level distribution feature parameters. Simultaneously, combined with the spatial distribution information of the feature coordinates on the PCB board, a unique feature identifier for each PCS is formed. The bidirectional matching algorithm establishes a one-to-one mapping relationship between the feature coordinates of the front and back PCS by comparing the grayscale histogram features and spatial position distribution features of the front and back PCS, ensuring the accuracy of the matching and avoiding mismatches caused by similar PCS specifications. Based on the established mapping relationship, a structured pose association index table is generated. The index table records the feature coordinate information of the back PCS corresponding to each feature coordinate of the front PCS. At the same time, each feature coordinate is assigned a rigid body pose label containing information such as spatial orientation and level. The two are integrated to form a set of feature coordinates of the front and back PCS with rigid body pose labels and a pose association index.
[0035] Specifically, the process of solving the spatial rigid body transformation matrix includes: Based on the pose association index, extract the correspondence pairs of PCS feature points on the front and back sides; Applying the aforementioned correspondence to the input translation-rotation coupled spatial rigid body transformation model, the transformation matrix parameters are solved using an iterative least squares algorithm. Calculate the reprojection error of the transformation matrix, compare the error value with a preset error threshold, and obtain the comparison result; Based on the optimized parameters, the spatial rigid body transformation matrix is solved to obtain the transformation matrix of the position mapping relationship between the front and back PCS.
[0036] In this embodiment, based on the pose association index table, a one-to-one correspondence between the feature points of the front and back PCS is extracted. Each pair of feature points belongs to the corresponding position of the same PCS on the front and back sides. The translation-rotation coupled spatial rigid body transformation model formula is as follows: Let the feature coordinates of the front PCS be (x1, y1) and the feature coordinates of the back PCS be (x2, y2), the model is: , Where a = cosθ, b = sinθ (θ is the rotation angle), (t x ,t y ) represents the translation amount, and the parameter vector β=[a,b,t] x ,t y ] T ; Extract the correspondence between the front and back PCS feature points ( , , , (i=1,2,...,m), construct the design matrix X and the observation vector Y; Substitute the parameters into the iterative least squares formula, initialize the parameter β0, and calculate the error ε. k And update parameter β k+1 During the iteration process, the reprojection error of the transformation matrix is calculated; When the parameter change satisfies the convergence condition ||β k+1 -β k When || < δ and the reprojection error is less than a preset threshold, the iteration stops, the optimal parameter β∗ is obtained, and then the spatial rigid body transformation matrix is calculated.
[0037] By comprehensively considering the translational and rotational motions of the PCB board in space, the model can fully describe the positional mapping relationship between the front and back PCS. After inputting the extracted feature point correspondences into the model, an iterative least squares algorithm is used to continuously optimize the transformation matrix parameters, minimizing the error between the model's predicted coordinates of the back PCS feature points and the actual collected coordinates. During the iteration process, the rationality of the parameters is evaluated by calculating the reprojection error of the transformation matrix. The reprojection error is the deviation between the coordinates of the front PCS feature points projected onto the back side through the transformation matrix and the actual coordinates of the back side feature points. This error is compared with a preset error threshold. If the error exceeds the threshold, the iteration parameters are adjusted and the iteration continues until the error meets the requirements. Based on the optimized parameters, the final solution of the spatial rigid body transformation matrix is completed. This matrix can accurately describe the positional mapping relationship between the front and back PCS.
[0038] Specifically, the process of generating the sorted set of corresponding positive and negative PCS includes: Based on the spatial rigid body transformation matrix, the feature coordinates of the reverse PCS are transformed and mapped to obtain predicted coordinates that are consistent with the coordinate system of the front PCS. Calculate the Euclidean distance between the predicted coordinates and the corresponding actual coordinates of the frontal PCS to obtain the rigid body transformation deviation value; The deviation value is compared with a preset threshold to obtain a coordinate pair; Using the spatial relationship of the coordinate pairs, a corresponding sorted set of front and back PCS is generated and the corresponding serial numbers of the front and back PCS are obtained.
[0039] In this embodiment, the spatial rigid body transformation matrix obtained by calculation is used to transform and map the feature coordinates of all reverse PCS, transforming the feature coordinates of the reverse PCS into the coordinate system of the front PCS to obtain predicted coordinates, making the feature coordinates of the front and reverse PCS comparable. The Euclidean distance between each predicted coordinate and the corresponding actual feature coordinate of the front PCS is calculated. This distance is the rigid body transformation deviation value, which can intuitively reflect the accuracy of the mapping transformation. The rigid body transformation deviation value is compared with a preset threshold, and valid coordinate pairs with deviation values within the threshold range are selected, while invalid coordinate pairs with excessive deviations are eliminated to ensure the accuracy of subsequent sorting. Based on the spatial positional relationship of the valid coordinate pairs, the front and reverse PCS are uniformly sorted according to preset sorting rules (such as row priority, left to right, top to bottom), and a unique serial number is assigned to each PCS to clarify the correspondence between each PCS on the front and back sides, generating a corresponding sorted set of front and reverse PCS.
[0040] Specifically, the process of performing dynamic projection conversion and distortion correction includes: Based on the corresponding sorted set, analyze the spatial distribution pattern and density characteristics of PCS feature coordinates; By combining the real-time feedback of the grating ruler displacement data from the equipment's motion axis system, the mapping coefficient between visual coordinates and physical coordinates is dynamically updated; The initial physical coordinates are obtained by spatial projection transformation of the PCS feature coordinates through a visual-physical coordinate dynamic mapping model. By introducing radial and tangential distortion correction parameters of the camera, distortion error compensation is performed on the initial physical coordinates based on the camera calibration model to obtain the front and back PCS physical coordinate sets.
[0041] In this embodiment, the spatial distribution pattern and density characteristics of PCS feature coordinates are analyzed in depth based on the corresponding sorted set to understand the distribution of PCS on the PCB board, providing a distribution basis for coordinate mapping transformation. The grating ruler of the device motion axis system can collect the actual displacement data of the motion axis in real time and feed this data back to the system. The system combines this data to dynamically update the mapping coefficients between visual coordinates and physical coordinates, so that the mapping model can adapt to the changes in the device motion state in real time, improving the real-time performance and accuracy of coordinate transformation. The visual-physical coordinate dynamic mapping model projects the visual coordinates of PCS features into the physical coordinates of the device motion axis system based on the updated mapping coefficients to obtain the initial physical coordinates. Since the camera has radial and tangential distortion, it will cause errors in the initial physical coordinates. Therefore, the distortion correction parameters obtained during the camera calibration process are introduced. The distortion error compensation of the initial physical coordinates is performed based on the camera calibration model to eliminate the influence of distortion and obtain an accurate set of physical coordinates for the front and back PCS.
[0042] Specifically, the process of quantitative analysis and fitting calculation of the axial displacement deviation of the corresponding PCS includes: Based on the physical coordinate set of the front and back PCS, multiple feature sampling points are selected in the X and Y axis directions; The actual displacement data of the sampling point during the movement of the equipment is collected in real time by a grating ruler, and the deviation between the physical coordinate value and the actual displacement data is calculated. The deviation values are decomposed into time series to separate the corresponding error values for multi-dimensional quantitative analysis; Based on the quantitative analysis results, a deviation-position relationship model is established. The least squares fitting algorithm is used to optimize the deviation-position relationship model and generate a personalized coordinate compensation scheme.
[0043] In this embodiment, when selecting feature sampling points in the X and Y axes, the spatial distribution pattern of PCS is comprehensively considered to ensure that the sampling points can uniformly cover the entire PCB board area and cover PCS areas with different distribution densities, thus ensuring the comprehensiveness of the deviation analysis. The grating ruler collects the actual motion displacement data of the sampling points in real time during the movement of the equipment. This data can truly reflect the actual position of the equipment's motion axis. It is compared with the corresponding physical coordinate value to calculate the deviation value between the two. This deviation value is the comprehensive deviation generated during coordinate transformation and equipment movement. The deviation value is decomposed into a time series to separate different types of error components such as systematic error, random error, and temperature drift error. Multi-dimensional quantitative analysis is performed on each error component to clarify the magnitude, distribution pattern, and trend of the error. Based on the quantitative analysis results, a deviation-position relationship model is established. This model can accurately describe the law of deviation value changing with PCS position. The least squares fitting algorithm is used to optimize the model to improve the model's fitting accuracy. Finally, based on the optimized model, a personalized coordinate compensation scheme corresponding to the pose of each PCS is generated to ensure the pertinence and accuracy of the compensation.
[0044] Specifically, the process of obtaining the corresponding sorting relationship includes: The personalized coordinate compensation scheme is used to correct the deviation of the physical coordinate set point by point; Based on the corresponding sorted set, calculate the overlap index and deviation stability index of the corresponding coordinates of the corrected front and back PCS. Based on the calculation results, the coordinate data and sorting information are integrated and corrected to obtain the physical coordinate set and sorting relationship of the front and back PCS.
[0045] In this embodiment, based on the personalized coordinate compensation scheme, the feature coordinates of each PCS in the physical coordinate set are corrected point by point for deviation. The coordinate positions are adjusted according to the compensation values in the compensation scheme to eliminate the impact of deviation. Combined with the previously generated corresponding sorting set, the correspondence between the corrected front and back PCS is clarified. The overlap index and deviation stability index of each pair of corresponding coordinates are calculated. The overlap index reflects the matching degree of the corresponding coordinates, and the deviation stability index reflects the fluctuation of the deviation after correction. These two indicators are used to verify the reliability of the correction effect and the coordinate correspondence. Based on the verified calculation results, the corrected coordinate data and sorting information are integrated, and the coordinate data of the PCS are matched one-to-one with the sorting number to form a precise physical coordinate set and sorting relationship of the front and back PCS.
[0046] Specifically, the process of determining the coordinate deviation and pose coincidence includes: Based on the physical coordinate set and sorting relationship of the front and back PCS, calculate the absolute deviation value and relative deviation rate of the corresponding coordinates of the front and back PCS. The coordinate deviation data, PCS contour matching parameters and rigid body transformation consistency parameters are input into the multi-dimensional pose coincidence evaluation model to obtain the coincidence score. The score is compared with the preset process threshold to obtain a binary judgment result.
[0047] In this embodiment, the absolute deviation value directly reflects the positional difference of the corresponding coordinates of the front and back PCS, while the relative deviation rate is calculated by the ratio of the absolute deviation value to the feature size of the PCS, which can more objectively evaluate the degree of deviation of PCS of different sizes. The coordinate deviation data, the PCS contour matching parameter (reflecting the matching of the front and back PCS contours), and the rigid body transformation consistency parameter (reflecting the consistency of the application of the rigid body transformation matrix) are used as input parameters of the multi-dimensional pose coincidence evaluation model. The model obtains a comprehensive coincidence score through weighted calculation to comprehensively evaluate the pose matching effect of the front and back PCS. The coincidence score is compared with a preset process threshold. If the score is higher than the threshold, it is determined that the accuracy meets the standard, and a binary judgment result of meeting the standard is output. If the score is lower than the threshold, it is determined that the accuracy does not meet the standard, and a binary judgment result of not meeting the standard is output.
[0048] Specifically, the process of adaptively matching and automatically calibrating the positions of PCS on the front and back sides of the PCB board includes: Based on the binary determination result, the physical coordinates are corrected a second time, and a second determination process is executed to obtain the adaptive matching and corresponding sorting results of the PCS positions on the front and back of the PCB board and the automatic calibration parameters of the whole process.
[0049] In this embodiment, for cases where the accuracy meets the standard, the adaptive matching and corresponding sorting results and fully automated calibration parameters are directly output based on the corrected physical coordinate set and sorting relationship of the front and back PCS. The calibration parameters include key parameters such as transformation matrix, compensation coefficient, and judgment threshold, providing a reference for the calibration of similar PCB boards in the future. For cases where the accuracy does not meet the standard, the main source of deviation is located based on the previous deviation analysis results, the parameters of the personalized coordinate compensation scheme are adjusted, and the physical coordinates are corrected a second time. After the correction is completed, the pose coincidence judgment process is re-executed until the judgment result that meets the accuracy standard is obtained. The adaptive matching and corresponding sorting results of the positions of the front and back PCS on the PCB board are output, along with the corresponding serial numbers of the PCS on the front and back sides. At the same time, the complete fully automated calibration parameters are output, realizing the accurate corresponding sorting and automated calibration of the positions of the front and back PCS on the PCB board, providing a reliable positional basis for subsequent processing steps such as laser burning and inkjet coating.
[0050] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for corresponding sorting and automatic calibration based on the positions of PCS on the front and back sides of a PCB board, characterized in that, include: S1: By synchronously and heterogeneously imaging the front and back PCS, the true pixel information of the PCS feature points is restored; By leveraging robust feature point extraction for corner gradient extremum detection and combining neighboring pixel grayscale variance thresholding, sub-pixel-level feature contours of PCS marker points are captured. Based on the extraction results, obtain the front and back PCS feature coordinate sets and pose association index of the rigid body pose label; S2: Based on the feature coordinate set and pose association index of the front and back PCS, perform spatial rigid body transformation matrix calculation on the feature points of the front and back to obtain the initial corresponding sorting relationship of the front and back PCS, calculate the coordinate pair rigid body transformation deviation value and compare it with a preset threshold to generate the corresponding sorting set of the front and back PCS. S3: Based on the corresponding sorted set, perform dynamic projection transformation and distortion correction on the feature coordinates of the PCS to obtain the physical coordinate set of the front and back PCS; perform quantitative analysis and fitting calculation of the axial displacement deviation of the corresponding PCS through multi-dimensional deviation self-solving to generate a coordinate compensation scheme for the PCS pose, and obtain the corresponding sorting relationship at the same time; determine the coordinate deviation and pose coincidence degree, and obtain the adaptive matching corresponding sorting and automatic calibration of the PCS position on the front and back of the PCB board based on the determination result.
2. The method according to claim 1, characterized in that, The specific process of restoring the true pixel information of PCS feature points includes: Based on the cross-workstation dual-camera synchronous triggering and timestamp alignment mechanism, multiple frames of heterogeneous original images of the front and back PCS are acquired. Adaptive Gaussian denoising and salt-and-pepper noise removal are performed on the multi-frame heterogeneous original images; The true grayscale value and spatial distribution information of PCS feature points are restored by a pixel-by-pixel offset compensation algorithm.
3. The method according to claim 1, characterized in that, The specific process for corner gradient extremum detection includes: The PCS marker features of the corresponding size are adapted by using a multi-scale gradient detection window. Perform Sobel gradient operator operations on the pixels within the window to calculate the gradient magnitude and direction angle in the X and Y directions, and obtain the pixel grayscale change characteristics; Local gradient extrema are screened using a non-maximum suppression algorithm, and corner regions of PCS markers are identified based on the spatial clustering density and distribution patterns of these extrema.
4. The method according to claim 1, characterized in that, The specific process of capturing the sub-pixel level feature contours of PCS marker points includes: A quadratic polynomial interpolation algorithm is used to optimize pixel coordinates at the sub-pixel level. Feature edge points are obtained by combining the gray-level change rate threshold of neighboring pixels; The closed initial contour of the PCS marker is obtained by chain code tracing algorithm. The closed initial contour is then subjected to curve fitting and Gaussian smoothing for noise reduction to obtain the sub-pixel level feature contour of the PCS marker.
5. The method according to claim 1, characterized in that, The specific process of obtaining the front and back PCS feature coordinate sets and pose association index of the rigid body pose label includes: The centroid coordinates of the profile are calculated by least-squares ellipse fitting, forming the initial coordinate set of the front and back PCS. A two-way matching algorithm based on the gray-level histogram features of feature points and their spatial location distribution is used to establish a mapping relationship between the feature coordinates of the front and back PCS. Based on the mapping relationship, a structured pose association index table is generated, and feature coordinate data and rigid body pose label information are integrated to obtain the front and back PCS feature coordinate set and pose association index with rigid body pose labels.
6. The method according to claim 5, characterized in that, The specific process of solving the spatial rigid body transformation matrix includes: Based on the pose association index, extract the correspondence pairs of PCS feature points on the front and back sides; Applying the aforementioned correspondence to the input translation-rotation coupled spatial rigid body transformation model, the transformation matrix parameters are solved using an iterative least squares algorithm. Calculate the reprojection error of the transformation matrix, compare the error value with a preset error threshold, and obtain the comparison result; Based on the optimized parameters, the spatial rigid body transformation matrix is solved to obtain the transformation matrix of the position mapping relationship between the front and back PCS.
7. The method according to claim 1, characterized in that, The specific process of generating the sorted set of corresponding positive and negative PCS includes: Based on the spatial rigid body transformation matrix, the feature coordinates of the reverse PCS are transformed and mapped to obtain predicted coordinates that are consistent with the coordinate system of the front PCS. Calculate the Euclidean distance between the predicted coordinates and the corresponding actual coordinates of the frontal PCS to obtain the rigid body transformation deviation value; The deviation value is compared with a preset threshold to obtain a coordinate pair; Using the spatial relationship of the coordinate pairs, a corresponding sorted set of front and back PCS is generated and the corresponding serial numbers of the front and back PCS are obtained.
8. The method according to claim 1, characterized in that, The specific process of performing dynamic projection conversion and distortion correction includes: Based on the corresponding sorted set, analyze the spatial distribution pattern and density characteristics of PCS feature coordinates; By combining the real-time feedback of the grating ruler displacement data from the equipment's motion axis system, the mapping coefficient between visual coordinates and physical coordinates is dynamically updated; The initial physical coordinates are obtained by spatial projection transformation of the PCS feature coordinates through a visual-physical coordinate dynamic mapping model. By introducing radial and tangential distortion correction parameters of the camera, distortion error compensation is performed on the initial physical coordinates based on the camera calibration model to obtain the front and back PCS physical coordinate sets.
9. The method according to claim 1, characterized in that, The specific process of quantitative analysis and fitting calculation of the corresponding PCS axis displacement deviation includes: Based on the physical coordinate set of the front and back PCS, multiple feature sampling points are selected in the X and Y axis directions; The actual displacement data of the sampling point during the movement of the equipment is collected in real time by a grating ruler, and the deviation between the physical coordinate value and the actual displacement data is calculated. The deviation values are decomposed into time series to separate the corresponding error values for multi-dimensional quantitative analysis; Based on the quantitative analysis results, a deviation-position relationship model is established. The least squares fitting algorithm is used to optimize the deviation-position relationship model and generate a personalized coordinate compensation scheme.
10. The method according to claim 1, characterized in that, The specific process for obtaining the corresponding sorting relationship includes: The personalized coordinate compensation scheme is used to correct the deviation of the physical coordinate set point by point; Based on the corresponding sorted set, calculate the overlap index and deviation stability index of the corresponding coordinates of the corrected front and back PCS. Based on the calculation results, the coordinate data and sorting information are integrated and corrected to obtain the physical coordinate set and sorting relationship of the front and back PCS.
11. The method according to claim 10, characterized in that, The specific process for determining the coordinate deviation and pose coincidence includes: Based on the physical coordinate set and sorting relationship of the front and back PCS, calculate the absolute deviation value and relative deviation rate of the corresponding coordinates of the front and back PCS. The coordinate deviation data, PCS contour matching parameters and rigid body transformation consistency parameters are input into the multi-dimensional pose coincidence evaluation model to obtain the coincidence score. The score is compared with the preset process threshold to obtain a binary judgment result.
12. The method according to claim 11, characterized in that, The specific process of obtaining the adaptive matching correspondence sorting and automatic calibration of the positions of PCS on the front and back sides of the PCB board includes: Based on the binary determination result, the physical coordinates are corrected a second time, and a second determination process is executed to obtain the adaptive matching and corresponding sorting results of the PCS positions on the front and back of the PCB board and the automatic calibration parameters of the whole process.