Visual identification-based pcb classification method and system, and storage medium
Through high-resolution industrial cameras, the number and perimeter of through holes are calculated, the recognition coefficients are established and the deviations are corrected, and the problem of insufficient recognition accuracy in the existing technology is solved, and efficient and accurate PCB through hole quality detection is achieved. Improve the reliability of the production process and product quality.
Patent Information
- Application Number
- CN202411120718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-15
AI Technical Summary
The existing PCB classification method based on visual recognition is insufficient recognition accuracy and slow processing speed when dealing with PCB with high density or complex layout, resulting in inaccurate classification or missed inspection, affecting product quality and production efficiency.
Use a high-resolution industrial camera to collect PCB images, establish the first recognition coefficient by calculating the number of through holes and the average perimeter, retrieve qualified sample data to establish a reference value, calculate the deviation and correct the recognition coefficient, judge whether the through hole quality is qualified, and improve the Detection accuracy and efficiency.
It improves the accuracy and efficiency of PCB through-hole quality inspection, reduces the misjudgment rate, ensures the consistency and reliability of the product, and reduces the quality control cost.
Smart Images

Figure CN119068505A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual recognition technology, and in particular to a PCB classification method, system and storage medium based on visual recognition. Background Art
[0002] With the rapid development of computer vision technology and automated inspection systems, PCB through-hole classification methods and systems based on visual recognition have become an indispensable part of quality control in the electronics manufacturing industry. Effective PCB through-hole detection and classification methods can not only improve detection accuracy and efficiency, but also reduce human errors and improve the automation level of production lines, and ensure product consistency and reliability. However, existing methods and systems still have some limitations in practical applications, such as insufficient recognition accuracy and slow processing speed. In addition, when dealing with high-density or complex layout PCBs, inaccurate classification or missed detection occurs, which affects the overall quality and production efficiency of the product, resulting in additional quality control costs and production delays.
[0003] In the Chinese invention application with application publication number CN112579810A, a printed circuit board classification method, device, computer equipment and storage medium are disclosed. An image of the printed circuit board to be tested is obtained, and then mathematical modeling is performed on the image of the printed circuit board to be tested to obtain a geometric mathematical model of the printed circuit board to be tested. When a geometric mathematical model of a stock printed circuit board whose similarity to the geometric mathematical model of the printed circuit board to be tested meets a preset threshold is found through a similarity algorithm, it indicates that the physical circuit board corresponding to the geometric mathematical model of the stock printed circuit board is the printed circuit board to be tested. The characteristic file information carrying classification information corresponding to the geometric mathematical model of the stock printed circuit board is obtained to obtain the classification result. During the whole process, there is no need to manually add numbering marks and manual classification processing in the production materials of the printed circuit board, which significantly improves the classification efficiency. The accuracy of printed circuit board classification is guaranteed by image recognition technology, and printed circuit board classification can be achieved efficiently and accurately.
[0004] In the above invention, the accuracy of printed circuit board classification is ensured by image recognition technology, thereby achieving efficient and accurate classification. At the same time, the mathematical modeling and similarity calculation of this method are relatively complex, requiring more computing resources and time when processing complex PCB designs, and lacking detailed analysis of the specific characteristics of the PCB, making it difficult to identify subtle quality problems.
[0005] To this end, the present invention provides a PCB classification method, system and storage medium based on visual recognition. Summary of the invention
[0006] 1. Technical issues to be solved
[0007] In view of the shortcomings of the prior art, the present invention provides a PCB classification method, system and storage medium based on visual recognition, which uses a high-resolution industrial camera to collect images of the PCB to be inspected, obtains the number and perimeter of the through holes on the PCB and the position coordinates of the through holes; establishes a first recognition coefficient F according to the number and average perimeter of the through holes of the PCB to be inspected, retrieves m qualified PCB sample data, and establishes a reference value F according to the number and average perimeter of the through holes. ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the deviation range is determined to determine whether the first recognition coefficient is within the qualified range. When the first recognition coefficient is abnormal, the second recognition coefficient command is started; after receiving the second recognition mode command, the n through-hole position data of the PCB to be inspected are retrieved, and the deviation between the actual position of each through-hole and the design standard position is calculated, and the average position deviation is calculated through the position deviations of all through-holes. According to the average position deviation, the first recognition coefficient F is corrected to obtain the corrected recognition coefficient F'; through the corrected recognition coefficient F', it is compared with the reference value to calculate the final deviation, and by comparing the deviation value with the preset tolerance range, it is determined whether the quality of the through-hole of the PCB to be inspected is qualified.
[0008] (II) Technical solution
[0009] To achieve the above objectives, the present invention is implemented through the following technical solutions: A PCB classification method based on visual recognition, comprising the following steps:
[0010] Use a high-resolution industrial camera to collect images of the PCB to be inspected, and obtain the number of through holes n and the perimeter P on the PCB to be inspected. i and the position coordinates of the through holes;
[0011] The first recognition coefficient F is established by the number of through holes and the average perimeter of the PCB to be tested, and m qualified PCB sample data are retrieved, and the reference value F is established by the number of through holes and the average perimeter of the through holes. ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified deviation range is determined to determine whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started;
[0012] After receiving the second identification mode command, retrieve the n through-hole position data of the PCB to be inspected, and calculate the deviation D between the actual position of each through-hole and the design standard position i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a, and then correct the first identification coefficient F to obtain a corrected second identification coefficient F';
[0013] By comparing the second identification coefficient F' with the qualified range of the deviation ΔF, it is determined whether the quality of the through hole of the PCB to be inspected is qualified and classified.
[0014] Further, the perimeter P of each through hole on the PCB to be tested is retrieved i The data is collected and the average value is calculated to obtain the average perimeter Pt of the PCB through hole to be tested. The formula is as follows:
[0015]
[0016] Wherein, i represents the i-th through hole on the PCB to be detected, i=1, 2, 3, ..., n, and n represents the total number of through holes on the PCB to be detected.
[0017] Furthermore, according to the number of through holes n of the PCB to be inspected and the average perimeter Pt of the through holes, the first recognition coefficient F is established, and the formula is as follows:
[0018] F=a1*n+a2*Pt
[0019] Among them, a1 and a2 are weight coefficients of the number of through holes and the average perimeter of the through holes, respectively, a1 is 0.5, and a2 is 0.5.
[0020] Furthermore, the data of m qualified PCB through-holes are retrieved from the historical database, the number of through-holes n and the average perimeter Pt of the through-holes in the m qualified PCBs are calculated, and the reference value F is calculated. ref , the formula is as follows:
[0021] F j =a1*n j +a2*Pt j
[0022]
[0023] Where j is the jth qualified PCB, j = 1, 2, 3, ..., m, n j is the number of through holes of the jth qualified PCB, Pt j For the average perimeter of the jth qualified PCB through hole, calculate the deviation ΔF of the first recognition coefficient F, the formula is as follows:
[0024] △F=FF ref
[0025] The standard deviation σF is calculated based on the reference value, and the formula is as follows:
[0026]
[0027] The acceptable range of the deviation ΔF of the first identification coefficient F is calculated by using the reference value and the standard deviation [(F ref -k*σF),(F ref +k*σF)], where k is the empirical coefficient, k=2 or 3.
[0028] Furthermore, by comparing the calculated first identification coefficient F with the deviation ΔF, the quality of the through hole of the PCB to be inspected can be determined, specifically:
[0029] When F is within the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is qualified;
[0030] When F is greater than the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is unqualified;
[0031] When F is less than the qualified range of the deviation ΔF, it indicates that the quality of the through-hole of the PCB to be inspected is abnormal and there is an incomplete detection problem, and a command to start the second identification mode is issued.
[0032] Further, upon receiving the second identification mode command, the through hole data of the PCB to be inspected is retrieved, and the actual position (x i ,y i ), and the designed standard position (X i ,Y i ), the calculation formula is as follows:
[0033]
[0034] Among them, D i is the position deviation distance of the i-th through hole, the designed standard position (X i ,Y i ) is obtained according to the PCB through-hole design specification, according to the position deviation D of all through-holes on the PCB to be tested i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a :
[0035]
[0036] The corresponding average through-hole position deviation D of the PCB to be inspected a The calculation formula is as above.
[0037] Furthermore, according to the average through-hole position deviation D of the PCB to be inspected a , correct the first recognition coefficient F, and obtain the second recognition coefficient F'. The calculation formula is as follows:
[0038] F'=b1*F+b2*Da
[0039] Among them, b1 and b2 are the first recognition coefficient F and the average through-hole position deviation D of the PCB to be inspected, respectively. a The weight coefficients are b1 and b2, respectively.
[0040] Furthermore, the second identification coefficient F' is compared with the deviation ΔF to judge the quality of the PCB through-hole to be inspected and classify it, specifically:
[0041] When F' is within the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is qualified;
[0042] When F' is not within the qualified range of the deviation ΔF, it indicates that the quality of the PCB through hole to be inspected is unqualified.
[0043] A PCB classification system based on visual recognition, comprising:
[0044] The data acquisition module uses a high-resolution industrial camera to collect images of the PCB to be inspected, and obtains the number, perimeter, and position coordinates of the through holes on the PCB;
[0045] The first recognition module establishes the first recognition coefficient F according to the number of through holes and the average perimeter of the PCB to be detected, retrieves m qualified PCB sample data, and establishes the reference value F according to the number of through holes and the average perimeter of the through holes ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified deviation range is determined to determine whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started;
[0046] After receiving the second identification mode command, the second identification module retrieves the n through-hole position data of the PCB to be inspected and calculates the deviation D between the actual position of each through-hole and the design standard position. i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first identification coefficient F to obtain a corrected second identification coefficient F';
[0047] The classification module compares the second recognition coefficient F' with the qualified range of the deviation ΔF to determine whether the quality of the PCB through hole to be inspected is qualified and classifies it.
[0048] A storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0049] In the PCB classification system, the storage medium includes non-volatile storage medium and internal memory. The non-volatile storage medium is used to store key data for a long time, such as operating system, detection program, benchmark value, sample data, deviation range, historical image and model data, to ensure that the system has the necessary resources when starting and executing key tasks. The internal memory provides high-speed storage space for processing temporary data of the PCB to be inspected during operation, such as the number of through holes, perimeter, position coordinates, and the recognition coefficient generated during the calculation process and the corrected results, to ensure the efficiency of real-time calculation and judgment.
[0050] (III) Beneficial effects
[0051] The present invention provides a PCB classification method based on visual recognition, which has the following beneficial effects:
[0052] 1. Use a high-resolution industrial camera to collect images of the PCB to be inspected, obtain the number, perimeter and position coordinates of the through holes on the PCB, so as to accurately identify and analyze the through hole features on the PCB and improve the accuracy and efficiency of quality inspection.
[0053] 2. Establish the first recognition coefficient F through the number of through holes and the average perimeter of the PCB to be tested, retrieve m qualified PCB sample data, and establish the reference value F through the number of through holes and the average perimeter of the through holes ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified range of deviation is determined. It is judged whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started to improve the detection accuracy of the PCB through-hole quality, ensure that unqualified products are screened out efficiently and reliably during the production process, and reduce potential quality problems and production costs.
[0054] 3. After receiving the second identification mode command, retrieve the n through-hole position data of the PCB to be inspected, and calculate the deviation D between the actual position of each through-hole and the design standard position i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first recognition coefficient F to obtain the corrected second recognition coefficient F', which can provide a more accurate evaluation when abnormal situations are detected, thereby effectively improving the comprehensive judgment ability of PCB through-hole quality, reducing the misjudgment rate, and ensuring product consistency and reliability.
[0055] 4. By comparing the second identification coefficient F' with the qualified range of deviation ΔF, the quality of the PCB through-hole to be inspected is judged and classified, and the PCB through-holes that do not meet the quality standards are effectively identified, thereby improving the reliability of the production process and the overall quality of the final product. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 A schematic diagram of a flow chart of a PCB classification method based on visual recognition according to the present invention;
[0057] Figure 2 It is a structural schematic diagram of a PCB classification system based on visual recognition of the present invention;
[0058] Figure 3 The present invention is a schematic diagram of a storage medium structure. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] See also Figure 1 The present invention provides a PCB classification method based on visual recognition, comprising the following steps:
[0061] Step 1: Use a high-resolution industrial camera to capture the image of the PCB to be inspected, and obtain the number, perimeter, and location coordinates of the through holes on the PCB.
[0062] The step 1 includes the following contents:
[0063] Step 101: Use a high-resolution industrial camera to collect images of the PCB to be inspected, use a mean filter to remove noise in the image, convert the color image into a grayscale image, and use the Sobel edge detection technology to identify the edges of the through holes on the PCB to be inspected.
[0064] The mean filter is a simple and effective image smoothing technique used to reduce noise in an image. It calculates the average value of each pixel and its surrounding neighborhood pixels to replace the original pixel value, thereby smoothing the image and reducing detail noise. During the processing, the new value of each pixel is the arithmetic mean of the values of its surrounding pixels.
[0065] Sobel edge detection technology is a commonly used image processing method used to detect edges in images. It identifies edges by calculating the gradient of the image grayscale value, especially the changes in the horizontal and vertical directions. The Sobel algorithm uses two convolution kernels (Sobel operators), one for detecting horizontal edges and the other for detecting vertical edges. By applying these convolution kernels, the Sobel technology can highlight the edge features in the image, generate a gradient map, and show the area with the most obvious grayscale changes in the image.
[0066] Step 102: Use OpenCV contour detection technology to obtain the boundary contour of each through hole, obtain the number of through holes n of the PCB to be inspected, and calculate the perimeter P of each through hole contour. i , get the average perimeter Pt of the PCB through hole to be inspected, the formula is as follows:
[0067]
[0068] Wherein, i represents the i-th through hole on the PCB to be detected, i=1, 2, 3, ..., n, and n represents the total number of through holes on the PCB to be detected.
[0069] OpenCV contour detection technology is an algorithm for extracting shape boundaries from binary images. Using the findContours function, OpenCV can identify continuous boundary lines in an image and represent them as a list of contours. Each contour consists of a series of points that describe the edge of an object in the image. Contour detection not only helps identify and analyze shapes and structures in images, but can also be used to calculate geometric features such as area and perimeter.
[0070] When using, combine the contents in steps 101 and 102:
[0071] Use a high-resolution industrial camera to collect images of the PCB to be inspected, use a mean filter to remove noise from the image, and convert the color image into a grayscale image. Use Sobel edge detection technology to identify the edges of the through holes on the PCB to be inspected, use OpenCV contour detection technology to obtain the boundary contour of each through hole, obtain the number of through holes n on the PCB to be inspected, and calculate the perimeter P of each through hole contour. i , the average perimeter Pt of the PCB through-hole to be inspected is obtained to accurately identify and analyze the through-hole features on the PCB and improve the accuracy and efficiency of quality inspection.
[0072] Step 2: Establish the first recognition coefficient F by the number of through holes and the average perimeter of the PCB to be tested, retrieve m qualified PCB sample data, and establish the reference value F by the number of through holes and the average perimeter of the through holes. ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F refThe deviation ΔF is defined according to the reference value and the standard deviation, and it is determined whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started.
[0073] The step 2 includes the following contents:
[0074] Step 201, retrieve the data of the number of through holes n and the average perimeter Pt of the through holes of the PCB to be inspected, and establish the first recognition coefficient F according to the number of through holes n and the average perimeter Pt of the through holes of the PCB to be inspected, the formula is as follows:
[0075] F=a1*n+a2*Pt
[0076] Among them, a1 and a2 are weight coefficients of the number of through holes and the average perimeter of the through holes, respectively, a1 is 0.5, and a2 is 0.5.
[0077] Step 202: by retrieving the data of m qualified PCB through holes, calculate the number of through holes n and the average perimeter Pt of the through holes in the m qualified PCBs, and calculate the reference value F ref , the formula is as follows:
[0078] F j =a1*n j +a2*Pt j
[0079]
[0080] Where j is the jth qualified PCB, j = 1, 2, 3, ..., m, n j is the number of through holes of the jth qualified PCB, Pt j For the average perimeter of the jth qualified PCB through hole, calculate the deviation ΔF of the first recognition coefficient F, the formula is as follows:
[0081] △F=FF ref
[0082] The standard deviation σF is calculated based on the reference value, and the formula is as follows:
[0083]
[0084] The acceptable range of the deviation ΔF of the first identification coefficient F is calculated by using the reference value and the standard deviation [(F ref -k*σF),(F ref +k*σF)], where k is the empirical coefficient, k=2 or 3.
[0085] Step 203: By comparing the calculated first identification coefficient F with the deviation ΔF, the quality of the through hole of the PCB to be inspected can be determined, specifically:
[0086] When F is within the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is qualified;
[0087] When F is greater than the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is unqualified;
[0088] When F is less than the qualified range of the deviation ΔF, it indicates that the quality of the through-hole of the PCB to be inspected is abnormal and there is an incomplete detection problem, and a command to start the second identification mode is issued.
[0089] Benchmark value: It is a standard or reference value used to judge whether a product is qualified in quality inspection. It is usually an average value obtained by counting the data of a large number of qualified products. It is used to reflect the standard performance or characteristics that the product should achieve under ideal circumstances.
[0090] When using, combine the contents in steps 201 to 203:
[0091] The first recognition coefficient F is established by the number of through holes and the average perimeter of the PCB to be tested, and m qualified PCB sample data are retrieved, and the reference value F is established by the number of through holes and the average perimeter of the through holes. ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified range of deviation is determined. It is judged whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started to improve the detection accuracy of the PCB through-hole quality, ensure that unqualified products are screened out efficiently and reliably during the production process, and reduce potential quality problems and production costs.
[0092] Step 3: After receiving the second identification mode command, retrieve the n through-hole position data of the PCB to be inspected, and calculate the deviation D between the actual position of each through-hole and the design standard position. i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first identification coefficient F to obtain the corrected second identification coefficient F'.
[0093] The step three includes the following contents:
[0094] Step 301: receiving the second identification mode command, retrieving the through hole data of the PCB to be inspected, and calculating the actual position (x i ,y i ), and the designed standard position (X i ,Y i ), the calculation formula is as follows:
[0095]
[0096] Among them, D i is the position deviation distance of the i-th through hole, the designed standard position (X i ,Y i ) is obtained according to the PCB through-hole design specification, according to the position deviation D of all through-holes on the PCB to be tested i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a :
[0097]
[0098] The corresponding average through-hole position deviation D of the PCB to be inspected a The calculation formula is as above.
[0099] Step 302: according to the average through hole position deviation D of the PCB to be inspected a , correct the first recognition coefficient F, and obtain the second recognition coefficient F'. The calculation formula is as follows:
[0100] F'=b1*F+b2*D a
[0101] Among them, b1 and b2 are the first recognition coefficient F and the average through-hole position deviation D of the PCB to be inspected, respectively. a The weight coefficients are b1 and b2, respectively.
[0102] When using, combine the contents in steps 301 and 302:
[0103] After receiving the second identification mode command, retrieve the n through-hole position data of the PCB to be inspected, and calculate the deviation D between the actual position of each through-hole and the design standard position i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first recognition coefficient F to obtain the corrected second recognition coefficient F', which can provide a more accurate evaluation when abnormal situations are detected, thereby effectively improving the comprehensive judgment ability of PCB through-hole quality, reducing the misjudgment rate, and ensuring product consistency and reliability.
[0104] Step 4: By comparing the second identification coefficient F' with the qualified range of the deviation ΔF, it is determined whether the quality of the PCB through-hole to be inspected is qualified and classified.
[0105] The step 4 includes the following contents:
[0106] Step 401: Compare the corrected second identification coefficient F' with the deviation ΔF. The range of the deviation ΔF is [(Fref -k*σF),(F ref +k*σF)].
[0107] Step 402, classify the quality of the PCB through-holes to be inspected into qualified and unqualified categories, specifically:
[0108] When F' is within the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is qualified;
[0109] When F' is not within the qualified range of the deviation ΔF, it indicates that the quality of the PCB through hole to be inspected is unqualified.
[0110] When using, combine the contents in steps 401 and 402:
[0111] By comparing the second identification coefficient F' with the qualified range of the deviation ΔF, it is determined whether the quality of the PCB through-hole to be inspected is qualified and classified, thereby improving the reliability of the production process and the overall quality of the final product.
[0112] See also Figure 2 The present invention provides a PCB classification system based on visual recognition, comprising:
[0113] The data acquisition module uses a high-resolution industrial camera to collect images of the PCB to be inspected, and obtains the number, perimeter, and position coordinates of the through holes on the PCB;
[0114] The first recognition module establishes the first recognition coefficient F according to the number of through holes and the average perimeter of the PCB to be detected, retrieves m qualified PCB sample data, and establishes the reference value F according to the number of through holes and the average perimeter of the through holes ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified deviation range is determined to determine whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started;
[0115] After receiving the second identification mode command, the second identification module retrieves the n through-hole position data of the PCB to be inspected and calculates the deviation D between the actual position of each through-hole and the design standard position. i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first identification coefficient F to obtain a corrected second identification coefficient F';
[0116] The classification module compares the second recognition coefficient F' with the qualified range of the deviation ΔF to determine whether the quality of the PCB through hole to be inspected is qualified and classifies it.
[0117] See also Figure 3 The present invention provides a storage medium, comprising:
[0118] In the PCB classification system, the storage medium includes non-volatile storage medium and internal memory. The non-volatile storage medium is used to store key data for a long time, such as operating system, detection program, benchmark value, sample data, deviation range, historical image and model data, to ensure that the system has the necessary resources when starting and executing key tasks. The internal memory provides high-speed storage space for processing temporary data of the PCB to be inspected during operation, such as the number of through holes, perimeter, position coordinates, and the recognition coefficient generated during the calculation process and the corrected results, to ensure the efficiency of real-time calculation and judgment.
[0119] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. A person of ordinary skill in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A PCB classification method based on visual recognition, characterized in that: The steps include: Use a high-resolution industrial camera to collect images of the PCB to be inspected, and obtain the number of through holes n and the perimeter P on the PCB to be inspected. i and the position coordinates of the through holes; The first recognition coefficient F is established by the number of through holes and the average perimeter of the PCB to be tested, and m qualified PCB sample data are retrieved, and the reference value F is established by the number of through holes and the average perimeter of the through holes. ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified deviation range is determined to determine whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started; After receiving the second identification mode command, retrieve the n through-hole position data of the PCB to be inspected, and calculate the deviation D between the actual position of each through-hole and the design standard position i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first identification coefficient F to obtain a corrected second identification coefficient F'; By comparing the second identification coefficient F' with the qualified range of the deviation ΔF, it is determined whether the quality of the through hole of the PCB to be inspected is qualified and classified.
2. A PCB classification method based on visual recognition according to claim 1, characterized in that: Get the perimeter P of each through hole on the PCB to be tested i The data is used to calculate the average value and obtain the average perimeter Pt of the PCB through hole to be tested. The formula is as follows: Wherein, i represents the i-th through hole on the PCB to be detected, i=1, 2, 3, ..., n, and n represents the total number of through holes on the PCB to be detected.
3. A PCB classification method based on visual recognition according to claim 2, characterized in that: According to the number of through holes n and the average perimeter Pt of the through holes to be inspected, the first recognition coefficient F is established. The formula is as follows: F=a1*n+a2*Pt Among them, a1 and a2 are weight coefficients of the number of through holes and the average perimeter of the through holes, respectively, a1 is 0.5, and a2 is 0.
5.
4. A PCB classification method based on visual recognition according to claim 3, characterized in that: By retrieving the data of m qualified PCB through holes, the number of through holes n and the average perimeter of the through holes Pt in the m qualified PCBs are calculated, and the reference value F is calculated. ref , the formula is as follows: <h2 style=";text-align:left;direction:ltr">F<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> =a1*n<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> +a2*Pt<h2 style=";text-align:left;direction:ltr"> j Where j is the jth qualified PCB, j = 1, 2, 3, ..., m, n j is the number of through holes of the jth qualified PCB, Pt j For the average perimeter of the jth qualified PCB through hole, calculate the deviation ΔF of the first recognition coefficient F, the formula is as follows: △F=F-F ref The standard deviation σF is calculated based on the reference value, and the formula is as follows: The acceptable range of the deviation ΔF of the first identification coefficient F is calculated by using the reference value and the standard deviation [(F ref -k*σF),(F ref +k*σF)], where k is the empirical coefficient, k=2 or 3.
5. A PCB classification method based on visual recognition according to claim 4, characterized in that: The first identification coefficient F is compared with the deviation ΔF to determine the quality of the through-hole of the PCB to be inspected, specifically: When F is within the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is qualified; When F is greater than the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is unqualified; When F is less than the qualified range of the deviation ΔF, it indicates that the quality of the through-hole of the PCB to be inspected is abnormal and there is an incomplete detection problem, and a command to start the second identification mode is issued.
6. A PCB classification method based on visual recognition according to claim 5, characterized in that: After receiving the second identification mode command, the coordinate data of the through hole position of the PCB to be inspected is retrieved, and the actual position (x i ,y i ), and the designed standard position (X i ,Y i ), the calculation formula is as follows: Among them, D i is the position deviation distance of the i-th through hole, the designed standard position (X i ,Y i ) is obtained according to the PCB through-hole design specification, according to the position deviation D of all through-holes on the PCB to be tested i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a : The corresponding average through-hole position deviation D of the PCB to be inspected a The calculation formula is as above.
7. A PCB classification method based on visual recognition according to claim 6, characterized in that: According to the average through hole position deviation D of the PCB to be inspected a , correct the first recognition coefficient F, and obtain the second recognition coefficient F'. The calculation formula is as follows: F’=b1*F+b2*D a Among them, b1 and b2 are the first recognition coefficient F and the average through-hole position deviation D of the PCB to be inspected, respectively. a The weight coefficients are b1 and b2, respectively.
8. A PCB classification method based on visual recognition according to claim 7, characterized in that: The second identification coefficient F' is compared with the deviation ΔF to judge the quality of the PCB through-hole to be inspected and classify it, specifically: When F' is within the qualified range of deviation ΔF, it means that the quality of the PCB through hole to be inspected is qualified; When F' is not within the qualified range of the deviation ΔF, it indicates that the quality of the PCB through hole to be inspected is unqualified.
9. A PCB classification system based on visual recognition, used to implement the method according to any one of claims 1 to 8, characterized in that: include: The data acquisition module uses a high-resolution industrial camera to collect images of the PCB to be inspected, and obtains the number, perimeter, and position coordinates of the through holes on the PCB; The first recognition module establishes the first recognition coefficient F according to the number of through holes and the average perimeter of the PCB to be detected, retrieves m qualified PCB sample data, and establishes the reference value F according to the number of through holes and the average perimeter of the through holes ref , by calculating the first recognition coefficient F of the PCB to be tested and the reference value F ref The deviation ΔF is defined according to the reference value and the standard deviation, and the qualified deviation range is determined to determine whether the first identification coefficient F is within the deviation range. When the first identification coefficient is abnormal, the second identification coefficient command is started; The second identification module, after receiving the second identification mode command, retrieves the n through-hole position data of the PCB to be inspected, and calculates the deviation D between the actual position of each through-hole and the design standard position i , and find the average value of these deviations to determine the average through-hole position deviation D of the PCB to be inspected a , and then correct the first identification coefficient F to obtain a corrected second identification coefficient F'; The classification module compares the second recognition coefficient F' with the qualified range of the deviation ΔF to determine whether the quality of the PCB through hole to be inspected is qualified and classifies it.
10. A storage medium, characterized in that: The storage medium stores computer-executable instructions. When the instructions are executed by a computer, the computer executes the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for detecting drilling precision of PCB mechanical drilling machine
CN104149125A
Detection method for blind holes on printed circuit board
CN106501706A
PCB hole position detection device and method
CN107345789A
PCB apparent defect automatic detection system and method based on image
CN107389701A
Method and system for defect detection and classification using x-ray
CN114402360A
