A method for detecting defects in gold wires of optical device chip packaging
Through machine vision technology, images of the gold wire area of the optical device chip package are collected, solder joint detection and gold wire area extraction are performed, combined with grayscale analysis, to solve the problems of low manual detection efficiency and low accuracy, and achieve fast and accurate detection. Gold wire defect detection.
Patent Information
- Application Number
- CN202210362277.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-04-07
AI Technical Summary
The existing technology relies on manual detection of gold wire defects in optical device chip packaging, which has low efficiency and low accuracy, and is difficult to adapt to the needs of modern industrial production.
An inspection method based on machine vision is used to collect the image of the gold wire area of the optical device chip package, and realize the gold wire defect detection through solder joint detection, gold wire area extraction and grayscale analysis. Specific steps include image preprocessing, solder joint detection, gold line area extraction and defect detection, using a 5-megapixel industrial camera and bi-telecentric lens combined with dark-field annular light illumination for high-resolution image collection and template matching.
It improves the detection speed and accuracy, avoids the inaccuracy and inconsistent standards of manual detection, and achieves accurate and robust detection of gold wire defects.
Smart Images

Figure CN114757903B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine vision defect detection, and more specifically, relates to a method for detecting gold wire defects in optical device chip packaging. Background Art
[0002] With the vigorous development of the Internet industry, information transmission has become increasingly important, and information transmission is an important foundation for many industries. Due to the advantages of optical communication such as fast speed, energy saving, and stability, a global communication framework has now been established based on the principle of optical fiber communication. Optical communication technology is one of the key technologies in the Internet era and occupies a core position in the modern communication system. To date, my country has developed into a major optical communication country, and the total length of optical fiber laid in my country accounts for 48% of the world. my country has strong research and development and production capabilities for optical communication devices, and the demand for optical device production has greatly increased.
[0003] Chip packaging is a critical step in the chip manufacturing process. Bonding refers to connecting the internal circuit of the chip to the pins with wires before packaging. Gold, as a metal with good conductivity, has many excellent properties. It has good corrosion resistance and is not easy to oxidize. It is currently the main bonding material in semiconductor packaging. The processing of optical devices is complicated, and errors may occur in each step, which will eventually lead to substandard product quality. The gold wire is an important component of the optical device and a channel for transmitting information. In the process of gold wire welding, it is easy to have defects such as breakage, missing wires and bending. These defects have a fatal impact on the quality of optical devices.
[0004] At present, the quality inspection of gold wires on optical devices mainly relies on manual inspection. Optical devices are very small and gold wires are distributed in large numbers. Manual inspection is difficult and the inspection efficiency is very low. It is also difficult to unify the inspection standards. Moreover, with the rapid increase in product output and higher requirements for quality and inspection accuracy, manual defect detection methods are gradually unable to adapt to the requirements of modern industrial production.
[0005] Therefore, it is necessary to develop a machine vision-based gold wire defect detection method for optical device chip packaging to improve detection efficiency and accuracy. Summary of the invention
[0006] In view of the defects of the prior art, the purpose of the present invention is to provide a method for detecting defects in gold wires in optical device chip packaging based on machine vision, which collects regional block images with packaging gold wires, extracts and detects solder joints in combination with a designed image processing algorithm, and then extracts the gold wire area and performs defect detection on the gold wire. The detection method of the present invention has fast detection speed and strong robustness.
[0007] To achieve the above object, the present invention provides a method for detecting defects in gold wires of optical device chip packaging, which comprises the following steps:
[0008] S1: Collect the area block image with the package gold wire on the optical device chip, and detect the solder joints of the gold wire.
[0009] S2: Extract the gold wire area based on solder joint tracing from the area block image of the package gold wire to obtain the gold wire area.
[0010] S3: grayscale analysis and feature calculation are performed on the extracted gold wire area to complete gold wire defect detection.
[0011] Furthermore, step S2 specifically includes the following sub-steps:
[0012] S21: performing image preprocessing on the area block image with the package gold wire to enhance the image contrast.
[0013] S22: Connect the welding point pairs, generate the perpendicular median line of the welding point pair connection line, and connect the two welding points with the points on the perpendicular median line.
[0014] S23: Expand the connecting lines to form two rectangular areas on the left and right sides of the perpendicular median, calculate the grayscale mean and grayscale variance of the two rectangular areas on the left and right sides of the perpendicular median, obtain the maximum value of the grayscale mean of the multiple rectangular areas on the left and right sides of the perpendicular median, and take the point on the perpendicular median corresponding to the rectangular area with the larger grayscale mean maximum value as the gold line trajectory point M,
[0015] S24: Connect the gold wire track point M to the two soldering points of the soldering point pair respectively, obtain the perpendicular midline of the line connecting the two soldering points and the gold wire track point M, the number of perpendicular midlines is two, connect the point on each perpendicular midline with the gold wire track point M and soldering point that are most adjacent to the point on the perpendicular midline, and then repeat step S23 to obtain gold wire track line points M2 and M1 respectively,
[0016] S25: According to the method of step S24, traverse the perpendicular median line to obtain more gold line trajectory points, until the obtained gold line trajectory points can be connected to form a gold line area,
[0017] Furthermore, in step S21, the image preprocessing is performed on the area block image with the packaged gold wire, specifically, the gray value of each pixel is transformed as follows:
[0018]
[0019] Among them, res pixel is the new grayscale value, orig is the original grayscale value of the pixel, mean is the average grayscale value in the selected range, Factor is the parameter for adjusting the contrast, and round is the rounding function.
[0020] Further, in step S23, the grayscale mean and grayscale variance of the two rectangular areas on the left and right sides of the perpendicular midline are calculated respectively. Specifically, assuming that the rectangular area is R, m is a point in the rectangular area, its grayscale value is g(p), the area of the rectangular area is S, the grayscale mean A of the rectangular area and the grayscale variance D of the area are respectively:
[0021]
[0022]
[0023] Further, in step S24, when obtaining the maximum value of the grayscale mean of multiple rectangular areas on the left and right sides of the perpendicular bisector, specifically, assuming that the expression of the perpendicular bisector is , the grayscale average function of the rectangular area to the left of the midpoint is , the grayscale average function of the rectangular area to the right of the midpoint is , to obtain The maximum value point is , The maximum value point is ,if ,choose As the gold line trajectory point, otherwise select .
[0024] Furthermore, in step S1, when collecting the area block image with the packaging gold wire on the optical device chip, an industrial camera with at least 5 million pixels and a double telecentric lens are used, and a dark field ring light illumination method is used in combination.
[0025] Furthermore, in step S1, when detecting and obtaining the solder joint pairs of the gold wire, the area block image with the packaged gold wire is first divided into PD area, IC area and base area, and templates are created for each area respectively. Template matching is performed on each area, and the solder joints are obtained based on the affine transformation matrix of the template matching to complete the solder joint detection.
[0026] Furthermore, in step S1, when obtaining the solder joints based on the affine transformation matrix of template matching, it is assumed that the coordinates of the solder joints in the template image are , the affine transformation matrix in template matching is A, and the coordinates of the solder joints in the image to be matched are , which is calculated by the following formula:
[0027]
[0028] Furthermore, when the solder joint detection is completed, a circle is obtained with the solder joint coordinates as the center and 10 to 15 pixels as the radius, and the grayscale average value P in the circle is calculated.
[0029] If P>G, the solder joint inspection result is good.
[0030] If P < G, the solder joint detection result is abnormal,
[0031] where G = 120.
[0032] Furthermore, in step S3, the grayscale mean threshold is set to , and the grayscale variance threshold is . Traverse the wire area of the gold wire. If both its grayscale mean and grayscale variance are less than the set thresholds, it is considered to have the defect of less wire or broken wire.
[0033] Furthermore, in step S3, connect any two endpoints of the gold wire, traverse the connection line of the endpoints, draw the perpendicular bisector of the connection line through the points on the connection line. The perpendicular bisector will generate intersection points with the wire area of the gold wire. The maximum value of the distance from the intersection point to the foot of the perpendicular is the bending parameter D. If the bending parameter D is greater than the threshold , it is considered to have a bending defect, otherwise it is a normal gold wire.
[0034] Generally speaking, compared with the prior art by the above technical solutions conceived by the present invention, the following beneficial effects are obtained:
[0035] Based on the solder joint detection result, the present invention extracts the wire area of the gold wire based on the solder joint. This method makes full use of the grayscale information near the wire area of the gold wire, and the extraction result is accurate and has high robustness. It can also extract well in the case of serious noise and too close gold wire spacing. According to the extraction result, grayscale analysis and geometric feature calculation can be carried out to complete the gold wire defect detection. It avoids the problems of inaccurate manual detection and inconsistent standards. In addition, the present invention uses a 5 million industrial camera, a double telecentric lens and combines dark field annular light source illumination to obtain high-resolution images, making the grayscale features of the gold wire area obvious. Furthermore, through reasonable region division for template matching, the solder joint position is obtained more accurately, and grayscale analysis is carried out around the solder joint to accurately complete the solder joint detection. The method of the present invention is accurate, effective and fast, and avoids the problems of slow speed and inaccurate detection in manual detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is the flowchart of the solder joint detection provided by the embodiment of the present invention;
[0037] Figure 2 is the regional block image of the optical device chip with encapsulated gold wires obtained by the embodiment of the present invention;
[0038] Figure 3 is for Figure 2 the schematic diagram after region division of the obtained image;
[0039] Figure 4 is the flowchart of the gold wire area extraction in the embodiment of the present invention;
[0040] Figure 5 This is an image after image preprocessing in the embodiment of the present invention. As can be seen from the figure, the features of its lines are more obvious;
[0041] Figure 6 A schematic diagram of generating a perpendicular midline of a solder joint and determining a gold wire trajectory point using the perpendicular midline of the solder joint in an embodiment of the present invention;
[0042] Figure 7 A schematic diagram of connecting gold wire track points including solder joints to form a rough gold wire area obtained in an embodiment of the present invention;
[0043] Figure 8 It is a schematic diagram of the process of performing gold wire defect detection in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0045] The present invention provides a method for detecting gold wire defects in optical device chip packaging based on machine vision, which mainly includes three main steps: S1: collecting a regional block image with packaging gold wires on an optical device chip, and detecting and obtaining solder joint pairs of the gold wires; S2: extracting gold wire regions based on solder joint tracing for the regional block image of the packaging gold wires; and S3: performing grayscale analysis and feature calculation on the extracted gold wire regions to complete gold wire defect detection.
[0046] Figure 1 : is a flow chart of solder joint detection provided by an embodiment of the present invention. It can be seen from the figure that it mainly includes the following detailed sub-steps:
[0047] (1) Use a 5-megapixel industrial camera, a dual telecentric lens and dark field annular light illumination to capture images of the area block with packaged gold wire on the optical device chip. The gold wire has a certain three-dimensional spatial shape, and the annular light source can illuminate from all directions, so that the three-dimensional information of the sample is highlighted. Therefore, the use of annular light source dark field illumination can better illuminate the gold wire, highlight the three-dimensional information of the gold wire, make the grayscale characteristics of the gold wire area obvious, and make it easy to extract. Figure 2 This is a block image of a region with packaging gold wires on an optical device chip obtained in an embodiment of the present invention, which is a dark field image.
[0048] (2) When detecting the solder joint pairs of the gold wires, the area block image with the package gold wires is first divided into a PD area, an IC area, and a base area. PD and IC are abbreviations of the proprietary names of the components. Figure 3Yes Figure 2 The schematic diagram of the obtained image after regional division, where the area indicated by serial number 1 is the PD area, which has two solder joints, and the PD component has a contour similar to a ring, which is easy to extract its feature template for template matching. The area indicated by serial number 2 is the IC area, which has 10 solder joints. The component has rich detailed contour information, but due to the lighting method, its contour information is not obvious enough, and corresponding image processing is required to create a template for template matching. The area indicated by serial numbers 3-8 is the base area, which has multiple solder joints. Among them, the relative position relationship of the four small circles indicated by serial numbers 3-6 is fixed, and the template can be directly created for template matching. For the area indicated by serial numbers 7-8, the relative positions of the four solder joints are fixed and can be regarded as a whole. Therefore, the four solder joints in the area are created as a whole template for template matching, so that the four solder joints in the area are directly matched.
[0049] For defect detection of optical devices, the key is to extract the gold wire area on the device and analyze the defects of the gold wire based on the extraction results. Only when the position of the solder joint is known can the integrity of the gold wire be judged. Therefore, the first task is to obtain the coordinates of the solder joints in each picture. Due to manufacturing process problems, the relative positions between the components and solder joints on different optical devices of the same model are not exactly the same, and there is a slight offset. Therefore, it is necessary to divide the area, and use different components for template matching to complete the detection of solder joints in different areas. That is, since the solder joint positions of each optical device produced by the manufacturing process do not completely overlap, it is impossible to match all solder joints through a single template matching. The solution is to divide the area of the product to be inspected. Due to the characteristics of the manufacturing process, this division method is reliable, that is, for components in different positions, there are always corresponding solder joints and their relative positions are fixed. All solder joints can be matched by template matching of different components. In this way, the positions of all solder joints can be obtained smoothly.
[0050] (3) Create a template for each divided area, and obtain the coordinates of the solder joints by matching the parts with contour features on the image. The key is to obtain the position of the solder joints. Only by knowing the position of the solder joints can we determine whether the gold wire is complete. Because the relative positions between the parts or solder joints on the device are not completely fixed during the production process, it is impossible to match all the solder joints at once, and they can only be matched by area.
[0051] (4) Perform template matching in regions. Template matching is a technique for finding the region in an image that is most similar to another image. Generally speaking, the template refers to a relatively small image. Then, the image to be detected may contain one or more parts that are the same as the template image. They have the same features. Through a certain algorithm, the part in the image to be detected that is most similar to the template can be found, and its position and the translation, rotation, scaling, etc. relative to the original template can be determined. This transformation is described by an affine transformation matrix. Components are matched in the image to be detected through template matching. Then, since the relative positions of the solder joints and the components remain unchanged, the solder joint coordinates in the image to be detected can be obtained by relying on the affine transformation matrix in the template matching process and the solder joint coordinates in the template image. Create templates for each region separately, perform template matching in regions, and calculate the solder joints based on the affine transformation matrix of the template matching to complete the solder joint detection.
[0052] (5) Calculate the solder joint coordinates of the gold wire based on the affine transformation matrix of the template matching. Assume that the coordinates of the solder joints in the template image are , and the affine transformation matrix in the template matching is A. Then, the coordinates of the solder joints in the image to be matched are , which is determined by the following formula:
[0053]
[0054] (6) Perform gray-scale analysis around the solder joints to complete the solder joint detection. Taking the solder joint coordinates as the center, form a circle with a radius of 10 to 15 pixels, calculate the average gray value P in the circle. Then, judge the matching result according to the following conditions:
[0055] (1) P > G, the matching result is good.
[0056] (2) P < G, the solder joint is abnormal.
[0057] Among them, G = 120, which is an empirical value.
[0058] Actually, the solder joint feature is approximately a high-gray-value circular region with a radius of 10 pixels. Only when the average gray value in this region is greater than a certain value is it considered qualified. Equivalently, the ideal solder joint coordinates are obtained through template matching, but the actual production solder joints may be missing. Since the normal solder joints are approximately a circular high-gray region, the average gray value of the circular region around this coordinate is considered. If the gray value is large, the solder joint is considered normal.
[0059] (7) Extract the gold wire region based on solder joint tracing for the sample image. Solder joint tracing means gradually determining the gold wire trajectory points between the solder joints starting from the solder joints, and fitting these gold wire trajectory points to obtain the gold wire extraction result, that is, the wire region of the gold wire. Figure 4: is a flowchart of gold wire area extraction in an embodiment of the present invention. As can be seen from the figure, it mainly includes the following sub-steps:
[0060] S71: Image preprocessing, for enhancing image contrast, specifically, performing the following transformation on the gray value of each pixel.
[0061]
[0062] Among them, res pixel is the new grayscale value, orig is the original grayscale value of the pixel, mean is the grayscale average value in the selected range, Factor is the parameter for adjusting the contrast, and round is the rounding function. For the above formula, in fact, first calculate the difference between the pixel value of the point and the surrounding grayscale average value, which may be a negative number. Multiply this difference by a coefficient and add it to the original grayscale value, so that the high grayscale value can be higher and the low grayscale value can be lower, that is, enhance the contrast, so that the grayscale features of the image are more obvious. After the preprocessing image enhancement process, the grayscale features of the lines are more obvious and easier to extract. This processing method is used for preprocessing of solder joints and gold wires, with the aim of increasing the contrast, making the grayscale values of solder joints and gold wires larger and easier to extract. Figure 5 This is an image after image preprocessing in an embodiment of the present invention. As can be seen from the figure, the features of its lines are more obvious.
[0063] S72: Generate the perpendicular midline of the solder joint connection line. Figure 6 FIG. 1 is a schematic diagram of generating a perpendicular midline of a solder joint and determining a gold wire trajectory point using the perpendicular midline of a solder joint in an embodiment of the present invention, wherein Figure 6 As we know, connect the two solder joints H1 and H2, find their perpendicular bisectors, and find that the gold wire must have an intersection with the perpendicular bisector. Find this intersection to get a track point. Traverse the points on the perpendicular bisector and connect the left and right endpoints. Expand the width of the connection to be slightly larger than the width of the gold wire, and generate two rectangular areas S1 and S2. Calculate the grayscale average and grayscale variance of the two rectangular areas S1 and S2. Since the grayscale of the gold wire area is large, the grayscale average of the rectangular area generated at the best track point must be the largest and the maximum value. Based on this, select the corresponding position with the largest extreme value of the left and right grayscale average as the required gold wire track point.
[0064] S73: traverse the perpendicular median line, and calculate the grayscale mean and variance in the rectangular area expanded by the line connecting the solder point and the point on the perpendicular median line. Assume that the region is R, m is a point in the region, its grayscale value is g(p), and the region area is S. The definitions of the regional grayscale mean A and the regional grayscale variance D are given below.
[0065]
[0066]
[0067] S74: Calculate the maximum grayscale mean value in the rectangular area on the left and right of the median vertical line, and combine the limiting conditions to take the point on the median vertical line corresponding to the position with the larger grayscale mean maximum value as the gold line trajectory point. Assume that the expression of the median vertical line is , the grayscale average function of the left rectangular area is , the grayscale average function of the right rectangular area is , we can obtain The maximum value point is , The maximum value point is ,if ,choose As a point on the center line of the gold line trajectory, otherwise select Since the grayscale of the gold line area is greater than the grayscale value of the surrounding area, the grayscale average value in the rectangular area selected as the evaluation standard must have a maximum value or a maximum value.
[0068] S75: Repeat the above process, after determining the middle track point M according to the two solder joints H1 and H2, then use M to replace H1 to repeat the above process, and perform the next round of repetitions to obtain a new gold wire track point M1. Similarly, use M to replace H2 to repeat the above process, and perform another round of repetitions to obtain a new gold wire track point M2. Perform another round of traversal based on this process, that is, repeat the above process for line segments H1M2, M2M, MM1, and M1H2 to obtain another four gold wire track points, a total of nine gold wire track points, connect these nine gold wire track points into a broken line segment, and expand this broken line segment to obtain the approximate gold wire area, such as Figure 7 As shown, Figure 7 The schematic diagram of the gold wire track points including the solder joints obtained by the embodiment of the present invention are connected to form a rough gold wire area. Because the gold wire is generally close to a straight line or a line with a small bend, nine points are enough to fit the gold wire area. The more track points, the more accurate it is, but it also increases the amount of calculation. If the gold wire is greatly curved and the line shape is complex, more track points are needed for fitting.
[0069] (8) Perform grayscale analysis and feature calculation on the extracted gold wire area to complete gold wire defect detection. Figure 8 : is a schematic diagram of the process of performing gold wire defect detection in an embodiment of the present invention. As can be seen from the figure, it mainly includes the following sub-steps:
[0070] S81: Determine whether the line is broken or missing by grayscale mean and variance. The grayscale value of the missing and broken line area is significantly smaller than that of the gold line area, which means that the grayscale average value in this area is relatively small, and there is no area with a large grayscale value in the area, resulting in a relatively small grayscale variance. For the normal gold line area, the extracted gold line area is expanded so that the expanded area completely covers the gold line area, and some areas are backgrounds with very low grayscale. Therefore, the grayscale average value of the normal gold line area is larger, and the grayscale variance is also larger. Set the grayscale mean threshold to , the grayscale variance mean is , traverse the gold wire area, if its grayscale mean and grayscale mean square error are less than the set threshold, it is considered to have a missing wire or broken wire defect.
[0071] S82: Calculate bending parameters for the entire gold wire area.
[0072] The definition of the gold wire bending defect is as follows: the straight line connecting the two solder joints of the gold wire is L. If there is a point on the gold wire area and the distance from L is greater than a threshold , it is considered to have a bending defect. Connect the two endpoints of the gold wire, traverse the line connecting the endpoints, and draw a perpendicular line through the point on the line. There will definitely be an intersection with the line area of the gold wire. The maximum distance from the intersection to the foot of the perpendicular is the bending parameter D. If the bending parameter D is greater than the threshold , it is considered to have a bending defect, otherwise it is a normal gold wire.
[0073] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting defects in gold wires of optical device chip packaging, characterized in that: It includes the following steps: S1: Collect the image of the area block on the optical device chip with encapsulated gold wires, and detect the solder joints of the gold wires. S2: Extract the gold wire area based on the solder joint tracing for the image of the area block with encapsulated gold wires to obtain the gold wire area. S3: Conduct gray-scale analysis and feature calculation on the extracted gold wire area to complete the gold wire defect detection. Among them, step S2 specifically includes the following sub-steps: S21: Perform image preprocessing on the image of the area block with encapsulated gold wires to enhance the image contrast. S22: Connect the solder joint pairs, generate the perpendicular bisector of the connection line of the solder joint pairs, and connect the two solder joints with the points on the perpendicular bisector. S23: Expand each connection line to form two rectangular areas on the left and right sides of the perpendicular bisector respectively, calculate the gray-scale mean value and gray-scale variance of the two rectangular areas on the left and right sides of the perpendicular bisector respectively, obtain the maximum value of the gray-scale mean values of multiple rectangular areas on the left and right sides of the perpendicular bisector, and take the point on the perpendicular bisector corresponding to the rectangular area with the larger maximum value of the gray-scale mean as the gold wire trajectory point M. S24: Connect the gold wire trajectory point M with the two solder joints of the solder joint pair respectively to obtain the perpendicular bisectors of the connection lines of the two solder joints and the gold wire trajectory point M. The number of perpendicular bisectors is two. Connect the points on each perpendicular bisector with the gold wire trajectory point M and the solder joint that is closest to the point on this perpendicular bisector, and then repeat step S23 to obtain the gold wire trajectory points M2 and M1 respectively. S25: Traverse the perpendicular bisectors in the manner of step S24 to obtain more gold wire trajectory points until the obtained gold wire trajectory points can be connected to form the gold wire area.
2. The method for detecting gold wire defects in optical device chip packaging according to claim 1, characterized in that: In step S21, when performing image preprocessing on the image of the area block with encapsulated gold wires, specifically, the gray-scale value of each pixel point is transformed as follows: Among them, the res pixel point is the new gray-scale value, orig is the original gray-scale value of the pixel point, mean is the gray-scale average value within the selected range, Factor is the parameter for adjusting the contrast size, and round is the rounding function.
3. A method for detecting defects in gold wires of optical device chip packaging as claimed in claim 2, characterized in that: In step S23, when calculating the gray-scale mean value and gray-scale variance of the two rectangular areas on the left and right sides of the perpendicular bisector respectively, specifically, assuming the rectangular area is R, m is a point within the rectangular area, its gray-scale value is g(p), the area of the rectangular area is S, the gray-scale mean value A of the rectangular area and the area gray-scale variance D are respectively: 。 4. The method for detecting gold wire defects in optical device chip packaging according to claim 2, characterized in that: In step S24, when obtaining the maximum value of the grayscale mean of multiple rectangular areas on the left and right sides of the median, specifically, assuming that the expression of the median is , the grayscale average function of the rectangular area to the left of the midpoint is , the grayscale average function of the rectangular area to the right of the midpoint is , to obtain The maximum value point is , The maximum value point is ,if ,choose As the gold line trajectory point, otherwise select .
5. The method for detecting gold wire defects in optical device chip packaging according to claim 2, characterized in that: In step S1, when collecting the image of the area block on the optical device chip with encapsulated gold wires, an industrial camera with at least 5 million pixels and a double telecentric lens are used, and a dark field ring light illumination method is used in combination.
6. The method for detecting defects in gold wires of optical device chip packaging according to claim 5, characterized in that: In step S1, when detecting the solder joint pairs of the gold wires, first divide the image of the area block with encapsulated gold wires into regions, including the PD region, the IC region, and the base region. Create templates for each region respectively, perform template matching for each region, and obtain the solder joints according to the affine transformation matrix of the template matching to complete the solder joint detection.
7. A method for detecting defects in gold wires of optical device chip packaging as claimed in claim 6, characterized in that: In step S1, when obtaining the solder joints based on the affine transformation matrix of template matching, it is assumed that the coordinates of the solder joints in the template image are , the affine transformation matrix in template matching is A, and the coordinates of the welding point in the image to be matched are , which is calculated by the following formula: When completing the solder joint detection, a circle is obtained with the solder joint coordinates as the center and a radius of 10 to 15 pixels, and the gray-scale average value P in the circle is calculated. If P > G, the solder joint detection result is good. If P < G, the solder joint detection result is abnormal. Among them, G = 120.
8. A method for detecting defects in gold wires of optical device chip packaging according to any one of claims 1 to 7, characterized in that: In step S3, the grayscale mean threshold is set to , the grayscale variance threshold is , traverse the line area of the gold wire. If its grayscale mean and grayscale mean square error are both less than the set threshold, it is considered to have a defect of missing wires or broken wires.
9. The method for detecting defects in gold wires of optical device chip packaging according to claim 8, characterized in that: In step S3, connect any two endpoints of the gold wire, traverse the line connecting the endpoints, and draw the perpendicular bisector of the line through the points on the line. The perpendicular bisector and the line area of the gold wire will have an intersection. The maximum distance from the intersection to the foot of the perpendicular is the bending parameter D. If the bending parameter D is greater than the threshold , it is considered to have a bending defect, otherwise it is a normal gold wire.
