Component defect detection method and system based on computer vision
By obtaining the grayscale histogram of the chip image, adjusting the tolerance of the LSD algorithm to identify the turning area of the wiring, screening the defective line segments, and constructing the defect coefficient annotation, the problem of inaccurate wiring detection is solved and the accuracy of chip component detection is improved.
Patent Information
- Application Number
- CN202510991426.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-18
AI Technical Summary
The wiring inspection method in the prior art does not fully consider the wiring distribution requirements, and the chip component defect detection is inaccurate.
By obtaining the grayscale histogram of the chip image, extracting the wiring area, using the LSD algorithm to identify line segments, adjusting the tolerance to identify the turning area, screening defective line segments, and combining the turning area spacing and arc center deviation to construct the defect coefficient for marking.
The accuracy of wiring defect detection is improved, ensuring the quality inspection accuracy of chip components.
Smart Images

Figure CN120510141B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image analysis, and in particular to a component defect detection method and system based on computer vision. Background Art
[0002] The quality of the wiring in a chip directly impacts signal transmission efficiency and system reliability. Low-quality wiring can cause signal delays, increased power consumption, and electromagnetic interference, leading to chip performance degradation or malfunction. Process defects in the wiring can exacerbate electromigration effects and shorten chip lifespan. To reduce the probability of chip failure during use and extend chip lifespan, accurate inspection of wiring defects in the chip is essential.
[0003] The traditional method uses the LSD algorithm to process the line segment tortuosity threshold of the rear wiring to judge the wiring regularity of the bending area, but it does not take into account the distribution requirements between different wiring lines, and the defect detection of chip components is inaccurate. Summary of the Invention
[0004] In order to solve the technical problem that the existing LSD algorithm does not fully consider the wiring distribution when performing defect detection, resulting in inaccurate chip component defect detection, the purpose of the present invention is to provide a component defect detection method and system based on computer vision. The technical solutions adopted are as follows:
[0005] A component defect detection method based on computer vision, the method comprising:
[0006] Acquire chip images of optoelectronic chips;
[0007] Extracting a wiring area based on the grayscale distribution in the grayscale histogram of the chip image; identifying line segments in the wiring area using a preset tolerance through an LSD algorithm; obtaining a turning area of the wiring based on the spatial distribution of the line segments in the wiring area; grouping the turning areas that are spatially close to each other and obtaining a common arc center; adjusting the preset tolerance to obtain a corrected tolerance based on the distribution of each turning area relative to the common arc center and the number of line segments contained therein, and re-identifying the line segments to obtain a corrected turning area;
[0008] Based on the abnormal characteristics of the length and angle of each line segment in a single corrected turning area, the defective line segments in each corrected turning area are screened out; based on the number and length of the defective line segments in each corrected turning area, combined with the uniformity of the spacing between adjacent corrected turning areas in the same group, and the deviation distribution of the arc center points, the corresponding line arrangement defect coefficient is obtained; and defects are marked based on the line arrangement defect coefficient.
[0009] Furthermore, the method for obtaining the wiring area includes:
[0010] Obtaining a grayscale threshold of the grayscale histogram based on a maximum inter-class variance algorithm, within a range of grayscale levels greater than the grayscale threshold, screening out a centerline grayscale level based on a grayscale interval between each grayscale level and a grayscale level with a smaller grayscale level and a lower frequency, combined with its own grayscale value; obtaining a grayscale difference range based on a grayscale interval between each grayscale level and a smaller grayscale level with a similar and closest frequency, combined with its own grayscale value and frequency;
[0011] The center line grayscale and the grayscale difference range are combined to obtain a wiring area.
[0012] Furthermore, the method for obtaining the turning area includes:
[0013] A preset sliding curve is slid in the line arrangement area, and whether the sliding curve is in the turning area is determined according to the number of line segment endpoints in the sliding curve. The complete line segments in the sliding curve in the turning area are merged to construct an area as the turning area.
[0014] Furthermore, the method for obtaining the correction tolerance includes:
[0015] According to the shortest distance between each turning area and the common arc center and the number of line segments included, the preset tolerance is adjusted to obtain a modified tolerance.
[0016] Furthermore, the method for obtaining the defective line segment includes:
[0017] In any of the modified turning areas, the deviation value between the length of each line segment and the average length of all line segments is obtained; the angle between each line segment and an adjacent line segment is obtained, and the difference angle between each angle and the average of all angles is obtained;
[0018] The solder overflow possibility of each line segment is obtained according to the deviation value and the corresponding difference angle of each line segment; and the defective line segments corresponding to the corrected turning area are screened out based on the solder overflow possibility.
[0019] Furthermore, the method for obtaining the wiring defect coefficient includes:
[0020] Based on the DTW algorithm, the alignment distance of the optimal alignment path of any two adjacent corrected turning areas in the same group is obtained; the average of the shortest distances between the line segments of any two adjacent corrected turning areas in the same group is obtained, and the overall shortest distance average of all the shortest distance averages in the same group is obtained;
[0021] For any of the corrected turning areas: obtain the arc center distance sum between its own arc center and other arc centers in the same group; according to the number and total length of the defective line segments, combined with the difference between the shortest distance mean and the overall shortest distance mean, as well as the arc center distance sum and the alignment distance, obtain the corresponding line defect coefficient.
[0022] Furthermore, the method for marking defects based on the wiring defect coefficient includes:
[0023] When the line defect coefficient is greater than a preset line defect threshold, all defective line segments in the corresponding correction turning area will be marked.
[0024] Furthermore, the method for obtaining the common arc center includes:
[0025] The common arc center is obtained by taking the mean coordinates of all arc centers in the same group as the coordinates of the common arc center.
[0026] Furthermore, the method for obtaining the arc center includes:
[0027] For a single turning area, a perpendicular line is drawn through the center points of all line segments in the turning area. Among all the intersection points of multiple perpendicular lines, the intersection point with the most perpendicular lines intersects is taken as the arc center position of the turning area.
[0028] The present invention also proposes a component defect detection system based on computer vision, which includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements any one of the steps of the component defect detection method based on computer vision.
[0029] The present invention has the following beneficial effects:
[0030] The present invention first images the chip and extracts the wiring area to provide a basis for subsequent analysis; further, the LSD algorithm is used to identify the line segments in the wiring area using a preset tolerance, and then the turning area of the wiring is obtained according to the spatial distribution of the line segments in the wiring area, providing a basis for subsequent adjustment of the LSD algorithm; further, according to the distribution of each turning area relative to the common arc center and the number of line segments contained, the position characteristics of the turning area are reflected, thereby adjusting the preset tolerance and re-identifying the line segments to obtain the corrected turning area, thereby improving the LSD algorithm's recognition accuracy for the line segments in the turning area; further, according to the abnormal characteristics of the length and angle of each line segment in a single corrected turning area, the line segment's abnormality is evaluated from two abnormal angles of length and angle, and defective line segments are screened out to provide a basis for subsequent defect detection; finally, according to the number and length of defective line segments in each corrected turning area, combined with the uniformity of the intervals between adjacent corrected turning areas in the same group, and the deviation distribution of the arc center points, the uniform distribution of the corrected turning area and the degree of defects are integrated to mark the defects. This solution extracts the wiring area through grayscale distribution, optimizes the LSD algorithm for line segment recognition in the turning area, and constructs the wiring defect coefficient by combining the spacing uniformity and arc center deviation in the turning area. This achieves accurate labeling of abnormal wiring and solves the problem of insufficient accuracy in complex wiring defect recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. 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 any creative work.
[0032] Figure 1 A flowchart of a component defect detection method based on computer vision provided by one embodiment of the present invention;
[0033] Figure 2 A grayscale histogram of a chip image provided by one embodiment of the present invention;
[0034] Figure 3 An exemplary diagram of a transition area provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] To further illustrate the technical means and effectiveness of the present invention in achieving its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of a computer vision-based component defect detection method and system proposed in accordance with the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0036] 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.
[0037] The following describes in detail a specific solution of a component defect detection method and system based on computer vision provided by the present invention with reference to the accompanying drawings.
[0038] See also Figure 1 , which shows a flowchart of a component defect detection method based on computer vision provided by one embodiment of the present invention, specifically comprising:
[0039] Step S1: Acquire a chip image of an optoelectronic chip.
[0040] In one embodiment of the present invention, a digital optical microscope with a high numerical aperture (NA>0.8) objective lens and extended depth of field (EDOF) is used. A scientific-grade CMOS sensor (dynamic range>16 bit, resolution≥4K) with long exposure (low noise mode) and real-time image overlay is used to capture images of optoelectronic chips.
[0041] Choose a black non-woven fabric, matte black ceramic, or light-absorbing velvet (reflectivity <2%) for the background to avoid stray light interference. Use a combination of coaxial light (COAX) and side lighting to eliminate shadows and enhance edge contrast. Install cross-polarizers on the light source and camera to suppress glare from metal surfaces. Place the instrument on an active vibration isolation platform (such as an air-floating vibration isolation table) to isolate it from ambient vibration. Use a constant temperature system (±0.1°C) to minimize image drift caused by thermal expansion.
[0042] Step S2: Extract the wiring area based on the grayscale distribution in the grayscale histogram of the chip image; use the preset tolerance to identify the line segments in the wiring area through the LSD algorithm; obtain the turning area of the wiring based on the spatial distribution of the line segments in the wiring area; group the turning areas with similar spaces and obtain the common arc center, adjust the preset tolerance to obtain the corrected tolerance based on the distribution of each turning area relative to the common arc center and the number of line segments contained, and re-identify the line segments to obtain the corrected turning area.
[0043] Considering that different optoelectronic chips may have different grayscale values in the wiring area due to different materials or different ambient lighting during shooting, simply identifying the wiring area based on a specific grayscale threshold will inevitably lead to inaccurate recognition. Therefore, the wiring area is extracted based on the grayscale distribution in the grayscale histogram of the chip image.
[0044] See also Figure 2 , which shows a grayscale histogram of a chip image provided by an embodiment of the present invention, Figure 2 The horizontal axis is the grayscale, which is dimensionless; the vertical axis is the number of pixels, which is also the frequency of the pixels.
[0045] Preferably, in one embodiment of the present invention, since the grayscale of the wiring area in the optoelectronic chip is larger than that of the background area, the grayscale histogram often shows obvious bimodal characteristics. Therefore, the grayscale threshold of the grayscale histogram is obtained based on the maximum inter-class variance algorithm, and the range of grayscale levels greater than the grayscale threshold is used as the grayscale range to be analyzed to obtain the grayscale range of the wiring area. Subsequently, the grayscale level and frequency differences are analyzed within the grayscale range, and the grayscale distribution characteristics of the grayscale histogram are analyzed.
[0046] Considering that the position in the wiring area that can be used as a reference for the center line has a larger grayscale, and the grayscale difference with its adjacent position is smaller than that of other positions, within the grayscale range to be analyzed, the center line grayscale is screened out based on the grayscale interval between each grayscale and the grayscale with smaller grayscale and lower frequency, combined with its own grayscale value.
[0047] As an example, for gray level A, obtain the first gray level whose gray level is less than A and whose frequency is less than the frequency of A, and the gray level interval between the gray level and A;
[0048] The value of gray level A is taken as the numerator, the corresponding gray interval is taken as the denominator, the fractional ratio is taken as the center line possibility of gray level A, and the gray level corresponding to the maximum center line possibility is taken as the center line gray level.
[0049] Because the edge of the line area is affected by the grayscale of the background area, its grayscale is smaller and the corresponding grayscale frequency is larger, and the grayscale difference with the adjacent pixels in the line area is larger. Therefore, the grayscale difference range is obtained based on the grayscale interval between each grayscale and the nearest smaller grayscale with similar frequency, combined with its own grayscale value and frequency;
[0050] As an example, within the grayscale range to be analyzed, the maximum absolute value of the frequency difference between two grayscale levels is obtained, which is taken as the maximum difference. When the absolute value of the frequency difference between two grayscale levels is less than 40% of the maximum difference, the frequencies of the two grayscale levels are determined to be similar.
[0051] For gray level A, obtain the gray level with a gray level smaller than A, a frequency close to A, and the gray level closest to A, and the gray level interval between A and A;
[0052] The product of the grayscale frequency and the corresponding grayscale interval is used as the numerator, the grayscale value is used as the denominator, the fractional ratio is used as the degree of compliance with the grayscale difference range, and the grayscale interval corresponding to the maximum degree of compliance is used as the grayscale difference range;
[0053] Finally, the center line grayscale and grayscale difference range are combined to obtain the line area. Since the grayscale at the edge of the line area is smaller, the grayscale difference range is used to obtain the line grayscale range on the side with smaller center line grayscale. For example, if the center line grayscale is 200 and the grayscale difference range is 20, the line grayscale range is 180-200, thus extracting the line area.
[0054] The grayscale interval between two grayscale levels is the difference between the larger grayscale level and the smaller grayscale level.
[0055] When using the LSD algorithm to determine the layout quality of the straight lines in the wiring area, the quality of the straight lines can be determined by simply applying a threshold to the number of segmented lines. However, due to the inherent curvature of the turning areas of the wiring, the LSD algorithm will split them into multiple segments during line segment recognition. Therefore, the method used to determine the straight lines will affect the accuracy of curve recognition.
[0056] At the same time, when identifying straight line parts, the same tolerance τ is often used for different line arrangements. However, for turning line areas, since the degree of turning in different turning line areas may be different, when the same tolerance τ is used to obtain line segments, some turning areas may be identified as straight line areas. Therefore, different tolerance sizes should be used for different turning line areas.
[0057] Therefore, the LSD algorithm is first used to identify the line segments in the wiring area using a preset tolerance, and then the turning area of the wiring is obtained according to the spatial distribution of the line segments in the wiring area, so as to adjust the tolerance of the turning area.
[0058] Preferably, in one embodiment of the present invention, the preset tolerance is Curvature; Considering that the turning area of the line arrangement will be divided into multiple line segments, the turning area can be identified according to the number of local line segments, showing the spatial distribution characteristics of the line segments in the line arrangement area;
[0059] Based on this, a preset sliding curve is slid in the line arrangement area, and whether the sliding curve is in the turning area is determined according to the number of line segment endpoints in the sliding curve. The complete line segments in the sliding curve in the turning area are merged to construct an area as the turning area.
[0060] As an example, the length of the preset sliding curve is set to 1 cm, the sliding step is 1 cm, and sliding is performed on the line area. 80% of the maximum number of line segment endpoints in the sliding curve is used as the quantity threshold. When the number of line segment endpoints in the sliding curve exceeds the quantity threshold, it is determined to be in the turning area, and the complete line segments in the sliding curve in the turning area are merged to construct an area as the turning area.
[0061] See also Figure 3 , which shows an example diagram of a turning area provided by an embodiment of the present invention, Figure 3 The original turning area curve is shown in the figure. The dashed segments at the solid line are the segments obtained by the LSD algorithm. For the convenience of comparison, the dashed segments are translated and separated.
[0062] It should be noted that since the lines have a certain spatial volume, they are called areas. For the convenience of demonstration, they are demonstrated in the form of curves and line segments.
[0063] Considering that the wiring in optoelectronic chips is often arranged in parallel, multiple curved wiring will have the same arc center in the turning area. Therefore, spatially close turning areas are grouped together and the common arc center is obtained to facilitate the analysis of the distribution of the turning areas.
[0064] Taking into account that the distribution of the turning area relative to the common arc center reflects the positional characteristics of the turning area, the closer to the inner side of the arc center, the shorter the arc length, and the number of line segments contained can also reflect the positional distribution of the turning area from the side. Therefore, according to the distribution of each turning area relative to the common arc center and the number of line segments contained, the preset tolerance is adjusted to obtain the corrected tolerance, and the line segments are re-identified to obtain the corrected turning area, thereby improving the LSD algorithm's recognition accuracy of the turning area and providing more reliable data support for subsequent defect detection.
[0065] Preferably, in one embodiment of the present invention, for a single turning area, a perpendicular line is drawn through the center points of all line segments in the turning area, and among all the intersection points of multiple perpendicular lines, the intersection point with the most perpendicular lines intersects is taken as the arc center position of the turning area.
[0066] The turning areas with the closest distance less than 5 mm are divided into a group of turning areas, a two-dimensional rectangular coordinate system is established in the chip image, and the average coordinates of all arc centers in the same group are used as the coordinates of the common arc center to obtain the common arc center.
[0067] Considering that the smaller the shortest distance between the turning area and the common arc center, the fewer the number of line segments it contains, the closer the turning area is to the inner circle, and the shorter the arc length, in order to prevent the turning area from being over-simplified by the line segments, a smaller tolerance size should be used for this turning area. Therefore, according to the shortest distance between each turning area and the common arc center and the number of line segments it contains, the preset tolerance is adjusted to obtain the corrected tolerance.
[0068] As an example, the inverse of the product of the shortest distance between each turning area and the corresponding common arc center and the number of line segments contained is used as the independent variable and mapped through the tanh function. The difference between the constant 1 and the mapping value of the tanh function is used as the correction coefficient, and the product of the preset tolerance τ and the correction coefficient is used as the correction tolerance of each turning area.
[0069] In other embodiments of the present invention, the implementer may also perform normalization in the corresponding data dimension through linear normalization to replace the tanh function; the LSD algorithm and the tanh function are both existing technologies and will not be described in detail.
[0070] Re-identify the line segment with the corrected tolerance and obtain the corrected turning area. It should be noted that re-obtaining the corrected turning area does not affect the previous grouping results. The method of re-obtaining the corrected turning area is the same as the process of obtaining the turning area. Only the LSD algorithm is adjusted, which will not be repeated.
[0071] Step S3: Based on the abnormal characteristics of the length and angle of each line segment in a single corrected turning area, the defective line segments in each corrected turning area are screened out; based on the number and length of the defective line segments in each corrected turning area, combined with the uniformity of the intervals between adjacent corrected turning areas in the same group, and the deviation distribution of the arc center points, the corresponding line arrangement defect coefficient is obtained; and defects are marked based on the line arrangement defect coefficient.
[0072] Considering the complex geometry of the chip cable's turning area, which obstructs the solder flow path and increases the likelihood of solder overflow, this area will inevitably exhibit different characteristics from other normal areas during line segment recognition. For example, the line segment identified in the solder overflow area may be shorter than other line segments and have different angles with adjacent line segments. Therefore, based on the abnormal characteristics of the length and angle of each line segment within a single corrected turning area, the line segment anomaly is evaluated from these two perspectives, and defective line segments within each corrected turning area are screened out, providing a basis for subsequent defect detection.
[0073] Preferably, in one embodiment of the present invention, considering that the line segment identified in the solder overflow area may be shorter than the lengths of other line segments, in any corrected turning area, the average length of all line segments is used as a reference to obtain the deviation value of the length of each line segment from the average length of all line segments;
[0074] Obtain the angle between each line segment and the adjacent line segment. Considering that the greater the difference between the angle and the mean of all angles, the more likely the geometric curvature at the corresponding line segment is to experience abnormal fluctuations, the difference between each angle and the mean of all angles is obtained.
[0075] Finally, based on the deviation value and corresponding difference angle of each line segment, the two abnormal angles of length and angle are combined to obtain the possibility of solder overflow for each line segment; based on the possibility of solder overflow, the defective line segments in the corresponding corrected turning area are screened out.
[0076] As an example, the difference between the length of each line segment and the mean length of all line segments is used as the deviation value; the difference between the maximum deviation value and the deviation value of each line segment is used as the numerator, the maximum deviation value is used as the denominator, and the fractional ratio is used as the length anomaly factor to express the abnormal characteristics of the line segment length;
[0077] The sum of the absolute values of the differences between the angle corresponding to each line segment and the mean angle is taken as the difference angle to indicate the abnormal characteristics of the angle of the line segment.
[0078] The product of the length anomaly factor and the difference angle of each line segment is normalized by the sigmoid function and used as the solder overflow possibility. The solder overflow possibility threshold is set to 0.7. When the solder overflow possibility threshold is exceeded, the corresponding line segment is judged as a defective line segment.
[0079] The angle between two line segments is the minimum angle between the lines on which the two line segments lie. Angles are measured in radians, and when a line segment has only one adjacent line segment, there is only one corresponding angle.
[0080] Offset or densely packed cables may cause signal transmission path anomalies, increasing the risk of signal delay or data loss. To ensure optimal chip performance, cables should be evenly spaced.
[0081] Considering that the spacing between evenly arranged lines is uniform and the arc center points are close; and considering that the number and length of defective line segments also reflect the defects of the lines, the corresponding line defect coefficient is obtained according to the number and length of defective line segments in each corrected turning area, combined with the uniformity of the spacing between adjacent corrected turning areas in the same group, and the deviation distribution of the arc center points, to characterize the defect degree of the lines and provide a basis for the final defect marking.
[0082] Preferably, in one embodiment of the present invention, considering that the DTW algorithm can measure whether the change trends between the line segments of two turning areas are consistent, the alignment distance of the optimal alignment path of any two adjacent corrected turning areas in the same group is obtained based on the DTW algorithm; the larger the alignment distance, the more inconsistent the change trends, the more uneven the line arrangement, the less uniform the intervals between the corrected turning areas, and the more likely defects are present;
[0083] Obtain the average of the shortest distances between any two adjacent corrected turning areas in the same group, and the overall average reflects the interval between the two adjacent turning areas; then obtain the overall shortest distance average of all the shortest distance means in the same group, indicating the regular interval between adjacent turning areas in the same group;
[0084] Considering that when the corrected turning areas of the same group are evenly arranged, multiple arc centers are close to or even overlap. The farther the distance between a certain arc center and other arc centers, the more likely the turning area is offset. The more obvious the deviation is, the more likely the defect is. The greater the difference between the shortest distance mean and the overall shortest distance mean, the greater the deviation in the interval arrangement. The less even the intervals between the corrected turning areas are, the more likely the defect is. At the same time, the number and length of defective line segments also indicate a higher probability of defect.
[0085] Based on this, for any corrected turning area: obtain the arc center distance and value between its own arc center and other arc centers in the same group; according to the number and total length of the defective line segments, combined with the difference between the shortest distance mean and the overall shortest distance mean, as well as the arc center distance sum and alignment distance, obtain the corresponding line defect coefficient.
[0086] As an example, for any corrected turning area: the product of the number of defective line segments and the total length is used as the performance factor of solder overflow, and the ratio of the performance factor of the current corrected turning area to the maximum performance factor is used as the solder defect factor;
[0087] The sum of the absolute values of the differences between the two shortest distance means corresponding to the current correction turning area and the overall shortest distance mean is used as the spacing defect factor;
[0088] The product of the arc center distance and value, alignment distance, solder defect factor, and spacing defect factor is used as the independent variable. After normalization using the sigmoid function, the wiring defect coefficient corresponding to the corrected turning area is obtained.
[0089] It should be noted that when there is only one adjacent corrected turning area in a certain corrected turning area, there is only one shortest distance mean, and the spacing defect factor also corresponds to only one difference absolute value; for two adjacent corrected turning areas a and b, the average value of the shortest distance between each line segment in a to the line segment in b is taken as the shortest distance mean between the line segments; if the average value corresponding to a to b is different from the average value corresponding to b to a, the average value of the two is taken as the shortest distance mean.
[0090] In other embodiments of the present invention, the implementer may also perform linear normalization on the product of the arc center distance and value, the alignment distance, the solder defect factor, and the spacing defect factor in the corresponding data dimension.
[0091] Finally, defects are marked based on the wiring defect coefficient.
[0092] Preferably, in one embodiment of the present invention, when the line defect coefficient is greater than a preset line defect threshold, all defective line segments in the corresponding correction turning area are marked.
[0093] As an example, the preset wiring defect threshold is 0.6.
[0094] In one embodiment of the present invention, after marking the defects, the method further includes: visually displaying the degree of wiring quality problems in different wiring turning areas in the form of a table, for example, [0001, 001004, 0.85], corresponding to the chip image number, turning area group number, and wiring defect coefficient.
[0095] An embodiment of the present invention also provides a component defect detection system based on computer vision, which includes a memory, a processor and a computer program, wherein the memory is used to store the corresponding computer program, and the processor is used to run the corresponding computer program. When the computer program runs in the processor, it can implement a component defect detection method based on computer vision described in steps S1-S3.
[0096] In summary, in order to address the technical problem that the existing defect detection using the LSD algorithm does not fully consider the wiring distribution and the defect detection of chip components is inaccurate, the present invention proposes a component defect detection method and system based on computer vision. The present invention first obtains the chip image of the optoelectronic chip, extracts the wiring area, and identifies the line segments in the wiring area through the LSD algorithm; further, based on the spatial distribution of the line segments, the turning area of the wiring is obtained; further, based on the distribution of each turning area relative to the common arc center and the number of line segments contained, the preset tolerance is adjusted and the line segments are re-identified to obtain the corrected turning area; further, based on the abnormal characteristics of the length and angle of each line segment in a single corrected turning area, the defective line segments are screened out; finally, based on the number and length of the defective line segments in each corrected turning area, combined with the uniformity of the spacing between adjacent corrected turning areas in the same group, and the deviation distribution of the arc center points, the defects are marked. This solution extracts the wiring area through grayscale distribution, optimizes the LSD algorithm for line segment recognition in the turning area, and constructs a wiring defect coefficient based on the uniformity of the spacing between the turning area and the arc center deviation, so as to achieve accurate marking of abnormal wiring and solve the problem of insufficient accuracy in identifying complex wiring defects.
[0097] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0098] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A component defect detection method based on computer vision, characterized in that: The method comprises: Acquire chip images of optoelectronic chips; Extracting a wiring area based on the grayscale distribution in the grayscale histogram of the chip image; identifying line segments in the wiring area using a preset tolerance through an LSD algorithm; obtaining a turning area of the wiring based on the spatial distribution of the line segments in the wiring area; grouping the turning areas that are spatially close to each other and obtaining a common arc center; adjusting the preset tolerance to obtain a corrected tolerance based on the distribution of each turning area relative to the common arc center and the number of line segments contained therein, and re-identifying the line segments to obtain a corrected turning area; Based on the abnormal characteristics of the length and angle of each line segment in a single corrected turning area, defective line segments in each corrected turning area are screened out; based on the number and length of the defective line segments in each corrected turning area, combined with the uniformity of the spacing between adjacent corrected turning areas in the same group and the deviation distribution of the arc center points, the corresponding line arrangement defect coefficient is obtained; and defects are marked based on the line arrangement defect coefficient. The method for obtaining the turning area includes: A preset sliding curve is slid in the line arrangement area, and whether the sliding curve is in the turning area is determined according to the number of line segment endpoints in the sliding curve. The complete line segments in the sliding curve in the turning area are merged to construct an area as the turning area.
2. The component defect detection method based on computer vision according to claim 1, characterized in that: The method for obtaining the wiring area includes: Obtaining a grayscale threshold of the grayscale histogram based on a maximum inter-class variance algorithm, and taking a grayscale range greater than the grayscale threshold as a grayscale range to be analyzed; In the grayscale range to be analyzed: taking each grayscale as a target grayscale one by one, for the target grayscale, taking the nearest grayscale with a grayscale level smaller than the target grayscale and a frequency smaller than the target grayscale as a first matching grayscale, and obtaining a first grayscale interval between the target grayscale and the corresponding first matching grayscale; The target grayscale value is used as the numerator, the corresponding first grayscale interval is used as the denominator, the fractional ratio is used as the centerline probability of the target grayscale, and the grayscale corresponding to the maximum centerline probability is used as the centerline grayscale; Obtaining the maximum absolute value of the frequency difference between two gray levels, and taking this as the maximum difference; when the absolute value of the frequency difference between two gray levels is less than 40% of the maximum difference, determining that the frequencies of the two gray levels are similar; for the target gray level, obtaining a gray level that is smaller than the target gray level, has a frequency close to the target gray level, and is closest to the target gray level, as the second matching gray level; and obtaining a second gray interval between the target gray level and the corresponding second matching gray level; The product of the frequency of the target gray level and the corresponding second gray interval is used as the numerator, the value of the target gray level is used as the denominator, the fractional ratio is used as the degree of compliance with the gray difference range of the target gray level, and the second gray interval corresponding to the maximum degree of compliance is used as the gray difference range; The center line grayscale and the grayscale difference range are combined to obtain a wiring area.
3. The component defect detection method based on computer vision according to claim 1, characterized in that: The method for obtaining the correction tolerance includes: According to the shortest distance between each turning area and the common arc center and the number of line segments included, the preset tolerance is adjusted to obtain a modified tolerance.
4. The component defect detection method based on computer vision according to claim 1, characterized in that: The method for obtaining the defective line segment includes: In any of the modified turning areas, the deviation value between the length of each line segment and the average length of all line segments is obtained; the angle between each line segment and an adjacent line segment is obtained, and the difference angle between each angle and the average of all angles is obtained; The solder overflow possibility of each line segment is obtained according to the deviation value and the corresponding difference angle of each line segment; and the defective line segments corresponding to the corrected turning area are screened out based on the solder overflow possibility.
5. The component defect detection method based on computer vision according to claim 1, characterized in that: The method for obtaining the wiring defect coefficient includes: Based on the DTW algorithm, the alignment distance of the optimal alignment path of any two adjacent corrected turning areas in the same group is obtained; the average of the shortest distances between the line segments of any two adjacent corrected turning areas in the same group is obtained, and the overall shortest distance average of all the shortest distance averages in the same group is obtained; For any of the corrected turning areas: obtain the arc center distance sum between its own arc center and other arc centers in the same group; according to the number and total length of the defective line segments, combined with the difference between the shortest distance mean and the overall shortest distance mean, as well as the arc center distance sum and the alignment distance, obtain the corresponding line defect coefficient.
6. The component defect detection method based on computer vision according to claim 1, characterized in that: The method for marking defects based on the wiring defect coefficient includes: When the line defect coefficient is greater than a preset line defect threshold, all defective line segments in the corresponding correction turning area will be marked.
7. The component defect detection method based on computer vision according to claim 1, characterized in that: The method for obtaining the common arc center includes: The common arc center is obtained by taking the mean coordinates of all arc centers in the same group as the coordinates of the common arc center.
8. The component defect detection method based on computer vision according to claim 7, characterized in that: The method for obtaining the arc center includes: For a single turning area, a perpendicular line is drawn through the center points of all line segments in the turning area. Among all the intersection points of multiple perpendicular lines, the intersection point with the most perpendicular lines intersects is taken as the arc center position of the turning area.
9. A component defect detection system based on computer vision, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the component defect detection method based on computer vision as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Method and device for automatically detecting internal defects of lithium battery cell
CN113129260A
Optical device chip packaging gold wire defect detection method
CN114757903A