A PCB circuit board defect detection method based on computer vision

Through a computer vision-based method, the PCB circuit board is segmented and complexity judging, the defect feature set is obtained and the historical detection results are compared, which solves the problems of low detection efficiency and missed detection in the prior art, and achieves more efficient and accurate defect detection and processing.

CN119151939BActive Publication Date: 2025-04-22SHENZHEN PENGBOHUI ELECTRONICS CO LTD

Patent Information

Application Number
CN202411649748.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-04-22
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

When detecting defects of PCB circuit boards in the prior art, the resource distribution is unreasonable, resulting in low detection efficiency and different batches of defects, which are prone to false detection or missed inspection.

Method used

Using a computer vision-based method, we obtain preprocessed images of the template PCB circuit board, perform image segmentation and complexity evaluation, obtain defect feature sets, and perform secondary defect comparisons based on historical batch detection results to generate defect processing methods.

Benefits of technology

It improves the detection efficiency of PCB circuit board, reduces the possibility of false detection or missed detection, and can more accurately identify and deal with defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151939B_ABST
    Figure CN119151939B_ABST
Patent Text Reader

Abstract

This application discloses a PCB circuit board defect detection method based on computer vision, belonging to the technical field of computer vision. The method includes: image segmentation of a preprocessed PCB image to obtain multiple preprocessed images and recording the image segmentation method; secondary image acquisition of the PCB circuit board within the preprocessed images to obtain preprocessed target images; obtaining a defect feature set for each preprocessed target image; obtaining the target defect feature set and marking defects in the target images according to the target defect feature set to obtain a first circuit board defect; establishing a historical batch defect database and performing secondary defect comparison on the target images to obtain a second circuit board defect; obtaining the defect points of the PCB circuit board and describing the defect points to obtain a defect description; and generating a defect processing method based on the defect description. This application has the effect of improving the detection efficiency of PCB circuit boards and reducing the possibility of false detections or missed detections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer vision, and in particular to a PCB circuit board defect detection method based on computer vision. Background Art

[0002] A printed circuit board, or PCB, is a conductive board used to support and connect electronic components. It is one of the most basic components in electronic products. Almost all electronic devices require the use of PCBs to provide electrical connections and mechanical support.

[0003] In the prior art, when defects of a PCB circuit board are generally detected, the PCB circuit board is usually placed on a detection table, and then a camera is placed directly above the detection table to photograph the PCB circuit board. The photographed image of the PCB circuit board is then compared with a template image to perform defect detection.

[0004] However, the distribution of electronic components and circuits on PCB circuit boards is not uniform. Testing the entire image will lead to unreasonable distribution of testing resources, resulting in low testing efficiency. The defects of PCB circuit boards in different batches are different, and using the same imaging method may result in false detection or missed detection. Summary of the invention

[0005] The purpose of the present invention is to provide a PCB circuit board defect detection method based on computer vision to solve the problems raised in the above background technology.

[0006] The present application provides a PCB circuit board defect detection method based on computer vision, the method comprising the following steps:

[0007] Obtain a pre-processed PCB image of a sample PCB circuit board and a sample batch number, perform image segmentation on the pre-processed PCB image, obtain multiple pre-processed images and record the image segmentation method;

[0008] According to the plurality of preprocessed images, the complexity of each preprocessed image is obtained, and according to the complexity, a secondary image acquisition is performed on the PCB circuit board in the preprocessed image to obtain a preprocessed target image;

[0009] Performing defect analysis on a plurality of the preprocessed target images to obtain a defect feature set of each of the preprocessed target images, and marking each defect feature set with the batch mark according to the sample batch number;

[0010] Acquire an initial image and a batch number of a PCB circuit board, perform image segmentation on the initial image according to the image segmentation method to obtain a target image, obtain a target defect feature set by combining the target image and the batch number, perform defect marking on the target image according to the target defect feature set, and obtain a first circuit board defect;

[0011] Obtain historical batch inspection results of PCB circuit boards, establish a historical batch defect database based on the historical batch inspection results, perform a secondary defect comparison on the target image based on the historical batch defect database, and obtain a second circuit board defect;

[0012] The defect points of the PCB circuit board are obtained by combining the first circuit board defect and the second circuit board defect, and the defect points are described to obtain a defect description, and a defect processing method is generated according to the defect description.

[0013] Preferably, the steps of performing image segmentation on the pre-processed PCB image, obtaining a plurality of pre-processed images and recording the image segmentation method are specifically as follows:

[0014] Based on the pre-processed PCB image, performing image scanning on the pre-processed PCB image to obtain a binary image and a negative image of the pre-processed PCB image;

[0015] Based on the binary image, obtaining component distribution data and circuit distribution data of the pre-processed PCB image;

[0016] Extracting the data of the degree of overlap of the component distribution data and the circuit distribution data according to the negative film image to obtain the data of the degree of overlap between the component and the circuit;

[0017] Establishing a coincidence threshold, dividing the coincidence data according to the coincidence threshold, and obtaining a low coincidence data set and a high coincidence data set respectively;

[0018] Edges are depicted according to the low overlap data set and the high overlap data set to obtain image segmentation edges, and image segmentation is performed on the preprocessed PCB image according to the image segmentation edges to obtain multiple preprocessed images, and the image segmentation method is recorded.

[0019] Preferably, the step of obtaining the complexity of each of the preprocessed images according to the plurality of preprocessed images is specifically as follows:

[0020] Extracting the number of components, component sizes, component shapes and circuit directions in the preprocessed images according to the plurality of preprocessed images;

[0021] According to the size of the component and the shape of the component, the single body shielding area of ​​each component on the bottom plate of the sample PCB circuit board is obtained;

[0022] Obtaining the occlusion area and occlusion position of the bottom plate in the preprocessed image according to the single body occlusion area and the number of components;

[0023] Combining the shielding area, the shielding position and the circuit direction, obtaining the shielded hidden circuit segment in the bottom plate;

[0024] According to the number of components, the component shapes and the hidden circuit segments, a complexity evaluation is performed on the preprocessed image to obtain the complexity of the preprocessed image.

[0025] Preferably, the step of performing secondary image acquisition on the PCB circuit board in the preprocessed image according to the complexity to obtain the preprocessed target image is specifically as follows:

[0026] Based on the complexity, respectively obtaining an occluded area and a recognizable area of ​​the preprocessed image;

[0027] Based on the occlusion area, according to the component size and the component shape of the component, obtaining a shooting angle of the occlusion area;

[0028] Calling a backup camera to acquire a second image of the blocked area according to the shooting angle to obtain a first target image;

[0029] Based on the identifiable area, the number of picture particles per unit area in the identifiable area is obtained, and the image clarity is obtained according to the number of picture particles per unit area;

[0030] Determining whether the image clarity can meet the preset recognition requirement, if it is determined that the image clarity cannot meet the recognition requirement, performing a secondary image acquisition on the identifiable area to obtain a second target image;

[0031] If it is determined that the image clarity can meet the recognition requirement, the image of the identifiable area is used as the second target image;

[0032] The first target image and the second target image are combined to obtain a preprocessed target image.

[0033] Preferably, the step of performing defect analysis on a plurality of the preprocessed target images to obtain a defect feature set of each of the preprocessed target images, and marking each defect feature set with the batch mark according to the sample batch number, is specifically as follows:

[0034] Based on the plurality of pre-processed target images, obtaining a processing point and a processing surface of each of the pre-processed target images;

[0035] Based on the processing point, extracting the shape feature, color feature and light absorption feature of the processing point;

[0036] Obtaining point defect characteristics of the processing point according to the appearance characteristics, the color characteristics and the light absorption characteristics;

[0037] Based on the processed surface, extracting light effect features, line features, and light and dark features of the processed surface;

[0038] Obtaining surface defect characteristics of the processed surface according to the light effect characteristics, line characteristics, and light and dark characteristics;

[0039] Combining the point defect feature and the surface defect feature to obtain a plurality of defect features in the preprocessed target image;

[0040] The process information in the current production process is obtained, the defect characteristics are screened according to the process information to obtain a defect characteristic set, and the batch mark is marked on each defect characteristic set according to the sample batch number.

[0041] Preferably, the step of obtaining a target defect feature set by combining the target image and the batch number, marking the target image for defects according to the target defect feature set, and obtaining the first circuit board defect is specifically as follows:

[0042] performing content matching and screening on the defect feature set in combination with the target image and the batch number to obtain a target defect feature set;

[0043] Based on the target defect feature set, defect recognition is performed on the processed points and processed surfaces in the target image, and defect marking is performed on the identified defects to obtain marked defects;

[0044] Extracting features of the marking defect to obtain appearance features of the marking defect, and obtaining a defect grade of the marking defect according to the appearance features;

[0045] A first circuit board defect of the PCB circuit board is obtained according to the marked defect and the defect level.

[0046] Preferably, the steps of obtaining historical batch inspection results of PCB circuit boards, establishing a historical batch defect database based on the historical batch inspection results, performing a secondary defect comparison on the target image based on the historical batch defect database, and obtaining the second circuit board defect are specifically as follows:

[0047] Obtain historical batch test results of PCB circuit boards, sort out the historical batch test results by batch and perform standard digitization to obtain historical batch test data;

[0048] Establish a historical batch defect database based on the historical batch inspection data, and perform secondary defect comparison on the target image based on the historical batch defect database as a comparison benchmark to obtain historical defects occurring on the PCB circuit board;

[0049] According to the historical defect, a second circuit board defect of the PCB circuit board is obtained.

[0050] Preferably, after the step of obtaining a second circuit board defect of the PCB circuit board according to the historical defect, the method further includes:

[0051] Obtaining defect data of the PCB circuit board according to the first circuit board defect and the second circuit board defect;

[0052] The defect data is substituted into the defect feature set for matching, and the unmatched defect data is marked as additional defect data, and the additional defect data is added to the defect feature set.

[0053] Preferably, the defect point of the PCB circuit board is obtained by combining the first circuit board defect and the second circuit board defect, and the defect point is described to obtain a defect description, and the step of generating a defect processing method according to the defect description is specifically as follows:

[0054] Obtaining a defect point of the PCB circuit board according to the first circuit board defect and the second circuit board defect;

[0055] According to the defect point, the appearance, function and location of the defect point are described to obtain a defect description;

[0056] The current PCB circuit board production process is obtained, and the defect description is substituted into the production process, the formation of the defect point is simulated, the defect cause causing the defect is obtained, and a defect treatment method is generated according to the defect cause.

[0057] In summary, the present application includes at least one of the following beneficial technical effects:

[0058] By preprocessing the selected sample PCB circuit boards in the same batch, the preprocessed PCB image of the sample PCB is obtained, the binary image and negative image of the preprocessed PCB image are obtained, the circuit distribution and component distribution in the preprocessed PCB image are obtained, and the preprocessed PCB image is segmented according to the overlap between the two to obtain the preprocessed image. Then, the preprocessed image is acquired for a second time according to the occlusion of the components in the preprocessed image to obtain the picture that was not originally photographed, that is, the preprocessed target image. The preprocessed target image is subjected to defect analysis to obtain a defect feature set of each preprocessed target image, and a batch mark is added. When the PCB circuit boards of this batch are inspected, the above-mentioned picture segmentation and picture shooting methods are first called to obtain the target image, and then the defect feature set is called to perform defect detection on the target image, and then the historical defects that still appear on the PCB circuit board are obtained according to the historical batch inspection results, and then the defect feature set is supplemented. Finally, the defect cause of the defect is detected and a defect handling method is generated. The inspection efficiency of the PCB circuit board is improved and the possibility of false detection or missed detection is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 This is a step flow chart of a PCB circuit board defect detection method based on computer vision provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following is combined with Figure 1 The present application is further described in detail, but the embodiments of the present invention are not limited thereto.

[0061] In an embodiment of the present application, a PCB circuit board defect detection method based on computer vision is disclosed.

[0062] In this embodiment, a PCB circuit board defect detection method based on computer vision includes the following steps:

[0063] S100: Acquire a pre-processed PCB image of a sample PCB circuit board and a sample batch number, perform image segmentation on the pre-processed PCB image, obtain multiple pre-processed images and record the image segmentation method;

[0064] S200: Obtaining the complexity of each preprocessed image according to the plurality of preprocessed images, and performing secondary image acquisition on the PCB circuit board in the preprocessed image according to the complexity to obtain a preprocessed target image;

[0065] S300: performing defect analysis on a plurality of pre-processed target images to obtain a defect feature set of each pre-processed target image, and marking each defect feature set with a batch mark according to a sample batch number;

[0066] S400: Acquire an initial image and a batch number of a PCB circuit board, perform image segmentation on the initial image according to an image segmentation method to obtain a target image, obtain a target defect feature set by combining the target image and the batch number, perform defect marking on the target image according to the target defect feature set, and obtain a first circuit board defect;

[0067] S500: Obtain historical batch inspection results of PCB circuit boards, establish a historical batch defect database based on the historical batch inspection results, perform secondary defect comparison on the target image based on the historical batch defect database, and obtain a second circuit board defect;

[0068] S600: Defect points of the PCB circuit board are obtained by combining the first circuit board defect and the second circuit board defect, and the defect points are described to obtain defect descriptions, and a defect processing method is generated according to the defect descriptions.

[0069] It should be pointed out that the above steps are only a preferred implementation order. In the specific implementation process, some steps can be replaced without affecting the overall implementation effect.

[0070] The steps of performing image segmentation on the pre-processed PCB image, obtaining multiple pre-processed images and recording the image segmentation method are as follows:

[0071] Based on the pre-processed PCB image, image scanning is performed on the pre-processed PCB image to obtain a binary image and a negative image of the pre-processed PCB image;

[0072] Based on the binary image, component distribution data and circuit distribution data of the pre-processed PCB image are obtained;

[0073] Extracting the data of the overlap between the component distribution data and the circuit distribution data according to the negative film image, and obtaining the overlap data between the component and the circuit;

[0074] Establish a coincidence threshold, divide the coincidence data according to the coincidence threshold, and obtain a low coincidence data set and a high coincidence data set respectively;

[0075] The edge is delineated according to the low overlap data set and the high overlap data set to obtain the image segmentation edge, and the pre-processed PCB image is segmented according to the image segmentation edge to obtain multiple pre-processed images, and the image segmentation method is recorded.

[0076] In application, the inspection of PCB circuit boards in a factory is taken as an example. The factory produces a batch of PCB circuit boards, the number of which is 5,000. One of them is selected as a sample PCB circuit board, and its image is obtained as a pre-processed PCB image, and the image is processed to obtain a binary image and a negative image. The binary image only displays black and white, so the components and circuits on the PCB circuit board are marked black, and the left side of the PCB circuit board is a densely distributed component area, and the right side is a circuit area. According to the negative image, the negative image can change the background color of inconspicuous factors to make them conspicuous, so the components and circuits are very conspicuous in the negative image. Further, the overlap data between the components and the circuit can be obtained, that is, many components on the left side are covered on the circuit, and the components in the left part area are also enriched according to the area. Therefore, the edge is depicted according to the overlap between the components and the circuit, and the pre-processed PCB image is divided into 6 pre-processed images, and the image segmentation method is recorded at the same time.

[0077] According to the plurality of preprocessed images, the steps of obtaining the complexity of each preprocessed image are specifically as follows:

[0078] According to the plurality of pre-processed images, the number of components, the size of components, the shape of components and the circuit direction in the pre-processed images are extracted;

[0079] According to the size and shape of the components, the single-unit shielding area of ​​each component on the bottom plate of the sample PCB circuit board is obtained;

[0080] According to the single occlusion area and the number of components, the occlusion area and occlusion position of the bottom plate in the preprocessed image are obtained;

[0081] Combining the shielding area, shielding position and circuit direction, the shielded hidden circuit segment in the base plate is obtained;

[0082] According to the number of components, component shapes and hidden circuit segments, the complexity of the preprocessed image is judged to obtain the complexity of the preprocessed image.

[0083] In application, the inspection of PCB circuit boards in a factory is taken as an example. For the 6 pre-processed images, one of the pre-processed images with a medium number of components is selected as an example. In this image, the component size, component number, component shape and circuit direction of the components are obtained. It is found that the number of components is 8, some of the component sizes are large, some are small, and the component shapes are mostly cylindrical, while the circuit direction leads to the bottom of the components. Based on the above content, the obscured area and obscured position of the bottom plate in the PCB circuit board can be obtained. At these positions, there are many welding points and circuits that cannot be photographed, so the hidden circuit segments in the bottom plate are obtained, and the complexity of the pre-processed image is judged. The complexity of the pre-processed image is 6, and the highest complexity is 10.

[0084] The steps of performing secondary image acquisition of the PCB circuit board in the preprocessed image according to the complexity to obtain the preprocessed target image are as follows:

[0085] Based on the complexity, the occluded area and the recognizable area of ​​the preprocessed image are obtained respectively;

[0086] Based on the occlusion area, the shooting angle of the occlusion area is obtained according to the component size and component shape of the component;

[0087] Calling the backup camera to obtain a second image of the blocked area according to the shooting angle to obtain a first target image;

[0088] Based on the identifiable area, the number of picture particles per unit area in the identifiable area is obtained, and the image clarity is obtained according to the number of picture particles per unit area;

[0089] Determine whether the image clarity can meet the preset recognition requirements. If it is determined that the image clarity cannot meet the recognition requirements, perform a secondary image acquisition on the identifiable area to obtain a second target image;

[0090] If it is determined that the image clarity can meet the recognition requirements, the image of the recognizable area is used as the second target image;

[0091] The first target image and the second target image are combined to obtain a preprocessed target image.

[0092] In application, the inspection of PCB circuit boards in a factory is taken as an example. According to the obtained complexity, the pre-processed image is further split to obtain the occluded area and the identifiable area, that is, the unobstructed area. In the occluded area, the shooting angle is obtained according to the size and shape of the component. For example, if a large cylindrical component has its bottom obstructed, it is necessary to capture the image of the bottom of the component from the side. The number of particles in the identifiable area is counted. The smaller the number of particles, the blurrier the image. If vibration occurs during shooting, the captured image is not clear, and secondary image acquisition is required.

[0093] The steps of performing defect analysis on multiple pre-processed target images, obtaining a defect feature set of each pre-processed target image, and marking each defect feature set with a batch mark according to a sample batch number are specifically as follows:

[0094] Based on a plurality of preprocessed target images, a processing point and a processing surface of each preprocessed target image are obtained;

[0095] Based on the processing point, the shape characteristics, color characteristics and light absorption characteristics of the processing point are extracted;

[0096] The point defect characteristics of the processing point are obtained according to the shape characteristics, color characteristics and light absorption characteristics;

[0097] Based on the processed surface, extract the light effect features, line features, and light and dark features of the processed surface;

[0098] According to the light effect characteristics, line characteristics and light and dark characteristics, the surface defect characteristics of the processed surface are obtained;

[0099] Combining point defect features and surface defect features to obtain multiple defect features in the preprocessed target image;

[0100] The process information of the current production process is obtained, the defect characteristics are screened according to the process information to obtain a defect feature set, and a batch mark is added to each defect feature set according to the sample batch number.

[0101] In application, the inspection of PCB circuit boards in a factory is taken as an example. After the above-mentioned multiple rounds of processing, multiple pre-processed target images are obtained, and the processing points and processing surfaces of each pre-processed target image are further obtained. The processing points are positions such as welding points and circuit connection points, and the processing surface is the plane area on the PCB circuit board. Taking a certain welding point as the processing point, the appearance feature of the welding point is obtained to be irregular, the color feature is partially blackened, and the light absorption feature is shown as a relatively large absorption of light, which indicates that the welding point has defects. Taking the plane of a certain PCB circuit board as the processing surface, the light effect feature of the processing surface is obvious, the line feature is regular and orderly, the light and dark feature is shown as normal light and dark contrast, and there is no light and dark contrast in abnormal areas, etc., which indicates that the processing surface has no defects. After the above defects are collected and screened, a defect feature set is obtained, and the defect feature set is marked with a batch mark of this batch.

[0102] The steps of obtaining a target defect feature set by combining the target image and the batch number, marking the target image for defects according to the target defect feature set, and obtaining the first circuit board defect are specifically as follows:

[0103] The defect feature set is matched and screened based on the target image and batch number to obtain the target defect feature set;

[0104] Defect recognition is performed on the processing points and the processing surfaces in the target image based on the target defect feature set, and the identified defects are marked to obtain marked defects;

[0105] Extract features of the marked defects to obtain appearance features of the marked defects, and obtain defect levels of the marked defects based on the appearance features;

[0106] According to the marked defect and the defect level, the first circuit board defect of the PCB circuit board is obtained.

[0107] In application, the inspection of PCB circuit boards in a factory is taken as an example. The 5,000 PCB circuit boards in this batch are inspected for defects, and the defect feature set is matched and screened according to the batch number to obtain the target feature set. And according to the image acquisition method in the preprocessing process, the processing points and processing surfaces in the target image of the PCB circuit board are obtained for defect identification, and the marked defects are obtained. At the same time, the defect level is obtained according to the appearance characteristics. For example, some welding points have a bit ugly shape, which is a mild defect, and some welding points have excessive welding or not welded in place, which is a severe defect. The first circuit board defect is obtained by combining the marked defect and the defect level.

[0108] The steps of obtaining historical batch inspection results of PCB circuit boards, establishing a historical batch defect database based on the historical batch inspection results, performing secondary defect comparison on the target image based on the historical batch defect database, and obtaining the second circuit board defect are specifically as follows:

[0109] Obtain historical batch test results of PCB circuit boards, sort out the historical batch test results by batch and standardize them into data to obtain historical batch test data;

[0110] Establish a historical batch defect database based on historical batch inspection data, and perform secondary defect comparison on the target image using the historical batch defect database as a comparison benchmark to obtain historical defects that occurred on the PCB circuit board;

[0111] According to the historical defects, a second circuit board defect of the PCB circuit board is obtained.

[0112] In application, take the inspection of PCB circuit boards in a factory as an example. Obtain the historical batch inspection results of this factory and generate a historical batch defect database. Perform a secondary defect comparison on the target image with the historical batch database, and find that during the first defect identification process, there is a defect at the connection of a certain circuit, but it was not identified because the defect was found before and then dealt with. However, it appears again in this batch of PCB circuit boards, and the defect is relatively hidden and not easy to be found, so the defect is marked as a historical defect, that is, the second circuit board defect.

[0113] After the step of obtaining the second circuit board defect of the PCB circuit board according to the historical defect, the method further includes:

[0114] Obtaining defect data of the PCB circuit board according to the first circuit board defect and the second circuit board defect;

[0115] The defect data is substituted into the defect feature set for matching, and the unmatched defect data is marked as additional defect data, and the additional defect data is added to the defect feature set.

[0116] In application, take the inspection of PCB circuit boards in a factory as an example. After unifying the data of the first circuit board defect and the second circuit board defect, the defect data is obtained, and the data is substituted into the defect feature set for matching. If the defects of a component soldering point and a circuit connection are not found in the defect feature set, the above two defect data are added to the defect feature set to improve the defect feature set.

[0117] The defect point of the PCB circuit board is obtained by combining the first circuit board defect and the second circuit board defect, and the defect point is described to obtain a defect description, and the steps of generating a defect processing method according to the defect description are specifically as follows:

[0118] Obtaining defect points of the PCB circuit board according to the first circuit board defect and the second circuit board defect;

[0119] According to the defect point, the appearance, function and location of the defect point are described to obtain a defect description;

[0120] Obtain the current PCB circuit board production process, substitute the defect description into the production process, simulate the formation of defect points, obtain the defect cause, and generate a defect treatment method based on the defect cause.

[0121] In application, the inspection of PCB circuit boards in a factory is taken as an example. According to the first circuit board defect and the second circuit board defect, there are three defect points on the PCB circuit board, namely a component welding point, a circuit connection point and a panel scratch. According to the above three defect points, their appearance, function and location are described respectively to obtain defect descriptions, and the formation process of defect points is simulated according to the current PCB circuit board production process, and the defect causes of the formation of the three defect points are obtained respectively, and then defect treatment methods are generated according to the defect causes.

[0122] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A PCB circuit board defect detection method based on computer vision, characterized in that: The following steps are involved: Obtain a pre-processed PCB image of a sample PCB circuit board and a sample batch number, perform image segmentation on the pre-processed PCB image, obtain multiple pre-processed images and record the image segmentation method; According to the plurality of preprocessed images, the complexity of each preprocessed image is obtained, and according to the complexity, a secondary image acquisition is performed on the PCB circuit board in the preprocessed image to obtain a preprocessed target image; Performing defect analysis on a plurality of the pre-processed target images to obtain a defect feature set of each of the pre-processed target images, and marking each defect feature set with the batch mark according to the sample batch number; Acquire an initial image and a batch number of a PCB circuit board, perform image segmentation on the initial image according to the image segmentation method to obtain a target image, obtain a target defect feature set by combining the target image and the batch number, perform defect marking on the target image according to the target defect feature set, and obtain a first circuit board defect; Obtain historical batch inspection results of PCB circuit boards, establish a historical batch defect database based on the historical batch inspection results, perform a secondary defect comparison on the target image based on the historical batch defect database, and obtain a second circuit board defect; Combining the first circuit board defect and the second circuit board defect to obtain a defect point of the PCB circuit board, describing the defect point to obtain a defect description, and generating a defect processing method according to the defect description; The step of obtaining the complexity of each of the preprocessed images according to the plurality of preprocessed images is specifically as follows: Extracting the number of components, component sizes, component shapes and circuit directions in the preprocessed images according to the plurality of preprocessed images; According to the size of the component and the shape of the component, the single body shielding area of ​​each component on the bottom plate of the sample PCB circuit board is obtained; Obtaining the occlusion area and occlusion position of the bottom plate in the preprocessed image according to the single body occlusion area and the number of components; Combining the shielding area, the shielding position and the circuit direction, obtaining the shielded hidden circuit segment in the bottom plate; According to the number of components, the component shapes and the hidden circuit segments, a complexity evaluation is performed on the preprocessed image to obtain the complexity of the preprocessed image; The steps of performing secondary image acquisition on the PCB circuit board in the preprocessed image according to the complexity to obtain the preprocessed target image are specifically as follows: Based on the complexity, respectively obtaining an occluded area and a recognizable area of ​​the preprocessed image; Based on the occlusion area, according to the component size and the component shape of the component, obtaining a shooting angle of the occlusion area; Calling a backup camera to acquire a second image of the blocked area according to the shooting angle to obtain a first target image; Based on the identifiable area, the number of picture particles per unit area in the identifiable area is obtained, and the image clarity is obtained according to the number of picture particles per unit area; Determining whether the image clarity can meet the preset recognition requirement, if it is determined that the image clarity cannot meet the recognition requirement, performing a secondary image acquisition on the identifiable area to obtain a second target image; If it is determined that the image clarity can meet the recognition requirement, the image of the identifiable area is used as the second target image; Combining the first target image and the second target image to obtain a preprocessed target image; The step of performing defect analysis on a plurality of the pre-processed target images to obtain a defect feature set of each of the pre-processed target images, and marking each defect feature set with the batch mark according to the sample batch number, is specifically as follows: Based on the plurality of pre-processed target images, obtaining a processing point and a processing surface of each of the pre-processed target images; Based on the processing point, extracting the shape feature, color feature and light absorption feature of the processing point; Obtaining point defect characteristics of the processing point according to the appearance characteristics, the color characteristics and the light absorption characteristics; Based on the processed surface, extracting light effect features, line features, and light and dark features of the processed surface; Obtaining surface defect characteristics of the processed surface according to the light effect characteristics, line characteristics, and light and dark characteristics; Combining the point defect feature and the surface defect feature to obtain a plurality of defect features in the preprocessed target image; The process information in the current production process is obtained, the defect characteristics are screened according to the process information to obtain a defect characteristic set, and the batch mark is marked on each defect characteristic set according to the sample batch number.

2. A PCB circuit board defect detection method based on computer vision according to claim 1, characterized in that: The steps of performing image segmentation on the pre-processed PCB image, obtaining a plurality of pre-processed images and recording the image segmentation method are specifically as follows: Based on the pre-processed PCB image, performing image scanning on the pre-processed PCB image to obtain a binary image and a negative image of the pre-processed PCB image; Based on the binary image, obtaining component distribution data and circuit distribution data of the pre-processed PCB image; Extracting the data of the degree of overlap of the component distribution data and the circuit distribution data according to the negative film image to obtain the data of the degree of overlap between the component and the circuit; Establishing a coincidence threshold, dividing the coincidence data according to the coincidence threshold, and obtaining a low coincidence data set and a high coincidence data set respectively; Edges are depicted according to the low overlap data set and the high overlap data set to obtain image segmentation edges, and image segmentation is performed on the preprocessed PCB image according to the image segmentation edges to obtain multiple preprocessed images, and the image segmentation method is recorded.

3. A PCB circuit board defect detection method based on computer vision according to claim 2, characterized in that: The step of obtaining a target defect feature set by combining the target image and the batch number, marking the target image for defects according to the target defect feature set, and obtaining the first circuit board defect is specifically as follows: performing content matching and screening on the defect feature set in combination with the target image and the batch number to obtain a target defect feature set; Based on the target defect feature set, defect recognition is performed on the processed points and processed surfaces in the target image, and defect marking is performed on the identified defects to obtain marked defects; Extracting features of the marking defect to obtain appearance features of the marking defect, and obtaining a defect grade of the marking defect according to the appearance features; A first circuit board defect of the PCB circuit board is obtained according to the marked defect and the defect level.

4. A PCB circuit board defect detection method based on computer vision according to claim 3, characterized in that: The steps of obtaining historical batch inspection results of PCB circuit boards, establishing a historical batch defect database according to the historical batch inspection results, and performing a secondary defect comparison on the target image according to the historical batch defect database to obtain the second circuit board defect are specifically as follows: Obtain historical batch test results of PCB circuit boards, sort out the historical batch test results by batch and perform standard digitization to obtain historical batch test data; Establish a historical batch defect database based on the historical batch inspection data, and perform secondary defect comparison on the target image based on the historical batch defect database as a comparison benchmark to obtain historical defects occurring on the PCB circuit board; According to the historical defect, a second circuit board defect of the PCB circuit board is obtained.

5. A PCB circuit board defect detection method based on computer vision according to claim 4, characterized in that: After the step of obtaining a second circuit board defect of the PCB circuit board according to the historical defect, the method further includes: Obtaining defect data of the PCB circuit board according to the first circuit board defect and the second circuit board defect; The defect data is substituted into the defect feature set for matching, and the unmatched defect data is marked as additional defect data, and the additional defect data is added to the defect feature set.

6. A PCB circuit board defect detection method based on computer vision according to claim 5, characterized in that: The steps of obtaining a defect point of the PCB circuit board by combining the first circuit board defect and the second circuit board defect, describing the defect point to obtain a defect description, and generating a defect processing method according to the defect description are specifically as follows: Obtaining a defect point of the PCB circuit board according to the first circuit board defect and the second circuit board defect; According to the defect point, the appearance, function and location of the defect point are described to obtain a defect description; The current PCB circuit board production process is obtained, and the defect description is substituted into the production process, the formation of the defect point is simulated, the defect cause causing the defect is obtained, and a defect treatment method is generated according to the defect cause.

Citation Information

Patent Citations

  • Printed circuit board defect detection system and method based on visual edge calculation

    CN115060742A

  • Welding defect detection and identification method and system based on machine vision

    CN117808814A

  • Touch screen defect detection method and system based on machine vision

    CN118314145A

Cited By

  • Image restoration method suitable for rain environment test

    CN122841198A