A method, device, medium and product for positioning calibration of a surface mount equipment

By combining image recognition models and iterative calculations with multi-source image fusion and an improved YOLOv7 network model, the problem of inaccurate positioning and matching of surface mount equipment is solved, high-precision positioning and calibration is achieved in complex environments, and the stability and reliability of the system are enhanced.

CN120659248BActive Publication Date: 2025-10-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511164846.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-10-17
Estimated Expiration
2045-08-20

AI Technical Summary

Technical Problem

Existing surface mount equipment has problems with inaccurate positioning and matching, especially under different environmental conditions, irregular equipment placement, irregular component shapes, and point obstruction, making it difficult to achieve accurate matching of pads and component pins.

Method used

An image recognition model is used to identify the positions of pads and component pins, and the confidence levels are recorded. Through iterative calculation and confidence weighting, the impact of low-confidence position detection results is reduced, and the final matching results and spatial mapping parameters are output. Multi-source image fusion and an improved YOLOv7 network model are combined to improve recognition accuracy, and graph structure and geometric consistency constraints are introduced to correct the positions of key points.

Benefits of technology

It improves the positioning and matching accuracy of surface mount equipment, enhances anti-interference ability, ensures recognition stability and reliability in complex environments and irregular conditions, and improves the accuracy of positioning calibration and system robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120659248B_ABST
    Figure CN120659248B_ABST
Patent Text Reader

Abstract

The application discloses a positioning calibration method and device of a surface mounting equipment, a medium and a product, relates to the technical field of printed circuit boards, and comprises the following steps: obtaining a first position of a pad on a circuit board and a second position of an element pin of a to-be-mounted element by using an image recognition model, recording the confidence, performing position transformation calculation on the positions of the matched pad and element pin in the current iteration, combining the confidence to calculate the position error after transformation, and outputting the final matching result of the pad and the element pin and the corresponding final space mapping parameter after the first iteration calculation condition is reached. The application effectively reduces the influence of low-confidence position detection results on space mapping parameter calculation, ensures the stability and reliability of the final space mapping parameter, has stronger anti-interference ability compared with traditional position error calculation, and improves the positioning matching accuracy of the high surface mounting equipment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of printed circuit boards, and in particular to a positioning calibration method, device, medium and product of a surface mounting equipment. BACKGROUND

[0002] Surface-Mount Technology (SMT) is a technology widely used in modern electronic manufacturing, which realizes the miniaturization and high density of electronic products by directly mounting electronic components on the surface of a Printed Circuit Board (PCB). Visual positioning calibration of surface mounting equipment is a key step to ensure accurate mounting of components on the circuit board. By identifying and positioning the pads on the circuit board and the pin positions of the components to be mounted, the position mapping relationship between the pads and the component pins is established, thereby achieving accurate mounting. However, due to different environmental conditions, irregular placement of equipment, irregular shape of components, and point occlusion, the current positioning matching result is not accurate enough.

[0003] How to improve the positioning matching accuracy of surface mounting equipment is a technical problem to be solved by those skilled in the art. SUMMARY

[0004] The present application provides a positioning calibration method, device, medium and product of a surface mounting equipment to at least solve the problem of insufficient accuracy of positioning matching of surface mounting equipment in related technologies.

[0005] The present application provides a positioning calibration method of a surface mounting equipment, comprising:

[0006] obtaining a circuit image of a circuit board and a component image of a component to be mounted;

[0007] using an image recognition model to respectively recognize the circuit image and the component image, to obtain a first position and a first confidence of a pad on the circuit board, and a second position and a second confidence of a component pin of the component to be mounted;

[0008] entering an iterative calculation, in the current iteration, matching the pad and the component pin, calculating a spatial mapping parameter according to the matched pairs of the first position and the second position, performing a position transformation calculation on the matched first position and the second position according to the spatial mapping parameter, and calculating a position error of the transformed position according to the first confidence and / or the second confidence, until a first iteration end condition is reached, and outputting a final matching result of the pad and the component pin and a corresponding final spatial mapping parameter.

[0009] The application further provides an electronic device, comprising a memory for storing a computer program, and a processor for executing the computer program to implement the steps of the positioning calibration method of any of the surface mount devices.

[0010] The application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of the positioning calibration method of any of the surface mount devices.

[0011] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the positioning calibration method of any of the surface mount devices.

[0012] According to the application, when the first position of the pad on the circuit board and the second position of the element pin of the element to be mounted are identified by using the image recognition model, the corresponding confidence is recorded, when the first position and the second position are matched and calculated, the position transformation calculation of the matched pad and element pin in the current iteration is performed, and the position error of the transformed position is calculated in combination with the confidence, so that the final matching result of the pad and the element pin and the corresponding final spatial mapping parameter are output after the first iteration calculation condition is reached, the influence of the low-confidence position detection result on the spatial mapping parameter calculation can be effectively reduced, the stability and reliability of the final spatial mapping parameter are ensured, the anti-interference ability is stronger than that of the traditional position error calculation, and the recognition interference caused by different environmental conditions, irregular equipment placement, irregular element shape and point occlusion can be better adapted, so that the accuracy of the positioning and matching of the high surface mount device is improved. BRIEF DESCRIPTION OF DRAWINGS

[0013] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0014] Figure 1 A flowchart of a positioning calibration method of a surface mount device provided for the embodiments of the application;

[0015] Figure 2 A structural schematic diagram of a positioning calibration system of a surface mount device provided for the embodiments of the application;

[0016] Among them, 201 is a camera system, and 202 is a detection device. DETAILED DESCRIPTION

[0017] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0018] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0019] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0020] In the visual positioning calibration process of the surface mount device, a camera is used to take photos of the circuit board and the photos of the components to be mounted, and the photos are input into an image recognition model to obtain the spatial coordinates of the pads on the circuit board and the spatial coordinates of the component pins of the components to be mounted, and a spatial mapping relationship between the two is established to realize accurate automatic mounting.

[0021] However, in actual application, there are various unfavorable conditions that affect the accuracy of the positioning and matching of the pads and the component pins.

[0022] Firstly, under different environmental light conditions, especially in the presence of metal reflection or shadow, the traditional single light source imaging is difficult to provide stable image quality, resulting in blurred or lost key details in the image, thereby affecting the subsequent image recognition and positioning accuracy.

[0023] At the same time, for the pads and component pins with irregular shapes or placed at different angles, the traditional target detection method cannot provide high enough accuracy. This means that the system may not be able to accurately identify the positions of the pads and component pins, especially when dealing with complex shapes and layouts.

[0024] In addition, key point detection is prone to false detection or local occlusion: the traditional method is prone to false detection or local occlusion when detecting key points, resulting in inaccurate final spatial mapping parameters. For example, in some cases, the system may mistakenly identify non-key points as key points, or miss the real key points due to partial occlusion.

[0025] To cope with the above adverse conditions, improve the positioning matching accuracy of the surface mount device, the application provides a positioning calibration method, device, medium and product of a surface mount device, by using an image recognition model to identify the first position of the pads on the circuit board and the second position of the component pins of the component to be mounted, the corresponding confidence is also recorded, when the first position and the second position are matched and calculated, the iterative calculation is performed, the position transformation calculation of the matched pads and component pins in the current iteration is performed, and the position error after the transformation is calculated combined with the confidence, so that the final matching result of the pads and component pins and the corresponding final spatial mapping parameters are output after the first iteration calculation condition is reached, which can effectively reduce the influence of low confidence position detection results on spatial mapping parameter calculation, ensure the stability and reliability of the final spatial mapping parameters, and has stronger anti-interference ability compared with traditional position error calculation, and can better adapt to identification interference caused by different environmental conditions, irregular equipment placement, irregular component shape, point occlusion and the like, thereby improving the positioning matching accuracy of the high surface mount device.

[0026] Figure 1 A flowchart of a positioning calibration method of a surface mount device provided by the embodiment of the application is shown in the figure. Figure 2 A structural schematic diagram of a positioning calibration system of a surface mount device provided by the embodiment of the application is shown in the figure.

[0027] As shown in the figure, the positioning calibration method of the surface mount device provided by the embodiment of the application can include: S101: acquiring a circuit image of a circuit board and a component image of a component to be mounted. Figure 1

[0028] S102: using an image recognition model to respectively identify the circuit image and the component image, to obtain the first position of the pads on the circuit board and the first confidence, and the second position of the component pins of the component to be mounted and the second confidence.

[0029] S103: entering iterative calculation, in the current iteration, matching the pads and the component pins, calculating the spatial mapping parameters according to the matched pairs of first positions and second positions, performing position transformation calculation on the matched first positions and second positions according to the spatial mapping parameters, and calculating the position error after the transformation according to the first confidence and / or the second confidence, until the first iteration end condition is reached, outputting the final matching result of the pads and the component pins and the corresponding final spatial mapping parameters.

[0030] ​In the embodiments of the present invention, pads refer to metal contact points on a circuit board for soldering surface mount components (such as chip resistors, chip capacitors, etc.). These pads are specially designed for component pins to ensure that the components can be properly fixed on the circuit board and achieve electrical connection. For example, the pins of components such as chip resistors and chip capacitors need to be aligned with the pads on the circuit board and soldered.

[0031] The positioning and calibration method of the surface mount device provided by the embodiment of the present invention can be applied to the following Figure 2 The system shown in FIG. 1 mainly includes a camera system 201 and a detection device 202. The camera system 201 is used to acquire image data, and the detection device 202 is used to locate and match key points based on the image data. The camera system 201 may include an image acquisition module, an image enhancement processing module, and a compensation control module. The detection device 202 may include a key point detection module, a graph structure modeling and optimization module, and a spatial mapping parameter estimation module.

[0032] In an embodiment of the present invention, the types of key points include solder pads and component pins. The positioning and calibration task of the surface mount equipment requires accurately establishing a spatial mapping relationship between the spatial coordinates of the solder pads and the spatial coordinates of the component pins they match, so that the machine can grab the components to be mounted and realize automatic mounting.

[0033] For S101, in the positioning and calibration task of the surface mount equipment, the circuit board is placed on a bracket or fixture, and the components to be mounted are placed on another bracket or tray. The camera is used to capture the circuit image of the circuit board and the component image of the components to be mounted respectively.

[0034] For S102, a pre-trained image recognition model can be used to perform image recognition on the circuit image of the circuit board and the component image of the component to be mounted, respectively, to identify the position of the pad and the position of the component pin from the circuit image, and to use the image recognition model to output the confidence level corresponding to the position recognition result.

[0035] For S103, the random sampling consensus algorithm (RANSAC) can be used to perform matching calculations on pads and component pins.

[0036] In each iteration of the iterative calculation, the solder pads and the component pins can be randomly matched to obtain a key point pair (a pair of matched solder pad and component pin). A set of key point pairs (such as 3 pairs) are randomly selected to calculate the spatial mapping parameters of the current iteration, that is, the transformation parameters used to map the spatial coordinates of the solder pads and the spatial coordinates of the component pins. Then, for each key point pair of the current iteration, the position of one key point is transformed using the spatial mapping parameters. It can be understood that if the spatial mapping parameters can accurately describe the relationship between the spatial coordinates of the solder pads and the spatial coordinates of the component pins, the transformed key point should coincide with the position of the other key point in the key point pair. In actual situations, the transformed key point may have an error with the position of the other key point in the key point pair, which may be caused by inaccurate position recognition results of the solder pads or the component pins, may be caused by unreasonable matching of the solder pads and the component pins, or may be caused by inappropriate selection of the key point pairs for calculating the spatial mapping parameters. For the error caused by the first reason, in the embodiment of the present application, the confidence (the first confidence and / or the second confidence) corresponding to the position recognition result output by the image recognition model in S102 is used as a weight, that is, the position error calculated in S103 is the result of weighting the actual position error with the confidence.

[0037] Therefore, when calculating the position error in the current iteration, the influence of the key point with high confidence in the image recognition link on the matching calculation error is increased, and the influence of the key point with low confidence in the image recognition link on the matching calculation error is reduced, that is, the influence of the low-confidence position detection result on the calculation of the spatial mapping parameters is reduced, thereby ensuring the stability and reliability of the final spatial mapping parameters.

[0038] After the iterative calculation reaches the first iteration end condition, the optimal matching result is selected from each iteration as the final matching result of the solder pads and the component pins, and the corresponding spatial mapping parameters are obtained as the final spatial mapping parameters.

[0039] The first iteration end condition can be reaching a first preset number of iterations, or the position error of the current iteration satisfying a preset error condition.

[0040] The positioning calibration method of the surface mounting device provided by the embodiment of the present application can effectively reduce the influence of low-confidence position detection results on the calculation of the spatial mapping parameters, ensure the stability and reliability of the final spatial mapping parameters, and has stronger anti-interference ability compared with the traditional position error calculation, and can better adapt to recognition interference caused by different environmental conditions, irregular device placement, irregular component shape, and point occlusion, thereby improving the accuracy of the positioning and matching of the high surface mounting device.

[0041] On the basis of the above-mentioned embodiments, in the positioning calibration method of the surface mounting device provided by the embodiment of the present application, in order to solve the problem that the image quality is unstable due to environmental conditions, the circuit image of the circuit board and the component image of the component to be mounted in S101 can include: acquiring an initial image shot by a camera, calculating an image quality parameter of the initial image; if the image quality parameter of the initial image meets a second threshold condition, the initial image enters the step of being recognized by the image recognition model; if the image quality parameter of the initial image does not meet the second threshold condition, the initial image is enhanced to obtain an enhanced image; calculating the image quality parameter of the enhanced image; if the image quality parameter of the enhanced image meets the second threshold condition, the enhanced image enters the step of being recognized by the image recognition model; if the image quality parameter of the enhanced image does not meet the second threshold condition, the initial image shot by the camera is reacquired, and the step of calculating the image quality parameter of the initial image is entered; wherein the initial image includes the circuit image and the component image.

[0042] In the embodiment of the present application, for the circuit board and the component to be mounted, multiple source images can be collected to solve the problem that a single light source imaging is difficult to provide stable image quality. The initial image shot by the camera can include: acquiring visible light images, polarization images and near-infrared images shot by a synchronous trigger visible light camera, a polarization camera and a near-infrared camera; performing fusion processing on the visible light images, the polarization images and the near-infrared images to obtain the initial image.

[0043] In a specific implementation, a three-channel imaging platform composed of a visible light camera, a polarization camera and a near-infrared camera can be arranged on a surface mount device operation platform. The three-channel imaging platform acquires images of a circuit board and a component to be mounted by a synchronous triggering mode, and obtains respective visible light images, polarization images and near-infrared images. The visible light images are used to obtain color and geometric contour information, the polarization images are used to extract surface reflection direction characteristics, and the near-infrared images are used to penetrate packaging materials and identify hidden structures.

[0044] To evaluate the image quality of the visible light image, an overall edge sharpness function is defined, and the expression can be:

[0045] ;

[0046] wherein, represents the average value of the gradient amplitudes of all pixels in the region, and represents the overall edge sharpness; represents a region of interest in which the key point is located in the visible light image, represents the total number of pixels in the region R, represents the gradient of the visible light image in the x direction, represents the gradient of the visible light image in the y direction, represents the visible light image.

[0047] To evaluate the effect of the polarization image in suppressing the reflection of the metal pad, gradient analysis is performed on the polarization image, and an image edge sharpness function is defined, and the expression can be:

[0048] ;

[0049] wherein E represents the edge sharpness value of the key point region in the polarization image, represents the gradient of the polarization image in the x direction, represents the gradient of the polarization image in the y direction. The greater E is, the clearer the edge is, and can be used to quantify the reflection suppression capability.

[0050] To further determine whether the near-infrared image is suitable for key point recognition in the current scene, the spectral response of the near-infrared image is analyzed, and a signal-to-noise ratio evaluation factor is defined, and the expression can be:

[0051] ;

[0052] wherein, represents the spectral response intensity of the near-infrared image at the wavelength , , represents the main frequency range of the useful signal in the near-infrared image, , R represents a signal-to-noise ratio evaluation factor of the near-infrared image.

[0053] The three types of images are weighted and fused to generate a high-quality initial image, and the expression is:

[0054]

[0055] wherein, is a weight coefficient of the visible light image, is an output value of an edge definition function of the visible light image; is a weight coefficient of the polarization image enhancement term, is a nonlinear gain adjustment factor of the polarization image, and E is an output value of an image edge definition function of the polarization image; is a weight coefficient of the near-infrared image, and R is a signal-to-noise ratio evaluation factor of the near-infrared image.

[0056] In the embodiment of the present application, the image quality parameter of the initial image can be calculated by the following formula:

[0057]

[0058] wherein, Q represents an image quality parameter of the initial image, represents a contrast weight coefficient, and C represents an image contrast, represents a uniformity weight coefficient, and U represents an image uniformity.

[0059] By setting a three-channel imaging platform to collect multi-modal image data, the visual recognition problems of the surface-mounted device under complex lighting conditions, such as pad reflection and packaging shielding, can be effectively solved. The polarization image is evaluated by gradient analysis and edge definition function to suppress the reflection of the metal surface. The near-infrared image is evaluated by a signal-to-noise ratio evaluation factor to determine its ability to penetrate the packaging material, so as to ensure that the image quality is controllable and evaluable. The image quality is optimized by weighted fusion and image quality comprehensive evaluation function, and a high-quality, stable and reliable input basis is provided for subsequent key point detection.

[0060] In some other optional embodiments of the present application, after acquiring multi-source images, such as visible light images, polarization images and near-infrared images, the images can not be fused, but the visible light images, polarization images and near-infrared images of the circuit board and the to-be-mounted element are respectively used for image recognition and matching calculation in subsequent steps, and the matching results of the three channels are fused to obtain the matching results and the spatial mapping parameters.

[0061] ​​In the embodiment of the present application, the initial image is subjected to enhancement processing to obtain an enhanced image, which can include: normalizing the image features of the initial image to obtain a normalized image; extracting image features of multiple scales from the normalized image and performing weighted fusion calculation on the image features of multiple scales to obtain a first image; performing local enhancement processing on the first image according to the image features of the first image, the minimum gray value in the local region of the first image, the maximum gray value in the local region of the first image, and the target gray level number, to limit the output image features to not exceed the gray level range, to obtain an enhanced image.

[0062] In specific implementation, multi-scale Retinex enhancement algorithm and adaptive histogram equalization (CLAHE) can be used to enhance the contrast of the image, thereby generating a high-quality homographic image.

[0063] The illumination normalization function is defined, and the expression can be:

[0064] ;

[0065] wherein, is a two-dimensional Gaussian kernel with a standard deviation of , and * represents a convolution operation, is a small constant to prevent division by zero, is the normalized image.

[0066] The multi-scale Retinex enhancement algorithm is used to extract multi-scale features from , and enhance the contrast of image details, and the expression of the enhanced image is defined as:

[0067] ;

[0068] wherein, is the number of scales, is the weighting coefficient corresponding to the th scale, satisfying , is the standard deviation of the Gaussian kernel of the th scale, is a bias constant used to avoid taking the logarithm of zero, is the first image obtained after multi-scale Retinex enhancement.

[0069] The adaptive histogram equalization algorithm is used to perform local enhancement processing on , and the expression can be:

[0070] ;

[0071] wherein, is the minimum gray value in the local region, is the maximum gray value in the local region, is the target number of gray levels, The function is used to limit the output value not to exceed the gray level range.

[0072] An image quality feedback mechanism is introduced to determine whether the enhanced image meets the needs of subsequent key point detection, and the expression is:

[0073] ;

[0074] wherein, is the contrast of the enhanced image, defined as the difference between the maximum gray value and the minimum gray value, is the uniformity of the enhanced image, defined as the inverse of the gray variance in the local region, , are the weight coefficients of contrast and uniformity respectively, is the quality index of the enhanced image.

[0075] A second threshold is set If , the image acquisition stage is returned to adjust the imaging parameters and collect a new image; otherwise, the enhanced image is output as the input of image recognition.

[0076] The positioning calibration method of the surface mount device provided by the embodiment of the application combines light normalization processing and a multi-scale Retinex enhancement algorithm, which can significantly improve the image detail contrast without introducing excessive noise, and the CLAHE algorithm further enhances the gray distribution uniformity of the local region. After introducing the image quality feedback mechanism, the method can dynamically adjust the image acquisition parameters according to the current image quality index, forming a closed-loop image preprocessing process, avoiding low-quality images from entering the subsequent processing link, thereby ensuring the stability and reliability of the entire vision system, improving the calibration accuracy and system robustness.

[0077] On the basis of the above-mentioned embodiment, in the positioning calibration method of the surface mount device provided by the embodiment of the application, the image recognition model can adopt an improved YOLOv7 network model, and the improved YOLOv7 network model is a deformable convolution module introduced in the backbone network Backbone part on the basis of the standard YOLOv7, which is used to improve the perception ability of irregular shape targets such as pads and component pins.

[0078] The deformable convolution operation is defined, and the expression is:

[0079] ;

[0080] wherein, represents the response value of position p in the output feature map, and K is the number of convolution kernel sampling points, is the weight of the th sampling point, is the input feature map, is the standard convolution sampling offset, is the learnable spatial offset generated by an additional convolution layer.

[0081] In the network header part, a multi-task output structure is adopted to simultaneously predict target categories, bounding box parameters and key point coordinates. The key point regression part is defined as:

[0082] ;

[0083] wherein, is the center coordinate of the target bounding box, is the width and height of the target bounding box, is the target rotation angle, is the predicted coordinate of the th key point in the th target, is a key point mapping function, which is realized by using an affine transformation combined with a normalized offset. The i th target is the i th element or the i th pad, depending on the type of the object currently analyzed. The key points of the element refer to the element pins, and the key points of the pad can refer to the center points of the pad.

[0084] For the two types of targets, pad and element pin, the improved YOLOv7 network model outputs the category information, bounding box parameters (including position and size) and a plurality of key point coordinates of each target, in addition to the key point confidence, which represents the reliability of the key point recognition. The information collectively constitutes the result of target detection, providing a basis for subsequent analysis and processing.

[0085] In the embodiment of the present application, a pre-trained improved YOLOv7 network model can be used for image recognition. In addition, the embodiment of the present application also provides a training method of an image recognition model. The training steps of the image recognition model can include: inputting an image sample into the image recognition model to output key point type recognition results and key point position recognition results of a plurality of key points on the image sample; calculating a classification loss value according to the key point type recognition results and corresponding true values; calculating a position loss value according to the key point position recognition results and corresponding true values; calculating a geometric consistency loss value according to the key point position recognition results of the plurality of key points; determining an image recognition loss value according to the classification loss value, the position loss value and the geometric consistency loss value; updating model parameters of the image recognition model according to the image recognition loss value until a third iteration end condition is reached.

[0086] In training the image recognition model, the loss function can be:

[0087] ;

[0088] wherein, is an image recognition loss value, is a classification loss value, is a coefficient of a position loss value, is the position loss value, is a coefficient of a geometric consistency loss value, is the geometric consistency loss value.

[0089] The classification loss is used to measure the difference between the target category predicted by the model and the real target category, and in the multi-task output structure of the image recognition model adopted in the embodiment of the present application, the classification loss can be calculated using the cross-entropy loss function.

[0090] The position loss value can be a bounding box regression loss, which is used to measure the difference between the bounding box parameters predicted by the model and the real bounding box parameters, and can use the mean square error loss.

[0091] To improve the key point positioning accuracy, the embodiment of the present application introduces a geometric consistency loss function to constrain the relative position relationship between key points. According to the key point position recognition results of multiple key points, the geometric consistency loss value can be calculated, which can include: calculating the first product of the difference value of the key point position recognition results of two key points on the image sample input to the current iterative training of the image recognition model and the rotation matrix rotated by the first angle around the target center of the image sample; calculating the first difference value of the true value corresponding to the two key point position recognition results; calculating the two-norm of the second difference value of the first product minus the first difference value to obtain a first result; calculating the mean value of the first result corresponding to each image sample of the current iterative training of the image recognition model to obtain the geometric consistency loss value.

[0092] The geometric consistency loss function can be defined as:

[0093] ;

[0094] wherein, is the total number of image samples, is the rotation matrix of the i-th image sample rotated by the first angle around the target center, , , is the position prediction result of two predicted key points on the i-th image sample, , is the true value coordinate corresponding thereto.

[0095] After the above processing, the target category of each pad and component pin, the bounding box parameter, and the coordinates of several key points are output, and the key point confidence is attached, indicating the reliability of the key point identification.

[0096] The output key point data will be used as input data for the next stage for subsequent matching optimization.

[0097] In the surface mount device positioning calibration method provided by the embodiment of the application, the improved YOLOv7 network model is used as the image recognition model, the deformable convolution module is introduced, the perception ability for irregular-shaped pads and component pins is effectively enhanced, the model can adapt to target recognition tasks under different angles and deformations, and the introduction of the geometric consistency loss function strengthens the spatial constraint relationship between key points, improves the structural consistency of the key point regression result, and the method not only improves the key point detection precision, but also provides high-confidence data support for subsequent matching calculation, which is an important prerequisite for realizing high-precision spatial mapping.

[0098] On the basis of the above-mentioned embodiment, the position recognition result of the pad can also be corrected before entering the matching calculation.

[0099] The surface mount device positioning calibration method provided by the embodiment of the application can further include: before entering the iterative calculation, establishing a graph structure according to the first positions of the pads on the circuit image, the pads being nodes in the graph structure, the relationships between the pads being edges between the nodes in the graph structure, and the node features of the nodes including at least the first positions; for each node, calculating the graph attention coefficients between the node and the neighbor nodes of the node based on the graph attention network respectively, and updating the node features of the node according to the graph attention coefficients; determining the corrected first positions from the updated node features, and entering the iterative calculation with the corrected first positions; wherein the neighbor nodes are nodes connected to the node through edges; if the distance between the first positions corresponding to two nodes satisfies the edge connection condition, there is an edge connection between the two nodes.

[0100] In the target detection stage, the key point coordinates of the pads and component pins can be obtained, but due to various factors (such as image noise, occlusion, etc.), there are certain errors in these original detection results. In the embodiment of the application, the geometric consistency constraint term based on the graph structure is introduced, and the graph attention network (GAT) is used to learn the neighborhood dependency relationship between nodes. The principle of the graph attention network for correcting the coordinates mainly lies in that it can capture and model the complex relationship and dependency between nodes, better understand the position and role of each key point in its local environment, and thus correct the original detection results, so as to output more accurate key point coordinates.

[0101] In the embodiments of the present application, after the first positions of the pads (key points) on the circuit image are identified by the image recognition model, all the pad key points can be regarded as nodes in the graph, and an initial graph structure can be constructed. The expression can be:

[0102] ;

[0103] wherein, represents a set of nodes in the graph, represents a set of edges, and the existence of an edge is determined by the spatial distance between nodes.

[0104] In the embodiments of the present application, the distance between the first positions corresponding to two nodes satisfies the edge connection condition, which can include: the Euclidean distance between the first positions corresponding to two nodes is less than a maximum connection distance threshold; the maximum connection distance threshold is determined according to the pad arrangement density of the circuit board.

[0105] That is, the edge connection condition can be expressed as: . Wherein, , are two-dimensional coordinates of nodes, represents the Euclidean distance, is a set maximum connection distance threshold, which can be dynamically adjusted according to the pad arrangement density.

[0106] In the graph structure, is defined as the maximum connection distance threshold, and its physical meaning is a standard for judging whether there is a direct connection between two nodes. In actual application, such as the arrangement of pads on the circuit board, can be dynamically adjusted according to the pad arrangement density to adapt to different layout situations.

[0107] When the Euclidean distance (i.e. the straight-line distance of their two-dimensional coordinates) between two nodes is less than , it can be considered that the two nodes are close enough in space so that there may be some form of interaction or dependence between them. This connection may be physical (such as electrical connection in a circuit) or logical (such as data flow or control signal transmission). By setting , meaningful node connections can be effectively screened out when constructing the graph structure, avoiding the introduction of too much noise or irrelevant links, thereby improving the accuracy and efficiency of the graph model.

[0108] In the scenario of circuit image processing, the feature vector of a node can include but is not limited to visual features such as the position, shape, size, color of the node, as well as semantic information such as the category of the node and its connection relationship with other nodes.

[0109] The two-dimensional coordinates of the key points are an important part of the node feature vector, which directly reflects the position information of the node in the image. When constructing the graph structure, the two-dimensional coordinates of the nodes are not only used to calculate the Euclidean distance between the nodes to determine whether the condition is met , but also as input features involved in the subsequent calculation of the graph attention coefficient.

[0110] To enhance the information interaction ability between the nodes of the graph, a graph attention network is introduced on the graph structure, wherein a graph attention coefficient function is defined, and the expression is as follows:

[0111] ;

[0112] wherein, , are the feature vectors of the node i and the node j respectively, W is a learnable linear transformation matrix, a is a parameter vector in the attention mechanism, || represents a vector splicing operation, represents a neighbor node set of the node , represents the attention weight of the node j to the node i.

[0113] The feature representation of each node in the graph is updated, wherein a node feature updating function is defined, and the expression is as follows:

[0114] ;

[0115] wherein, is the updated node feature, is a ReLU activation function.

[0116] A geometric consistency constraint term based on the graph structure is introduced to correct the original detection result of the pad key point and output the corrected first position.

[0117] In the positioning calibration method of the surface mounting device provided in the embodiment of the application, the pad key points are constructed as graph nodes, and the graph structure is established based on the spatial topological relationship, which is helpful to understand the relative position relationship between the pads from a global perspective. The graph attention network learns the neighborhood dependency relationship between the nodes, effectively corrects the mis-matched key points, and improves the overall consistency and robustness of the registration. In addition, the geometric consistency constraint term further enhances the spatial rationality of the key point matching, so that the system can still maintain a high matching accuracy rate in the face of local occlusion or mis-detection, and provides a more reliable key point set for the calculation of subsequent spatial mapping parameters.

[0118] In the embodiment of the present application, a pair of key points refers to a pad key point and a component pin. Specifically, the pad key point is a specific position on the circuit board for soldering the component pin, which has clear geometric features and coordinates. The component pin key point is the pin position on the component to be mounted, which also has clear geometric features and coordinates.

[0119] When performing spatial mapping and transformation, it is necessary to find the correspondence between the pad key point and the component pin key point, i.e. "each pair of key points". Through this correspondence, a spatial mapping model from the component pin to the pad can be constructed, thereby realizing accurate component mounting.

[0120] Then, based on the above embodiment, in the positioning and calibration method of the surface mounting device provided in the embodiment of the present application, the calculation of the position error after transformation according to the first confidence and / or the second confidence in S103 until the first iteration end condition is reached, and the output of the final matching result of the pad and the component pin and the corresponding final spatial mapping parameter can include: for each pair of first position and second position, calculating the first position error of the third position calculated by the position transformation of the second position using the spatial mapping parameter and the first position; determining the first weight of the first position error according to the first confidence and / or the second confidence; calculating the position error of the current iteration by weighting the first position error using the first weight; until the first iteration end condition is reached, determining the iteration with the minimum position error in each iteration, and taking the matching relationship of the pad and the component pin in the iteration as the final matching result, and taking the spatial mapping parameter obtained in the iteration as the final spatial mapping parameter.

[0121] In specific implementation, the weighted least squares method can be used to estimate the optimal spatial mapping parameter, and the weight factor is determined by the confidence, and the random sample consensus algorithm (RANSAC) is combined to remove the mis-matching points to obtain the spatial mapping matrix.

[0122] Define the spatial transformation model, for each pair of key points, construct the error function, the expression is:

[0123] ;

[0124] Where the confidence of the key point is used as the weight factor, so that the key point with high confidence has a greater proportion in the parameter estimation process; is the component pin coordinate transformed based on the spatial mapping matrix, is the pad key point coordinate.

[0125] Solve the minimization problem of the error function , and obtain the optimal spatial mapping parameter.

[0126] Error function The purpose is to measure the pros and cons of affine transformation parameters A and translation vector t, so that the element pin key points after transformation are as close as possible to the corresponding pad key points.

[0127] By solving the minimum of , the optimal space mapping model can be obtained, so as to realize accurate component mounting.

[0128] In the embodiment of the application, in order to eliminate the matching of the key points, the random sample consensus algorithm (RANSAC) can be used to eliminate the matching points. The space mapping parameters calculated according to the matched pairs of first positions and second positions in S103 can include: randomly selecting pairs of first positions and second positions to calculate initial space mapping parameters; using the initial space mapping parameters to calculate the position transformation of all matched first positions and second positions, and calculating the key point position error after transformation; determining that a pair of first positions and second positions with a key point position error less than a first threshold value are inliers (the rest are outliers); repeating the second iteration times, recording the maximum inlier set in each iteration and the corresponding initial space mapping parameters; selecting the initial space mapping parameters corresponding to the largest number of inliers as the space mapping parameters.

[0129] In each iteration of the random sample consensus algorithm, the step of randomly selecting key point pairs is repeated until the maximum inlier set of the current iteration is determined. The second iteration times can be 100 times.

[0130] When randomly selecting key point pairs, a minimum number of key point pairs can be selected, that is, the minimum number of key point pairs required to uniquely determine the affine transformation parameters. For example, for affine transformation in two-dimensional space, at least 3 pairs of non-collinear key points are required to uniquely determine the transformation parameters, because affine transformation contains 6 degrees of freedom (2 translations, 1 rotation, 1 scaling and 2 shears), and each pair of key points can provide 2 constraint conditions (x and y coordinates), so at least 3 pairs of key points are required to meet the 6 constraint conditions.

[0131] In the embodiment of the application, the random sample consensus algorithm is used to eliminate the matching points in the positioning and calibration task of the surface mounting equipment, and the space mapping parameters containing the largest number of inliers are selected as the global optimal solution, so as to further ensure the stability and reliability of the space mapping parameters, improve the anti-interference ability, and especially suitable for industrial scenes with outliers or multi-pose changes, which provides a guarantee for realizing high-precision space mapping.

[0132] ​Based on the above embodiments, the positioning calibration method of the surface mount device provided by the embodiment of the present invention may also include: calculating the posture deviation based on the final space mapping parameters and the standard space mapping parameters; inputting the posture deviation into the motion control model of the camera to obtain the calibration parameters of the camera.

[0133] Among them, calculating the posture deviation based on the final spatial mapping parameters and the standard spatial mapping parameters can include: training a prediction model based on the error of the final spatial mapping parameters compared with the standard spatial mapping parameters and the error of the historical final spatial mapping parameters compared with the standard spatial mapping parameters; and using the prediction model to predict the posture deviation at the next moment.

[0134] In an embodiment of the present invention, an LSTM time series can be used to train historical calibration error data to predict the posture deviation at the next moment, and the predicted value can be fed back to the motion control platform to drive the camera or platform to perform dynamic compensation actions to complete closed-loop online calibration.

[0135] In the specific implementation, the current spatial mapping matrix is ​​extracted from each positioning calibration task and compared with the standard reference transformation matrix to calculate the pose deviation at that moment. The expression is:

[0136] ;

[0137] in, Indicates the current calibration time, represents the Frobenius norm of the matrix difference, Indicates the The overall pose deviation in the calibration, Represents the spatial mapping matrix at the current moment (i.e., the t-th calibration task), Represents the standard reference transformation matrix, which is a spatial mapping matrix in an ideal state that is predetermined or determined after multiple calibrations. It represents the positional relationship between targets such as pads and component pins under ideal conditions. 、 These two parameters act on each image acquisition device at the current moment.

[0138] The standard reference transformation matrix represents the ideal positional relationship between pads and target components, such as component pins. This ideal state is determined during the initial calibration phase or after multiple calibrations, and reflects the geometric alignment of the device under optimal operating conditions. When setting the standard reference transformation matrix, it is assumed that the placement of the circuit board and the initial positions of the components to be mounted are fixed. This is because a reference point is needed to measure deviations in actual operation. This does not mean that these positions will always remain unchanged in practice, but rather provides a theoretically optimal alignment state as a comparison benchmark.

[0139] The pose deviation refers to the actual space mapping matrix at the current moment Transformation moment with standard reference To address this posture deviation, an embodiment of the present invention uses an LSTM time series model to train historical calibration error data, predict the posture deviation at the next moment, and feed the predicted value back to the motion control platform, driving the camera or platform to perform dynamic compensation actions, completing closed-loop online calibration. In this way, the posture of the component can be adjusted in real time to ensure its accurate alignment with the pad, improving placement accuracy and production efficiency.

[0140] In this embodiment of the present invention, a time series prediction model based on long short-term memory network is constructed to learn the dynamic law of posture drift during the operation of surface mount equipment. The trained LSTM model is used to infer the current and historical posture deviation sequence and output the predicted deviation at the next moment; the predicted deviation is converted into the predicted deviation. Convert to specific mechanical adjustment instructions , sent to the motion control platform of the surface mount device, the expression is:

[0141] ;

[0142] in, is the gain coefficient matrix, which is set according to the response characteristics of the mechanical system. is the compensation instruction sent to the controller.

[0143] The above instructions can directly act on the X / Y / Z-axis motor or image acquisition module of the surface mount device to achieve online closed-loop calibration.

[0144] In the positioning calibration method for surface mount equipment provided in an embodiment of the present invention, the LSTM time series model can predict the posture deviation trend that may occur in the surface mount equipment in the future by learning historical calibration error data, thereby realizing early compensation rather than ex post correction. The closed-loop online calibration mechanism effectively alleviates the problem of accumulated positioning errors caused by factors such as thermal drift and mechanical vibration, and improves the positioning stability of the equipment under long-term operation. By converting the predicted deviation into actual mechanical control instructions, the method can complete adaptive calibration without human intervention, significantly improving the automation level and production efficiency of surface mount equipment.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0146] The embodiment of the present application also provides a positioning calibration device of a surface mount device, which can comprise: an image acquisition module configured to acquire a circuit image of a circuit board and an element image of a to-be-mounted element; a key point detection module configured to identify the circuit image and the element image by using an image recognition model to obtain a first position and a first confidence of a pad on the circuit board and a second position and a second confidence of an element pin of the to-be-mounted element; and the key point detection module is configured to enter an iterative calculation, in a current iteration, match the pad and the element pin, calculate a spatial mapping parameter according to the matched pairs of first positions and second positions, perform position transformation calculation on the matched first positions and second positions according to the spatial mapping parameter, and calculate a position error of the transformed positions according to the first confidence and / or the second confidence, until a first iteration end condition is reached, and output a final matching result of the pad and the element pin and a corresponding final spatial mapping parameter.

[0147] In the embodiment of the present application, the key point detection module calculates the spatial mapping parameter according to the matched pairs of first positions and second positions, which can comprise: randomly selecting pairs of first positions and second positions to calculate an initial spatial mapping parameter; performing position transformation calculation on all matched first positions and second positions by using the initial spatial mapping parameter, and calculating the transformed key point position error to determine that a pair of first position and second position with a key point position error less than a first threshold value is an inlier; repeating a second iteration number of times, recording a maximum inlier set in each iteration and a corresponding initial spatial mapping parameter; and selecting the initial spatial mapping parameter corresponding to the largest number of inliers as the spatial mapping parameter.

[0148] In the embodiment of the present application, the key point detection module calculates the position error of the transformed positions according to the first confidence and / or the second confidence until the first iteration end condition is reached, and outputs the final matching result of the pad and the element pin and the corresponding final spatial mapping parameter, which can comprise: for each pair of first position and second position, calculating a first position error of a third position after position transformation calculation of the second position by using the spatial mapping parameter and the first position, determining a first weight of the first position error according to the first confidence and / or the second confidence; performing weighted calculation on the first position error by using the first weight to obtain a position error of the current iteration; until the first iteration end condition is reached, determining an iteration with the smallest position error in each iteration, taking the matching relationship of the pad and the element pin in the iteration as the final matching result, and taking the spatial mapping parameter obtained in the iteration as the final spatial mapping parameter.

[0149] In the embodiment of the present application, the training step of the image recognition model can comprise: inputting the image sample into the image recognition model, outputting the key point type recognition result and the key point position recognition result of the plurality of key points on the image sample; calculating the classification loss value according to the key point type recognition result and the corresponding true value; calculating the position loss value according to the key point position recognition result and the corresponding true value; calculating the geometric consistency loss value according to the key point position recognition result of the plurality of key points; determining the image recognition loss value according to the classification loss value, the position loss value and the geometric consistency loss value; updating the model parameters of the image recognition model according to the image recognition loss value until the third iteration end condition is reached.

[0150] In the embodiment of the present application, the geometric consistency loss value can be calculated according to the key point position recognition result of the plurality of key points, which can comprise: calculating the first product of the difference value of the key point position recognition result of two key points on the image sample inputted by the current iteration training of the image recognition model and the rotation matrix rotated by the first angle around the target center of the image sample; calculating the first difference value of the true value corresponding to the two key point position recognition results; calculating the two-norm of the second difference value of the first product minus the first difference value to obtain the first result; calculating the mean value of the first result corresponding to each image sample of the current iteration training of the image recognition model to obtain the geometric consistency loss value.

[0151] The positioning calibration device of the surface mount device provided by the embodiment of the present application can further comprise:

[0152] The graph structure modeling optimization module is configured to, before entering the iterative calculation, establish a graph structure according to the first positions of the pads on the circuit image, the pads being nodes in the graph structure, the relationships between the pads being edges between the nodes in the graph structure, and the node features of the nodes at least including the first positions; for each node, calculate the graph attention coefficients between the node and the neighbor nodes of the node based on the graph attention network respectively, and update the node features of the node according to the graph attention coefficients; determine the corrected first positions from the updated node features, and enter the iterative calculation with the corrected first positions; wherein the neighbor nodes are nodes connected to the node by edges; if the distance between the first positions corresponding to two nodes satisfies the edge connection condition, the two nodes are connected by an edge.

[0153] The distance between the first positions corresponding to the two nodes satisfying the edge connection condition can comprise: the Euclidean distance between the first positions corresponding to the two nodes being less than a maximum connection distance threshold; the maximum connection distance threshold being determined according to the pad arrangement density of the circuit board.

[0154] In the embodiment of the present application, the image acquisition module can comprise: an image collection module, configured to acquire an initial image captured by a camera, and calculate an image quality parameter of the initial image; an image enhancement processing module, configured to: if the image quality parameter of the initial image meets a second threshold condition, then enter a step of recognizing the initial image by using an image recognition model; if the image quality parameter of the initial image does not meet the second threshold condition, then perform enhancement processing on the initial image to obtain an enhanced image, calculate an image quality parameter of the enhanced image, if the image quality parameter of the enhanced image meets the second threshold condition, then enter the step of recognizing the enhanced image by using the image recognition model; and if the image quality parameter of the enhanced image does not meet the second threshold condition, then re-acquire the initial image captured by the camera, and enter the step of calculating the image quality parameter of the initial image. The initial image comprises a circuit image and an element image.

[0155] In the embodiment of the present application, the image enhancement processing module performs enhancement processing on the initial image to obtain an enhanced image, which can comprise: performing normalization processing on image features of the initial image to obtain a normalized image; extracting image features of multiple scales from the normalized image, and performing weighted fusion calculation on the image features of the multiple scales to obtain a first image; and performing local enhancement processing on the first image according to image features of the first image, a minimum gray value in a local region of the first image, a maximum gray value in the local region of the first image, and a target gray level number, to limit the output image features to be within a gray level range, to obtain the enhanced image.

[0156] In the embodiment of the present application, the image collection module acquires an initial image captured by a camera, which can comprise: acquiring a visible light image, a polarization image and a near-infrared image captured by a synchronous trigger visible light camera, a polarization camera and a near-infrared camera; and performing fusion processing on the visible light image, the polarization image and the near-infrared image to obtain the initial image.

[0157] The positioning calibration device of the surface mount device provided in the embodiment of the present application can further comprise: a compensation control module, configured to calculate a pose deviation amount according to the final space mapping parameter and the standard space mapping parameter, and input the pose deviation amount into a motion control model of the camera to obtain a calibration parameter of the camera.

[0158] In the embodiment of the present application, the compensation control module calculates a pose deviation amount according to the final space mapping parameter and the standard space mapping parameter, which can comprise: training a prediction model according to an error of the final space mapping parameter compared with the standard space mapping parameter and an error of a historical final space mapping parameter compared with the standard space mapping parameter; and predicting the pose deviation amount at the next moment by using the prediction model.

[0159] The features of the positioning calibration device of the surface mount equipment can refer to the related descriptions of the positioning calibration method of the surface mount equipment, and will not be repeated here.

[0160] The embodiments of the present application also provide an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above positioning calibration method embodiments of the surface mount equipment.

[0161] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to perform the steps in any of the above positioning calibration method embodiments of the surface mount equipment when executed.

[0162] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0163] The embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any of the above positioning calibration method embodiments of the surface mount equipment.

[0164] The embodiments of the present application also provide another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any of the above positioning calibration method embodiments of the surface mount equipment.

[0165] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0166] The positioning calibration method, device, medium and product of the surface mount device provided by the application are described in detail. The principles and implementation manners of the application are described by using specific examples in this paper, and the above description of the examples is only used to help understand the method of the application and its core idea. It should be pointed out that, for ordinary skilled persons in the technical field, some improvements and modifications can be made to the application without departing from the principles of the application, and these improvements and modifications also fall within the protection scope of the application.

Claims

1. A positioning and calibration method for a surface mount device, characterized in that: include: Acquire a circuit image of a circuit board and a component image of a component to be mounted; Using an image recognition model to respectively identify the circuit image and the component image, obtain a first position and a first confidence of a pad on the circuit board, and a second position and a second confidence of a component pin of the component to be mounted; Entering an iterative calculation, in the current iteration, matching the pad and the component pin, calculating spatial mapping parameters based on the matched multiple pairs of the first position and the second position, performing position transformation calculation on the matched first position and the second position based on the spatial mapping parameters, and calculating the transformed position error based on the first confidence level and / or the second confidence level, until the first iteration end condition is met, outputting the final matching result of the pad and the component pin and the corresponding final spatial mapping parameters; The transformed position error is calculated according to the first confidence level and / or the second confidence level until a first iteration end condition is reached, and a final matching result of the pad and the component pin and a corresponding final spatial mapping parameter are output, including: For each pair of the first position and the second position, calculating a first position error between a third position obtained by performing position transformation calculation on the second position using the spatial mapping parameters and the first position; determining a first weight of the first position error according to the first confidence level and / or the second confidence level; Performing weighted calculation on the first position error using the first weight to obtain the position error of the current iteration; Until the end condition of the first iteration is reached, the iteration with the smallest position error among the iterations is determined, and the matching relationship between the pad and the component pin is used as the final matching result, and the spatial mapping parameters obtained therein are used as the final spatial mapping parameters.

2. The positioning and calibration method of the surface mount device according to claim 1, characterized in that: Calculating a spatial mapping parameter based on the matched pairs of the first positions and the second positions includes: randomly selecting a plurality of pairs of the first position and the second position to calculate initial spatial mapping parameters; Performing position transformation calculation on all the matched first positions and second positions using the initial spatial mapping parameters, and calculating the position error of the key points after the transformation; Determine a pair of the first position and the second position whose position error of the key point is less than a first threshold as an inlier; Repeat the second iteration number, and record the maximum inlier point set and the corresponding initial space mapping parameters in each iteration; The initial spatial mapping parameters corresponding to the largest number of interior points are selected as the spatial mapping parameters.

3. The positioning and calibration method of the surface mount device according to claim 1, characterized in that: The training steps of the image recognition model include: Inputting an image sample into the image recognition model, and outputting key point type recognition results and key point position recognition results for a plurality of key points on the image sample; Calculate the classification loss value based on the key point type recognition result and the corresponding true value; Calculating a position loss value based on the key point position recognition result and the corresponding true value; Calculating a geometric consistency loss value based on the key point position recognition results of the plurality of key points; Determining an image recognition loss value according to the classification loss value, the position loss value, and the geometric consistency loss value; The model parameters of the image recognition model are updated according to the image recognition loss value until the third iteration end condition is reached.

4. The positioning and calibration method of the surface mount device according to claim 3, characterized in that: Calculating a geometric consistency loss value according to the key point position recognition results of the plurality of key points includes: For the image sample inputted into the current iterative training of the image recognition model, calculating a first product of a difference between key point position recognition results of two key points on the image sample and a rotation matrix rotated around a target center of the image sample by a first angle; Calculating a first difference between the true values ​​corresponding to the two key point position recognition results; Calculating a second norm of a second difference of the first product minus the first difference to obtain a first result; The mean of the first results corresponding to the image samples of the current iterative training of the image recognition model is calculated to obtain the geometric consistency loss value.

5. The positioning and calibration method of a surface mount device according to claim 1, wherein: Also includes: Before entering iterative calculation, a graph structure is established based on the first position of each of the pads on the circuit image, wherein the pads are nodes in the graph structure, and the relationships between the pads are edges between the nodes in the graph structure, and node features of the nodes include at least the first position; For each node, the graph attention coefficient between the node and its neighboring nodes is calculated based on the graph attention network, and the node feature of the node is updated according to the graph attention coefficient; Determine a revised first position from the updated node features, and enter iterative calculation based on the revised first position; Among them, neighbor nodes are nodes that have edge connections with the node; If the distance between the first positions corresponding to two nodes meets the edge connection condition, then an edge connection exists between the two nodes.

6. The method for positioning and calibrating a surface mount device according to claim 5, wherein: The distance between the first positions corresponding to the two nodes satisfies an edge connection condition, including: The Euclidean distance between the first positions corresponding to the two nodes is less than a maximum connection distance threshold; The maximum connection distance threshold is determined according to the pad arrangement density of the circuit board.

7. The positioning and calibration method of a surface mount device according to claim 1, wherein: Obtain circuit images of the circuit board and component images of the components to be mounted, including: Obtaining an initial image captured by a camera, and calculating image quality parameters of the initial image; If the image quality parameter of the initial image meets a second threshold condition, entering the step of recognizing using the image recognition model with the initial image; If the image quality parameter of the initial image does not meet the second threshold condition, performing enhancement processing on the initial image to obtain an enhanced image; calculating image quality parameters of the enhanced image; If the image quality parameter of the enhanced image meets the second threshold condition, the enhanced image is used to enter the step of image recognition model recognition; If the image quality parameter of the enhanced image does not meet the second threshold condition, reacquiring the initial image taken by the camera and entering the step of calculating the image quality parameter of the initial image; The initial image includes the circuit image and the component image.

8. The method for positioning and calibrating a surface mount device according to claim 7, wherein: Performing enhancement processing on the initial image to obtain an enhanced image includes: Normalizing the image features of the initial image to obtain a normalized image; Extracting image features at multiple scales from the normalized image, and performing weighted fusion calculation on the image features at multiple scales to obtain a first image; Based on the image features of the first image, the minimum grayscale value within the local area of ​​the first image, the maximum grayscale value within the local area of ​​the first image, and the target grayscale level, the first image is locally enhanced to limit the output image features to not exceed the grayscale range, thereby obtaining the enhanced image.

9. The method for positioning and calibrating a surface mount device according to claim 7, wherein: Get the initial image captured by the camera, including: Acquire visible light images, polarization images, and near-infrared images captured by a synchronously triggered visible light camera, polarization camera, and near-infrared camera; The visible light image, the polarization image, and the near-infrared image are fused to obtain the initial image.

10. The positioning and calibration method of a surface mount device according to claim 1, wherein: Also includes: Calculating a posture deviation according to the final space mapping parameters and the standard space mapping parameters; The posture deviation is input into a motion control model of a camera to obtain calibration parameters for the camera.

11. The method for positioning and calibrating a surface mount device according to claim 10, wherein: Calculating the posture deviation according to the final space mapping parameters and the standard space mapping parameters includes: training a prediction model based on an error of the final spatial mapping parameter compared to the standard spatial mapping parameter and an error of a historical final spatial mapping parameter compared to the standard spatial mapping parameter; The prediction model is used to predict the posture deviation at the next moment.

12. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method for positioning and calibrating a surface mount device as claimed in any one of claims 1 to 11 when executing the computer program.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the positioning and calibration method of the surface mount device according to any one of claims 1 to 11 are implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the positioning calibration method for a surface mount device according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Multi-layer circuit board drilling method and device based on machine vision

    CN120186892A

  • PCB processing deviation correction method and system based on visual calibration

    CN120431040A