PCB defect detection method and system based on AI vision

By acquiring and compensating for positioning and feature deviations in PCB inspection, corrected image data is generated, solving the problem of inaccurate inspection caused by image deviations in high-density, high-precision PCB inspection, improving inspection efficiency and accuracy, and reducing production costs.

CN120823208AActive Publication Date: 2025-10-21浙江君浩电子股份有限公司

Patent Information

Application Number
CN202511325547.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-17
Publication Date
2025-10-21
Estimated Expiration
2045-09-17

AI Technical Summary

Technical Problem

In high-density, high-precision PCB inspection scenarios, factors such as installation deviations of vision equipment, limitations in mechanical motion precision, and lens optical characteristics can cause shape distortion and size discrepancies in the PCB lines and pads in the images, resulting in inaccurate defect detection. This necessitates frequent manual re-inspection and calibration, reducing inspection efficiency and increasing production costs.

Method used

By acquiring the original image data and design parameters of the target PCB area captured by the first vision device, the positioning deviation and feature deviation are determined, deviation compensation processing is performed, and corrected image data is generated to improve detection accuracy.

Benefits of technology

It effectively avoids line shape distortion and size inaccuracy caused by shooting deviation, improves the stability and reliability of intelligent detection, and reduces the need for manual re-inspection and calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120823208A_ABST
    Figure CN120823208A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of PCB detection, and particularly relates to a PCB defect detection method and system based on AI vision, and the method comprises the steps: obtaining the original image data of a target PCB region shot by a first vision device, obtaining the design parameters of the target PCB region, and providing a reference for the subsequent analysis; according to the original image data and the design parameters of the target PCB area, determining a positioning deviation and a characteristic deviation of a first visual device shot in the target PCB area, and realizing quantitative positioning and characteristic deviation; according to the positioning deviation and the characteristic deviation, deviation compensation processing is carried out on the original image data, corrected image data of the target PCB area is obtained, and the problems of line shape distortion, size distortion and the like caused by shooting deviation are effectively avoided; the defect detection result of the target PCB area is determined based on the corrected image data, and the stability and reliability of intelligent detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of PCB detection technology, and in particular relates to a PCB defect detection method and system based on AI vision. Background Art

[0002] With the rapid development of the electronics manufacturing industry, printed circuit board (PCB) inspection technology has become a critical component in ensuring product quality. With the advancement of artificial intelligence, particularly deep learning, PCB defect detection through image acquisition and input into machine vision models has gained widespread attention. This technology not only improves inspection speed and accuracy, but also reduces the need for manual intervention.

[0003] However, due to factors such as deviations in visual equipment installation, mechanical motion precision limitations, and lens optical properties, the PCB circuits and pads in the image may exhibit inherent image deviations, such as shape and size distortion. During inspection, these inherent deviations in the image data can lead to inaccurate defect detection. This is especially true in high-density, high-precision PCB inspection scenarios, where circuit spacing is extremely small and component layouts are compact. Even small image deviations can be amplified, requiring frequent manual re-inspections and calibrations during the inspection process, significantly reducing inspection efficiency and increasing production costs. Summary of the Invention

[0004] The embodiments of the present application provide a PCB defect detection method and system based on AI vision, which can solve the problem of inaccurate defect detection caused by the deviation of image data itself during the PCB defect detection process.

[0005] In a first aspect, an embodiment of the present application provides a PCB defect detection method based on AI vision, comprising: Obtaining original image data of the target PCB area captured by the first vision device; Obtain design parameters of the target PCB area; Determining, based on the original image data and design parameters of the target PCB area, a positioning deviation and a feature deviation captured by the first visual device in the target PCB area; performing deviation compensation processing on the original image data according to the positioning deviation and the characteristic deviation to obtain corrected image data of the target PCB area; A defect detection result of the target PCB area is determined based on the corrected image data.

[0006] The above technical solutions in the embodiments of the present application have at least the following technical effects: The PCB defect detection method based on AI vision provided in the embodiment of the present application obtains the original image data of the target PCB area captured by the first visual device, obtains the design parameters of the target PCB area, and provides a benchmark for subsequent analysis. Based on the original image data and design parameters of the target PCB area, the positioning deviation and feature deviation captured by the first visual device in the target PCB area are determined to achieve quantitative positioning and feature deviation. Based on the positioning deviation and feature deviation, the original image data is subjected to deviation compensation processing to obtain corrected image data of the target PCB area, effectively avoiding problems such as line shape distortion and size distortion caused by shooting deviation. The defect detection results of the target PCB area are determined based on the corrected image data, thereby improving the stability and reliability of intelligent detection.

[0007] In a second aspect, an embodiment of the present application provides an AI vision-based PCB defect detection system, comprising: An acquisition unit, configured to acquire original image data of a target PCB area captured by a first visual device; Parameter unit, used to obtain the design parameters of the target PCB area; a deviation unit, configured to determine, based on the original image data and design parameters of the target PCB area, a positioning deviation and a feature deviation of the target PCB area photographed by the first visual device; a correction unit, configured to perform deviation compensation processing on the original image data according to the characteristic deviation and the positioning deviation to obtain corrected image data of the target PCB area; A determining unit is configured to determine a defect detection result of the target PCB area based on the corrected image data.

[0008] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any one of the above aspects when executing the computer program.

[0009] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute the method according to any one of the above aspects.

[0010] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions of the above aspects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 This is a flow chart of a PCB defect detection method based on AI vision provided by an embodiment of the present application; Figure 2 This is a schematic diagram of the operation of the AI ​​vision-based PCB defect detection method provided in one embodiment of the present application; Figure 3 This is a structural diagram of a PCB defect detection system based on AI vision provided in one embodiment of the present application; Figure 4 It is a structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0013] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0014] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0015] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0016] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if the described condition or event is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of the described condition or event" or "in response to detecting the described condition or event," depending on the context.

[0017] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0018] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0019] Due to factors such as deviations in visual equipment installation, mechanical motion precision limitations, and lens optical properties, PCB traces and pads in the image may exhibit inherent image deviations, such as shape and size distortion. During inspection, these inherent deviations in image data can lead to inaccurate defect detection. This is particularly true in high-density, high-precision PCB inspection scenarios, where trace spacing is extremely small and component layouts are compact. Even small image deviations can be amplified, requiring frequent manual re-inspections and calibrations during the inspection process, significantly reducing inspection efficiency and increasing production costs.

[0020] To solve the above problems, an embodiment of the present application provides a PCB defect detection method and system based on AI vision. In this method, the original image data of the target PCB area taken by the first visual device is obtained, and the design parameters of the target PCB area are obtained to provide a benchmark for subsequent analysis. According to the original image data and design parameters of the target PCB area, the positioning deviation and feature deviation taken by the first visual device in the target PCB area are determined to achieve quantitative positioning and feature deviation. According to the positioning deviation and feature deviation, the original image data is subjected to deviation compensation processing to obtain corrected image data of the target PCB area, effectively avoiding problems such as line shape distortion and size distortion caused by shooting deviation. The defect detection results of the target PCB area are determined based on the corrected image data to improve the stability and reliability of intelligent detection.

[0021] The AI ​​vision-based PCB defect detection method provided in the embodiment of the present application can be applied to electronic devices. In this case, the electronic device is the executor of the AI ​​vision-based PCB defect detection method provided in the embodiment of the present application. The embodiment of the present application does not impose any restrictions on the specific type of electronic device.

[0022] For example, the electronic device may be an ultra-mobile personal computer (UMPC), a netbook, a desktop computer, a computer, a laptop computer, a communication device, a computing device, a satellite wireless device, etc.

[0023] In order to better understand the AI ​​vision-based PCB defect detection method provided in the embodiment of the present application, the specific implementation process of the AI ​​vision-based PCB defect detection method provided in the embodiment of the present application is exemplarily introduced below.

[0024] Figure 1 A schematic flow chart of a PCB defect detection method based on AI vision provided in an embodiment of the present application is shown. The PCB defect detection method based on AI vision includes: S100: Acquire original image data of a target PCB area captured by a first vision device.

[0025] It is understood that the first vision device can be a camera system installed on an industrial production line (such as a high-resolution industrial CCD / CMOS camera), which is responsible for capturing images of the target PCB area. During this process, the camera captures the entire field of view of the target PCB area according to the set exposure parameters, shooting angle, focal length, and other conditions. Raw image data can be automatically acquired through the OpenCV cv2.VideoCapture() function or the camera SDK interface. Raw image data is generally output in RAW, BMP, or JPEG format and stored locally or uploaded to a server. Raw image data is used for subsequent image calibration and defect detection analysis. It has high fidelity but may contain noise, distortion, and other information, necessitating subsequent calibration.

[0026] In one possible implementation, S100, obtaining original image data of a target PCB area captured by a first vision device, includes: S110 , acquiring initial image data and a first shooting angle captured by a first vision device in a target PCB area, and standard image data and a second shooting angle captured by a second vision device in the target PCB area.

[0027] It can be understood that accurate image data pairs can be obtained by cross-referencing images from multiple visual devices. The initial image data refers to the image captured by the current first visual device, and the standard image data is a high-quality reference image obtained by a second visual device with known calibration. During image acquisition, the shooting angle corresponding to each device can be recorded. The shooting angle can be the rotation angle and pitch angle of the camera relative to the PCB area, which can be represented by Euler angles or rotation matrices. The first shooting angle is the angle information captured by the first visual device in the target PCB area, and the second shooting angle is the angle information captured by the second visual device in the target PCB area, which is used for subsequent angle difference calculation and image calibration to ensure geometric consistency between images.

[0028] S120 , performing feature matching processing on the initial image data and the second shooting angle according to the standard image data to obtain a first calibration parameter.

[0029] It can be understood that the key structural features in the initial image data and the standard image data can be extracted, described and paired by an image processing algorithm, and error compensation can be performed in combination with the second shooting angle to calculate the first calibration parameter. The first calibration parameter is a calibration parameter for aligning the initial image data with the standard image data. The first calibration parameter can be an affine transformation matrix, a perspective transformation matrix or a homogeneous projection matrix in the form of a 3×3 or 2×3 real number matrix, which is used for subsequent image coordinate transformation and geometric correction. Feature point detection algorithms such as SIFT, SURF or ORB can be used to extract key points and their descriptors in the two images, and then BruteForce or FLANN can be used for feature point matching, and the RANSAC algorithm is used to eliminate abnormal matching pairs. OpenCV's cv2.findHomography or cv2.estimateAffinePartial2D functions are used to generate the first calibration parameter matrix. The first calibration parameter matrix is ​​used to perform angle offset compensation and coordinate unification on the original image, thereby enhancing the consistency between images and the accuracy of feature alignment.

[0030] Exemplarily, S120, performing feature matching processing on the initial image data and the second shooting angle according to the standard image data to obtain the first calibration parameter, includes: S121, extract key feature points from the standard image data to generate a first feature vector set.

[0031] It can be understood that the key feature points in the standard image data refer to important image area points that can represent the geometric outline of the PCB structure, such as the center of the pad, the corner of the device, the intersection of the circuit line, etc. The key feature points have high repeatability and high discrimination, and are suitable for image matching and structure recognition. The first feature vector set is a vector group generated after the key feature points in the standard image data are vectorized by the image descriptor algorithm, which is used for image feature matching, transformation estimation and difference analysis. A multi-scale space can be constructed based on the SIFT algorithm, and the scale extreme points can be found as key feature points. The local gradient direction histogram can be used to generate a 128-dimensional feature vector; or the ORB algorithm can be used to generate a binary first feature vector set based on FAST corner detection and BRIEF descriptor. The first feature vector set will be used as the benchmark reference data for subsequent feature matching with the initial image to determine the transformation relationship between images and error calculation.

[0032] S122: extract corresponding feature points from the initial image data to generate a second feature vector set.

[0033] It can be understood that the corresponding feature points in the initial image data are image feature position points corresponding to the structure in the standard image data extracted from the initial image data taken by the first visual device, and can be obtained through a feature point detection algorithm. The second feature vector set is a local image pattern description of the image feature points, which is used for similarity matching with the first feature vector set and calculating the spatial mapping relationship. The same algorithm as S121 (such as SIFT, ORB) can be used to extract features and calculate descriptors for the initial image to ensure homogeneity and matching basis with the feature vectors of the standard image data. The key points and descriptors can be obtained and the second feature vector set can be generated through the cv2.SIFT_create() or cv2.ORB_create() function in OpenCV to provide basic data for subsequent matching, correction and deviation compensation.

[0034] S123: Calculate a feature matching degree based on the similarity between the first feature vector set and the second feature vector set.

[0035] It can be understood that the feature matching degree is the overall similarity between the first feature vector set and the second feature vector set, which is used to measure the degree of consistency in geometric structure. It can be quantified as the ratio of the number of successfully matched feature point pairs to the total number of points, or expressed using a weighted matching score. A brute force matching algorithm or a fast approximate matching algorithm such as FLANN can be used to establish the point pair relationship between the two feature sets. Then, for each point pair, the Euclidean distance or Hamming distance between the descriptors is calculated. Unstable point pairs are filtered out using the Lowe's ratio test or a distance threshold. The number of valid matching pairs and the total number of detected points are counted to form the feature matching degree, which is used to determine whether the images are similar enough to perform geometric transformation or angle correction operations.

[0036] S124: When the feature matching degree is greater than a preset threshold, an angle offset parameter is calculated according to the difference between the first shooting angle and the second shooting angle to obtain a first calibration parameter.

[0037] It can be understood that the angle offset parameter refers to the difference in spatial posture between the first shooting angle and the second shooting angle, which can be expressed as the Euler angle difference or rotation matrix difference in three directions. Under the condition that the feature matching degree meets the preset threshold, the angle offset parameter is used to assist in generating or correcting the image transformation matrix, so that the initial image can be completely aligned with the standard image data through affine transformation or perspective transformation. The first calibration parameter is the image mapping matrix finally formed under the action of the angle offset parameter, which is used for image space coordinate unification and structure correction. The difference matrix ΔR=R2·R1 of the first shooting angle and the second shooting angle can be solved through the external parameter matrices (R1, R2) -1 , and based on the matching point pairs, the least squares fitting is performed on the rotation difference to form an angle compensation model that can be applied to the image coordinate transformation, thereby outputting a calibration parameter matrix that satisfies geometric consistency, namely the first calibration parameter, for subsequent image correction. By utilizing the scale and rotation invariance of the feature points, it can effectively cope with the perspective changes in PCB shooting and eliminate the errors caused by the shooting angle.

[0038] S130 , obtaining original image data of the target PCB area according to the first calibration parameter, the initial image data, and the first shooting angle.

[0039] As can be understood, image correction can be used to map the initial image data to a standard reference coordinate system, thereby obtaining raw image data of the target PCB area with standardized geometric characteristics. The OpenCV functions cv2.warpAffine or cv2.warpPerspective can be used to reproject the initial image data pixel-wise according to the calibration parameters to obtain the raw image data of the target PCB area, achieving complete uniformity of angular information and ensuring that the image can be used for subsequent design parameter comparison and defect detection.

[0040] S200: Obtain design parameters of a target PCB area.

[0041] It can be understood that the design parameters of the target PCB area refer to standardized reference data related to the target PCB board's structural layout, device arrangement, circuit routing, and coordinates of key feature points. These design parameters are typically exported from PCB design software (such as Altium Designer, Cadence Allegro, or Mentor Graphics) and include Gerber files, ODB++ format, or database files containing structural hierarchy information. Design parameters serve as reference templates during the inspection process, enabling structural comparison with actual image data, positional offset analysis, and defect identification. A pre-set parsing program can parse the design file into a table of structural parameters or feature point coordinates, which are then aligned with the image processing results. Coordinate mapping relationships are used to determine the corresponding position of each image feature point within the design parameters, serving as the basis for subsequent deviation assessment and correction. Accurate acquisition of design parameters is directly related to image recognition accuracy and the tolerance control capabilities of the inspection algorithm, forming a critical link in the integration of image processing and CAD drawings.

[0042] S300: Determine, based on original image data and design parameters of the target PCB area, a positioning deviation and a feature deviation captured by a first vision device in the target PCB area.

[0043] It can be understood that positioning deviation and feature deviation refer to the differences between the original image data and the design parameters in terms of spatial position and structural morphology. Positioning deviation mainly describes the translation, rotation or scaling error of the overall structure in the image relative to the design reference coordinates, while feature deviation describes the detailed deformation or displacement of specific key points, edges or device contours in the image relative to the standard position. Determining these deviations helps to evaluate whether the current image acquisition effect is qualified, or whether there are problems such as mechanical errors, image distortion or process deformation. By aligning the image feature point set with the design parameter feature point set, estimating the overall offset using affine transformation or minimum mean square error fitting method, and further calculating the displacement vector of each local feature point, a complete deviation analysis model can be constructed to guide subsequent image compensation, equipment alignment correction or structural integrity assessment. The deviation judgment results can also serve as an important basis for quality control and be statistically analyzed.

[0044] In one possible implementation, S300, determining, based on original image data and design parameters of the target PCB area, a positioning deviation of the target PCB area captured by the first vision device, includes: S310: Process the original image data and design parameters using a preset feature deviation model to determine the positioning deviation of the first vision device photographing the target PCB area.

[0045] It can be understood that a feature deviation model is a model used to quantify the degree to which the structure in an image deviates from the design reference. It is used to map the structural consistency between the original image data and the design parameters into a quantifiable positioning deviation index. The feature deviation model can be generated based on the image feature point matching distance, structural similarity indicators (such as SSIM and Hausdorff distance), or the output of neural network-based image comparison. A model function f(I,D)=L can be constructed, where I is the image feature set, D is the design parameter set, and L is the output positioning deviation value. For example, the support vector regression model (SVR) based on the RBF kernel or the deviation score prediction based on a deep neural network (such as a CNN + regression layer) can be used. Traditional methods can also be used, such as calculating the average offset distance of each key point in the image in the x and y directions as a deviation index and setting a qualified threshold for judgment. The feature deviation model is the key to converting the structural offset of image data into a standard numerical expression, supporting subsequent offset correction and structural deformation identification of PCB images.

[0046] S320: Determine the positioning deviation of the target PCB area captured by the first vision device based on the positioning deviation and the original image data.

[0047] It can be understood that positioning deviation is the specific spatial displacement determined after further analysis of the positioning deviation, reflecting the difference in spatial coordinates between the image captured by the first vision device and the standard design coordinate system in the x and y planes. The positioning deviation is determined by analyzing the offset of each key reference point in the original image relative to the standard coordinates in the design parameters, and combining the image registration transformation matrix to infer the overall position error vector. A pad or positioning hole with a clear structure and clear boundaries in the image can be selected as a reference point, and the change in the Euclidean distance between it and the design coordinates can be calculated. The overall offset is then modeled using the least squares method or ICP algorithm to generate a positioning deviation vector (Vx, Vy). This positioning deviation serves as a direct input for coordinate compensation and subsequent image correction, and is an important intermediate variable for quantifying image acquisition errors and using them for repair.

[0048] S330: Obtain a feature deviation captured by the first vision device in the target PCB area according to the positioning deviation and the design parameters.

[0049] It can be understood that feature deviation refers to the further identification of microscopic deformations of key structural points in the image relative to standard feature points in the design parameters based on the determination of positioning deviation. Feature deviation includes not only overall positional offset but also structural morphological changes such as rotation, scaling, and nonlinear deformation. It is determined by first performing preliminary coordinate alignment using positioning deviation, and then calculating the degree of structural offset based on the residual vector between the standard and actual feature points. The coordinates of the feature points in the design parameters can be transformed through coordinate mapping and compared one-to-one with the coordinates of the feature points actually extracted in the image. The feature offset is calculated using Euclidean distance or Manhattan distance, and a feature deviation matrix is ​​generated to describe the overall deformation trend. Feature deviation can be used to determine problems such as pad stretching, component misalignment, and line offset. It is a core reference for high-precision defect judgment and image error compensation. It is subsequently used to effectively solve problems such as line distortion and dimensional deviation caused by shooting errors through precise compensation of positioning deviation and feature deviation.

[0050] Exemplarily, S330, obtaining a characteristic deviation captured by the first vision device in the target PCB area based on the positioning deviation and the design parameter, includes: S331, determining the coordinates of standard feature points of the target PCB area according to the design parameters.

[0051] It can be understood that standard feature point coordinates are the position data of reference points with unique physical meaning extracted from design parameters in a two-dimensional design coordinate system. These can include pad centers, device corners, circuit nodes, etc. These points exist in fixed positions in the PCB design file and should remain stable and consistent during actual production. They are a key point set for comparison analysis and accuracy verification. The corresponding coordinate points can be extracted by parsing the structural layer or pad layer information in Gerber or ODB++ files, or by directly exporting DXF coordinate format from PCB design drawings and uniformly converting them into a pixel coordinate system or physical coordinate system consistent with the image acquisition coordinates, providing a standard benchmark for subsequent image feature deviation calculations.

[0052] S332: Generate a coordinate transformation matrix based on the positioning deviation.

[0053] It can be understood that the coordinate transformation matrix is ​​a two-dimensional coordinate mapping function calculated based on image positioning deviations. It can be an affine transformation matrix or a perspective transformation matrix. Its function is to transform the coordinates of the standard feature points in the design parameters into positions in the current image coordinates, thereby achieving consistency comparison across coordinate systems. Based on the matching point pairs, the estimateAffine2D or getPerspectiveTransform function in OpenCV can be used to generate the transformation matrix. The design parameter coordinate set is used as input and the matrix is ​​applied to calculate the new coordinate position, forming the corrected reference point position for comparison.

[0054] S333: Use the coordinate transformation matrix to transform the standard feature point coordinates to obtain transformed standard feature point coordinates.

[0055] It can be understood that the transformed standard feature point coordinates are the new coordinate values ​​obtained by mapping the standard feature point coordinates in the original design parameters through the aforementioned coordinate transformation matrix. They represent the positions where these structural points should appear in the current image acquisition coordinate system and are the predicted values ​​used for difference analysis with the feature points detected in the actual image. Each design coordinate point can be transformed through an affine matrix, and its mapping result in the image coordinate system can be output to obtain the transformed standard feature point coordinates. These coordinates form a point pair relationship with the actual image feature points for subsequent deviation calculation and error statistics.

[0056] S334, extracting the coordinates of the feature points actually detected from the original image data.

[0057] It can be understood that the coordinates of the actual detected feature points refer to the pixel locations of structural points detected in the original image data by the image feature extraction algorithm. These points can be output by feature detection algorithms such as ORB and SIFT. Their physical meaning is the same as the designed standard feature points, but they may have position drift and blur in the image. Therefore, their accurate extraction is a key prerequisite for deviation assessment and image quality judgment. The coordinates of each feature point can be extracted through the keypoint output interface of the detection algorithm and stored in an array or table format for subsequent comparison with the standard coordinates.

[0058] S335 , calculating the difference between the coordinates of the feature points actually detected and the coordinates of the standard feature points after transformation, and determining the difference as the feature deviation.

[0059] The degree of difference, as it can be understood, refers to the difference in distance between the transformed standard feature point coordinates and the feature point coordinates detected in the actual image. This can be calculated using the Euclidean distance formula d = √[(x1 − x2)² + (y1 − y2)²]. The degree of difference for all feature points is statistically analyzed and averaged or maximized to obtain the overall feature deviation index. Feature deviation is used to determine whether the image meets design requirements or whether further image compensation and offset correction are required. Matrix operations can be used to batch calculate differences, and a deviation tolerance range can be set to subsequently determine whether to trigger compensation mechanisms or defect detection processes.

[0060] In some embodiments, the method further comprises: S610, obtaining sample image data and standard positioning data of a sample PCB area photographed by a sample first vision device; wherein the standard positioning data is positioning data of standard image data photographed by a gold standard vision device.

[0061] It can be understood that the sample first vision device refers to a shooting device with the same or equivalent configuration as the target first vision device, which is used to capture images of the sample PCB area to train the model or generate a benchmark. The sample image data refers to the image data set captured using the vision device, which can contain multiple actual image samples of different types and different degrees of deviation. Standard positioning data refers to the image or position coordinate results captured and output by the gold standard vision device (such as a high-precision calibration camera or laser interferometer), which is used as the real reference value of the sample image to calculate deviations, train models or mark labels. By setting up an image acquisition station, the sample PCB can be photographed by the first vision device and the gold standard device in turn, and the images can be synchronized and matched with the logo. The accurate spatial position of the same structural point can be determined by the image coordinate pair or external positioning device to build a high-precision comparison basis between the image and the reference, thereby supporting subsequent error modeling and training data set construction. It is a key link in improving the model generalization ability and detection performance.

[0062] S620: Perform feature point extraction and matching processing on the sample image data to obtain predicted positioning data of the sample PCB area.

[0063] It can be understood that feature point extraction and matching processing refers to the detection and description of structural feature points between sample image data and standard image data, and the establishment of a pairing relationship between the feature points in the two images, so as to obtain the spatial transformation relationship and the degree of structural consistency between the images. The predicted positioning data is the spatial position data calculated based on the feature correspondence between the sample image data and the standard image data, which represents the system's ability to predict the standard structure position in the unknown input image. The SIFT, ORB and other algorithms in OpenCV can be called to extract the key points in the sample image and the standard image data, and the matching point pairs are calculated through descriptor matching. The RANSAC algorithm is combined to filter out abnormal point pairs, generate a transformation matrix, and apply it to the standard image data coordinates to map to the sample image coordinates, thereby obtaining the predicted positioning points and forming the estimated positioning output result of the visual model, providing a benchmark comparison for subsequent error calculation and model optimization.

[0064] Exemplarily, S620, extracting and matching feature points of the sample image data to obtain predicted positioning data of the sample PCB area, includes: S621: Apply a feature point detection algorithm to the sample image data to extract feature points and generate feature descriptors.

[0065] As you can understand, a feature descriptor is a vector representation generated by encoding the pixel structure around a feature point. It is typically rotation- and scale-invariant and can be used for feature matching between different images. Based on the ORB algorithm, the FAST corner detector can be used to select key points, and then the BRIEF descriptor can be used to generate a binary vector feature descriptor. Alternatively, SIFT can be used to construct a Gaussian difference pyramid to search for extreme points and calculate a 128-dimensional feature descriptor. Feature descriptors, as the core of image structure representation, support the solution of spatial correspondences between images and serve as the input basis for deviation assessment and model training.

[0066] S622 , performing feature point detection on the standard image data of the sample PCB area, extracting standard feature points and generating standard feature descriptors.

[0067] As you can understand, the standard feature descriptor is the structural expression vector for each feature point in the standard image data. This descriptor is then matched with the descriptor in the sample image to establish a mapping relationship. The same feature extraction algorithm (such as SIFT or ORB) can be used to ensure descriptor consistency. Matching can be performed using methods such as KD trees, LSH, or brute-force search to map the structural information in the standard image data to the sample image, enabling structural location prediction and error annotation.

[0068] S623, matching the feature descriptor with the standard feature descriptor, and screening feature point pairs with a matching degree higher than a preset threshold.

[0069] As can be understood, feature descriptors can be matched against standard feature descriptors to identify high-quality point pairs whose distance difference is less than a set tolerance or that pass a ratio test (such as Lowe's ratio test). High-quality point pairs are considered to have a high degree of correspondence between the two images and can be used to accurately solve transformation relationships or train model data annotation. Sample descriptors can be matched one-to-one with standard descriptors, and the matching error or ratio can be calculated. Matches with an error less than a set threshold (such as 0.75) are retained as valid point pairs. Outlier matches can then be removed through RANSAC or LMedS, thereby improving matching accuracy and robustness and providing high-confidence input for transformation matrix calculation.

[0070] S624 , calculating a transformation matrix based on the feature point pairs, mapping the sample image data to a coordinate system of the standard image data, and obtaining predicted positioning data of the sample PCB area.

[0071] It can be understood that the transformation matrix is ​​a geometric mapping matrix calculated from high-quality feature point pairs between the sample image and the standard image data. It is used to map the structure of one image to the coordinate system of the other image, achieving image alignment and structure prediction. The OpenCV function cv2.findHomography() can be used to calculate the homography matrix based on the matching point pairs, or estimateAffinePartial2D() can be used to calculate the affine transformation parameters. These are then applied to the structural point mapping process in the sample image, mapping the sample image data to the coordinate system of the standard image data, and obtaining the predicted positioning data of the sample PCB area. The generated predicted positioning data will serve as the model training target or error evaluation benchmark.

[0072] S630: Determine, based on the difference between the standard positioning data and the predicted positioning data, a sample positioning deviation of the sample PCB area photographed by the sample first vision device.

[0073] It can be understood that sample positioning deviation refers to the structural position difference between the predicted positioning data and the standard positioning data in the sample PCB image captured by the sample First Vision device. It is an indicator used to quantify the model prediction accuracy or the error level of the sample image. It can be expressed as the average error distance, maximum offset, or root mean square error of all corresponding feature points. The coordinates of the predicted positioning points are mapped one-to-one with the coordinates of the standard reference points. The Euclidean distance difference is calculated and the overall error index is statistically analyzed. This is used as the label value of the training sample and input into the deviation modeling process. It is an important training input for forming the structural regression model.

[0074] S640 , using the sample image data and the design parameters of the sample PCB area as expected inputs and the sample positioning deviation as expected output, trains the initial machine learning model to obtain a feature deviation model.

[0075] It can be understood that the initial machine learning model refers to a model used to fit the mapping relationship between the sample image structure deviation and the image features or design parameters, and can be in the form of a regression neural network, support vector machine, or gradient boosting tree. The feature deviation model is based on the sample image and its corresponding design parameters as input, and the sample positioning deviation as the supervised output. The deviation prediction function obtained by training the initial machine learning model can map the image features into spatial error estimates. The feature coordinates, angles, brightness, texture features, etc. extracted from the image can be encoded as input vectors, and then the sample positioning deviation is used as the target. The model is trained through a machine learning framework (such as TensorFlow, PyTorch, LightGBM). After the loss converges, the prediction model for actual image deviation estimation is output, providing accurate valuation support for subsequent image quality judgment and error compensation.

[0076] S400 , performing deviation compensation processing on the original image data according to the positioning deviation and the feature deviation to obtain corrected image data of the target PCB area.

[0077] It can be understood that deviation compensation processing refers to the geometric correction and structural calibration of the original image data based on the positioning deviation and feature deviation obtained in the previous steps, so that the image returns to the designed structural alignment state. The corrected image is the corrected image data, which can be used for subsequent high-precision detection processing. By constructing a coordinate transformation matrix and a feature compensation matrix, the overall image coordinates and the positions of key structural points are transformed respectively, and the image is corrected by applying image remapping functions such as warpAffine or warpPerspective in OpenCV. The result is a corrected image with a structure and position close to the standard reference state. This is the core part of the image preprocessing process.

[0078] In one possible implementation, S400 performs deviation compensation processing on the original image data based on the positioning deviation and the feature deviation to obtain corrected image data of the target PCB area, including: S410, generating a coordinate transformation matrix according to the positioning deviation; wherein the coordinate transformation matrix is ​​used to correct the position offset in the original image data.

[0079] It can be understood that the coordinate transformation matrix is ​​a two-dimensional affine or perspective transformation matrix generated based on the positioning deviation. It is mainly used to correct the overall position offset in the image so that the image structure is spatially aligned with the standard coordinates. The position offset may include transformations such as translation, rotation, and scaling of the image in the x and y axis directions. The translation matrix can be calculated based on the positioning offset vector, or the affine transformation matrix can be calculated using known reference point pairs to achieve image repositioning through transformation operations.

[0080] S420, generating a feature compensation matrix according to the feature deviation; wherein the feature compensation matrix is ​​used to correct feature deformation in the original image data.

[0081] As can be understood, the feature compensation matrix is ​​a structural-level geometric repair parameter matrix generated based on feature deviations. It is used to correct distortion, stretching, or misalignment of local features such as devices or circuits in the image. The feature compensation matrix acts on key points and reconstructs the structure of abnormally deformed areas in the image through local nonlinear interpolation, deformation models, or elastic transformations. The feature compensation matrix can be constructed using the TPS (Thin Plate Spline) deformation model or by fitting a local displacement field based on eigenvector differences, and applied to local areas in the image for fine correction.

[0082] S430: Fusing the characteristic compensation matrix and the coordinate transformation matrix to obtain a comprehensive compensation matrix.

[0083] It can be understood that the comprehensive compensation matrix is ​​the result of a weighted fusion or series combination of the coordinate transformation matrix and the feature compensation matrix. It is used to uniformly perform dual compensation for image position and structure, and is a key step in improving image restoration quality. The feature compensation matrix and coordinate transformation matrix can be synthesized through matrix multiplication or interpolation reconstruction algorithms. In combination with image affine and nonlinear transformation modules, a multi-level compensation process is constructed to ensure that the spatial structure of the entire image is completely close to the design parameters.

[0084] S440 , performing deviation compensation processing on the original image data using the comprehensive compensation matrix to obtain corrected image data of the target PCB area.

[0085] It can be understood that deviation compensation processing refers to applying the aforementioned comprehensive compensation matrix to the original image data, completing dual corrections of the image coordinates and structure through image pixel-level remapping and interpolation operations, and outputting corrected image data that meets design standards. The remap or warp function in OpenCV can be called to transform the image pixel coordinates, and image clarity is maintained through bilinear interpolation or cubic convolution interpolation, thereby outputting an image version with minimal error, namely the corrected image data, which is used for subsequent defect detection processing. Through precise compensation of positioning deviation and feature deviation, problems such as line distortion and dimensional deviation caused by shooting errors can be effectively resolved, effectively improving the accuracy of visual inspection in high-precision and high-demand PCB inspection.

[0086] S500: Determine a defect detection result of a target PCB area based on the corrected image data.

[0087] It can be understood that defect detection results refer to inspection reports generated by executing image recognition and defect location algorithms on corrected image data. These reports can include information such as defect type (e.g., broken wire, short circuit, cold solder joint), defect location (pixel coordinates or physical coordinates), and defect severity, used to determine whether a PCB product is qualified. Pre-trained deep learning models (e.g., YOLO and Mask R-CNN) can be used to perform object detection and semantic segmentation on images. Traditional algorithms based on template matching, edge detection, and morphological analysis can also be used to extract abnormal areas. Design parameters can then be combined to screen for defective areas. Ultimately, structured inspection data or image annotation information is output as defect detection results for subsequent sorting, report generation, or manual review.

[0088] In one possible implementation, S500, determining a defect detection result of a target PCB area based on the corrected image data, includes: S510, using a preset PCB defect detection model to process the corrected image data to obtain a defect detection result of the target PCB area; wherein the PCB defect detection model is a machine learning model obtained through training.

[0089] A PCB defect detection model is a pre-trained machine learning or deep learning model used to identify common defects in printed circuit board images. Based on the input corrected image data, it can identify defects such as broken wires, short circuits, missing pads, offset solder joints, burrs, and foreign matter, and locate their specific locations within the image, thereby generating structured defect detection results. PCB defect detection models can be constructed using a convolutional neural network (CNN) architecture, including object detection frameworks such as YOLO, Faster R-CNN, RetinaNet, and EfficientDet. The model is trained on a large-scale, annotated PCB defect image set. The model input is the corrected image, and the output is multiple defect candidate boxes with corresponding confidence scores and category labels. The corrected image can be input into the PCB defect detection model. The model first performs multi-scale convolution feature extraction on the image, then integrates the features through the Feature Pyramid Network (FPN). Finally, the detection head performs bounding box regression and category prediction. The output detection results include the frame coordinates, category, and confidence score of each defect. This effectively solves problems such as line distortion and dimensional deviation caused by shooting errors, improves detection accuracy and reliability, and enhances the ability to detect high-precision and high-requirement PCBs.

[0090] Corresponding to the AI ​​vision-based PCB defect detection method of the above embodiment, the embodiment of the present application also provides a PCB defect detection system based on AI vision, and the various units of the system can implement the various steps of the AI ​​vision-based PCB defect detection method. Figure 3 A structural block diagram of the AI ​​vision-based PCB defect detection system provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0091] Reference Figure 3 , the AI ​​vision-based PCB defect detection system includes: An acquisition unit, configured to acquire original image data of a target PCB area captured by a first visual device; Parameter unit, used to obtain the design parameters of the target PCB area; a deviation unit, configured to determine, based on the original image data and design parameters of the target PCB area, a positioning deviation and a feature deviation of the target PCB area photographed by the first visual device; a correction unit, configured to perform deviation compensation processing on the original image data according to the characteristic deviation and the positioning deviation to obtain corrected image data of the target PCB area; A determining unit is configured to determine a defect detection result of the target PCB area based on the corrected image data.

[0092] It should be noted that the information interaction, execution process, etc. between the above-mentioned systems / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit module can exist physically alone, or two or more unit modules can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0094] The embodiment of the present application also provides an electronic device, Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. Figure 4 As shown, the electronic device 6 of this embodiment includes: at least one processor 60 ( Figure 4 Only one is shown), at least one memory 61 ( Figure 4 Only one is shown in the figure) and a computer program 62 stored in the at least one memory 61 and executable on the at least one processor 60. When the processor 60 executes the computer program 62, the electronic device 6 implements the steps of any of the above-mentioned embodiments of the PCB defect detection method based on AI vision, or implements the functions of the various units in the above-mentioned system embodiments.

[0095] For example, the computer program 62 may be divided into one or more units, which are stored in the memory 61 and executed by the processor 60 to implement the present application. The one or more units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the electronic device 6.

[0096] The electronic device 6 can be a computing device or terminal device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that Figure 4It is only an example of the electronic device 6 and does not constitute a limitation on the electronic device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, buses, etc.

[0097] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0098] In some embodiments, the memory 61 may be an internal storage unit of the electronic device 6, such as a hard drive or memory of the electronic device 6. In other embodiments, the memory 61 may also be an external storage device of the electronic device 6, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 6. Furthermore, the memory 61 may include both an internal storage unit of the electronic device 6 and an external storage device. The memory 61 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is about to be output.

[0099] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0100] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the steps of any of the above method embodiments.

[0101] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process steps in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to an electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, removable hard drives, magnetic disks, or optical disks. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.

[0102] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0103] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0104] In the embodiments provided in the present application, it should be understood that the disclosed AI vision-based PCB defect detection system / electronic device and method can be implemented in other ways. For example, the above-described AI vision-based PCB defect detection system / electronic device embodiment is merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0105] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0106] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A PCB defect detection method based on AI vision, characterized in that: include: Obtaining original image data of the target PCB area captured by the first vision device; Obtain design parameters of the target PCB area; Determining, based on the original image data and design parameters of the target PCB area, a positioning deviation and a feature deviation captured by the first visual device in the target PCB area; performing deviation compensation processing on the original image data according to the positioning deviation and the characteristic deviation to obtain corrected image data of the target PCB area; A defect detection result of the target PCB area is determined based on the corrected image data.

2. The PCB defect detection method based on AI vision according to claim 1, characterized in that: The acquiring of original image data of the target PCB area captured by the first visual device includes: Acquire initial image data and a first shooting angle captured by the first visual device in the target PCB area, and standard image data and a second shooting angle captured by the second visual device in the target PCB area; performing feature matching processing on the initial image data and the second shooting angle according to the standard image data to obtain a first calibration parameter; Original image data of the target PCB area is obtained according to the first calibration parameter, the initial image data, and the first shooting angle.

3. The PCB defect detection method based on AI vision according to claim 2, characterized in that: The performing feature matching processing on the initial image data and the second shooting angle according to the standard image data to obtain a first calibration parameter includes: Extracting key feature points from the standard image data to generate a first feature vector set; Extracting corresponding feature points from the initial image data to generate a second feature vector set; Calculating a feature matching degree based on a similarity between the first feature vector set and the second feature vector set; When the feature matching degree is greater than a preset threshold, an angle offset parameter is calculated according to a difference between the first shooting angle and the second shooting angle to obtain a first calibration parameter.

4. The PCB defect detection method based on AI vision according to claim 1, characterized in that: Determining, based on the original image data and design parameters of the target PCB area, a positioning deviation of the target PCB area photographed by the first visual device, comprising: Processing the original image data and the design parameters using a preset feature deviation model to determine the positioning deviation of the first visual device photographing the target PCB area; Determining a positioning deviation of the target PCB area captured by the first visual device based on the positioning deviation and the original image data; A characteristic deviation of the target PCB area photographed by the first vision device is obtained according to the positioning deviation and the design parameters.

5. The PCB defect detection method based on AI vision according to claim 1, characterized in that: The method further comprises: Acquire sample image data and standard positioning data of a sample PCB area captured by a sample first vision device; wherein the standard positioning data is positioning data of standard image data captured by a gold standard vision device; Performing feature point extraction and matching processing on the sample image data to obtain predicted positioning data of the sample PCB area; Determining, based on a difference between the standard positioning data and the predicted positioning data, a sample positioning deviation of the sample PCB area photographed by the sample first vision device; The sample image data and the design parameters of the sample PCB area are used as expected inputs, and the sample positioning deviation is used as expected output. The initial machine learning model is trained to obtain a feature deviation model.

6. The PCB defect detection method based on AI vision according to claim 5, characterized in that: The extracting and matching the sample image data to obtain the predicted positioning data of the sample PCB area includes: Applying a feature point detection algorithm to the sample image data to extract feature points and generate feature descriptors; Performing feature point detection on the standard image data of the sample PCB area, extracting standard feature points and generating standard feature descriptors; Matching the feature descriptor with the standard feature descriptor, and screening feature point pairs with a matching degree higher than a preset threshold; A transformation matrix is ​​calculated based on the feature point pairs, and the sample image data is mapped to a coordinate system of standard image data to obtain predicted positioning data of the sample PCB area.

7. The PCB defect detection method based on AI vision according to claim 1, characterized in that: Obtaining, based on the positioning deviation and the design parameters, a characteristic deviation captured by the first visual device in the target PCB area, includes: Determining the standard feature point coordinates of the target PCB area according to the design parameters; generating a coordinate transformation matrix according to the positioning deviation; Using the coordinate transformation matrix to transform the standard feature point coordinates to obtain transformed standard feature point coordinates; Extracting the coordinates of the feature points actually detected from the original image data; The difference between the actually detected feature point coordinates and the transformed standard feature point coordinates is calculated, and the difference is determined as the feature deviation.

8. The PCB defect detection method based on AI vision according to claim 1, characterized in that: The performing deviation compensation processing on the original image data according to the positioning deviation and the characteristic deviation to obtain corrected image data of the target PCB area includes: Generating a coordinate transformation matrix according to the positioning deviation; wherein the coordinate transformation matrix is ​​used to correct the position offset in the original image data; Generating a feature compensation matrix according to the feature deviation; wherein the feature compensation matrix is ​​used to correct feature deformation in the original image data; Fusing the characteristic compensation matrix and the coordinate transformation matrix to obtain a comprehensive compensation matrix; The original image data is subjected to deviation compensation processing using the comprehensive compensation matrix to obtain corrected image data of the target PCB area.

9. The PCB defect detection method based on AI vision according to claim 1, characterized in that: Determining a defect detection result of the target PCB area based on the corrected image data includes: Processing the corrected image data using a preset PCB defect detection model to obtain a defect detection result for the target PCB area; The PCB defect detection model is a machine learning model obtained through training.

10. A PCB defect detection system based on AI vision, characterized in that: include: An acquisition unit, configured to acquire original image data of a target PCB area captured by a first visual device; Parameter unit, used to obtain the design parameters of the target PCB area; a deviation unit, configured to determine, based on the original image data and design parameters of the target PCB area, a positioning deviation and a feature deviation of the target PCB area photographed by the first visual device; a correction unit, configured to perform deviation compensation processing on the original image data according to the characteristic deviation and the positioning deviation to obtain corrected image data of the target PCB area; A determining unit is configured to determine a defect detection result of the target PCB area based on the corrected image data.

Citation Information

Patent Citations

  • Lens thermal effect error compensation method in vision measurement system

    CN108986171A

  • Combined image distance correction method, device and system and storage medium

    CN119052459A

  • 3D positioning method and system based on holder

    CN119339103A

  • Method and device for detecting and positioning surface defects of PCB (Printed Circuit Board)

    CN119559128A

  • Circuit board detection method and system based on machine vision

    CN120451153A

Cited By

  • Intelligent control method and system for deformation of structural member of intelligent coal preparation equipment based on dynamic data fusion

    CN121188410A

  • Intelligent control method and system for structural deformation of intelligent coal preparation equipment based on dynamic data fusion

    CN121188410B

  • Intelligent production control method of PCB (Printed Circuit Board)

    CN121639686A

  • Circuit board key area positioning method and system based on AOI detection

    CN121788799A