Printed circuit board standard library manufacturing and quality detection method and device based on AOI optical detection equipment and storage medium
By applying image preprocessing, filtering, segmentation and classification technologies in AOI optical inspection equipment, we independently developed automatic identification of printed circuit board components and construction of standard libraries, which solved the problems of heavy workload and low maintenance efficiency in the existing technology. Efficient and accurate printed circuit board quality inspection is achieved.
Patent Information
- Application Number
- CN202411373117.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, when using AOI automatic optical detection equipment to conduct welding quality inspection of electronic controller printed circuit boards, a large number of standard images of different versions need to be produced according to the actual status of the product, resulting in large workload and low maintenance efficiency.
By obtaining the printed circuit board optical image collected by AOI equipment, image pre -processing, filtering, segmentation and classification are performed, and the automatic identification, extraction, classification and screening process of independently develop components will be used to build a standard library for printing circuit boards to achieve quality testing.
It realizes the automatic establishment of standard libraries for printed circuit boards of different types of electronic controllers, and automatically detects miswelding and missing soldering to ensure the accuracy of detection results, prevent human errors, and improve maintenance efficiency.
Smart Images

Figure CN119359641A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of aircraft engine maintenance, and in particular to a method, device and storage medium for preparing a printed circuit board standard library and quality inspection based on AOI optical inspection equipment. Background Art
[0002] The electronic controller is an important part of the aircraft engine. When repairing an aircraft engine, the electronic controller is also included. The electronic controller repair mainly includes the repair of hardware structures such as aviation sockets, housings, shock absorbers, and printed circuit boards. The printed circuit board repair is an important part of the electronic controller repair. The quality of its repair directly affects the performance of the electronic controller's software and hardware, and then affects the performance of the aircraft engine.
[0003] At present, AOI automatic optical inspection equipment is used to check the welding quality of electronic controller printed circuit boards. This method requires secondary development in advance to produce standard images, and then compare the standard images with the product images and report the difference information, and combine manual judgment to confirm the difference information one by one. Due to the frequent changes in the technical status of electronic controllers, and the presence of certain manual welding and flying wires during manufacturing or repair, a large number of different versions of standard images need to be produced according to the actual status of the product, which is labor-intensive and has low maintenance efficiency. Summary of the invention
[0004] The purpose of the present application is to provide a method, device and storage medium for preparing and inspecting a standard library of printed circuit boards based on AOI optical inspection equipment, so as to solve the problems in the prior art of using AOI automatic optical inspection equipment to inspect the welding quality of electronic controller printed circuit boards, which requires the preparation of a large number of different versions of standard images according to the actual status of the product, resulting in a large workload and low maintenance efficiency due to the frequent changes in the technical status of the electronic controller and certain manual welding and flying wires during manufacturing or repair.
[0005] To achieve the above-mentioned purpose, the embodiment of the present application provides a method for preparing a standard library of printed circuit boards and inspecting their quality based on an AOI optical inspection device, comprising the following steps: obtaining optical images of different types and packaged components in a standard circuit board collected using an AOI automatic optical inspection device, and obtaining a local red, green and blue tricolor image after the optical image is magnified;
[0006] All the local red, green and blue three-color images are stitched into a three-color layout, and Gaussian filtering is performed on the three-color layout to remove noise, so as to obtain a first image of the circuit board that only retains component information;
[0007] Using a threshold filtering method, respectively extracting the plate color and the line color in the first image for filtering to obtain a target image;
[0008] Convert the pixels on the target image into a picture pixel matrix, use a search algorithm to mark and record the components of the same type, and achieve preliminary classification of the components;
[0009] Fusion classification technology is used to eliminate small areas and merge adjacent areas to achieve component recognition and obtain recognition images;
[0010] According to the component pixel point set in the identified image, a new component pixel point vertex coordinate set is calculated, and a rectangular screenshot is taken of the overall color image obtained by splicing all local red, green and blue three-color images according to the four vertex coordinates to obtain a component image and corresponding vertex coordinate data as the extracted component information;
[0011] Compressing and classifying the extracted component images;
[0012] Generate component library and circuit board library according to classification results, circuit board and component characteristics;
[0013] The circuit board of the corresponding model is retrieved from the circuit board library, and the corresponding model and position information of the components in the circuit board are queried, and the component information of the test circuit board is compared with that of the standard circuit board. If the information is consistent, it is determined that the quality of the test circuit board is qualified.
[0014] Optionally, the adopting a threshold filtering method to extract the plate color and the line color in the first image respectively for filtering to obtain a target image includes:
[0015] Performing board color filtering on the first image of the preprocessed circuit board to unify the board color of the circuit board into blue, thereby obtaining a second image;
[0016] Performing circuit board copper line filtering to remove the copper lines on the second image, thereby obtaining a filtered third image;
[0017] Binarizing the third image to obtain a fourth black-and-white image of the circuit board with obvious contrast;
[0018] A fifth image of the circuit board is obtained by performing Gaussian filtering and denoising on the fourth image;
[0019] The three fifth images are superimposed and merged, and the fifth images are denoised using Gaussian filtering to obtain the target image.
[0020] Optionally, converting pixels on the target image into a picture pixel matrix, using a search algorithm to mark and record components of the same type, and realizing preliminary classification of components, includes:
[0021] Assume the picture pixel matrix is D ij , component set S = {s1,s2,s3,…,sn},s n is the set of pixels contained in the nth component, and D ij ∈[R i,j =0,G i,j =0,B i,j =0|D ij =1]∪[R i,j =254,G i,j =254,B i,j =254|D ij =0], R i,j represents the pixel at coordinate (i, j) in the image obtained using red backlight, G i,j represents the pixel at coordinate (i, j) in the image obtained using green backlight, B i,j represents the pixel at coordinate (i, j) in the image obtained using a blue backlight. Each D ij The eight surrounding pixels are D i-1,j-1 ,D i-1,j ,D i-1,j+1 ,D i,j-1 ,D i,j+1 ,D i+1,j-1 ,D i+1,j ,D i+1,j+1 , detect D ij The eight surrounding pixels;
[0022] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 = 0, that is, the values of the eight pixels are all 0, then a new element s is added to the set S n+1 That is, S∪{s n+1}, and at this time s n+1 ={D ij};
[0023] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 =1, check the subset s of the eight pixels with a value of 1 in the set S. n , and pixel D ij Add to subset s n In, that is, s n ∪{Dij};
[0024] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 ≥2, check the subset s in set S where multiple pixels with values of 1 among the eight pixels are located. n ,s n+1 ,s n+2 ... and merge these subsets n =s n ∪s n+1 ∪s n+2 ∪…, and delete redundant subsets in the set S, S = S-{s n+1}-{s n+2}-…, and so on, traverse all the pixels and convert D ij All pixels with a value of 1 in the set are initially assigned to a subset s of the set S. n middle.
[0025] Optionally, the fusion classification technology is used to eliminate small areas, merge adjacent areas, realize component recognition, and obtain a recognition image, including:
[0026] Calculate the four vertex numbers of all subsets in set S in For n All elements of D ij The minimum value of i in For n All elements of D ij The maximum value of i in For n All elements of D ij The minimum value of j in For n All elements of D ij The maximum value of j in ;
[0027] At this time, the component set S = {s1, s2, s3, ..., s n} is converted into a set of vertex coordinates of the pixel position of the component image G = {g1, g2, g3, ..., g n},and
[0028] Get any two subsets g in the set G n and g m The distance between nm ;
[0029] Set the distance threshold H according to the size of the image. nm ≤H, subset s in set S n and m Merge and delete redundant subsets m ;
[0030] After the component subsets are merged, all new subsets s are counted. n The pixel D contained in ij The number k n , and set the pixel number threshold K according to the size of the image. n ≤K, then delete the corresponding subset s from the set S n , and finally the component pixel point set S after fusion and optimization is obtained.
[0031] Optionally, compressing and classifying the extracted component images includes:
[0032] The extracted component image is compressed into a three-channel three-dimensional vector by using a convolutional autoencoder for data compression training, and the three-channel three-dimensional vector is put into K-means for classification.
[0033] Optionally include:
[0034] Convolutional Autoencoder:
[0035]
[0036] During training, a regularization term is added to the loss function to make the derivative of the encoder function as small as possible. Input data x, encoding function h(x), decoding function g(x), loss function L(x), regularization parameter λ, loss function makes the autoencoder insensitive to small changes in the image:
[0037]
[0038] Optionally include:
[0039] After the convolutional autoencoder is trained, the encoding function h(x) is used to generate a three-channel three-dimensional vector for K-means classification. The number of classification clusters is determined according to the number of component types, and the standard image compression information of the corresponding components is selected as the classification center of the initial cluster.
[0040] K-means classification clustering center point calculation method:
[0041] M k =[(r k1 ,g k1 ,b k1 ),(r k2 ,gk2 ,b k2 ),(r k3 ,g k3 ,b k3 )],
[0042] X i =[(r i1 ,g i1 ,b i1 ),(r i2 ,g i2 ,b i2 ),(r i3 ,g i3 ,b i3 )],
[0043]
[0044] M k is the classification center point, X i is the classification element, D ik is the distance from the classification element to the classification center point;
[0045] New classification center point calculation method:
[0046]
[0047] Iteratively calculate new classification center points until all classification partitions gradually converge.
[0048] Optionally include:
[0049] According to the classification results, all extracted component images are labeled with corresponding classification labels, and the classified non-component noise data are labeled with noise data labels;
[0050] Put the labeled component image data into the convolutional neural network for training to obtain the component classifier;
[0051] The component classifier is used to screen and classify the newly extracted original device image data.
[0052] To achieve the above-mentioned purpose, the present application also provides a printed circuit board standard library production and quality inspection device based on AOI optical inspection equipment, including: a memory; and
[0053] A processor connected to the memory is configured to execute the steps of the method described above.
[0054] To achieve the above objectives, the present application also provides a computer storage medium on which a computer program is stored, wherein the computer program implements the steps of the above method when executed by a machine.
[0055] The embodiments of the present application have the following advantages:
[0056] By using the above method, through the collection and comparison of printed circuit board images, image filtering and noise reduction technology, image segmentation and classification technology are adopted to independently develop the automatic identification, extraction, classification and screening process of printed circuit board components, and on this basis, a printed circuit board standard library is constructed to realize the quality inspection of printed circuit boards. Using this application, it is possible to automatically establish a standard library of printed circuit boards for electronic controllers of different models, and automatically perform wrong soldering and leak detection of printed circuit boards. It is not only simple and convenient to operate, but also can ensure the accuracy of the test results, prevent human errors, and ensure the quality of equipment maintenance. Thereby solving the problem of large workload, easy to produce human errors and low work efficiency when manually performing printed circuit board quality inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the implementation methods of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings described below are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0058] Figure 1 A flowchart of a method for preparing a standard library of printed circuit boards and inspecting quality based on AOI optical inspection equipment provided for at least one embodiment of the present application;
[0059] Figure 2A A red image of a local red, green and blue color image of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0060] Figure 2B A green image of a local red, green and blue color image of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided in at least one embodiment of the present application;
[0061] Figure 2C A blue image of a local red, green and blue color image of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided in at least one embodiment of the present application;
[0062] Figure 3 A third image schematic diagram of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0063] Figure 4Another third image schematic diagram of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0064] Figure 5 A third image schematic diagram of a printed circuit board standard library preparation and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0065] Figure 6 A fifth image schematic diagram of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0066] Figure 7 Another fifth image schematic diagram of a printed circuit board standard library preparation and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0067] Figure 8 A fifth image schematic diagram of a printed circuit board standard library preparation and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0068] Fig. 9 A target image of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0069] Fig.10 An identification image of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0070] Fig.11 A picture of a component in a method for preparing a standard library of printed circuit boards and inspecting quality based on AOI optical inspection equipment provided by at least one embodiment of the present application;
[0071] Fig.12 A circuit board library data structure diagram of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided in at least one embodiment of the present application;
[0072] Fig.13 A component library data structure diagram of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment provided in at least one embodiment of the present application;
[0073] Fig.14 A module block diagram of a printed circuit board standard library production and quality inspection device based on AOI optical inspection equipment provided in at least one embodiment of the present application. DETAILED DESCRIPTION
[0074] The following is a description of the implementation of the present application by specific specific embodiments. People familiar with the technology can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0075] It should be noted that, in the claims and description of the present application, the steps may be executed substantially in parallel or in the reverse order under appropriate circumstances, depending on the functions involved, and the terms "first", "second" and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance.
[0076] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0077] The purpose of this application is to independently develop a process for automatic identification, extraction, classification, and screening of circuit board components through circuit board image acquisition and comparison, image filtering and noise reduction technology, image segmentation and classification technology, and build a circuit board standard library based on this to achieve circuit board quality inspection.
[0078] In particular, the following technical difficulties are solved:
[0079] How to obtain component information in a circuit board;
[0080] How to pre-process the component information in the circuit board and retain the useful component information;
[0081] How to identify and extract components from circuit boards;
[0082] How to classify and screen components in circuit boards;
[0083] How to design circuit board and component library data structure;
[0084] How to test the quality of circuit boards.
[0085] An embodiment of the present application provides a method for preparing a standard library of printed circuit boards and a method for quality inspection based on AOI optical inspection equipment, referring to Figure 1 , Figure 1A flowchart of a printed circuit board standard library production and quality inspection method based on AOI optical inspection equipment is provided in at least one embodiment of the present application. It should be understood that the method may also include additional boxes not shown and / or the boxes shown may be omitted, and the scope of the present application is not limited in this respect.
[0086] At step 101, optical images of different types of packaged components in a standard circuit board are acquired using an AOI automatic optical inspection device, and the optical images are magnified to obtain a local red, green and blue three-color image.
[0087] At step 102, all the local red, green and blue three-color images are spliced into a three-color map, and Gaussian filtering is performed on the three-color map to remove noise, thereby obtaining a first image of the circuit board that only retains component information.
[0088] In step 103, a threshold filtering method is used to extract the plate color and line color in the first image and perform filtering to obtain a target image.
[0089] At step 104, the pixels on the target image are converted into a picture pixel matrix, and the components of the same type are marked and recorded using a search algorithm to achieve preliminary classification of the components.
[0090] In step 105, a fusion classification technique is used to remove small areas and merge adjacent areas to achieve component recognition and obtain a recognition image.
[0091] At step 106, a new set of component pixel vertex coordinates is calculated based on the component pixel set in the identified image, and a rectangular screenshot is taken of the overall color image obtained by splicing all local red, green and blue three-color images based on the four vertex coordinates to obtain a component image and corresponding vertex coordinate data as the extracted component information.
[0092] At step 107, the extracted component images are compressed and classified.
[0093] At step 108, a component library and a circuit board library are generated according to the classification results, the characteristics of the circuit board and the components.
[0094] At step 109, a circuit board of corresponding model is retrieved from the circuit board library, and the corresponding model and position information of the components in the circuit board are queried, and the component information of the test circuit board is compared with that of the standard circuit board. If the information is consistent, it is determined that the quality of the test circuit board is qualified.
[0095] Specifically include:
[0096] (I) Image preprocessing
[0097] In order to make the acquired pictures contain more useful information, the present application first obtains optical images of different types and packaged components in a standard circuit board collected by AOI automatic optical inspection equipment, and obtains a high-resolution local red, green and blue tricolor image after the optical image is magnified. FIG. 2A to FIG. 2C They are respectively a red, green, and blue color map in the local red, green, and blue color map.
[0098] To avoid the stitched image being too large, all the local red, green and blue three-color images are reduced (for example, reduced by 0.08 times), and all the local red, green and blue three-color images are stitched into a three-color map (there are three three-color maps, which are obtained under red, green and blue backlights respectively), and finally Gaussian filtering is performed on the three-color maps to remove noise, and the first image of the circuit board that only retains the component information is obtained (there are three images).
[0099] (II) Target Image Segmentation
[0100] The study found that, except for components, the background color of the circuit board is relatively simple, and the main colors are the color of the circuit board itself and the color of the copper wires connecting the components. In addition, PCB boards are basically only green and yellow, and the copper wires are basically purple-red. In view of this feature of the circuit board, in order to reduce the amount of image data that retains component information, highlight the outline of the target device, and obtain a black and white image with obvious contrast, image segmentation technology is used.
[0101] The color area filtering technology is independently designed, and the threshold filtering method is adopted, [R(i,j); G(i,j); B(i,j)], to extract the plate color and line color in the first image respectively for filtering to obtain the target image. In some embodiments, it specifically includes:
[0102] First, the first image of the preprocessed circuit board is subjected to color filtering to unify the color of the circuit board into blue, thereby obtaining the second image (three images). i,j represents the pixel at coordinate (i, j) in the image obtained using red backlight, G i,j represents the pixel at coordinate (i, j) in the image obtained using green backlight, B i,j Represents the pixel at coordinate (i, j) in the image obtained using a blue backlight.
[0103] Yellow board color green light parameter settings:
[0104] [30≤R i,j ≤111,30≤G i,j ≤130,45≤B i,j ≤125|R i,j =254,G i,j =0,B i,j =0]
[0105] Yellow board color blue light parameter settings:
[0106] [5≤R i,j ≤40,13≤G i,j ≤70,12≤B i,j ≤80|R i,j =254,G i,j =0,B i,j =0]
[0107] Yellow board color red light parameter settings:
[0108] [0≤R i,j ≤30,8≤G i,j ≤60,38≤B i,j ≤88|R i,j =254,G i,j =0,B i,j =0]
[0109] Green board color green light parameter settings:
[0110] [10≤R i,j ≤83,28≤G i,j ≤111,28≤B i,j ≤114|R i,j =254,G i,j =0,B i,j =0]
[0111] Green board color blue light parameter settings:
[0112] [0≤R i,j ≤32,0≤G i,j ≤59,0≤B i,j ≤44|R i,j =254,G i,j =0,B i,j =0]
[0113] Green board color red light parameter settings:
[0114] [6≤R i,j ≤89,0≤G i,j ≤57,0≤B i,j ≤62|R i,j =254,G i,j =0,B i,j =0]
[0115] Then, the copper wires on the circuit board are filtered out to remove the copper wires on the second image, and the filtered third image (three images) is obtained. Figure 3-Figure 5 shown.
[0116] Green board line color green light parameter settings:
[0117] [29≤R i,j ≤116,96≤G i,j ≤187,78≤B i,j ≤179|R i,j =254,G i,j =0,B i,j =0]
[0118] Green board line color blue light parameter settings:
[0119] [0≤R i,j ≤41,24≤G i,j ≤91,22≤B i,j ≤77|R i,j =254,G i,j =0,B i,j =0]
[0120] Green board line color red light parameter settings:
[0121] [10≤R i,j ≤90,25≤G i,j ≤84,20≤B i,j ≤84|R i,j =254,G i,j =0,B i,j =0]
[0122] The third image is binarized to obtain a fourth black-and-white image of the circuit board with obvious contrast, and the formula is:
[0123] [R i,j ≠254,G i,j ≠0,B i,j ≠0|R i,j =254,G i,j =254,B i,j =254]
[0124] [R i,j =254,G i,j =0,B i,j =0|R i,j =0,G i,j =0,B i,j =0]
[0125] After performing Gaussian filtering and denoising on the fourth image, a fifth image of the circuit board is obtained, such as Figure 6-Figure 8 shown.
[0126] Finally, the three binary circuit board fifth images are superimposed and merged. Since the superposition and merging process will cause the noise on the three images to be superimposed, the Gaussian filter is used again to denoise the fifth image, and finally the following is obtained: Fig. 9 The target image of the circuit board is shown.
[0127] (III) Component identification
[0128] Component identification uses self-designed preliminary classification and fusion classification technology. The preliminary classification technology converts the pixels on the target image of the circuit board into a picture pixel matrix with only 0 and 1 elements, and uses a search algorithm to mark and record components of the same type to achieve preliminary classification of components. In some embodiments, it specifically includes:
[0129] Assume the picture pixel matrix is D ij , component set S = {s1,s2,s3,…,s n},s n is the set of pixels contained in the nth component, and D ij ∈[R i,j =0,G i,j =0,B i,j =0|D ij =1]∪[R i,j =254,G i,j =254,B i,j =254|D ij =0], R i,j represents the pixel at coordinate (i, j) in the image obtained using red backlight, G i,j represents the pixel at coordinate (i, j) in the image obtained using green backlight, B i,j represents the pixel at coordinate (i, j) in the image obtained using a blue backlight. Each D ij The eight surrounding pixels are D i-1,j-1 ,D i-1,j ,D i-1,j+1 ,D i,j-1 ,D i,j+1 ,D i+1,j-1 ,D i+1,j ,D i+1,j+1 , detect D ij The eight surrounding pixels;
[0130] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1= 0, that is, the values of the eight pixels are all 0, then a new element s is added to the set S n+1 That is, S∪{s n+1}, and at this time s n+1 ={D ij};
[0131] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 =1, check the subset s of the eight pixels with a value of 1 in the set S. n , and pixel D ij Add to subset s n In, that is, s n ∪{D ij};
[0132] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 ≥2, check the subset s in set S where multiple pixels with values of 1 among the eight pixels are located. n ,s n+1 ,s n+2 ... and merge these subsets n =s n ∪s n+1 ∪s n+2 ∪…, and delete redundant subsets in the set S, S = S-{s n+1}-{s n+2}-…, and so on, traverse all the pixels and convert D ij All pixels with a value of 1 in the set are initially assigned to a subset s of the set S. n middle.
[0133] After the initial classification, there are problems such as retaining useless via information, separating IC pins from IC bodies, and segmenting some devices. Fusion classification technology is used to eliminate small areas and merge adjacent areas to achieve component identification. The following results are obtained: Fig.10 In some embodiments, the fusion classification technology specifically includes:
[0134] First calculate the four vertex numbers of all subsets in set S in Forn All elements of D ij The minimum value of i in For n All elements of D ij The maximum value of i in For n All elements of D ij The minimum value of j in For n All elements of D ij The maximum value of j in ;
[0135] At this time, the component set S = {s1, s2, s3, ..., s n} is converted into a set of vertex coordinates of the pixel position of the component image G = {g1, g2, g3, ..., g n},and
[0136] Get any two subsets g in the set G n and g m The distance between nm , the calculation method is as follows:
[0137] 1. Subset g n and g m intersect.
[0138]
[0139] 2. Subset g n and g m Horizontal axis separation.
[0140]
[0141] 3. Subset g n and g m Separation of vertical axis.
[0142]
[0143] 4. Subset g n and g m Do not intersect.
[0144]
[0145] Set the distance threshold H according to the size of the image. nm ≤H, subset s in set S n and m Merge and delete redundant subsets m ;
[0146] After the component subsets are merged, all new subsets s are counted.n The pixel D contained in ij The number k n , and set the pixel number threshold K according to the size of the image. n ≤K, then delete the corresponding subset s from the set S n , and finally the component pixel point set S after fusion and optimization is obtained.
[0147] (IV) Component extraction
[0148] In order to solve the problem of component extraction, a new component pixel vertex coordinate set G = {g1, g2, g3, ..., g n},and And according to the coordinates of the four vertices Take a rectangular screenshot of the overall color image obtained by stitching all the local red, green and blue three-color images to obtain the component image and the corresponding vertex coordinate data as the extracted component information. One of the component images is shown in Fig.11 .
[0149] Next, the extracted component images are compressed and classified.
[0150] (V) Component Classification
[0151] In some embodiments, a convolutional autoencoder is used for data compression training to compress the extracted component image into a three-channel three-dimensional vector, and then the three-channel three-dimensional vector is put into K-means for classification.
[0152] The processing steps include:
[0153] Convolutional Autoencoder:
[0154]
[0155] During training, a regularization term is added to the loss function to make the derivative of the encoder function as small as possible. Input data x, encoding function h(x), decoding function g(x), loss function L(x), regularization parameter λ, loss function makes the autoencoder insensitive to small changes in the image:
[0156]
[0157] The encoder h(x) consists of three parts: convolutional layer, maximum pooling layer, and fully connected layer. The fully connected layer outputs a three-channel three-dimensional vector as a compressed representation of the image.
[0158] Convolutional Layer:
[0159] M[r,g,b]=∑(X[r,g,b]×W[p,q,c,k])+b[k],
[0160] M[r,g,b] is the output feature map, X[r,g,b] is the input image data, W[p,q,c,k] is the convolution kernel, and b[k] is the bias term;
[0161] Max pooling layer:
[0162] C[r,g,b]=max(M[r,g,b]),
[0163] Fully connected layer:
[0164] Y=f(U×C[r,g,b]+l)=[(r1,g1,b1),(r2,g2,b2),(r3,g3,b3)],
[0165] Y is the compressed three-channel three-dimensional vector, U is the weight of each layer of the connection layer, f(x) is the activation function, and l is the bias term.
[0166] The decoder corresponding to the decoding function g(x) and the encoder corresponding to the encoding function h(x) have the same and opposite structure. The structure of the encoder is: original image data → convolution layer → pooling layer → fully connected layer; the structure of the decoder is: fully connected layer → depooling layer → deconvolution layer → reconstructed image data.
[0167] After the convolutional autoencoder is trained, the encoding function h(x) is used to generate compressed information of the image (three-channel three-dimensional vector), and the compressed information is classified by K-means. The number of classification clusters is determined according to the number of component types, and the standard image compression information of the corresponding component is selected as the classification center of the initial cluster;
[0168] K-means classification clustering center point calculation method:
[0169] M k =[(r k1 ,g k1 ,b k1 ),(r k2 ,g k2 ,b k2 ),(r k3 ,g k3 ,b k3 )],
[0170] X i =[(r i1 ,g i1 ,b i1 ),(r i2 ,g i2 ,b i2 ),(ri3 ,g i3 ,b i3 )],
[0171]
[0172] M k is the classification center point, X i is the classification element, D ik is the distance from the classification element to the classification center point;
[0173] New classification center point calculation method:
[0174]
[0175] Iteratively calculate new classification center points until all classification partitions gradually converge.
[0176] (VI) Component screening
[0177] In some embodiments, according to the classification results, all extracted component images are labeled with corresponding classification labels, and the classified non-component noise data are labeled with noise data labels.
[0178] Then the labeled component image data is put into the convolutional neural network for training to obtain a component classifier. The convolutional neural network has a similar structure to the encoder h(x) in the convolutional autoencoder, but the output result becomes the corresponding component classification or noise data. After the component classifier is trained, the component classifier can be directly used to screen and classify the newly extracted original component image data.
[0179] (VII) Component library and circuit board library data structure design
[0180] According to the classification results, the characteristics of the circuit board and components, design the circuit board library and component library data structure. According to the above method, collect the component data of the newly added circuit board, and automatically generate the component library and circuit board library according to the circuit board and component library data structure. Circuit board library data structure reference Fig.12 : Component library data structure reference Fig.13 :
[0181] (VIII) Circuit board quality inspection
[0182] The circuit board of the corresponding model is retrieved from the circuit board library, and the corresponding model and position information of the components in the circuit board are queried, and the component information of the test circuit board is compared with that of the standard circuit board. If the information is consistent, it is determined that the quality of the test circuit board is qualified.
[0183] Through the above method, through circuit board image acquisition and comparison, image filtering and noise reduction technology, image segmentation and classification technology are used to independently develop the automatic identification, extraction, classification and screening process of circuit board components, and build a circuit board standard library based on this to achieve circuit board quality detection. Using this application, it is possible to automatically establish a standard library of electronic controller circuit boards of different models, and automatically perform circuit board mis-welding and leak detection. It is not only simple and convenient to operate, but also can ensure the accuracy of the test results, prevent human errors, and ensure the quality of equipment maintenance. Thereby solving the problem of heavy workload, easy human errors and low work efficiency when manually performing circuit board quality inspection.
[0184] Specific beneficial effects include:
[0185] 1. Easy operation
[0186] This application can greatly improve the work efficiency of electronic controller maintenance personnel. When using AOI automatic optical inspection equipment to check the soldering quality of circuit boards, there is no need to spend a lot of time on secondary development of standard circuit board samples.
[0187] 2. Prevent human errors
[0188] This application can effectively prevent human errors and ensure the accuracy of standard circuit board samples. Since electronic controller circuit boards have many components and the components are small in size, manual inspection of circuit board welding quality is prone to inaccurate human inspections, false inspections, and missed inspections, which poses a hidden danger to the quality of circuit board repairs.
[0189] 3. Solve bottleneck problems
[0190] This application can solve the bottleneck problem of heavy workload and low work efficiency in manual production of standard circuit board samples. Using this application, it can replace manual work, automatically build a circuit board standard library, realize circuit board wrong soldering and leak soldering inspection, and greatly improve the maintenance efficiency of electronic controller circuit boards.
[0191] Fig.14 A block diagram of a printed circuit board standard library production and quality inspection device based on AOI optical inspection equipment provided in at least one embodiment of the present application. The device includes:
[0192] A memory 201; and a processor 202 connected to the memory 201, wherein the processor 202 is configured to: obtain optical images of different types and packaged components in a standard circuit board collected using an AOI automatic optical inspection device, and obtain a local red, green and blue tricolor image after the optical image is magnified;
[0193] All the local red, green and blue three-color images are stitched into a three-color layout, and Gaussian filtering is performed on the three-color layout to remove noise, so as to obtain a first image of the circuit board that only retains component information;
[0194] Using a threshold filtering method, respectively extracting the plate color and the line color in the first image for filtering to obtain a target image;
[0195] Convert the pixels on the target image into a picture pixel matrix, use a search algorithm to mark and record the components of the same type, and achieve preliminary classification of the components;
[0196] Fusion classification technology is used to eliminate small areas and merge adjacent areas to achieve component recognition and obtain recognition images;
[0197] According to the component pixel point set in the identified image, a new component pixel point vertex coordinate set is calculated, and a rectangular screenshot is taken of the overall color image obtained by splicing all local red, green and blue three-color images according to the four vertex coordinates to obtain a component image and corresponding vertex coordinate data as the extracted component information;
[0198] Compressing and classifying the extracted component images;
[0199] Generate component library and circuit board library according to classification results, circuit board and component characteristics;
[0200] The circuit board of the corresponding model is retrieved from the circuit board library, and the corresponding model and position information of the components in the circuit board are queried, and the component information of the test circuit board is compared with that of the standard circuit board. If the information is consistent, it is determined that the quality of the test circuit board is qualified.
[0201] In some embodiments, the processor 202 is further configured to: adopt a threshold filtering method to extract the plate color and the line color in the first image for filtering to obtain a target image, including:
[0202] Performing board color filtering on the first image of the preprocessed circuit board to unify the board color of the circuit board into blue, thereby obtaining a second image;
[0203] Performing circuit board copper line filtering to remove the copper lines on the second image, thereby obtaining a filtered third image;
[0204] Binarizing the third image to obtain a fourth black-and-white image of the circuit board with obvious contrast;
[0205] A fifth image of the circuit board is obtained by performing Gaussian filtering and denoising on the fourth image;
[0206] The three fifth images are superimposed and merged, and the fifth images are denoised using Gaussian filtering to obtain the target image.
[0207] In some embodiments, the processor 202 is further configured to: convert the pixels on the target image into a picture pixel matrix, use a search algorithm to mark and record the components of the same type, and implement preliminary classification of the components, including:
[0208] Assume the picture pixel matrix is D ij , component set S = {s1,s2,s3,…,s n},s n is the set of pixels contained in the nth component, and D ij ∈[R i,j =0,G i,j =0,B i,j =0|D ij =1]∪[R i,j =254,G i,j =254,B i,j =254|D ij =0], R i,j represents the pixel at coordinate (i, j) in the image obtained using red backlight, G i,j represents the pixel at coordinate (i, j) in the image obtained using green backlight, B i,j represents the pixel at coordinate (i, j) in the image obtained using a blue backlight. Each D ij The eight surrounding pixels are D i-1,j-1 ,D i-1,j ,D i-1,j+1 ,D i,j-1 ,D i,j+1 ,D i+1,j-1 ,D i+1,j ,D i+1,j+1 , detect D ij The eight surrounding pixels;
[0209] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 = 0, that is, the values of the eight pixels are all 0, then a new element s is added to the set S n+1 That is, S∪{s n+1}, and at this time s n+1 ={D ij};
[0210] When Di-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 =1, check the subset s of the eight pixels with a value of 1 in the set S. n , and pixel D ij Add to subset s n In, that is, s n ∪{D ij};
[0211] When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 ≥2, check the subset s in set S where multiple pixels with values of 1 among the eight pixels are located. n ,s n+1 ,s n+2 ... and merge these subsets n =s n ∪s n+1 ∪s n+2 ∪…, and delete redundant subsets in the set S, S = S-{s n+1}-{s n+2}-…, and so on, traverse all the pixels and convert D ij All pixels with a value of 1 in the set are initially assigned to a subset s of the set S. n middle.
[0212] In some embodiments, the processor 202 is further configured to: adopt fusion classification technology to eliminate small areas, merge adjacent areas, realize component recognition, and obtain a recognition image, including:
[0213] Calculate the four vertex numbers of all subsets in set S in For n All elements of D ij The minimum value of i in For n All elements of D ij The maximum value of i in For n All elements of D ij The minimum value of j in For n All elements of Dij The maximum value of j in ;
[0214] At this time, the component set S = {s1, s2, s3, ..., s n} is converted into a set of vertex coordinates of the pixel position of the component image G = {g1, g2, g3, ..., g n},and
[0215] Get any two subsets g in the set G n and g m The distance between nm ;
[0216] Set the distance threshold H according to the size of the image. nm ≤H, subset s in set S n and m Merge and delete redundant subsets m ;
[0217] After the component subsets are merged, all new subsets s are counted. n The pixel D contained in ij The number k n , and set the pixel number threshold K according to the size of the image. n ≤K, then delete the corresponding subset s from the set S n , and finally the component pixel point set S after fusion and optimization is obtained.
[0218] In some embodiments, the processor 202 is further configured to: compress and classify the extracted component images, including:
[0219] The extracted component image is compressed into a three-channel three-dimensional vector by using a convolutional autoencoder for data compression training, and the three-channel three-dimensional vector is put into K-means for classification.
[0220] In some embodiments, the processor 202 is further configured to include:
[0221] Convolutional Autoencoder:
[0222]
[0223] During training, a regularization term is added to the loss function to make the derivative of the encoder function as small as possible. Input data x, encoding function h(x), decoding function g(x), loss function L(x), regularization parameter λ, loss function makes the autoencoder insensitive to small changes in the image:
[0224]
[0225] In some embodiments, the processor 202 is further configured to include:
[0226] After the convolutional autoencoder is trained, the encoding function h(x) is used to generate a three-channel three-dimensional vector for K-means classification. The number of classification clusters is determined according to the number of component types, and the standard image compression information of the corresponding components is selected as the classification center of the initial cluster.
[0227] K-means classification clustering center point calculation method:
[0228] M k =[(r k1 ,g k1 ,b k1 ),(r k2 ,g k2 ,b k2 ),(r k3 ,g k3 ,b k3 )],
[0229] X i =[(r i1 ,g i1 ,b i1 ),(r i2 ,g i2 ,b i2 ),(r i3 ,g i3 ,b i3 )],
[0230]
[0231] M k is the classification center point, X i is the classification element, D ik is the distance from the classification element to the classification center point;
[0232] New classification center point calculation method:
[0233]
[0234] Iteratively calculate new classification center points until all classification partitions gradually converge.
[0235] In some embodiments, the processor 202 is further configured to include:
[0236] According to the classification results, all extracted component images are labeled with corresponding classification labels, and the classified non-component noise data are labeled with noise data labels;
[0237] Put the labeled component image data into the convolutional neural network for training to obtain the component classifier;
[0238] The component classifier is used to screen and classify the newly extracted original device image data.
[0239] The specific implementation method is referred to the aforementioned method embodiment and will not be described in detail here.
[0240] The present application may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present application.
[0241] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0242] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0243] The computer program instructions for performing the operation of the present application can be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of a computer-readable program instruction to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute a computer-readable program instruction, thereby realizing various aspects of the present application.
[0244] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0245] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0246] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0247] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the function involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs the function or action of the specification, or can be realized by a combination of special-purpose hardware and computer instructions.
[0248] Note that, unless otherwise directly stated, all features disclosed in this specification (including any attached claims, abstracts and drawings) may be replaced by alternative features for achieving the same, equivalent or similar purposes. Therefore, unless otherwise explicitly stated, each feature disclosed is only an example of a group of equivalent or similar features. Where used, further, preferably, further and more preferably are simple beginnings for elaborating another embodiment based on the aforementioned embodiment, and the content of the further, preferably, further or more preferably followed by the combination with the aforementioned embodiment constitutes a complete construction of another embodiment. Several further, preferably, further or more preferably settings following the same embodiment can be arbitrarily combined to form another embodiment.
[0249] Although the present application has been described in detail above with general descriptions and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements may be made to the present application. Therefore, these modifications or improvements made without departing from the spirit of the present application are within the scope of protection claimed by the present application.
Claims
1. A method for preparing a standard library of printed circuit boards and for quality inspection based on AOI optical inspection equipment, characterized in that: The following steps are involved: Obtaining optical images of different types of packaged components in a standard circuit board collected by an AOI automatic optical inspection device, wherein the optical images are magnified to obtain a local red, green and blue tricolor image; All the local red, green and blue three-color images are spliced into a three-color layout, and Gaussian filtering is performed on the three-color layout to remove noise, so as to obtain a first image of the circuit board that only retains component information; Using a threshold filtering method, respectively extracting the plate color and the line color in the first image for filtering to obtain a target image; Convert the pixels on the target image into a picture pixel matrix, use a search algorithm to mark and record the components of the same type, and achieve preliminary classification of the components; Fusion classification technology is used to eliminate small areas and merge adjacent areas to achieve component recognition and obtain recognition images; According to the component pixel point set in the identified image, a new component pixel point vertex coordinate set is calculated, and a rectangular screenshot is taken of the overall color image obtained by splicing all local red, green and blue three-color images according to the four vertex coordinates to obtain a component image and corresponding vertex coordinate data as the extracted component information; Compressing and classifying the extracted component images; Generate component library and circuit board library according to classification results, circuit board and component characteristics; The circuit board of the corresponding model is retrieved from the circuit board library, and the corresponding model and position information of the components in the circuit board are queried, and the component information of the test circuit board is compared with that of the standard circuit board. If the information is consistent, it is determined that the quality of the test circuit board is qualified.
2. The method for preparing a standard library of printed circuit boards and detecting quality based on AOI optical detection equipment according to claim 1, characterized in that: The method of adopting a threshold filtering method to extract the plate color and the line color in the first image and filter them respectively to obtain a target image includes: Performing board color filtering on the first image of the preprocessed circuit board to unify the board color of the circuit board into blue, thereby obtaining a second image; Performing circuit board copper line filtering to remove the copper lines on the second image, thereby obtaining a filtered third image; Binarizing the third image to obtain a fourth black-and-white image of the circuit board with obvious contrast; A fifth image of the circuit board is obtained by performing Gaussian filtering and denoising on the fourth image; The three fifth images are superimposed and merged, and the fifth images are denoised using Gaussian filtering to obtain the target image.
3. The method for preparing a standard library of printed circuit boards and detecting quality based on AOI optical inspection equipment according to claim 1, characterized in that: The pixels on the target image are converted into a picture pixel matrix, and the components of the same type are marked and recorded using a search algorithm to achieve preliminary classification of the components, including: Assume the picture pixel matrix is D ij , component set S = {s1,s2,s3,…,s n },S n is the set of pixels contained in the nth component, and D ij ∈[R i,j =0,G i,j =0,B i,j =0|D ij =1]∪[R i,j =254,G i,j =254,B i,j =254|D ij =0]; R i,j represents the pixel at coordinate (i, j) in the image obtained using red backlight; G i,j represents the pixel at coordinate (i, j) in the image obtained using a green backlight; B i,j represents the pixel at coordinate (i, j) in the image obtained using a blue backlight; Each D ij The eight surrounding pixels are D i-1,j-1 ,D i-1,j ,D i-1,j+1 ,D i,j-1 ,D i,j+1 ,D i+1,j-1 ,D i+1,j ,D i+1,j+1 , detect D ij The eight surrounding pixels: When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 = 0, that is, the values of the eight pixels are all 0, then a new element s is added to the set S n+1 That is, S∪{s n+1 }, and at this time s n+1 ={D ij }; When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 =1, check the subset s of the eight pixels with a value of 1 in the set S. n , and pixel D ij Add to subset s n In, that is, s n ∪{D ij }; When D i-1,j-1 +D i-1,j +D i-1,j+1 +D i,j-1 +D i,j+1 +D i+1,j-1 +D i+1,j +D i+1,j+1 ≥2, check the subset s in set S where multiple pixels with values of 1 among the eight pixels are located. n ,s n+1 ,s n+2 ... and merge these subsets n =s n ∪s n+1 ∪s n+2 ∪…, and at the same time delete the redundant subsets in the set S, S = S-{s n+1 }-{s n+2 }-…, and so on, traverse all the pixels and convert D ij All pixels with a value of 1 in the set are initially assigned to a subset s of the set S. n middle.
4. The method for preparing a standard library of printed circuit boards and detecting quality based on AOI optical detection equipment according to claim 3, characterized in that: The fusion classification technology is used to eliminate small areas, merge adjacent areas, realize component recognition, and obtain a recognition image, including: Calculate the four vertex numbers of all subsets in set S in For n All elements of D ij The minimum value of i in For n All elements of D ij The maximum value of i in For n The minimum value of j among all elements of For n All elements of D ij The maximum value of j in ; At this time, the component set S = {s1, s2, s3, ..., s n } is converted into a set of vertex coordinates of the pixel position of the component image G = {g1, g2, g3, ..., g n },and Get any two subsets g in the set G n and g m The distance between nm ; Set the distance threshold H according to the size of the image. nm ≤H, subset s in set S n and m Merge and delete redundant subsets m ; After the component subsets are merged, all new subsets s are counted. n The pixel D contained in ij The number k n , and set the pixel number threshold K according to the size of the image. n ≤K, then delete the corresponding subset s from the set S n , and finally the component pixel point set S after fusion and optimization is obtained.
5. The method for preparing a standard library of printed circuit boards and detecting quality based on AOI optical detection equipment according to claim 1, characterized in that: The step of compressing and classifying the extracted component images includes: The extracted component image is compressed into a three-channel three-dimensional vector by using a convolutional autoencoder for data compression training, and the three-channel three-dimensional vector is put into K-means for classification.
6. The method for preparing a standard library of printed circuit boards and inspecting their quality based on AOI optical inspection equipment according to claim 5, characterized in that: include: Convolutional Autoencoder: During training, a regularization term is added to the loss function to make the derivative of the encoder function as small as possible. Input data x, encoding function h(x), decoding function g(x), loss function L(x), regularization parameter λ, loss function makes the autoencoder insensitive to small changes in the image:
7. The method for preparing a standard library of printed circuit boards and inspecting their quality based on AOI optical inspection equipment according to claim 6, characterized in that: include: After the convolutional autoencoder is trained, the encoding function h(x) is used to generate a three-channel three-dimensional vector for K-means classification. The number of classification clusters is determined according to the number of component types, and the standard image compression information of the corresponding components is selected as the classification center of the initial cluster. K-means classification clustering center point calculation method: M k =[(r k1 ,g k1 ,b k1 ),(r k2 ,g k2 ,b k2 ),(r k3 ,g k3 ,b k3 )], X i =[(r i1 ,g i1 ,b i1 ),(r i2 ,g i2 ,b i2 ),(r i3 ,g i3 ,b i3 )], M k is the classification center point, X i is a classification element, D ik is the distance from the classification element to the classification center point; New classification center point calculation method: Iteratively calculate new classification center points until all classification partitions gradually converge.
8. The method for preparing a standard library of printed circuit boards and inspecting their quality based on AOI optical inspection equipment according to claim 7, characterized in that: include: According to the classification results, all extracted component images are labeled with corresponding classification labels, and the classified non-component noise data are labeled with noise data labels; Put the labeled component image data into the convolutional neural network for training to obtain the component classifier; The component classifier is used to screen and classify the newly extracted original component image data.
9. A printed circuit board standard library production and quality inspection device based on AOI optical inspection equipment, characterized in that: include: Memory; as well as A processor connected to the memory, the processor being configured to perform the steps of the method according to any one of claims 1 to 8.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a machine, the steps of the method according to any one of claims 1 to 8 are implemented.