PCB detection method and system

By collecting and processing the original pictures and gerber files of the PCB board, synthesizing the standard picture and configuring the region-specific detection parameters and methods, it solves the problems of low detection efficiency and difficult parameter separation in the existing technology, and achieves efficient and accurate detection and Quality traceability.

CN119359645APending Publication Date: 2025-01-24SHANGHAI TECHSENSE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411381133.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, PCB board detection efficiency is low and manual standards are not unified, which can easily lead to misjudgment and missed judgments, and it is difficult to quickly set the parameter separation between the detection area and different areas.

Method used

By collecting the original pictures of the PCB board, calculating the radiation transformation function, collecting multiple pictures in real time to synthesize the standard chart, creating and reading the gerber file, mapping it to the standard chart, obtaining the areas of different disks, and configuring different detection parameters and method to identify defects.

Benefits of technology

It improves the detection efficiency, achieves a higher detection rate, and the detection accuracy reaches 5um. It can freely combine detection areas according to gerber files to adapt to different production needs, and enhances quality traceability through OCR recognition function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359645A_ABST
    Figure CN119359645A_ABST
Patent Text Reader

Abstract

The invention provides a PCB detection method and system. The method comprises the steps that S1, an original picture of a PCB is collected; s2, a radiation transformation function is obtained through calculation of the original picture, multiple new PCB pictures are collected in real time, radiation pictures are obtained according to radiation transformation, and the multiple radiation pictures are synthesized into a standard picture; s3, creating and reading a gerber file, mapping the gerber file to the standard graph to obtain a new gerber graph layer of which the size is the same as that of the standard graph, and checking whether a disk is missed in the current standard graph or not according to the new gerber graph layer; s4, extracting different layers in the new gerber layers, and obtaining regions of different disks according to set operation; and S5, independently configuring different detection parameters and detection methods in the areas of different disks, and identifying defects. The detection efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PCB board detection, and in particular to a PCB board detection method and system. Background Art

[0002] PCB inspection refers to a series of inspections and tests on printed circuit boards (PCBs) to ensure that they meet design specifications and quality standards. PCBs are one of the core components of modern electronic devices, used to support and connect various electronic components such as resistors, capacitors, integrated circuits, etc. Therefore, the quality of PCBs directly affects the reliability and performance of the final product.

[0003] In the prior art, Gao Lei and Lang Jiayun "Research on a PCB Defect Detection Method" 2023-10-05 tried to use the method of comparing two pictures to compare, and regarded the different parts as defects, without considering that the importance of different areas is different, and once the selected reference picture has defects, it will lead to detection failure.

[0004] The invention patent with publication number CN115184381A discloses a PCB board detection device and image recognition method based on image recognition. Considering the use of infrared function, some areas are preset to obtain the line contour lines in the area. The PCB board consists of tens of thousands of pad areas and lines. How to quickly set the detection area and set different parameters according to different areas is crucial to improving the productivity of the equipment.

[0005] From the above content, it can be seen that the existing technology has the following defects: PCB board appearance inspection is currently mainly based on workers' naked eye judgment, the manual standards are not unified, easy to fatigue, resulting in misjudgment and missed judgment, and low efficiency. There are many PCB panels with a small area, and it has been difficult to use different parameters to detect each layer separately. Summary of the invention

[0006] In view of the defects in the prior art, the present invention provides a PCB board detection method and system.

[0007] According to a PCB board detection method and system provided by the present invention, the scheme is as follows:

[0008] In a first aspect, a PCB board detection method is provided, the method comprising:

[0009] Step S1: Collect the original picture of the PCB board;

[0010] Step S2: Calculate the radiation transformation function through the original image, collect multiple new PCB board images in real time, obtain the radiation image according to the radiation transformation, and synthesize the multiple radiation images into a standard image;

[0011] Step S3: Create and read the gerber file, map it to the standard diagram, and obtain the size that is consistent with the standard Figure 1 Create a new gerber layer and check whether the disk is missing in the current standard image based on the new gerber layer;

[0012] Step S4: extract different layers in the new gerber layer, and obtain the areas of different disks according to set operations;

[0013] Step S5: Different detection parameters and detection methods are configured separately in the areas of different disks to identify defects.

[0014] Preferably, when collecting the original image in step S1, a light source system is arranged above the PCB board, and the light source system is composed of a plurality of separate light sources;

[0015] Adjust the angle and position of the light source so that the illumination points of multiple light sources converge together, ensuring that the brightest line of the light source is aligned with the color camera that collects the original image. The original image collected by the color camera is a three-channel image.

[0016] The step of ensuring that the brightest line of the light source is aligned with the color camera for collecting the original image specifically includes:

[0017] The brightness area conforms to the Gaussian normal distribution. If it is at the top of the Gaussian normal distribution curve, it is the brightest light. Use a camera to capture a picture and select a row of pixels. If the pixels conform to the normal distribution from left to right, it is the brightest point.

[0018] Preferably, the process of obtaining the radiographic image in step S2 includes:

[0019] Select multiple positioning points (x1, y1), (x2, y2), (x3, y3), (x4, y4) from each corner of the original image;

[0020] Select four points (x'1, y'1), (x'2, y'2), (x'3, y'3), (x'4, y'4) corresponding to the original image on the new PCB board image acquired in real time;

[0021] The radiation transformation matrix Hom2d is:

[0022]

[0023] The Hom2d function is used to map the current PCB board image into a radiographic image that is consistent with the angle and position of the original image.

[0024] Preferably, the step S2 further comprises: repairing the standard image, specifically as follows:

[0025] Step S2.1: Create a pipette tool. The data structure of this tool contains a coordinate (x, y) and a 3×3 matrix E. This tool is used to sample pixel values ​​from the image.

[0026] Step S2.2: The coordinates (x, y) of the eyedropper tool represent the coordinates of the current mouse position. For a single-channel image, Value(x, y) is a value between 0 and 255. If it is a three-channel image, then Value(x, y) is an array containing three values ​​between 0 and 255. The matrix E is used to store the pixel values ​​in the 3×3 area centered at (x, y). The matrix E is:

[0027]

[0028] Step S2.3: Construct a brush tool. The data structure of this brush tool contains a coordinate (x, y) and a value Value; the coordinate (x, y) represents the current mouse position, and Value needs to be initially set to a default value or obtained by other means before use;

[0029] Step S2.4: Find a position without defects near the defective position, execute the pipette function, and obtain the pixel matrix E in the 3×3 area centered at the position;

[0030] Step S2.5: Calculate the mean value Mean(E) of the current E, and assign the mean value to the Value of the brush tool; move the mouse over the defect area, and replace each pixel in the defect area with the Value of the brush tool.

[0031] Preferably, when synthesizing the standard image in step S2, if the length of the radiographic image is greater than the set width, mosaicking is performed:

[0032] 1) Ensure that there is an overlapping area between images to facilitate alignment of the images;

[0033] 2) Select reference points: select two reference points P1 and P2 in the overlapping area of ​​one of the radiographic images T1. These two points are located at the upper and lower ends of the radiographic image T1.

[0034] 3) Match the reference points and find two points q1 and q2 corresponding to P1 and P2 in the radiographic image T1 in the overlapping area of ​​another radiographic image T2;

[0035] 4) Calculate the slope and angle difference, and calculate the slope R1 of the straight line L1 passing through points P1 and P2 in the radiographic image T1;

[0036] Calculate the slope R2 of the straight line L2 passing through the points q1 and q2 in the radiographic image T2;

[0037] Calculate the angle difference θ between the two straight lines L1 and L2 by calculating the difference between the arc tangent values ​​of the two slopes: θ = atan(R1)-atan(R2);

[0038] 5) Rotation correction: use the rotation function rotate in the image processing library to rotate the radiographic image T2 according to the angle difference θ so that the overlapping parts of the two images are aligned;

[0039] 6) Translation alignment: translate the rotated radiographic image T2 in the horizontal direction until q1 in the radiographic image T2 is completely aligned with P1 in the radiographic image T1, and q2 is also aligned with P2.

[0040] 7) Synthesize the image. When the two images are completely aligned, they will be merged into a complete standard image.

[0041] Preferably, the standard image in step S2 further includes: when the defect is difficult to detect under any one of the R, G, and B channels, it is necessary to extract different image channels of the standard image, and then perform addition, subtraction, multiplication, and division combination operations on different channels to obtain a new single-channel image; specifically including:

[0042] Addition: Use the Add function of halcon to add the images of the two channels. The pixel value of the image is 0-255. If the grayscale value of the added pixel is greater than 255, it is 255.

[0043] Addition: Use halcon's sub function to subtract the images of the two channels. The pixel value of the image is 0-255. If the gray value of the pixel after addition is less than 0, it is 0.

[0044] Multiplication: Halcon's Multi function is used to multiply the images of two channels. The pixel value of the image is 0-255. If the grayscale value of the pixel after multiplication is greater than 255, it is 255.

[0045] Division: Use halcon's Dvi function to divide the two channels. The pixel value of the image is 0-255 and is an integer. The result is stretched between 0-255 to convert it to a positive number between 0-255.

[0046] Preferably, step S3 comprises:

[0047] Step S3.1: The front layer of the new gerber layer contains all disk information. The front layer is loaded from the local computer and each individual disk area is calculated through the 8-connected domain.

[0048] Step S3.2: sorting the individual disk regions after the connected domain in the order of row first and then column first to obtain an array Array of all disk regions, where assuming there are n disks in total, the Array data is n-dimensional;

[0049] Step S3.3: ROI i For the i-th region in the array Array, cut out the ROI in the standard image i Get a new local picture of the area size;

[0050] Step S3.4: Perform threshold segmentation on the local image to obtain the region roi after the threshold. The static threshold method is selected here. The contrast between the disk and the background color is bright. The threshold size selected by the algorithm is 150, that is, 150-255 is directly segmented by the threshold;

[0051] Step S3.5: Compare ROI with ROI i The size of the area, usually ROI: ROI i The range is between 0.8-1.1. If it exceeds this range, the disk is confirmed to be lost.

[0052] Preferably, in step S5, detection is performed on the areas of different disks, and different detection parameters are configured including area size and grayscale value range, and the configured detection methods include grayscale detection and differential detection;

[0053] Detection is performed in the areas of different disks, and it can also be modified manually or by extracting gray values ​​in the image. The modification method includes adding to the current area, deleting the current area, finding the intersection with the current area, finding the union with the current area, and limiting all monitoring areas to be within the current area;

[0054] The detection of the area also includes: detecting the distance between the two disks, calculating the distance between the two disks after extracting the gray value to the two disks, and using this as a standard value, and comparing the subsequent detection with it. The detection steps include:

[0055] 1) For a disk in the standard image, draw an area on the periphery to include the disk, and then use a static threshold to segment the outer contour of the disk, with the threshold range between 150-255;

[0056] 2) Use the least squares method to fit the outer contour of the disk and calculate the center P1;

[0057] 3) Repeat steps 1) and 2) to calculate the center P2 of the other disk;

[0058] 4) Calculate the distance L between points P1 and P2 and save it, and set the acceptable fluctuation range of L as [-2, 2];

[0059] 5) When the center distance k between these two disks in the new standard map to be judged is not within the set range, that is, k < L - 2 or k > L + 2, store the current information and give an alarm.

[0060] Preferably, step S5 further includes: OCR recognition function, specifically as follows:

[0061] 1) Select the area: The user frames an area of interest on the picture, and the system crops this area to obtain a new image segment, denoted as ReducedImage;

[0062] 2) Preprocessing: Perform binarization processing on ReducedImage. By setting a threshold range, the image is segmented into two parts, namely the foreground (i.e., characters) and the background, highlighting the character contours; among them, the threshold refers to the brightness boundary that distinguishes the foreground and the background in the grayscale image. If the image itself is in color, it needs to be converted to a grayscale image first;

[0063] 3) Character positioning and sorting: Detect and extract the contour areas of the characters. Usually, this step will use methods such as edge detection or connected component analysis to complete;

[0064] 4) Sort the extracted character contour areas: The sorting method depends on the actual arrangement of the characters. If they are arranged horizontally, sort them in the order from left to right and from top to bottom; if they are arranged vertically, sort them in the order from top to bottom and from left to right;

[0065] 5) Character recognition: Use the OCR recognition function do_ocr_word_cnn in Halcon to recognize the text content within these character contour areas. The do_ocr_word_cnn function can recognize the characters within the contours and convert them into an editable text format for storage;

[0066] Associate the current PCB board with the characters to provide a basis for subsequent quality traceability; when comparing the QR code on the PCB board with the characters to be compared, by comparing the characters contained in the QR code with the characters being compared at this time, it can verify whether the QR code is printed correctly.

[0067] In a second aspect, a PCB board detection system is provided, and the system includes:

[0068] A light source system, an information acquisition module, a controller module, and a server module;

[0069] The light source system is used to provide a stable light source;

[0070] The information acquisition module is used to acquire PCB board images and transmit the acquired PCB board images to the controller module;

[0071] The controller module is used to receive the PCB board image for calculation;

[0072] The server module is used to back up core data; the interaction between the controller and the server is through TCP / IP;

[0073] Wherein, the controller module also includes:

[0074] Jigsaw module, used to realize jigsaw puzzles under multiple acquisitions;

[0075] The gerber parsing and mapping module is used to read the gerber raw data and parse and map it to the image size, which is the same as the length and width of the real-time collected image;

[0076] Parameter setting module, used to set different parameters according to different areas;

[0077] OCR recognition module, used to read OCR and verify whether OCR is correct;

[0078] The detection system also includes:

[0079] The flipping mechanism is used to flip the PCB board to realize the double-sided detection function.

[0080] Compared with the prior art, the present invention has the following beneficial effects:

[0081] 1. The present invention can generate different detection areas according to the original gerber file; can manually change the area, and can repair the image more flexibly; can use differential and grayscale detection algorithms to have a higher detection rate, and also has a card setting function. When defects appear in the card area, a special alarm can be issued to improve the yield of the product.

[0082] 2. The present invention sets different parameters according to the gerber layers, and can quickly detect defects on the disks under different layers, and the detection accuracy can reach 5um, which greatly improves the detection accuracy.

[0083] Other beneficial effects of the present invention will be explained in the specific implementation manner through the introduction of specific technical features and technical solutions. Through the introduction of these technical features and technical solutions, those skilled in the art should be able to understand the beneficial technical effects brought about by the technical features and technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0085] Figure 1 It is the overall system block diagram of the present invention;

[0086] Figure 2 It is a schematic diagram of the process of the present invention;

[0087] Figure 3 A schematic diagram of the process for generating a standard diagram;

[0088] Figure 4 Flowchart for checking missing disks and obtaining layer area. DETAILED DESCRIPTION

[0089] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0090] The embodiment of the present invention provides a PCB board detection method, referring to Figure 1 and Figure 2 As shown, the method specifically includes:

[0091] Step S1: Collect the original image of the PCB board.

[0092] In this step, when collecting the original image, a light source system is set above the PCB board, and the light source system consists of multiple separate light sources;

[0093] Adjust the angle and position of the light source so that the illumination points of multiple light sources converge together, ensuring that the brightest line of the light source is aligned with the color camera that collects the original image. The original image collected by the color camera is a three-channel image.

[0094] Among them, ensuring that the brightest line of the light source is in line with the color camera that collects the original image includes:

[0095] The brightness area conforms to the Gaussian normal distribution. If it is at the top of the Gaussian normal distribution curve, it is the brightest light. Use a camera to capture a picture and select a row of pixels. If the pixels conform to the normal distribution from left to right, it is the brightest point.

[0096] Reference Figure 3As shown, step S2: a radiation transformation function is calculated through the original image, and then a plurality of new PCB board images are collected in real time, a radiation image is obtained according to the radiation transformation, and the plurality of radiation images are synthesized into a standard image.

[0097] The process of obtaining the radiographic image in this step includes: selecting a plurality of positioning points (x1, y1), (x2, y2), (x3, y3), (x4, y4) from each corner of the original image;

[0098] Select four points (x'1, y'1), (x'2, y'2), (x'3, y'3), (x'4, y'4) corresponding to the original image on the new PCB board image acquired in real time;

[0099] The radiation transformation matrix Hom2d is:

[0100]

[0101] The Hom2d function is used to map the current PCB board image into a radiographic image that is consistent with the angle and position of the original image.

[0102] Reference Figure 3 As shown, step S2 also includes: repairing the standard image, specifically as follows:

[0103] Step S2.1: Create a pipette tool. The data structure of this tool contains a coordinate (x, y) and a 3×3 matrix E. This tool is used to sample pixel values ​​from the image.

[0104] Step S2.2: The coordinates (x, y) of the eyedropper tool represent the coordinates of the current mouse position. For a single-channel image, Value(x, y) is a value between 0 and 255. If it is a three-channel image, then Value(x, y) is an array containing three values ​​between 0 and 255. The matrix E is used to store the pixel values ​​in the 3×3 area centered at (x, y). The matrix E is:

[0105]

[0106] Step S2.3: Construct a brush tool. The data structure of this brush tool contains a coordinate (x, y) and a value Value; the coordinate (x, y) represents the current mouse position, and Value needs to be initially set to a default value or obtained by other means before use;

[0107] Step S2.4: Find a position without defects near the defective position, execute the pipette function, and obtain the pixel matrix E in the 3×3 area centered at the position;

[0108] Step S2.5: Calculate the mean value Mean(E) of the current E, and assign the mean value to the Value of the brush tool; move the mouse over the defect area, and replace each pixel in the defect area with the Value of the brush tool.

[0109] Reference Figure 3 As shown, when synthesizing the standard image in step S2, if the length of the radiographic image is greater than the set width, mosaicking is performed:

[0110] 1) Ensure that there is an overlapping area between images to facilitate alignment of the images;

[0111] 2) Select reference points: select two reference points P1 and P2 in the overlapping area of ​​one of the radiographic images T1. These two points are located at the upper and lower ends of the radiographic image T1.

[0112] 3) Match the reference points and find two points q1 and q2 corresponding to P1 and P2 in the radiographic image T1 in the overlapping area of ​​another radiographic image T2;

[0113] 4) Calculate the slope and angle difference, and calculate the slope R1 of the straight line L1 passing through points P1 and P2 in the radiographic image T1;

[0114] Calculate the slope R2 of the straight line L2 passing through the points q1 and q2 in the radiographic image T2;

[0115] Calculate the angle difference θ between the two straight lines L1 and L2 by calculating the difference between the arc tangent values ​​of the two slopes: θ = atan(R1)-atan(R2);

[0116] 5) Rotation correction: use the rotation function rotate in the image processing library to rotate the radiographic image T2 according to the angle difference θ so that the overlapping parts of the two images are aligned;

[0117] 6) Translation alignment: translate the rotated radiographic image T2 in the horizontal direction until q1 in the radiographic image T2 is completely aligned with P1 in the radiographic image T1, and q2 is also aligned with P2.

[0118] 7) Synthesize the image. When the two images are completely aligned, they will be merged into a complete standard image.

[0119] The standard image in step S2 also includes: when the defect is difficult to detect under any one of the R, G, and B channels, it is necessary to extract different image channels of the standard image, and then perform addition, subtraction, multiplication, and division combination operations on different channels to obtain a new single-channel image; specifically including:

[0120] Addition: Use the Add function of halcon to add the images of the two channels. The pixel value of the image is 0-255. If the grayscale value of the added pixel is greater than 255, it is 255.

[0121] Addition: Use halcon's sub function to subtract the images of the two channels. The pixel value of the image is 0-255. If the gray value of the pixel after addition is less than 0, it is 0.

[0122] Multiplication: Halcon's Multi function is used to multiply the images of two channels. The pixel value of the image is 0-255. If the grayscale value of the pixel after multiplication is greater than 255, it is 255.

[0123] Division: Use halcon's Dvi function to divide the two channels. The pixel value of the image is 0-255 and is an integer. The result is stretched between 0-255 to convert it to a positive number between 0-255.

[0124] Reference Figure 4 As shown, step S3: create and read the gerber file, map it to the standard diagram, and obtain the size that is consistent with the standard Figure 1 Create a new gerber layer and check whether the disk is missing in the current standard image based on the new gerber layer.

[0125] The step S3 comprises:

[0126] Step S3.1: The front layer of the new gerber layer contains all disk information. The front layer is loaded from the local computer and each individual disk area is calculated through the 8-connected domain.

[0127] Step S3.2: sorting the individual disk regions after the connected domain in the order of row first and then column first to obtain an array Array of all disk regions, where assuming there are n disks in total, the Array data is n-dimensional;

[0128] Step S3.3: ROI i For the i-th region in the array Array, cut out the ROI in the standard image i Get a new local picture of the area size;

[0129] Step S3.4: Perform threshold segmentation on the local image to obtain the region roi after the threshold. The static threshold method is selected here. The contrast between the disk and the background color is bright. The threshold size selected by the algorithm is 150, that is, 150-255 is directly segmented by the threshold;

[0130] Step S3.5: Compare ROI with ROI iThe area size, usually roi: ROI i The range is between 0.8 - 1.1. Exceeding this range means the disk is confirmed to be lost.

[0131] Step S4: Extract different layers in the new gerber layer and obtain the areas of different disks through set operations.

[0132] Step S5: Separate detection parameters and detection methods are configured for the areas of different disks to identify defects.

[0133] In this step S5, detection is performed on the areas of different disks. The configured different detection parameters include area size and grayscale value range. The configured detection methods include grayscale detection and differential detection;

[0134] When detecting in the areas of different disks, it is also possible to modify manually or by extracting the grayscale values in the picture. The modification methods include adding to the current area, deleting the current area, taking the intersection with the current area, taking the union with the current area, and limiting that all monitoring areas are within the current area;

[0135] Detecting in the area also includes: detecting the distance between two disks. After extracting two disks through grayscale values, calculate the distance between the two disks and use this as a standard value for comparison with the subsequent detections. The detection steps include:

[0136] 1) For one disk in the standard image, draw an area around it to contain this disk, and then static threshold segmentation is used to obtain the outer contour of this disk. The threshold range is between 150 - 255;

[0137] 2) Use the least squares method to fit the outer contour of this disk and calculate the center P1;

[0138] 3) Repeat steps 1) and 2) to calculate the center P2 of the other disk;

[0139] 4) Calculate the distance L between points P1 and P2 and save it, and set the acceptable fluctuation range of L as [-2, 2];

[0140] 5) When the center distance k between these two disks in the new standard image to be judged is not within the set range, that is, k < L - 2 or k > L + 2, then store the current information and give an alarm.

[0141] This step S5 also includes: OCR recognition function, specifically as follows:

[0142] 1) Select the area: The user frames an area of interest on the picture, and the system crops this area to obtain a new image segment, denoted as ReducedImage;

[0143] 2) Preprocessing: Binarize ReducedImage and divide the image into two parts, i.e., foreground (characters) and background, by setting a threshold range to highlight the outline of the characters. The threshold refers to the brightness boundary that distinguishes the foreground and background in a grayscale image. If the image itself is in color, it needs to be converted to a grayscale image first.

[0144] 3) Character positioning and sorting: Detect and extract the outline area of ​​the characters. This step is usually completed using edge detection or connected component analysis methods;

[0145] 4) Sort the extracted character contour areas: the sorting method depends on the actual arrangement of the characters. If the characters are arranged horizontally, they are sorted from left to right and from top to bottom; if the characters are arranged vertically, they are sorted from top to bottom and from left to right.

[0146] 5) Character recognition: Use the OCR recognition function do_ocr_word_cnn in Halcon to recognize the text content within the character outline area. The do_ocr_word_cnn function can recognize the characters within the outline and convert them into editable text format for storage;

[0147] The current PCB board is associated with the characters to provide a basis for subsequent quality traceability; when the QR code on the PCB board is compared with the characters that need to be compared, the characters contained in the QR code and the characters being compared at this time can be used to verify whether the QR code is printed correctly.

[0148] The present invention also provides a PCB board detection system, which specifically comprises: a light source system, an information collection module, a controller module, a server module and a flip mechanism.

[0149] Among them, the light source system is used to provide a stable light source; the information acquisition module is used to collect PCB board images and transmit the collected PCB board images to the controller module; the controller module is used to receive PCB board images for calculation; the server module is used to back up core data; the interaction between the controller and the server is achieved through TCP / IP; the flipping mechanism is used to flip the PCB board to realize the function of double-sided detection.

[0150] Specifically, the controller module also includes: a puzzle module, which is used to realize puzzle under multiple acquisitions; a gerber parsing and mapping module, which is used to read the original gerber data and parse and map it to the image size, which is the same as the length and width of the real-time acquired image; a parameter setting module, which is used to set different parameters according to different areas; an OCR recognition module, which is used to read OCR and verify whether the OCR is correct.

[0151] Next, the present invention will be described in more detail.

[0152] The present invention provides a PCB board detection method, which specifically includes the following contents:

[0153] 1. Collect the original picture of the PCB board.

[0154] Select a 15K line scan color camera, the height from the bottom of the camera lens to the product surface is 200mm, to ensure that the product detection accuracy reaches 5um, and select a linear high-intensity light source. Ensure that the brightest line of the light source is in line with the camera, and the color camera collects three-channel images. Among them, the color camera used has three channels of RGB. The pictures collected by the color camera are three channels. After the color camera collects a picture, the software system obtains a color picture image, and then uses the function discompose(image, R, G, B) in halcon, where R, G, and B are pictures of three channels respectively.

[0155] Place the PCB board on the platform. There is a light source system between the camera and the PCB board. This light source is different from the conventional light source system. This light source system consists of three separate light sources. The mounting bracket of the light source can adjust the angle and position. The light sources are at a 45-degree angle and converge together. Due to the strong brightness, a fan is added at an interval of 45 cm on the top of each separate light source for heat dissipation.

[0156] Since the detection accuracy reaches 5um, which is a high detection accuracy, the brightness uniformity of the image acquisition is very important for the detection and its

[0157] It is important to note that the ink on most PCB boards is dim. This light source system can illuminate the dim PCB while ensuring the uniformity of the image brightness. The light source system is equipped with a fan to facilitate heat dissipation and extend the service life of the system.

[0158] To determine the brightest light in a light source, first place a piece of ordinary A4 paper under the light source, and adjust the angle and position of the light source while roughly observing whether the illumination points of the three light sources converge together;

[0159] Theoretically, the brightness area conforms to the Gaussian normal distribution. If it is at the top of the Gaussian normal distribution curve, it is the brightest light. Use a camera to capture a picture and select a row of pixels. If the pixels conform to the normal distribution from left to right, it is the brightest point.

[0160] 2. Through the collected pictures, four points are selected from the pictures to calculate the radiation transformation function.

[0161] At least three points are needed, and the present invention uses four-point positioning. Taking four points as an example, multiple positioning points (x1, y1), (x2, y2), (x3, y3), and (x4, y4) are selected from each corner of the original image.

[0162] Select four points (x'1, y'1), (x'2, y'2), (x'3, y'3), (x'4, y'4) corresponding to the original image on the new PCB board image acquired in real time.

[0163] The radiation transformation matrix Hom2d is:

[0164]

[0165] The Hom2d function is used to map the current PCB board image into a radial image with the same angle and position as the original image. The specific principle is to select an image as a template image, and then select four points from the template image. These four points are scattered as much as possible at the four corners of the template image. When a new image is obtained, the same four points are automatically selected to obtain hom2d, and then the hom2d function is used to map the current new image into an image with the same angle and position as the template image.

[0166] 3. Collect four more pictures, and obtain four new pictures according to the above-mentioned radial transformation, and generate a standard picture according to the common parts of the four pictures.

[0167] This step also includes: repairing the standard image, as follows:

[0168] 1) Create a pipette tool whose data structure contains a coordinate (x, y) and a 3×3 matrix E. This tool is used to sample pixel values ​​from an image.

[0169] 2) The coordinates (x, y) of the eyedropper tool represent the coordinates of the current mouse position. For a single-channel image, Value(x, y) is a value between 0 and 255. If it is a three-channel image, then Value(x, y) is an array containing three values ​​between 0 and 255. The matrix E is used to store the pixel values ​​in the 3×3 area centered at (x, y). The matrix E is:

[0170]

[0171] 3) Construct a brush tool. The data structure of this brush tool contains a coordinate (x, y) and a value Value; the coordinate (x, y) represents the current mouse position, and Value must be initially set to a default value or obtained by other means before use;

[0172] 4) Find a location without defects near the defective location, execute the pipette function, and obtain the pixel matrix E in the 3×3 area centered at the location;

[0173] 5) Calculate the current mean value Mean(E) of E and assign this mean value to the Value of the brush tool; move the mouse over the defect area and replace each pixel in the defect area with the Value of the brush tool.

[0174] 4. When synthesizing standard images, if the length of the radiographic image is greater than the set width, a mosaic will be performed.

[0175] Usually, in order to improve the accuracy, we will narrow the camera's field of view. The accuracy that this detection can achieve is 5um. The camera's field of view width selected in this item is only 80mm. If the PCB board width is less than 80mm, the entire product can be scanned once, but usually the width of the PCB board will exceed 80mm. At this time, we need to be able to automatically calculate the number of scans based on the width of the PCB board, such as 150mm needs to be scanned twice, and 240mm needs to be scanned 3 times. How to turn multiple acquired images into a complete image? This algorithm realizes this function.

[0176] The premise of the algorithm is that the local images that must be puzzled must have overlapping parts. There are no excessive requirements for the range of the overlapping parts. It can be adjusted appropriately according to the actual situation. The following example takes collecting two images and synthesizing them into one image (the two images are called image T1 and image T2 respectively):

[0177] 1) Ensure that there is an overlapping area between images to facilitate alignment of the images;

[0178] 2) Select reference points: select two reference points P1 and P2 in the overlapping area of ​​one of the radiographic images T1. These two points are located at the upper and lower ends of the radiographic image T1.

[0179] 3) Match the reference points and find two points q1 and q2 corresponding to P1 and P2 in the radiographic image T1 in the overlapping area of ​​another radiographic image T2;

[0180] 4) Calculate the slope and angle difference, and calculate the slope R1 of the straight line L1 passing through points P1 and P2 in the radiographic image T1;

[0181] Calculate the slope R2 of the straight line L2 passing through the points q1 and q2 in the radiographic image T2;

[0182] Calculate the angle difference θ between the two straight lines L1 and L2 by calculating the difference between the arc tangent values ​​of the two slopes: θ = atan(R1)-atan(R2);

[0183] 5) Rotation correction: use the rotation function rotate in the image processing library to rotate the radiographic image T2 according to the angle difference θ so that the overlapping parts of the two images are aligned;

[0184] 6) Translation alignment: translate the rotated radiographic image T2 in the horizontal direction until q1 in the radiographic image T2 is completely aligned with P1 in the radiographic image T1, and q2 is also aligned with P2.

[0185] 7) Synthesize the image. When the two images are completely aligned, they will be merged into a complete standard image.

[0186] Furthermore, different image channels of the standard image can be extracted, and then combination operations such as addition, subtraction, multiplication and division can be performed on different channels to obtain a new single-channel image.

[0187] Under normal circumstances, it is sufficient to extract any one of the three channels R, G, and B of a color image for detection. However, some defects are difficult to detect under any of the three channels R, G, and B. At this time, we need to combine the three single-channel images of R, G, and B into a new single-channel image, including:

[0188] Addition: Use the Add function of halcon to add the images of the two channels. The pixel value of the image is 0-255. If the grayscale value of the added pixel is greater than 255, it is 255.

[0189] Addition: Use halcon's sub function to subtract the images of the two channels. The pixel value of the image is 0-255. If the gray value of the pixel after addition is less than 0, it is 0.

[0190] Multiplication: Halcon's Multi function is used to multiply the images of two channels. The pixel value of the image is 0-255. If the grayscale value of the pixel after multiplication is greater than 255, it is 255.

[0191] Division: Use halcon's Dvi function to divide the two channels. The pixel value of the image is 0-255 and is an integer. The result is stretched between 0-255 to convert it to a positive number between 0-255.

[0192] 5. Read the gerber file and map it to the standard drawing to get the size that is consistent with the standard Figure 1 Create a new gerber layer and check whether the disk is missing in the current standard image based on the new gerber layer.

[0193] Background: PCB boards are generated according to gerber drawings, so the new gerber contains all the information on the board. PCB boards generally contain gold plates and copper plates, which are collectively referred to as plates. Checking whether the plates are missing in the current standard drawing specifically includes:

[0194] 1) The front layer of the new gerber layer contains all the disk information. The front layer is loaded from the local computer and each individual disk area is calculated through the 8-connected domain.

[0195] 2) Sort each individual disk area after the connected domain in the order of row first and then column first to obtain an array Array of all disk areas. Assuming there are n disks in total, the Array data is n-dimensional;

[0196] 3) ROI i For the i-th region in the array Array, cut out the ROI in the standard image i Get a new local picture of the area size;

[0197] 4) Perform threshold segmentation on the local image to obtain the region roi after thresholding. The static threshold method is selected here. The contrast between the disk and the background color is bright. The threshold size selected by the algorithm is 150, that is, 150-255 is directly segmented by the threshold;

[0198] 5) Compare ROI with ROI i The size of the area, usually ROI: ROI i The range is between 0.8-1.1. If it exceeds this range, the disk is confirmed to be lost.

[0199] 6. Extract different layers in the new gerber layer and obtain the areas of different disks based on set operations.

[0200] For example, the front layer contains all the disks, and the sitfr layer contains the entire board. If I want to detect all areas except the disks, I can calculate it as follows: (sitfr) intersection (complement of front);

[0201] The Hole layer represents all the holes on the PCB, if the customer wants to detect all areas of the pads and holes;

[0202] Then it can be calculated as follows: (sitfr) intersects (the complement of front) intersects (the complement of hole);

[0203] In practical applications, the gerber contains about 10 regions. Through set operations such as intersection and complement, about 30 region layer detection areas can be obtained.

[0204] Different parameters can be set for the 30 layer areas respectively. Each layer area can choose grayscale or differential or use both at the same time. As for setting parameters: it depends on actual experience. If the disk is very important to the PCB board, and the accuracy is 5um, defects above 15um must be detected. It is not important to detect all areas except the disk ((sitfr) intersection (front's complement)), so it can be set to be detected above 50um. The specific number is more about the quality of the incoming materials and is adjusted manually based on experience.

[0205] As for the selection of differential and grayscale detection, there is no absolute limit. It is mainly based on experience. The system provides a checkable function, and the algorithm will start immediately when it is checked.

[0206] 7. Get different disk areas. Each area can be set with different detection parameters, such as area size, grayscale value range, etc. Get different disk areas. Each area can be set with different detection methods. The algorithm uses grayscale detection and differential detection.

[0207] Grayscale detection is to set a grayscale range. For example, the areas within the range of T1-T2 are detected. For the detected areas, the areas within the range of Area1-Area2 are judged to be defects.

[0208] Differential detection is to determine the difference between the current image and the standard image. If the pixel difference between them is greater than T (generally settable, usually around 45), it is identified as a detected area. For the detected areas, the areas within the range of Area1-Area2 are then identified as defects.

[0209] Detection can be performed in different disk areas, and can also be modified manually or by extracting grayscale values ​​from images. The modification methods include adding to the current area, deleting the current area, finding the intersection with the current area, and finding the union with the current area, limiting all monitoring areas to be within the current area.

[0210] The actual gerber area of ​​the PCB board is much larger than the actual PCB area produced. Take the disk as an example. The disk is made of copper or gold, and the side of the disk is black ink. The gerber area is much larger than the disk where the copper or gold is located. Therefore, the generated area must be manually fine-tuned and shrunk again to make the detection area all on the disk; at the same time, the production process also causes the current batch of disks to be biased to the left or right, so it also needs to be adjusted.

[0211] Generally, modifications will be made in two situations. The first is when the gerber area is larger than the actual production area, and the second is when the production process causes deviations.

[0212] The detection of the area also includes: detecting the distance between two disks, calculating the distance between the two disks after extracting them through gray values, and using this as a standard value for comparison with those detected later. The detection steps include:

[0213] 1) For one disk in the standard image, draw a region around it to contain the disk, and then perform static threshold segmentation on the outer contour of the disk. The threshold range is between 150 and 255;

[0214] 2) Fit the outer contour of the disk using the least squares method and calculate the center P1;

[0215] 3) Repeat steps 1) and 2) to calculate the center P2 of the other disk;

[0216] 4) Calculate the distance L between points P1 and P2 and save it, and set the acceptable fluctuation range of L as [-2, 2];

[0217] 5) When the center distance k between the two disks in the new standard image to be judged is not within the set range, that is, k < L - 2 or k > L + 2, the current information is stored and an alarm is given.

[0218] 8. The present invention also has the function of drawing the card area. A large PCB is composed of multiple small chips, and it can generate the function of each card area in batches. When the detected defect is inside the card, a special window can be popped up to prompt.

[0219] Usually, there are several or hundreds of chips on a PCB board. The card area can be understood as a special area, which is drawn manually. It is very important to mark this area. For example, a defect on the disk is more important than a defect on the edge ink. If a card area is drawn for the disk, special attention should be paid when a defect appears in this area, mainly for the prompting function. Usually, one chip only contains one card area. If a defect appears in one card area but other card areas are still good, it means that this PCB board is not completely scrapped and can still be used for statistical yield.

[0220] Understanding the above-mentioned card area is very important. When a defect appears, the system should automatically pop up a window to prompt the operator, and the operator can perform operations such as stopping for inspection.

[0221] All of the above parameters have the functions of uploading to the server and downloading from the server. For the function of uploading and downloading server data, a copy is also reserved locally. The local parameters are used for normal detection, and they are synchronized with the server only when uploading or downloading is clicked.

[0222] 9. The present invention has OCR recognition function, can recognize multi-line OCR, can recognize English and numbers, can recognize horizontal or vertical OCR, has manual capture area and recognize OCR in fixed area. The details are as follows:

[0223] 1) Selected area: The user selects an area of ​​interest on the image, and the system crops this area to obtain a new image segment, recorded as ReducedImage;

[0224] 2) Preprocessing: Binarize ReducedImage and divide the image into two parts, i.e., foreground (characters) and background, by setting a threshold range to highlight the outline of the characters. The threshold refers to the brightness boundary that distinguishes the foreground and background in a grayscale image. If the image itself is in color, it needs to be converted to a grayscale image first.

[0225] 3) Character positioning and sorting: Detect and extract the outline area of ​​the characters. This step is usually completed using edge detection or connected component analysis methods;

[0226] 4) Sort the extracted character contour areas: the sorting method depends on the actual arrangement of the characters. If the characters are arranged horizontally, they are sorted from left to right and from top to bottom; if the characters are arranged vertically, they are sorted from top to bottom and from left to right.

[0227] 5) Character recognition: Use the OCR recognition function do_ocr_word_cnn in Halcon to recognize the text content within the character outline area. The do_ocr_word_cnn function can recognize the characters within the outline and convert them into editable text format for storage;

[0228] The current PCB board is associated with the characters to provide a basis for subsequent quality traceability; when the QR code on the PCB board is compared with the characters that need to be compared, the characters contained in the QR code and the characters being compared at this time can be used to verify whether the QR code is printed correctly.

[0229] The embodiment of the present invention provides a PCB board detection method and system, which improves the detection efficiency. According to the experimental results, the detection accuracy can reach 5um, which is the highest detection accuracy currently available on the market. The detection areas can be freely combined according to the gerber file, and can be customized in real time according to production. The detection parameters are saved locally and on the server, which has higher data security protection. According to the card area, the user can be prompted which areas are more important or which areas do not need to be paid attention to.

[0230] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0231] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A PCB board detection method, characterized in that: include: Step S1: Collect the original picture of the PCB board; Step S2: Calculate the radiation transformation function through the original image, collect multiple new PCB board images in real time, obtain the radiation image according to the radiation transformation, and synthesize the multiple radiation images into a standard image; Step S3: Create and read a gerber file, map it to the standard image, obtain a new gerber layer with the same size as the standard image, and check whether the disk is missing in the current standard image based on the new gerber layer; Step S4: extract different layers in the new gerber layer, and obtain the areas of different disks according to set operations; Step S5: Different detection parameters and detection methods are configured separately in the areas of different disks to identify defects.

2. The PCB board detection method according to claim 1, characterized in that: When collecting the original image in step S1, a light source system is set above the PCB board, and the light source system consists of multiple separate light sources; Adjust the angle and position of the light source so that the illumination points of multiple light sources converge together, ensuring that the brightest line of the light source is aligned with the color camera that collects the original image. The original image collected by the color camera is a three-channel image. The step of ensuring that the brightest line of the light source is aligned with the color camera for collecting the original image specifically includes: The brightness area conforms to the Gaussian normal distribution. If it is at the top of the Gaussian normal distribution curve, it is the brightest light. Use a camera to capture a picture and select a row of pixels. If the pixels conform to the normal distribution from left to right, it is the brightest point.

3. The PCB board detection method according to claim 1, characterized in that: The process of obtaining the radiographic image in step S2 includes: Select multiple positioning points (x1, y1), (x2, y2), (x3, y3), (x4, y4) from each corner of the original image; Select four points (x'1, y'1), (x'2, y'2), (x'3, y'3), (x'4, y'4) corresponding to the original image on the new PCB board image acquired in real time; The radiation transformation matrix Hom2d is: The Hom2d function is used to map the current PCB board image into a radiographic image that is consistent with the angle and position of the original image.

4. The PCB board detection method according to claim 1, characterized in that: The step S2 further includes: repairing the standard image, specifically as follows: Step S2.1: Create a pipette tool. The data structure of this tool contains a coordinate (x, y) and a 3×3 matrix E. This tool is used to sample pixel values ​​from the image. Step S2.2: The coordinates (x, y) of the eyedropper tool represent the coordinates of the current mouse position. For a single-channel image, Value(x, y) is a value between 0 and 255. If it is a three-channel image, then Value(x, y) is an array containing three values ​​between 0 and 255. The matrix E is used to store the pixel values ​​in the 3×3 area centered at (x, y). The matrix E is: Step S2.3: Construct a brush tool. The data structure of this brush tool contains a coordinate (x, y) and a value Value; the coordinate (x, y) represents the current mouse position, and Value needs to be initially set to a default value or obtained by other means before use; Step S2.4: Find a position without defects near the defective position, execute the pipette function, and obtain the pixel matrix E in the 3×3 area centered at the position; Step S2.5: Calculate the mean value Mean(E) of the current E, and assign the mean value to the Value of the brush tool; move the mouse over the defect area, and replace each pixel in the defect area with the Value of the brush tool.

5. The PCB board detection method according to claim 1, characterized in that: When synthesizing the standard image in step S2, if the length of the radiographic image is greater than the set width, then jigsaw puzzle is performed: 1) Ensure that there is an overlapping area between images to facilitate alignment of the images; 2) Select reference points: select two reference points P1 and P2 in the overlapping area of ​​one of the radiographic images T1. The two points are located at the upper and lower ends of the radiographic image T1. 3) Match the reference points and find two points q1 and q2 corresponding to P1 and P2 in the radiographic image T1 in the overlapping area of ​​another radiographic image T2; 4) Calculate the slope and angle difference, and calculate the slope R1 of the straight line L1 passing through points P1 and P2 in the radiographic image T1; Calculate the slope R2 of the straight line L2 passing through the points q1 and q2 in the radiographic image T2; Calculate the angle difference θ between the two straight lines L1 and L2 by calculating the difference between the arc tangent values ​​of the two slopes: θ = atan(R1)-atan(R2); 5) Rotation correction: use the rotation function rotate in the image processing library to rotate the radiographic image T2 according to the angle difference θ so that the overlapping parts of the two images are aligned; 6) Translation alignment: translate the rotated radiographic image T2 in the horizontal direction until q1 in the radiographic image T2 is completely aligned with P1 in the radiographic image T1, and q2 is also aligned with P2. 7) Synthesize the image. When the two images are completely aligned, they will be merged into a complete standard image.

6. The PCB board detection method according to claim 2, characterized in that: The standard image in step S2 further includes: when the defect is difficult to detect under any one of the R, G, and B channels, it is necessary to extract different image channels of the standard image, and then perform addition, subtraction, multiplication, and division combination operations on different channels to obtain a new single-channel image; specifically including: Addition: Use the Add function of halcon to add the images of the two channels. The pixel value of the image is 0-255. If the grayscale value of the added pixel is greater than 255, it is 255. Addition: Use halcon's sub function to subtract the images of the two channels. The pixel value of the image is 0-255. If the gray value of the pixel after addition is less than 0, it is 0. Multiplication: Halcon's Multi function is used to multiply the images of two channels. The pixel value of the image is 0-255. If the grayscale value of the pixel after multiplication is greater than 255, it is 255. Division: Use halcon's Dvi function to divide the two channels. The pixel value of the image is 0-255 and is an integer. The result is stretched between 0-255 to convert it to a positive number between 0-255.

7. The PCB board detection method according to claim 1, characterized in that: The step S3 comprises: Step S3.1: The front layer of the new gerber layer contains information of all pads. Load the front layer from local and obtain individual pad areas through 8-connected domain calculation; Step S3.2: Sort the individual pad areas after connected domain processing in the order of row first and then column first to obtain an array Array of all pad areas. Assuming there are n pads in total, the Array data is n-dimensional; Step S3.3: ROI i For the i-th region in the array Array, cut out the ROI in the standard image i Get a new local picture of the area size; Step S3.4: Perform threshold segmentation on the local image to obtain the region roi after thresholding. Here, the static threshold method is selected. The pads are all bright compared with the background color, and the threshold value selected by the algorithm is 150, that is, those with values between 150 and 255 are segmented out by thresholding; Step S3.5: Compare ROI with ROI i The size of the area, usually ROI: ROI i The range is between 0.8-1.

1. If it exceeds this range, the disk is confirmed to be lost.

8. The PCB board detection method according to claim 1, characterized in that: In step S5, detection is performed in the regions of different pads, and different detection parameters including area size and gray value range are configured. The configured detection methods include gray scale detection and differential detection; When detecting in the regions of different pads, it is also possible to modify manually or by extracting the gray values in the picture. The modification methods include adding to the current region, deleting the current region, taking the intersection with the current region, taking the union with the current region, and limiting that all monitoring regions are within the current region; The detection in the region also includes: detecting the distance between two pads. After extracting two pads through gray values, calculate the distance between the two pads and use this as a standard value for comparison with those detected later. The detection steps include: 1) For a pad in the standard image, draw a region around it to contain this pad, and then statically threshold segment the outer contour of this pad. The threshold range is between 150 and 255; 2) Fit the outer contour of this pad using the least squares method and calculate the center P1; 3) Repeat steps 1) and 2) to calculate the center P2 of another pad; 4) Calculate the distance L between points P1 and P2 and save it. Set the acceptable fluctuation range of L as [-2, 2]; 5) When the center distance k between these two pads in the new standard image to be judged is not within the set range, that is, k < L - 2 or k > L + 2, store the current information and give an alarm.

9. The PCB board detection method according to claim 1, characterized in that: Step S5 also includes: OCR recognition function, specifically as follows: 1) Select the region: The user selects an area of interest on the picture, and the system crops this area to obtain a new image segment, denoted as ReducedImage; 2) Preprocessing: Perform binaryzation processing on ReducedImage. By setting a threshold range, the image is segmented into two parts: foreground (i.e., characters) and background, highlighting the character contours. Among them, the threshold refers to the brightness boundary for distinguishing foreground and background in a gray scale image. If the image itself is color, it needs to be converted to a gray scale image first; 3) Character location and sorting: Detect and extract the contour regions of characters. Usually, this step is completed using methods such as edge detection or connected component analysis; 4) Sort the extracted character contour areas: the sorting method depends on the actual arrangement of the characters. If they are arranged horizontally, they are sorted from left to right and from top to bottom; if they are arranged vertically, they are sorted from top to bottom and from left to right. 5) Character recognition: Use the OCR recognition function do_ocr_word_cnn in Halcon to recognize the text content within the character outline area. The do_ocr_word_cnn function can recognize the characters within the outline and convert them into editable text format for storage; The current PCB board is associated with the characters to provide a basis for subsequent quality traceability; when the QR code on the PCB board is compared with the characters that need to be compared, the characters contained in the QR code and the characters being compared at this time can be used to verify whether the QR code is printed correctly.

10. A PCB board detection system, based on the PCB board detection method according to any one of claims 1 to 9, characterized in that: include: Light source system, information acquisition module, controller module and server module; The light source system is used to provide a stable light source; The information acquisition module is used to acquire PCB board images and transmit the acquired PCB board images to the controller module; The controller module is used to receive the PCB board image for calculation; The server module is used to back up core data; The interaction between the controller and the server is through TCP / IP; Wherein, the controller module also includes: Jigsaw module, used to realize jigsaw puzzles under multiple acquisitions; The gerber parsing and mapping module is used to read the gerber raw data and parse and map it to the image size, which is the same as the length and width of the real-time collected image; Parameter setting module, used to set different parameters according to different areas; OCR recognition module, used to read OCR and verify whether OCR is correct; The detection system also includes: The flipping mechanism is used to flip the PCB board to realize the double-sided detection function.

Citation Information

Patent Citations

  • PCB detection device based on image recognition and image recognition method

    CN115184381A