PCB quality detection system and method based on machine vision
Through the PCB board quality inspection system based on machine vision, combined with the production analysis module and the quality inspection module, the image characteristics and grayscale differences are identified, and the traditional detection efficiency is solved, and the high-speed and accurate detection effect is achieved .
Patent Information
- Application Number
- CN202411338455.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional PCB board quality inspection relies on manual visual inspection, which has problems such as slow detection speed, low efficiency, easy fatigue, and easy misjudgment, and cannot meet the needs of modern electronic manufacturing for high quality and high efficiency. The existing machine vision-based detection system has low detection accuracy, poor adaptability and poor stability.
Design a PCB board quality inspection system based on machine vision, including production analysis module, acquisition module and quality inspection module. By analyzing the PCB board production process, a pollution library and problem library are established, image features are identified, image acquisition and positioning are carried out. Adjust, judge the grayscale difference surface, identify abnormal areas, and conduct problem analysis in combination with the pollution library and the problem library.
It realizes high-speed and continuous detection, improves detection efficiency and accuracy, reduces misjudgment and missed detection caused by human factors, can detect complex and tiny PCB board details, narrows the scope of quality inspection and screening, and improves the detection reliability.
Smart Images

Figure CN119246546A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of PCB board quality detection, and in particular to a PCB board quality detection system and method based on machine vision. Background Art
[0002] As an important part of electronic products, the quality of PCB boards plays a vital role in the performance stability of products. With the rapid development of the electronics industry, the manufacturing scale of PCB boards continues to expand, and the quality requirements are getting higher and higher. Traditional PCB board quality inspection mainly relies on manual visual inspection. This method has many shortcomings, such as slow detection speed, low efficiency, easy fatigue, easy misjudgment, etc., and cannot meet the needs of modern electronic manufacturing industry for high quality and high efficiency. With the rapid development of machine vision technology, its application in industrial automation, quality inspection and other fields is becoming more and more extensive. Machine vision technology can realize the functions of automatic recognition, positioning and measurement of objects by simulating the visual function of the human eye, combining image processing and artificial intelligence technology. Therefore, the application of machine vision technology in PCB board quality inspection has very important practical significance and application value. Although there are some PCB board quality inspection systems based on machine vision on the current market, most of these systems have problems such as low detection accuracy, weak adaptability, poor stability, etc., and cannot fully meet the needs of practical applications. Therefore, the development of a PCB board quality inspection technology based on machine vision has broad market prospects and application space.
[0003] Based on this, the present invention provides a PCB board quality detection system and method based on machine vision. Summary of the invention
[0004] In order to solve the problems existing in the above scheme, the present invention provides a PCB board quality detection system and method based on machine vision.
[0005] The purpose of the present invention can be achieved through the following technical solutions: A PCB board quality inspection system based on machine vision, including a production analysis module, an acquisition module and a quality inspection module; The production analysis module is used to analyze the production process of the PCB board and establish a corresponding pollution library and problem library based on the analysis results; the pollution library is used to store each reference pollution type and the pollution identification feature corresponding to each reference pollution type; the problem library is used to store each quality problem and the problem identification feature corresponding to each quality problem.
[0006] Furthermore, the method for analyzing the production process of the PCB board includes: Identify the production process information of the PCB board, and determine the reference pollution types and quality issues based on the production process information; Obtaining each problem acquisition image corresponding to each reference problem type and quality problem, classifying and sorting each problem acquisition image according to each reference problem type and quality problem, obtaining classified acquisition data corresponding to each reference problem type and quality problem, and marking each problem acquisition image in the classified acquisition data as a classified image; The classified images are processed to determine the image recognition features corresponding to each of the classified images; the image recognition features are integrated to obtain the pollution recognition features and problem recognition features corresponding to each reference problem type and quality problem, respectively.
[0007] The acquisition module is used to acquire images of the PCB boards to obtain target acquisition images corresponding to each PCB board.
[0008] The quality inspection module is used to perform quality inspection on the PCB board according to the target acquisition image, obtain the target acquisition image, adjust the target acquisition image according to the preset positioning point, and obtain the grayscale image of the PCB board; By comparing the preset inspection verification map with the grayscale map of the PCB board, the corresponding grayscale difference surface is obtained; according to the grayscale difference surface, it is determined whether the PCB board is abnormally inspected; When the test is judged to be normal, the output PCB board test is qualified; When it is determined that the detection is abnormal, the problem area is identified, and problem analysis is performed based on the problem area, the pollution library and the problem library to obtain corresponding problem analysis results, and corresponding processing is performed based on the obtained problem analysis results.
[0009] Furthermore, the method for setting the positioning point includes: Obtaining acquisition conditions, and determining each candidate point according to the acquisition conditions; Performing simulation acquisition on each candidate point to obtain a number of simulation images corresponding to each candidate point; performing grayscale processing on the simulation image to obtain a simulated grayscale image; identifying a grayscale value distribution map corresponding to each candidate point in the simulated grayscale image, merging the grayscale distribution map, and obtaining a grayscale difference curve corresponding to each candidate point; Fit the grayscale difference curve to obtain the corresponding difference function, which is marked as G(x), where x is the independent variable and represents the corresponding position on the boundary of the point to be selected; According to the formula Calculate the positioning value of each point to be selected; where: QG is the positioning value; Sort the candidate points in descending order according to the positioning value, and select the first A candidate points as the positioning points; A is a positive integer in the range of [2, 5].
[0010] Furthermore, the method for merging the grayscale distribution maps includes: Mark the boundary of the point to be selected in the grayscale distribution map as the positioning boundary; calculate the inner boundary value and the outer boundary value of each position on the positioning boundary in the grayscale value distribution map according to the preset grayscale representative method; Calculate the average inner boundary value and the average outer boundary value corresponding to each position on the positioning boundary of the selected point according to the inner boundary value and the outer boundary value of each position on the positioning boundary in each grayscale distribution map; mark the average inner boundary value and the average outer boundary value as the inner boundary representative value and the outer boundary representative value respectively; Calculate the absolute value of the difference between the outer boundary representative value and the inner boundary representative value of each position, and mark it as the position parameter; A grayscale difference curve is generated according to the position parameters corresponding to each position on the positioning boundary.
[0011] Furthermore, the grayscale representation method is: Mark the pixels at each position on the positioning boundary as reference pixels, make a tangent line on the positioning boundary according to the reference pixel, and then make a vertical line through the reference pixel as the tangent line, and mark each pixel within the positioning boundary corresponding to the vertical line as an inner selected pixel, and the inner selected pixel includes the reference pixel; mark each pixel outside the positioning boundary corresponding to the vertical line as an outer selected pixel, and the outer selected pixel does not include the reference pixel; sort each inner selected pixel and outer selected pixel according to the distance between them and the reference pixel, for the inner selected pixel, the serial number of the reference pixel is 1, and for the outer selected pixel, the serial number of the pixel closest to the reference pixel is 1; Starting from sequence number 1, the grayscale value difference between each adjacent pixel in the inner selected pixel and the outer selected pixel is calculated respectively, and the grayscale value difference calculated each time is compared with the preset standard deviation value; When the gray value difference is not greater than the standard deviation, the next gray value difference is calculated; When the gray value difference is greater than the standard deviation, the calculation of the gray value difference corresponding to the sequence number is stopped, and each pixel whose corresponding gray value difference is not greater than the standard deviation is marked as an inner calculation pixel and an outer calculation pixel respectively; The average gray value corresponding to the pixel in the statistics is calculated and marked as the inner boundary value; The average grayscale value corresponding to the pixel outside the statistics is calculated and marked as the outer boundary value.
[0012] Furthermore, the method for positioning and adjusting the target captured image according to the positioning point includes: Obtain a grayscale image of each positioning point and mark it as a positioning standard image; perform grayscale processing on the target acquisition image to obtain a target grayscale image; mark each positioning point in the target grayscale image according to the positioning image, obtain a grayscale image of the positioning point in the target grayscale image, and mark it as a positioning acquisition image; The target grayscale image is grayscale adjusted according to the positioning standard image and the positioning acquisition image to obtain a grayscale adjusted image, and the grayscale adjusted image is cropped according to the positioning points to obtain a grayscale image of the PCB board.
[0013] Furthermore, the method for judging whether the PCB board is abnormally detected according to the grayscale difference surface includes: Set the allowable error and establish a transformation model based on the allowable error. The expression of the transformation model is: ; Where: s is the gray value difference corresponding to the corresponding pixel in the gray difference plane; ε is the allowable error; the output data is the conversion value PH(s), and the conversion value includes 1 or 0; The grayscale difference surface is transformed through the transformation model to obtain the evaluation surface; Identify the abnormal areas in the evaluation surface, calculate the area of each abnormal area, and mark them as abnormal areas; When there is an abnormal area with an abnormal area greater than the threshold value X1 in the evaluation map, the detection is judged to be abnormal, and the abnormal area with an abnormal area greater than the threshold value X1 is marked as a problem area; When there is no abnormal area with an abnormal area greater than the threshold X1 in the evaluation graph, the detection is determined to be normal.
[0014] A PCB board quality detection method based on machine vision, the method comprising: Establish corresponding pollution database and problem database according to the analysis results; collect images of PCB boards to obtain target collection images corresponding to each PCB board; Position and adjust the target acquisition image according to the preset positioning points to obtain the grayscale image of the PCB board; By comparing the preset inspection verification map with the grayscale map of the PCB board, the corresponding grayscale difference surface is obtained; according to the grayscale difference surface, it is determined whether the PCB board is abnormally inspected; When the test is judged to be normal, the output PCB board test is qualified; When it is determined that the detection is abnormal, the problem area is identified, and problem analysis is performed based on the problem area, the pollution library and the problem library to obtain corresponding problem analysis results, and corresponding processing is performed based on the obtained problem analysis results.
[0015] Compared with the prior art, the present invention has the following beneficial effects: Through the cooperation between the production analysis module, the acquisition module and the quality inspection module, high-speed and continuous inspection is achieved, which greatly improves the inspection efficiency; secondly, because the machine vision technology has a high degree of objectivity and consistency, it can reduce the misjudgment and missed inspection caused by human factors. In addition, the inspection system can also detect complex and tiny details of PCB boards, thereby improving the accuracy and reliability of the inspection. By setting up the production analysis module, the current PCB board production process can be fully analyzed, and the various situations that the PCB board may encounter during quality inspection can be intelligently determined, so that the screening range can be greatly narrowed during quality inspection. Moreover, according to the preset contamination library and problem library, the problem situation with quality problems can be quickly determined; more efficient and accurate PCB board inspection can be achieved, avoiding failure to analyze the actual production situation, resulting in more invalid analysis and affecting the quality inspection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is a principle block diagram of the present invention. DETAILED DESCRIPTION
[0018] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. 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.
[0019] like Figure 1 As shown in the figure, a PCB board quality inspection system based on machine vision includes a production analysis module, an acquisition module, a quality inspection module, The production analysis module is used to analyze the production process of the PCB board, and establish a corresponding pollution library and problem library according to the analysis results; the pollution library is used to store various PCB board pollution types that may appear in the production process after cleaning and in the quality inspection stage and the corresponding pollution identification characteristics, and the pollution identification characteristics refer to the performance characteristics or identifiable characteristics of the PCB board pollution type; in order to distinguish, the stored PCB board pollution types are marked as reference pollution types; the problem library is used to store various quality problems that may appear in the production process and the corresponding problem identification characteristics; quality problems caused by pollution problems are not included.
[0020] By setting up the production analysis module, the current PCB board production process can be fully analyzed, and the various situations that the PCB board may encounter during quality inspection can be intelligently determined, thereby greatly narrowing the screening range during quality inspection. Moreover, according to the preset contamination library and problem library, the problem situations with quality problems can be quickly determined; more efficient and accurate PCB board detection can be achieved, avoiding failure to analyze the actual production conditions, resulting in more invalid analysis and affecting quality inspection efficiency.
[0021] Among them, the methods for analyzing the production process of PCB boards include: Identify the production process information of PCB boards, including the corresponding working methods, historical quality inspection data and other data related to pollution and quality issues; conduct direct analysis and corresponding retrieval based on the production process information to determine the various reference pollution types and quality issues; because the analysis is based only on historical quality inspection data, there may be incomplete data, so it is necessary to retrieve what other reference problem types and quality issues may exist under this condition based on detailed production process information; Obtaining each problem acquisition image corresponding to each reference problem type and quality problem, classifying and sorting each problem acquisition image according to each reference problem type and quality problem, obtaining classified acquisition data corresponding to each reference problem type and quality problem, and marking each problem acquisition image in the classified acquisition data as a classified image; The classified images are processed to determine the corresponding image recognition features, that is, the image recognition features of the problem compared with the normal PCB board. Specifically, control variable simulation is performed under the current quality inspection conditions according to the type of problem to determine the image recognition features corresponding to the problem type, such as dust, waste, water stains, etc.; the image recognition features are integrated to obtain the pollution recognition features and problem recognition features corresponding to each reference problem type and quality problem, respectively. Both the pollution recognition features and the problem recognition features are expressed in the form of features corresponding to the grayscale image.
[0022] The acquisition module is used to acquire images of the PCB board that needs to be inspected for quality, and obtain a target acquisition image.
[0023] In practical applications, it is necessary to ensure the stability of acquisition conditions, such as acquisition parameters such as illumination and angle, to facilitate subsequent data analysis and improve detection accuracy; it is also possible to perform illumination analysis and set appropriate illumination colors according to needs. It is also possible to use existing equipment installation analysis technology to analyze existing quality inspection conditions and intelligently determine the installation and layout of each acquisition device; it is also possible to use existing acquisition equipment that has been used, as long as it can meet quality inspection requirements. Quality inspection requirements generally include stability, consistency, etc.
[0024] The quality inspection module is used to perform quality inspection according to the target acquisition images corresponding to each PCB board, obtain the target acquisition images corresponding to the PCB board, perform positioning adjustment on the target acquisition images according to the preset positioning points, and obtain the grayscale image of the PCB board; According to the qualified PCB board, a detection and verification map of the PCB board, that is, a grayscale image of the qualified PCB board, is set; by positioning and comparing the preset PCB board grayscale map with the detection and verification map, a corresponding grayscale difference surface is obtained; that is, after aligning the corresponding positions, the absolute value of the difference between the grayscale values of the corresponding pixels between the PCB board grayscale map and the detection and verification map is calculated, and the grayscale difference surface corresponding to the PCB board is generated according to the absolute value of the difference corresponding to each position; According to the grayscale difference surface, it is judged whether the PCB board is abnormal. If the detection is normal, the output PCB board is qualified; if the detection is abnormal, Identify the corresponding problem area, perform problem analysis based on the problem area, pollution library and problem library, obtain the corresponding problem analysis results, and perform corresponding processing based on the obtained problem analysis results.
[0025] The problem analysis results include contamination problems and quality problems. For contamination problems, return to the cleaning process for re-cleaning; for quality problems, handle them according to the preset method, such as sorting them to a certain recycling point and manually checking the PCB boards at the recycling point; specifically, set the corresponding processing method according to the user's production needs, and then handle them according to the specific problems.
[0026] The method for setting the positioning point includes: Acquire acquisition conditions according to the acquisition module, and the acquisition conditions include items corresponding to various images that appear in the acquisition target image of the PCB board, such as a certain electronic component; determine various candidate points according to the acquisition conditions, that is, select various candidate points that may be used as positioning points according to the acquisition conditions in the manner of selecting positioning points. Generally, a statistical table is preset for matching, such as stability, distinguishability, etc. The candidate points are points on the PCB board; Perform simulation acquisition on each candidate point, that is, simulate according to the quality inspection process to obtain several simulation images corresponding to each candidate point, such as simulating according to each normal PCB board, each corresponding reference pollution type, and PCB board corresponding to quality problems; grayscale processing is performed on the simulated image to obtain a simulated grayscale image; identify the grayscale value distribution map corresponding to each candidate point in the simulated grayscale image, the grayscale value distribution map includes the grayscale value of the area corresponding to the candidate point and the grayscale value within the preset outer expansion range of the junction with the candidate point, such as L pixel distance, L is a positive integer; merge the grayscale distribution map to obtain the grayscale difference curve corresponding to each candidate point; mark the independent variable in the grayscale difference curve as x, that is, the corresponding position on the positioning boundary of the candidate point; Fit the grayscale difference curve to obtain the corresponding difference function, and mark the difference function as G(x); according to the formula Calculate the positioning value of each point to be selected; where: QG is the positioning value; Sort the candidate points in descending order according to the positioning value, and select the first A candidate points as the positioning points; A is a positive integer in the range of [2, 5].
[0027] Methods for merging grayscale distribution maps include: Mark the boundary of the selected point in the grayscale distribution map to obtain the positioning boundary; the grayscale value of the selected point is within the positioning boundary, including the boundary, and other grayscale values are outside the positioning boundary; calculate the inner boundary value and outer boundary value corresponding to each position on the positioning boundary in the grayscale value distribution map according to the preset grayscale representative method; Identify each grayscale distribution map corresponding to the point to be selected, obtain each inner boundary value and outer boundary value corresponding to the positioning boundary of the point to be selected, and calculate the corresponding average value, that is, the average inner boundary value and the average outer boundary value; this is equivalent to calculating the average inner boundary value and the average outer boundary value corresponding to each position on the positioning boundary of the point to be selected according to the inner boundary value and the outer boundary value of each position on the positioning boundary in each grayscale distribution map corresponding to the point to be selected; mark the average inner boundary value and the average outer boundary value as the inner boundary representative value and the outer boundary representative value respectively; Calculate the absolute value of the difference between the outer boundary representative value and the inner boundary representative value of each position, and mark it as the position parameter; The corresponding grayscale difference curve is generated according to the position parameters corresponding to each position on the positioning boundary. The horizontal axis marks the corresponding position, and the vertical axis represents the position parameter. Any position is selected as the starting point for substitution, and then a smooth curve is used to connect them to obtain the grayscale difference curve.
[0028] Grayscale representation method is: The standard deviation is set according to the similarity of the grayscale values. That is, when the difference of each grayscale value is within the standard deviation value CK, it can be regarded as the same color system. The standard difference is set according to the positioning. Because there will be a large color difference between the set positioning point and the surrounding area, there will be a large grayscale value gap, so there can be a large error range. Because taking only one pixel point is less representative, it is necessary to take more through the standard deviation value. Mark the pixels at each position on the positioning boundary as reference pixels, make a tangent line on the positioning boundary according to the reference pixel, and then make a vertical line through the reference pixel as the tangent line, and mark each pixel within the positioning boundary corresponding to the vertical line as an inner selected pixel, including the reference pixel; mark each pixel outside the positioning boundary corresponding to the vertical line as an outer selected pixel, excluding the reference pixel; sort each inner selected pixel and outer selected pixel according to the distance between them and the reference pixel, and sort them in order from small to large distance, for the inner selected pixel, the serial number of the reference pixel is 1, and for the outer selected pixel, the serial number of the pixel closest to the reference pixel is 1; Starting from sequence number 1, the grayscale value difference between each adjacent pixel in the inner selected pixel and the outer selected pixel is calculated respectively, and the grayscale value difference calculated each time is compared with the standard deviation value. When the grayscale value difference is not greater than the standard deviation value, the next grayscale value difference is calculated; when the grayscale value difference is greater than the standard deviation value, the calculation of the grayscale value difference corresponding to the sequence number is stopped, and each pixel whose corresponding grayscale value difference is not greater than the standard deviation value is marked as an inner calculation pixel and an outer calculation pixel respectively; The average gray value corresponding to the pixel in the statistics is calculated and marked as the inner boundary value; The average grayscale value corresponding to the pixel outside the statistics is calculated and marked as the outer boundary value.
[0029] The method for positioning and adjusting the target acquisition image according to the positioning point includes: Perform grayscale processing on the target acquisition image to obtain a target grayscale image; obtain a grayscale image of each positioning point, mark it as a positioning standard image, mark each positioning point in the target grayscale image according to the positioning image, obtain a grayscale image of the positioning point, and mark it as a positioning acquisition image; The target grayscale image is grayscale adjusted according to the positioning standard image and the positioning acquisition image to obtain a grayscale adjusted image, and the grayscale adjusted image is cropped according to the positioning points to obtain a PCB board grayscale image including only the PCB board.
[0030] The method for adjusting the grayscale of the target grayscale image according to the positioning standard image and the positioning acquisition image is: A corresponding grayscale adjustment model is established based on a neural network such as a CNN network or a DNN network, and a corresponding training set is established manually for training. The training set includes input data and output data. The input data is a simulated setting of various positioning standard images, positioning acquisition images and target grayscale images; the output data is a grayscale adjustment image; that is, according to the grayscale value difference between the positioning standard image and the positioning acquisition image, the corresponding grayscale adjustment method is determined, and then the grayscale values of other pixels are adjusted.
[0031] Methods for judging whether a PCB board is abnormal based on the grayscale difference surface include: Set the allowable error. In actual testing, the gray value error within a certain range can be considered qualified. The specific setting is made by the staff; The transformation model is established according to the allowable error. The expression of the transformation model is: ; Where: s is the input data, that is, the gray value difference corresponding to the corresponding pixels in the gray difference surface; ε is the allowable error; the output data is the conversion value PH(s), and the conversion value includes 1 or 0; The grayscale value differences in the grayscale difference surface are transformed by the transformation model to obtain the transformed values, and the corresponding evaluation surface is generated according to the transformation values of each position; Identify abnormal areas in the assessment surface, where the abnormal areas are continuously connected areas with a conversion value of 1; calculate the area of each abnormal area and mark it as the abnormal area; When there is an abnormal area with an abnormal area greater than the threshold value X1 in the evaluation map, the detection is judged to be abnormal, and the abnormal area with an abnormal area greater than the threshold value X1 is marked as a problem area; When there is no abnormal area with an abnormal area greater than the threshold value X1 in the evaluation graph, the detection is determined to be normal.
[0032] Methods for problem analysis based on problem areas, pollution libraries, and problem libraries include: Input the problem area into the pollution library and the problem library respectively, and calculate the pollution conformity between the problem area and each pollution identification feature and the quality conformity between the problem area and each quality problem respectively; compare the grayscale image to determine the corresponding conformity, which can also be replaced by similarity, or calculated by applying the existing conformity calculation method; The corresponding problem analysis results are determined based on the pollution compliance and quality compliance obtained, with the highest compliance taking precedence.
[0033] Through the cooperation between the production analysis module, the acquisition module and the quality inspection module, high-speed and continuous inspection is achieved, which greatly improves the inspection efficiency. Secondly, because machine vision technology has a high degree of objectivity and consistency, it can reduce misjudgments and missed inspections caused by human factors. In addition, the inspection system can also inspect complex and tiny PCB board details, thereby improving the accuracy and reliability of inspection.
[0034] A PCB board quality detection method based on machine vision, the method comprising: Establish corresponding pollution database and problem database according to the analysis results; Capture images of the PCB boards to obtain target acquisition images corresponding to each PCB board; Position and adjust the target acquisition image according to the preset positioning points to obtain the grayscale image of the PCB board; By comparing the preset inspection verification map with the grayscale map of the PCB board, the corresponding grayscale difference surface is obtained; according to the grayscale difference surface, it is determined whether the PCB board is abnormally inspected; When the test is judged to be normal, the output PCB board test is qualified; When it is determined that the detection is abnormal, the problem area is identified, and problem analysis is performed based on the problem area, the pollution library and the problem library to obtain corresponding problem analysis results, and corresponding processing is performed based on the obtained problem analysis results.
[0035] Methods for analyzing the production process of PCB boards include: Identify the production process information of the PCB board, and determine the reference pollution types and quality issues based on the production process information; Obtaining each problem acquisition image corresponding to each reference problem type and quality problem, classifying and sorting each problem acquisition image according to each reference problem type and quality problem, obtaining classified acquisition data corresponding to each reference problem type and quality problem, and marking each problem acquisition image in the classified acquisition data as a classified image; The classified images are processed to determine the image recognition features corresponding to each classified image; the image recognition features are integrated to obtain the pollution recognition features and problem recognition features corresponding to each reference problem type and quality problem.
[0036] The methods for setting the positioning point include: Obtaining acquisition conditions, and determining each candidate point according to the acquisition conditions; Perform simulated acquisition on each candidate point to obtain several simulated images corresponding to each candidate point; perform grayscale processing on the simulated image to obtain a simulated grayscale image; identify the grayscale value distribution map corresponding to each candidate point in the simulated grayscale image, and mark the boundary of the candidate point in the grayscale distribution map as the positioning boundary; mark the pixels at each position on the positioning boundary as reference pixels, make a tangent on the positioning boundary according to the reference pixel, and then make a vertical line of the tangent through the reference pixel, mark each pixel within the positioning boundary corresponding to the vertical line as an inner selected pixel, and the inner selected pixel includes the reference pixel; mark each pixel outside the positioning boundary corresponding to the vertical line as an outer selected pixel, and the outer selected pixel does not include the reference pixel; sort each inner selected pixel and outer selected pixel according to the distance between them and the reference pixel, for the inner selected pixel, the serial number of the reference pixel is 1, and for the outer selected pixel, the serial number of the pixel closest to the reference pixel is 1; Starting from sequence number 1, the grayscale value difference between each adjacent pixel in the inner selected pixel and the outer selected pixel is calculated respectively, and the grayscale value difference calculated each time is compared with the preset standard deviation value; When the gray value difference is not greater than the standard deviation, the next gray value difference is calculated; When the gray value difference is greater than the standard deviation, the calculation of the gray value difference corresponding to the sequence number is stopped, and each pixel whose corresponding gray value difference is not greater than the standard deviation is marked as an inner calculation pixel and an outer calculation pixel respectively; The average gray value corresponding to the pixel in the statistics is calculated and marked as the inner boundary value; The average grayscale value corresponding to the pixel outside the statistics is calculated and marked as the outer boundary value.
[0037] Calculate the average inner boundary value and the average outer boundary value corresponding to each position on the positioning boundary of the selected point according to the inner boundary value and the outer boundary value of each position on the positioning boundary in each grayscale distribution map; mark the average inner boundary value and the average outer boundary value as the inner boundary representative value and the outer boundary representative value respectively; Calculate the absolute value of the difference between the outer boundary representative value and the inner boundary representative value of each position, and mark it as the position parameter; A grayscale difference curve is generated according to the position parameters corresponding to each position on the positioning boundary.
[0038] Fit the grayscale difference curve to obtain the corresponding difference function, and mark the difference function as G(x), where x is the independent variable in the grayscale difference curve, indicating the corresponding position; according to the formula Calculate the positioning value of each point to be selected; where: QG is the positioning value; Sort the candidate points in descending order according to the positioning value, and select the first A candidate points as the positioning points; A is a positive integer in the range of [2, 5].
[0039] The above formulas are all calculated by removing dimensions and taking numerical values. The formula is a formula that is closest to the actual situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained by simulating a large amount of data.
[0040] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A PCB board quality inspection system based on machine vision, characterized in that: Including production analysis module, acquisition module and quality inspection module; The production analysis module is used to analyze the production process of the PCB board, and establish a corresponding pollution library and problem library according to the analysis results; the pollution library is used to store each reference pollution type and the pollution identification feature corresponding to each reference pollution type; The problem database is used to store various quality problems and problem identification features corresponding to each quality problem; The acquisition module is used to acquire images of the PCB boards to obtain target acquisition images corresponding to each PCB board; The quality inspection module is used to perform quality inspection on the PCB board according to the target acquisition image, obtain the target acquisition image, adjust the target acquisition image according to the preset positioning point, and obtain the grayscale image of the PCB board; By comparing the preset inspection verification map with the grayscale map of the PCB board, the corresponding grayscale difference surface is obtained; according to the grayscale difference surface, it is determined whether the PCB board is abnormally inspected; When the test is judged to be normal, the output PCB board test is qualified; When it is determined that the detection is abnormal, the problem area is identified, and problem analysis is performed based on the problem area, the pollution library and the problem library to obtain corresponding problem analysis results, and corresponding processing is performed based on the obtained problem analysis results.
2. A PCB board quality inspection system based on machine vision according to claim 1, characterized in that: Methods for analyzing the production process of PCB boards include: Identify the production process information of the PCB board, and determine the reference pollution types and quality issues based on the production process information; Obtaining each problem acquisition image corresponding to each reference problem type and quality problem, classifying and sorting each problem acquisition image according to each reference problem type and quality problem, obtaining classified acquisition data corresponding to each reference problem type and quality problem, and marking each problem acquisition image in the classified acquisition data as a classified image; The classified images are processed to determine the image recognition features corresponding to each of the classified images; the image recognition features are integrated to obtain the pollution recognition features and problem recognition features corresponding to each reference problem type and quality problem, respectively.
3. A PCB board quality inspection system based on machine vision according to claim 1, characterized in that: The methods for setting the positioning point include: Obtaining acquisition conditions, and determining each candidate point according to the acquisition conditions; Performing simulation acquisition on each candidate point to obtain a number of simulation images corresponding to each candidate point; performing grayscale processing on the simulation image to obtain a simulated grayscale image; identifying a grayscale value distribution map corresponding to each candidate point in the simulated grayscale image, merging the grayscale distribution map, and obtaining a grayscale difference curve corresponding to each candidate point; Fit the grayscale difference curve to obtain the corresponding difference function, mark the difference function as G(x), and use the formula Calculate the positioning value of each candidate point; where: QG is the positioning value; x is the independent variable of the difference function, indicating the corresponding position; Sort the candidate points in descending order according to the positioning value, and select the first A candidate points as the positioning points; A is a positive integer.
4. A PCB board quality inspection system based on machine vision according to claim 3, characterized in that: The value range of A is [2, 5].
5. A PCB board quality inspection system based on machine vision according to claim 3, characterized in that: Methods for merging grayscale distribution maps include: Mark the boundary of the point to be selected in the grayscale distribution map as the positioning boundary; calculate the inner boundary value and the outer boundary value of each position on the positioning boundary in the grayscale value distribution map according to the preset grayscale representative method; Calculate the average inner boundary value and the average outer boundary value corresponding to each position on the positioning boundary of the selected point according to the inner boundary value and the outer boundary value of each position on the positioning boundary in each grayscale distribution map; mark the average inner boundary value and the average outer boundary value as the inner boundary representative value and the outer boundary representative value respectively; Calculate the absolute value of the difference between the outer boundary representative value and the inner boundary representative value of each position, and mark it as the position parameter; A grayscale difference curve is generated according to the position parameters corresponding to each position on the positioning boundary.
6. A PCB board quality inspection system based on machine vision according to claim 5, characterized in that: Grayscale representation method is: Mark pixels at various positions on the positioning boundary as reference pixels, draw a tangent line on the positioning boundary according to the reference pixels, draw a vertical line of the tangent line through the reference pixels, and mark each pixel within the positioning boundary corresponding to the vertical line as an inner selected pixel, wherein the inner selected pixel includes the reference pixel; Mark each pixel outside the positioning boundary corresponding to the vertical line as an externally selected pixel, and the externally selected pixels do not include the reference pixel; sort each internally selected pixel and the externally selected pixel according to the distance between them and the reference pixel, for the internally selected pixel, the reference pixel is numbered 1, and for the externally selected pixel, the externally selected pixel closest to the reference pixel is numbered 1; Starting from sequence number 1, the grayscale value difference between each adjacent pixel in the inner selected pixel and the outer selected pixel is calculated respectively, and the grayscale value difference calculated each time is compared with the preset standard deviation value; When the gray value difference is not greater than the standard deviation, the next gray value difference is calculated; When the gray value difference is greater than the standard deviation, the calculation of the gray value difference corresponding to the sequence number is stopped, and each pixel whose corresponding gray value difference is not greater than the standard deviation is marked as an inner calculation pixel and an outer calculation pixel respectively; The average gray value corresponding to the pixel in the statistics is calculated and marked as the inner boundary value; The average grayscale value corresponding to the pixel outside the statistics is calculated and marked as the outer boundary value.
7. A PCB board quality inspection system based on machine vision according to claim 1, characterized in that: The method for positioning and adjusting the target acquisition image according to the positioning point includes: Obtain a grayscale image of each positioning point and mark it as a positioning standard image; perform grayscale processing on the target acquisition image to obtain a target grayscale image; mark each positioning point in the target grayscale image according to the positioning image, obtain a grayscale image of the positioning point in the target grayscale image, and mark it as a positioning acquisition image; The target grayscale image is grayscale adjusted according to the positioning standard image and the positioning acquisition image to obtain a grayscale adjusted image, and the grayscale adjusted image is cropped according to the positioning points to obtain a grayscale image of the PCB board.
8. The PCB board quality inspection system based on machine vision according to claim 7, characterized in that: Methods for judging whether a PCB board is abnormal based on the grayscale difference surface include: Set the allowable error and establish a transformation model based on the allowable error. The expression of the transformation model is: ; Where: s is the gray value difference corresponding to the corresponding pixel in the gray difference plane; ε is the allowable error; the output data is the conversion value 1 or 0; The grayscale difference surface is transformed through the transformation model to obtain the evaluation surface; Identify the abnormal areas in the evaluation surface, calculate the area of each abnormal area, and mark them as abnormal areas; When there is an abnormal area with an abnormal area greater than the threshold value X1 in the evaluation map, the detection is judged to be abnormal, and the abnormal area with an abnormal area greater than the threshold value X1 is marked as a problem area; When there is no abnormal area with an abnormal area greater than the threshold value X1 in the evaluation graph, the detection is determined to be normal.
9. A PCB board quality detection method based on machine vision, characterized in that: A PCB board quality inspection system based on machine vision as described in any one of claims 1 to 8, the method comprising: Establish corresponding pollution database and problem database according to the analysis results; collect images of PCB boards to obtain target collection images corresponding to each PCB board; Position and adjust the target acquisition image according to the preset positioning points to obtain the grayscale image of the PCB board; By comparing the preset inspection verification map with the grayscale map of the PCB board, the corresponding grayscale difference surface is obtained; according to the grayscale difference surface, it is determined whether the PCB board is abnormally inspected; When the test is judged to be normal, the output PCB board test is qualified; When it is determined that the detection is abnormal, the problem area is identified, and problem analysis is performed based on the problem area, the pollution library and the problem library to obtain corresponding problem analysis results, and corresponding processing is performed based on the obtained problem analysis results.
Citation Information
Patent Citations
Optical inspection system
CA2296143A1
PCB apparent defect automatic detection system and method based on image
CN107389701A
Two-dimensional PCB appearance defect real-time automatic detection technology based on deep learning
CN111754456A
Method for detecting and classifying stain and defect types and levels based on circuit board
CN114216915A
Positioning system and method for PCB production
CN117372434A
Cited By
Production quality tracking method and system of printed circuit board
CN121073287A
