CN118052815B - Visual automatic detection method for PCB soldering tin defect - Google Patents

Visual automatic detection method for PCB soldering tin defect Download PDF

Info

Publication number
CN118052815B
CN118052815B CN202410444088.XA CN202410444088A CN118052815B CN 118052815 B CN118052815 B CN 118052815B CN 202410444088 A CN202410444088 A CN 202410444088A CN 118052815 B CN118052815 B CN 118052815B
Authority
CN
China
Prior art keywords
pixel point
pixel
value
pcb
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410444088.XA
Other languages
Chinese (zh)
Other versions
CN118052815A (en
Inventor
周琳玲
陈新桥
龙叶家
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen United Shengxin Technology Co ltd
Original Assignee
Shenzhen United Shengxin Technology Co ltd
Filing date
Publication date
Application filed by Shenzhen United Shengxin Technology Co ltd filed Critical Shenzhen United Shengxin Technology Co ltd
Priority to CN202410444088.XA priority Critical patent/CN118052815B/en
Publication of CN118052815A publication Critical patent/CN118052815A/en
Application granted granted Critical
Publication of CN118052815B publication Critical patent/CN118052815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to the technical field of image processing, in particular to a visual automatic detection method for PCB soldering tin defects, which comprises the following steps: acquiring a PCB gray level image, and constructing a welding window gray level trend coefficient by combining gray level distribution of neighborhood pixel points of pixel points in the PCB gray level image with gray level distribution characteristics of welding points; analyzing gradient characteristics of soldering tin defects, constructing a welding edge characteristic index, and constructing a circular index and a circular neighborhood index by combining shape characteristics of a welding point and other parts of the PCB; and finally, constructing a welding point index, dividing the gray level image of the PCB by adopting a threshold dividing algorithm, and combining a neural network to obtain the category of the soldering tin defect of the PCB. The invention aims to position the welding point and improve the precision of image segmentation, thereby ensuring the accuracy of solder defect detection.

Description

Visual automatic detection method for PCB soldering tin defect
Technical Field
The application relates to the technical field of image processing, in particular to a visual automatic detection method for PCB soldering tin defects.
Background
With the popularity of modern electronic products, the quality of printed circuit boards (PCB boards) is directly related to the product performance as a core for information transmission and control. Soldering is a key step in PCB manufacturing, and soldering quality is directly related to product reliability and performance stability. As the market demand for PCB boards increases, the conventional welding quality detection method has failed to meet the demand for rapid production. Therefore, it is particularly urgent and important to improve the quality detection efficiency and accuracy of the PCB welding.
The existing visual detection method based on image processing has great potential in finding problems in a continuous production line, and potential defect areas can be automatically identified and marked and different types of defects can be classified. However, current image detection algorithms have some limitations in detecting solder defects. Conventional methods typically use a threshold segmentation algorithm to separate solder areas from other areas, but this method ignores the gray values of component pins, colors, and text on the PCB, resulting in the possibility of including areas that are not solder-related into the segmentation range as well. This may lead to large errors in the morphological processing stage, for example, when processing text or pin areas, the area of the solder dot may be affected, so that it becomes a dot lacking enough solder, and thus misjudgment is made as a defect, and the accuracy of solder defect detection is reduced.
Disclosure of Invention
In order to solve the technical problems, the invention provides a visual automatic detection method for PCB soldering tin defects, which aims to solve the existing problems.
The invention relates to a visual automatic detection method for PCB soldering tin defects, which adopts the following technical scheme:
an embodiment of the invention provides a visual automatic detection method for PCB solder defects, which comprises the following steps:
Acquiring a gray level image of a PCB;
Presetting a window size by taking each pixel point in the gray level image of the PCB as a center to obtain a sliding window of each pixel point; obtaining the sequence trend entropy of each pixel point based on the change characteristics of the gray value in the sliding window of each pixel point; according to the sequence trend entropy of each pixel point and the gray level distribution characteristics of the sliding window, the gray level trend coefficient of the welding window of each pixel point is obtained; obtaining a welding edge characteristic index of each pixel point according to the gray scale characteristic of the sliding window of each pixel point and the gradient distribution characteristic; obtaining the circular index of each pixel according to the gradient distribution characteristics of the middle row and column pixel of each pixel sliding window; obtaining the neighborhood circular index of each pixel point according to each pixel point and the circular index distribution of the neighborhood of each pixel point; obtaining welding point indexes of each pixel point according to the welding window gray scale trend coefficient, the welding edge characteristic index and the neighborhood circular index of each pixel point;
acquiring soldering tin areas by adopting a threshold segmentation algorithm according to the soldering point indexes of all the pixel points; and acquiring the solder defect type of the PCB by adopting a neural network according to the solder area.
Preferably, the obtaining the sequence trend entropy of each pixel based on the change characteristic of the gray value in the sliding window of each pixel includes:
Taking a sequence formed by gray values of all pixel points in each pixel point sliding window as a gray sequence of each pixel point;
for the gray sequence of each pixel point, calculating the absolute value of the difference value between any element and the following element; storing a sequence formed by the absolute values of the differences of all the elements as a gray level differential sequence of each pixel point;
for a gray level differential sequence of each pixel point, taking the frequency of each element in the gray level differential sequence as the relative frequency of each element; taking the relative frequency of each element as the true number of a logarithmic function based on 2; calculating the product of the calculation result of the logarithmic function of each element and the true number; and taking the opposite number of the sum value of the products of all the elements as the sequence trend entropy of each pixel point.
Preferably, the welding window gray scale trend coefficient of each pixel point is obtained by combining the sequence trend entropy of each pixel point with the gray scale distribution characteristic of the sliding window, specifically:
Obtaining the maximum gray value of each pixel point sliding window; calculating the difference value between the maximum gray value and the gray value of each pixel point; and taking the sum value of the sequence trend entropy of each pixel point and the difference value as a welding window gray scale trend coefficient of each pixel point.
Preferably, the welding edge characteristic index of each pixel is obtained according to the gray scale characteristic and gradient distribution characteristic of the sliding window of each pixel, specifically:
obtaining an average result of gray values of all pixel points in the gray image of the PCB;
For each pixel point, acquiring the gray value average value, the gray value standard deviation and the gradient value average value of all pixel points in a sliding window of the pixel point; calculating the difference value between the gray value mean value and the averaging result; taking the difference value as an index of an exponential function based on a natural constant; and taking the product of the calculation result of the exponential function, the standard deviation of the gray value and the average value of the gradient value as the welding edge characteristic index of each pixel point.
Preferably, the circle index of each pixel is obtained according to the gradient distribution characteristics of the pixels in the middle row and the middle column of the sliding window of each pixel, specifically:
The gradient average value of the middle column of pixel points of each pixel point sliding window is recorded as the vertical gradient average value of each pixel point; the gradient average value of the middle row of pixel points of each pixel point sliding window is recorded as the horizontal gradient average value of each pixel point;
When the vertical gradient mean value of each pixel point is larger than or equal to the horizontal gradient mean value, taking the ratio of the horizontal gradient mean value to the vertical gradient mean value of each pixel point as the circular index of each pixel point;
When the vertical gradient mean value of each pixel point is smaller than the horizontal gradient mean value, the ratio of the vertical gradient mean value to the horizontal gradient mean value of each pixel point is used as the circular index of each pixel point.
Preferably, the neighborhood circular index of each pixel point is specifically a standard deviation of the circular index of each pixel point and each pixel point in the four adjacent domains.
Preferably, the obtaining the welding point index of each pixel point according to the welding window gray scale trend coefficient, the welding edge characteristic index and the neighborhood circular index of each pixel point includes:
Calculating the gray scale trend coefficient of a welding window of each pixel point, the neighborhood circular index and presetting the sum of parameter adjusting coefficients larger than zero; and taking the ratio of the welding edge characteristic index of each pixel point to the sum value as the welding point index of each pixel point.
Preferably, the acquiring the solder area according to the welding point index of all the pixel points by using a threshold segmentation algorithm includes:
And acquiring an optimal threshold value for the welding point indexes of all the pixel points by adopting a threshold value segmentation algorithm, taking the pixel points with the welding point indexes larger than the optimal threshold value as soldering tin pixel points, and taking the area where the soldering tin pixel points are in the gray level image of the PCB as soldering tin areas.
Preferably, the method comprises the steps of obtaining solder defect types of the PCB by using a neural network according to a solder area, and specifically comprises the following steps:
and taking the segmented soldering tin area as the input of the convolutional neural network CNN, and outputting the soldering tin defect type of the PCB.
Preferably, the PCB solder defect categories include, but are not limited to: proper soldering tin, multi-tin series connection, lack soldering, less tin and solder accumulation.
The invention has at least the following beneficial effects:
According to the invention, whether the sliding window of the pixel point is positioned in the welding point area is judged by analyzing the reflection characteristics of the welding point, the gray scale value change trend analysis of the pixel point is used for constructing the gray scale trend coefficient of the welding window, judging the position of the pixel point, further constructing the standard deviation of the welding edge characteristic index and the circular index according to the gradient characteristics of the welding point defect, more accurately positioning the position of the pixel point, effectively distinguishing the welding point from the pin and the character area, finally obtaining the welding point index constructed by each pixel point, accurately dividing the image according to the welding point index, avoiding the problem that the follow-up defect classification is influenced by the low division precision of the conventional PCB solder defect detection algorithm in the image division stage, improving the classification precision of defect detection, and further guaranteeing the accuracy of the welding defect detection.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a visual automatic detection method for PCB solder defects;
fig. 2 is a flowchart of the acquisition of the welding point index.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following description refers to the specific implementation, structure, characteristics and effects of the visual automatic detection method for PCB solder defects according to the invention by combining the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the visual automatic detection method for PCB solder defects provided by the invention with reference to the accompanying drawings.
The embodiment of the invention provides a visual automatic detection method for PCB soldering tin defects.
Specifically, the following visual automatic detection method for solder defects of a PCB is provided, referring to fig. 1, the method includes the following steps:
step S001: shooting the PCB by a CCD camera, and preprocessing the acquired image.
And shooting an image of the PCB by using a CCD camera, preprocessing the acquired image, and eliminating the influence caused by noise and partial external interference so as to enhance the accuracy of subsequent analysis. In order to remove noise while preserving boundary information, the embodiment selects median filtering to process the image, and the practitioner can also adopt other denoising methods. And then converting the denoised RGB image into a gray scale image.
So far, the gray level image of the PCB is obtained.
Step S002: and constructing a gray scale trend coefficient of a welding window according to the reflection characteristics of the welding point, constructing a welding edge characteristic index according to the characteristics of the lack of welding defects, constructing a circular index according to the gradient characteristics of the welding defects, and finally constructing a welding point index.
Common types of defects for PCB solder joints include multi-tin series, low tin and lack of solder. For these common defects, different types of welds can be evaluated by analyzing their characteristics. The main characteristic of multi-tin series connection is that the quantity of soldering tin is excessive, so that the soldering tin is connected with soldering tin points on other pins; the main characteristic of the less tin is that the insufficient soldering tin quantity leads to poor contact between the components and the PCB; the main characteristic of the lack of soldering is that no soldering tin exists, i.e. the pins or leads of the component are not welded with soldering tin.
The reflection degree of the welding point of the PCB is inconsistent, the closer to the top end of the welding point, the greater the reflection degree, and the gray value of the pixel point can be gradually reduced along with the longer distance from the top end of the welding point. In this embodiment, a sliding window is established with the ith pixel point in the gray scale image of the PCB as the center, and the size of the sliding window in this embodiment isThe implementation can be set by the implementation personnel according to the actual situation, and the embodiment is not limited to this.
If the ith pixel point is in the welding point area, the gray value distribution of the pixel point in the sliding window of the ith pixel point can change in a certain trend. Traversing gray values of all pixel points in a sliding window of the ith pixel point row by row, constructing a sequence, and marking the sequence as a gray sequence of the ith pixel pointWhereinAnd the gray value of the nth pixel point in the sliding window of the ith pixel point is represented. Calculating the gray value difference absolute value of each pixel point in the gray sequence of the ith pixel point and the adjacent next pixel point to form a gray differential sequence of the ith pixel pointWhereinA1 st gray scale difference value of the sliding window representing the i-th pixel,Respectively representing the gray values of the 1 st pixel and the 2 nd pixel in the sliding window of the ith pixel. Taking the kth element in the gray differential sequence of the ith pixel point as an example, counting the occurrence frequency of the kth element in the sequence as the relative frequency of the kth element.
The gray scale trend coefficient of the welding window of the ith pixel point is calculated and used for measuring and judging the gray scale value distribution of the sliding window of the ith pixel point to be the degree of trend distribution, and the expression is as follows:
In the method, in the process of the invention, Is the welding window gray scale trend coefficient of the ith pixel point,The entropy of the sequence trend of the ith pixel point,Is the maximum gray value within the sliding window of the ith pixel,Is the gray value of the i-th pixel point,Represents the relative frequency of the kth element in the gray differential sequence of the ith pixel point,A logarithmic function with a base of 2 is shown.
The sequence trend entropy of the ith pixel point is used for measuring the gray value change degree of the pixel point in the gray differential sequence, and if the gray value change shows an increasing or decreasing trend, the information entropy is smaller; in contrast, if the gray distribution in the window is irregular, and various gray changes occur in disorder, the information entropy will be large. Therefore, when the value of the sequence trend entropy is smaller, the more likely that the gray level change of the pixel point in the sliding window of the ith pixel point is regular or periodic, the greater the possibility that the ith pixel point belongs to the welding point area.
If the ith pixel point is the point at the top of the welding point, the gray value of other pixel points in the sliding window is reduced along with the increase of the distance between the ith pixel point and the sliding window, the sliding window also has certain trend distribution, andIs 0. So far, if the ith pixel point is the topmost point of the welding point, thenThe value of (2) is smaller; if the ith pixel point is located in the welding point area, thenIs smaller and since the gray values in the region of the weld point differ littleThe value of (c) is also smaller,The value of (2) is smaller; if the ith pixel point is not located in the welding point area, thenIf the value of (2) is largerThe value of (2) is larger. To this end, whenThe smaller the value of i-th pixel is, the greater the likelihood that the i-th pixel will be located in the weld area.
Although there are various types of solder defects of the PCB, only the lack of solder defects is not performed in the soldering operation, so that further recognition of the lack of solder defects is required to improve the accuracy of image segmentation. If the pins of the component are only inserted into the PCB and no welding operation is performed, gaps exist between the bonding pads and the pins of the component, a sobel operator is used for calculating the average value of gradient values of all pixel points in a sliding window of the ith pixel point, and the average value is recorded asBecause the gradient at the gap is more obvious, thereforeThe value of (c) will be larger and the gray value will be lower. The welding edge characteristic index of the ith pixel point is calculated, and the welding edge characteristic index is used for more accurately positioning the position of the ith pixel point, and the expression is as follows:
In the method, in the process of the invention, Is the welding edge characteristic index of the ith pixel point,The gray value average value of all pixels in the ith pixel sliding window,Is the average value of gray values of all pixel points in the gray image of the PCB,The gradient value average value of all pixels in the ith pixel sliding window,And (3) sliding the standard deviation of gray values of all pixels of the window for the ith pixel, wherein e is a natural constant.
Because the background color of the PCB is dark green, the gray value is lower, and the color of each component is usually gray black, thereforeIs lower in value; if the ith pixel point is located in the welding point area, thenIf the ith pixel is located in the pad area, since the pad is also typically silver gray in colorThe value of (2) is also larger; if the ith pixel point is located in the background area, thenIs small and possibly negative; when the sliding window of the ith pixel point is positioned at the connection position of the edge or pin of the component and the bonding pad, thenThe value of (2) is larger; if the sliding window of the ith pixel point is positioned at the edge of the bonding pad or the edge of the component, the gray value variation difference of the pixel points in the window is larger,The value of (2) is also larger. So far, the welding edge characteristic index of the ith pixel point can be calculated to more accurately position whether the position of the ith pixel point is in the background area or the bonding pad area, whenThe greater the value of (i) the greater the likelihood that the i-th pixel will be located at the pin-to-pad connection.
In the process of shooting a CCD camera on a PCB and acquiring an image, the material of a component pin generally has higher reflectivity, so that the characteristic index of a pixel spot welding edge at the edge of the pin is relatively higher. In order to more accurately separate pins, characters and bonding pads, the characteristics of a welding area are analyzed, and the pins of the component are found to be obvious linear characteristics, are straight in form and distributed along one direction, have obvious horizontal or vertical characteristics, and the character area also has very strong horizontal or vertical characteristics; the bonding pad presents a circular or approximately circular structural feature, and the texture distribution has certain circular regularity.
The Sobel operator is used for calculating the average value of the gradient value of the pixel point in the middle column of the sliding window of the ith pixel point, and the average value of the gradient value of the pixel point in the middle column of the sliding window of the ith pixel point is recorded as the average value of the vertical gradient of the ith pixel point; and (3) marking the gradient average value of the pixel points in the middle row of the ith pixel point sliding window as the horizontal gradient average value of the ith pixel point. From this, according to the average value of the horizontal gradient and the average value of the vertical gradient in the sliding window of the ith pixel point, the circular index of the ith pixel point is calculated, and the expression is:
In the method, in the process of the invention, Is the circular index of the ith pixel point,The horizontal gradient mean value and the vertical gradient mean value of the ith pixel point are respectively obtained.
If the sliding window is positioned in the pad area, the average value of the horizontal gradient and the average value of the vertical gradient in the sliding window of the ith pixel point are relatively similar, and thenThe closer the value of (2) is to 1, ifThe larger the value of (c) the more the gradient of the pixel point in the sliding window has a larger difference in horizontal or vertical direction, the more likely it is to have a pronounced horizontal or vertical feature.
And acquiring the circular index of each pixel point in the four neighbors of the ith pixel point. Taking standard deviation of circular indexes of pixels in the four neighborhoods of the ith pixel point as the neighborhood circular index of the ith pixel point
If the sliding windows of the neighbor pixel points of the ith pixel point are all positioned in the pad area, according to the distribution characteristics of the circular textures in the pad area, the circular index values of all the pixel points are very close to 1, and thenThe value of (2) is smaller; if the sliding window of the pixel point in the neighborhood of the ith pixel point is positioned in the pin area or the character area of the component, the circular index distribution of the pixel points is greatly different according to the horizontal or vertical characteristics of the component and the characters, so thatThe value of (2) will be larger. So far, when the neighborhood circle index of the i-th pixel point is smaller, the probability that the i-th pixel point is located in the pad region is greater.
According to the gray scale trend coefficient, the welding edge characteristic index and the neighborhood circular index of the welding window of the ith pixel point, the welding point index of the ith pixel point is calculated, and the expression is as follows:
In the method, in the process of the invention, Is the weld index for the i-th pixel,Is the welding edge characteristic index of the ith pixel point,Is the welding window gray scale trend coefficient of the ith pixel point,Is the neighborhood circular index of the ith pixel point,To preset the parameter adjustment coefficient greater than zero and avoid the denominator being 0, the experimental value of 0.001 is taken in this embodiment. The flowchart for acquiring the welding point index is shown in fig. 2.
If it isThe larger the value of the (i) th pixel point neighborhood gray scale distribution and the gradient edge characteristic are in accordance with the region characteristic of the welding point, the greater the possibility of being positioned at the welding point and the welding point is, and the smaller the possibility of being positioned at the background region, the pin region and the character region of the PCB is.
Step S003: based on the welding point indexes of all the pixel points, using a threshold segmentation algorithm to obtain an optimal threshold value, segmenting the image, and finally using a neural network to automatically classify the soldering tin defects.
Traversing all pixel points in the image, obtaining welding point indexes of all pixel points, taking the welding point indexes of all pixel points as input, and obtaining an optimal threshold P by using an OTSU Ojin method. And marking the pixel points with the welding point index being larger than P in the image as soldering tin pixel points, and marking the pixel points with the welding point index being smaller than P as background pixel points. And dividing the image according to the soldering tin pixel points and the background pixel points, so as to realize accurate division of soldering tin areas. And then sending the divided soldering tin areas into a convolutional neural network CNN, wherein the label data of the network, namely the PCB welding condition, is obtained through manual labeling, and one labeling embodiment is as follows: label 1 indicates proper soldering, label 2 indicates multi-tin series connection, label 3 indicates lack of soldering, label 4 indicates less tin, label 5 indicates solder accumulation, and arabic numerals 1, 2, 3, 4, 5 are used instead when input to the network; the practitioner may define the defect label itself according to the specific class of defect. And (3) inputting the label data into a convolutional neural network CNN after using one-hot coding, wherein the output of the neural network is the type of PCB solder defects, and the visual automatic detection of the PCB solder defects is realized. The convolutional neural network CNN is a known technology, and will not be described in detail in this embodiment.
In summary, the embodiment of the invention mainly analyzes the reflection characteristics of the welding point to determine whether the sliding window of the pixel is located in the welding point area, analyzes the gray value change trend of the pixel to construct the gray trend coefficient of the welding window, determines the position of the pixel, further constructs the standard deviation of the welding edge characteristic index and the circular index according to the gradient characteristics of the welding point defect, more precisely locates the position of the pixel, effectively distinguishes the welding point from the pin and the text area, finally obtains the welding point index constructed by each pixel, precisely segments the image according to the welding point index, avoids the problem that the follow-up defect classification is affected due to the low segmentation precision of the conventional PCB tin soldering defect detection algorithm in the image segmentation stage, improves the classification precision of defect detection, and further ensures the accuracy of welding defect detection.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and the same or similar parts of each embodiment are referred to each other, and each embodiment mainly describes differences from other embodiments.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; the technical solutions described in the foregoing embodiments are modified or some of the technical features are replaced equivalently, so that the essence of the corresponding technical solutions does not deviate from the scope of the technical solutions of the embodiments of the present application, and all the technical solutions are included in the protection scope of the present application.

Claims (6)

1. A visual automatic detection method for PCB soldering defects is characterized by comprising the following steps:
Acquiring a gray level image of a PCB;
Presetting a window size by taking each pixel point in the gray level image of the PCB as a center to obtain a sliding window of each pixel point; obtaining the sequence trend entropy of each pixel point based on the change characteristics of the gray value in the sliding window of each pixel point; according to the sequence trend entropy of each pixel point and the gray level distribution characteristics of the sliding window, the gray level trend coefficient of the welding window of each pixel point is obtained; obtaining a welding edge characteristic index of each pixel point according to the gray scale characteristic of the sliding window of each pixel point and the gradient distribution characteristic; obtaining the circular index of each pixel according to the gradient distribution characteristics of the middle row and column pixel of each pixel sliding window; obtaining the neighborhood circular index of each pixel point according to each pixel point and the circular index distribution of the neighborhood of each pixel point; obtaining welding point indexes of each pixel point according to the welding window gray scale trend coefficient, the welding edge characteristic index and the neighborhood circular index of each pixel point;
acquiring soldering tin areas by adopting a threshold segmentation algorithm according to the soldering point indexes of all the pixel points; acquiring solder defect types of the PCB by adopting a neural network according to the solder area;
The sequence trend entropy of each pixel point is obtained based on the change characteristics of gray values in the sliding window of each pixel point, and the sequence trend entropy comprises the following steps:
Taking a sequence formed by gray values of all pixel points in each pixel point sliding window as a gray sequence of each pixel point;
for the gray sequence of each pixel point, calculating the absolute value of the difference value between any element and the following element; storing a sequence formed by the absolute values of the differences of all the elements as a gray level differential sequence of each pixel point;
For a gray level differential sequence of each pixel point, taking the frequency of each element in the gray level differential sequence as the relative frequency of each element; taking the relative frequency of each element as the true number of a logarithmic function based on 2; calculating the product of the calculation result of the logarithmic function of each element and the true number; taking the opposite number of the sum of the products of all the elements as the sequence trend entropy of each pixel point;
The welding window gray scale trend coefficient of each pixel point is obtained according to the sequence trend entropy of each pixel point and the gray scale distribution characteristics of the sliding window, and specifically comprises the following steps:
Obtaining the maximum gray value of each pixel point sliding window; calculating the difference value between the maximum gray value and the gray value of each pixel point; taking the sum of the sequence trend entropy of each pixel point and the difference value as a welding window gray scale trend coefficient of each pixel point;
the circular index of each pixel is obtained according to the gradient distribution characteristics of the middle row and column pixel of each pixel sliding window, specifically:
The gradient average value of the middle column of pixel points of each pixel point sliding window is recorded as the vertical gradient average value of each pixel point; the gradient average value of the middle row of pixel points of each pixel point sliding window is recorded as the horizontal gradient average value of each pixel point;
When the vertical gradient mean value of each pixel point is larger than or equal to the horizontal gradient mean value, taking the ratio of the horizontal gradient mean value to the vertical gradient mean value of each pixel point as the circular index of each pixel point;
When the vertical gradient mean value of each pixel point is smaller than the horizontal gradient mean value, taking the ratio of the vertical gradient mean value to the horizontal gradient mean value of each pixel point as the circular index of each pixel point;
the method for obtaining the welding point index of each pixel point according to the welding window gray scale trend coefficient, the welding edge characteristic index and the neighborhood circular index of each pixel point comprises the following steps:
Calculating the gray scale trend coefficient of a welding window of each pixel point, the neighborhood circular index and presetting the sum of parameter adjusting coefficients larger than zero; and taking the ratio of the welding edge characteristic index of each pixel point to the sum value as the welding point index of each pixel point.
2. The visual automation detection method of the PCB solder defect of claim 1, wherein the welding edge characteristic index of each pixel is obtained according to the gray scale characteristic and gradient distribution characteristic of the sliding window of each pixel, specifically:
obtaining an average result of gray values of all pixel points in the gray image of the PCB;
For each pixel point, acquiring the gray value average value, the gray value standard deviation and the gradient value average value of all pixel points in a sliding window of the pixel point; calculating the difference value between the gray value mean value and the averaging result; taking the difference value as an index of an exponential function based on a natural constant; and taking the product of the calculation result of the exponential function, the standard deviation of the gray value and the average value of the gradient value as the welding edge characteristic index of each pixel point.
3. The visual automation detection method of the PCB solder defects of claim 1, wherein the neighborhood circular index of each pixel is specifically a standard deviation of the circular index of each pixel and the four neighboring pixel points of each pixel.
4. The method for visually and automatically detecting the solder defects of the PCB according to claim 1, wherein the step of obtaining the solder areas by a threshold segmentation algorithm according to the solder point indexes of all the pixel points comprises the following steps:
And acquiring an optimal threshold value for the welding point indexes of all the pixel points by adopting a threshold value segmentation algorithm, taking the pixel points with the welding point indexes larger than the optimal threshold value as soldering tin pixel points, and taking the area where the soldering tin pixel points are in the gray level image of the PCB as soldering tin areas.
5. The visual automation detection method of the solder defect of the PCB according to claim 1, wherein the step of obtaining the solder defect type of the PCB by using a neural network according to the solder region comprises the following steps:
and taking the segmented soldering tin area as the input of the convolutional neural network CNN, and outputting the soldering tin defect type of the PCB.
6. The automated visual inspection method of solder defects of a PCB of claim 5, wherein the solder defect categories of the PCB comprise: proper soldering tin, multi-tin series connection, lack soldering, less tin and solder accumulation.
CN202410444088.XA 2024-04-15 Visual automatic detection method for PCB soldering tin defect Active CN118052815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410444088.XA CN118052815B (en) 2024-04-15 Visual automatic detection method for PCB soldering tin defect

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410444088.XA CN118052815B (en) 2024-04-15 Visual automatic detection method for PCB soldering tin defect

Publications (2)

Publication Number Publication Date
CN118052815A CN118052815A (en) 2024-05-17
CN118052815B true CN118052815B (en) 2024-06-28

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992898A (en) * 2017-12-14 2018-05-04 哈尔滨工业大学(威海) A kind of electronic component welding point defect detection method
CN115311301A (en) * 2022-10-12 2022-11-08 江苏银生新能源科技有限公司 PCB welding spot defect detection method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992898A (en) * 2017-12-14 2018-05-04 哈尔滨工业大学(威海) A kind of electronic component welding point defect detection method
CN115311301A (en) * 2022-10-12 2022-11-08 江苏银生新能源科技有限公司 PCB welding spot defect detection method

Similar Documents

Publication Publication Date Title
CN115049653B (en) Integrated circuit board quality detection system based on computer vision
CN115311301A (en) PCB welding spot defect detection method
CN109242853B (en) PCB defect intelligent detection method based on image processing
CN113658131B (en) Machine vision-based tour ring spinning broken yarn detection method
US9996766B2 (en) Imaging-based methods for detecting and measuring defects in extruded cellular ceramic articles
CN115511888B (en) Inductance defect detection method and system based on vision
CN115345883B (en) PCB (printed circuit board) eccentric hole abnormality detection method based on linear gray level enhancement
CN117095004B (en) Excavator walking frame main body welding deformation detection method based on computer vision
CN115239727B (en) PCB surface defect detection method
CN114972575A (en) Linear fitting algorithm based on contour edge
CN116630322B (en) Quality detection method of PCBA (printed circuit board assembly) based on machine vision
CN116664570B (en) Flat connector production defect detection method based on industrial vision
CN114755243A (en) FPC connector surface crack detection method based on machine vision
CN114549530A (en) PCB welding quality evaluation method based on image processing
CN114612471B (en) Method for detecting surface defects of complex-texture ceramic tiles
CN115330758A (en) Welding quality detection method based on denoising processing
CN115294114A (en) Quality detection method based on ECU circuit welding
CN112669295A (en) Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN116168218A (en) Circuit board fault diagnosis method based on image recognition technology
CN115330796A (en) Copper wire tinning defect identification method
CN115866502A (en) Microphone part surface defect online detection process
CN118052815B (en) Visual automatic detection method for PCB soldering tin defect
CN117934467A (en) Titanium metal welding quality detection method and system based on image processing
CN118052815A (en) Visual automatic detection method for PCB soldering tin defect
CN117315289A (en) Aeroengine blade contour edge detection method based on image processing

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant