Sn ball defect detection method and device, computer device and storage medium
Patent Information
- Application Number
- CN202210672344.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-06-15
AI Technical Summary
[0002]相关技术中,采用人工检测和图像处理两种方式进行锡球缺陷检测,人工检测方式检测效率低,且易受人为主观因素的影响,缺陷检测的准确率低
[0039] A fourth aspect of this application provides a storage medium that is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the solder ball defect detection method as described in any one of the embodiments of the first aspect of this application.
Smart Images

Figure CN115272173B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a method and apparatus for detecting solder ball defects, a computer device, and a storage medium. Background Technology
[0002] In related technologies, two methods are used for solder ball defect detection: manual inspection and image processing. Manual inspection is inefficient and easily affected by subjective human factors, resulting in low accuracy. Image processing calculates the grayscale value of each solder ball to determine whether a defect exists, but it cannot accurately identify defective solder balls, leading to a high rate of missed detections of defective solder balls. Summary of the Invention
[0003] The main objective of this application is to provide a method, apparatus, computer equipment, and storage medium for detecting solder ball defects, which can accurately detect defective solder balls and reduce the missed detection rate of defective solder balls.
[0004] To achieve the above objectives, a first aspect of this application provides a method for detecting solder ball defects, the method comprising:
[0005] Get the initial image;
[0006] An affine transformation is performed on the initial image to obtain a solder ball image;
[0007] The solder ball image is subjected to an erosion operation based on a preset structure operator to obtain a first feature image;
[0008] Subtract the first pixel value of the pixel in the solder ball image from the second pixel value of the pixel in the first feature image to obtain the second feature image;
[0009] Threshold segmentation is performed on the second feature image to obtain the defect detection result.
[0010] In some embodiments, acquiring the initial image includes:
[0011] Acquire color images;
[0012] Extract the green channel image component from the color image, and obtain an initial image based on the green channel image component.
[0013] In some embodiments, the affine transformation of the initial image to obtain the solder ball image includes one of the following:
[0014] If the initial image is a noisy image, then Gaussian filtering is performed on the initial image to obtain a first intermediate image, and affine transformation is performed on the first intermediate image to obtain a tin ball image;
[0015] If the initial image is a weak image, then the initial image is enhanced in grayscale to obtain a second intermediate image, and the second intermediate image is subjected to an affine transformation to obtain a tin ball image;
[0016] If the initial image is a blurred image, then the initial image is deblurred to obtain a third intermediate image, and the third intermediate image is subjected to an affine transformation to obtain a tin ball image;
[0017] If the initial image is a distorted image, then the initial image is geometrically corrected to obtain a fourth intermediate image, and the fourth intermediate image is subjected to an affine transformation to obtain a tin ball image.
[0018] In some embodiments, the preset structure operator is a circular structure operator, and the step of performing an erosion operation on the solder ball image according to the preset structure operator to obtain a first feature image includes:
[0019] The first feature image is obtained by performing an erosion operation on the tin ball image based on the circular structure operator.
[0020] In some embodiments, the step of performing an erosion operation on the solder ball image based on the circular structure operator to obtain a first feature image includes:
[0021] Obtain the outline image of the solder ball;
[0022] The defective solder ball image is obtained based on the solder ball contour image;
[0023] Remove the defective solder ball image from the solder ball image to obtain the defect-free solder ball image;
[0024] The first feature image is obtained by performing an erosion operation on the defect-free tin ball image based on the circular structure operator.
[0025] In some embodiments, obtaining the defective solder ball image based on the solder ball contour image includes:
[0026] Calculate the height and surface area of the solder ball in the solder ball contour image;
[0027] An image of the defective solder ball is obtained based on the height and the surface area.
[0028] In some embodiments, the step of thresholding the second feature image to obtain the defect detection result includes:
[0029] Obtain the grayscale histogram of the second feature image;
[0030] The threshold is determined based on the grayscale histogram;
[0031] The second feature image is segmented based on the threshold to obtain the defect detection result.
[0032] A second aspect of this application provides a solder ball defect detection device, the device comprising:
[0033] The image acquisition module is used to acquire the initial image;
[0034] The first image processing module is used to perform an affine transformation on the initial image to obtain a tin ball image;
[0035] The second image processing module performs an etching operation on the tin ball image according to a preset structural operator to obtain a first feature image;
[0036] The third image processing module is used to subtract the first pixel value of the pixel in the solder ball image from the second pixel value of the pixel in the first feature image to obtain the second feature image;
[0037] The image segmentation module is used to perform threshold segmentation on the second feature image to obtain the defect detection result.
[0038] A third aspect of this application provides a computer device including a memory and a processor, wherein the memory stores a program, and when the program is executed by the processor, the processor is used to perform a solder ball defect detection method as described in any one of the embodiments of the first aspect of this application.
[0039] A fourth aspect of this application provides a storage medium that is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the solder ball defect detection method as described in any one of the embodiments of the first aspect of this application.
[0040] The solder ball defect detection method, apparatus, computer equipment, and storage medium proposed in this application obtain an initial image, perform an affine transformation on the initial image to obtain a solder ball image, perform an etching operation on the solder ball image according to a preset structure operator to obtain a first feature image, subtract the solder ball image from the first feature image to obtain a second feature image, and perform threshold segmentation on the second feature image to obtain a defect detection result. This method can improve the efficiency of solder ball defect detection, accurately detect defective solder balls, and reduce the missed detection rate of defective solder balls. Attached Figure Description
[0041] Figure 1 This is a flowchart of the solder ball defect detection method provided in the embodiments of this application;
[0042] Figure 2 yes Figure 1 A flowchart illustrating the specific method of step S110;
[0043] Figure 3 yes Figure 1 A flowchart illustrating the specific method of step S120;
[0044] Figure 4 yes Figure 1 A flowchart illustrating the specific method of step S130;
[0045] Figure 5 yes Figure 4 A flowchart illustrating the specific method of step S420;
[0046] Figure 6 yes Figure 1 A flowchart illustrating the specific method of step S150;
[0047] Figure 7 This is a module structure diagram of the solder ball defect detection device provided in the embodiments of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0049] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0050] Unless otherwise defined, 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 pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0051] BGA packaging achieves data transmission and mechanical connections between chips by fabricating an array of solder balls on the bottom of the package substrate. The performance of the solder balls directly affects the reliability of the solder joints in the BGA package, thus affecting the quality stability of the chip. To ensure chip quality stability, chip testing is necessary, and solder ball defect detection is an essential step in chip testing. There are two main technologies for solder ball defect detection: manual inspection and machine vision-based 2D image processing. Manual inspection is labor-intensive, and relying on manual inspection with a microscope to examine each solder ball individually is not only inefficient but also inaccurate and highly susceptible to subjective human factors. Machine vision-based 2D image processing calculates the grayscale value of each solder ball to determine if a defect exists. However, this method is computationally intensive, inefficient, and has a high false negative rate when the solder ball damage is small.
[0052] Based on this, the main objective of this application is to propose a solder ball defect detection method. This method involves acquiring an image of a solder ball illuminated by a white ring light source, performing an etching operation on the solder ball image according to a preset structural operator to obtain a first feature image, subtracting the first pixel value of a pixel in the solder ball image from the second pixel value of a pixel in the first feature image to obtain a second feature image, thereby removing the bright area at the top of the solder ball, and performing threshold segmentation on the second feature image to obtain the solder ball defect detection result. This method requires less computation, has a fast solder ball defect detection speed, and high detection accuracy, simultaneously meeting the requirements of speed and detection accuracy.
[0053] Reference Figure 1 The solder ball defect detection method according to the first aspect of the present application is applied to a solder ball defect detection device. The solder ball defect detection method includes, but is not limited to, steps S110 to S150.
[0054] S110, Obtain the initial image;
[0055] S120, Perform an affine transformation on the initial image to obtain the tin ball image;
[0056] S130, perform erosion operation on the tin ball image according to the preset structure operator to obtain the first feature image;
[0057] S140, subtract the first pixel value of the pixel in the solder ball image from the second pixel value of the pixel in the first feature image to obtain the second feature image;
[0058] S150, threshold segmentation is performed on the second feature image to obtain the defect detection result.
[0059] In step S110, an initial image is acquired, wherein the initial image is an image of the array of solder balls captured by a camera with a resolution of 12 megapixels, the array of solder balls is illuminated by a white ring light source, and the size of the initial image is 4000×3000.
[0060] In step S120, an affine transformation is performed on the initial image to divide the array of solder balls in the initial image into multiple individual solder balls, thus obtaining a solder ball image.
[0061] In step S130, the preset structure operator is a circular structure operator. Multiple individual solder balls are traversed one by one, and an erosion operation is performed on the solder ball images of the multiple individual solder balls according to the circular structure operator to obtain a first feature image. Under white ring light illumination, the top of the solder ball will have a bright area due to its smoothness. The bright area feature at the top of the solder ball is obtained by performing an erosion operation on the solder ball image according to the circular structure operator. This bright area feature is a circle, the center of which is the center of the solder ball in the solder ball image, and the radius is one-third or one-half of the radius of the solder ball. It can be understood that the first feature image is the image obtained after performing an erosion operation on the solder ball image, and it includes the bright area feature at the top of the solder ball.
[0062] In mathematical morphology, erosion eliminates boundary points of objects, reducing image size. If the image of a solder ball is represented as A, the structure operator as S, and the erosion operator as ⊙, then the method for calculating the erosion of the solder ball image A by the structure operator S is as follows: The erosion operation involves moving a circular structure operator S within the solder ball image A. When the circular structure operator S completely covers the solder ball image, it is determined whether the covered area matches the circular structure operator. If they match, the image pixels covered by the origin of the circular structure operator are marked as foreground points (bright feature points), and the remaining image pixels are marked as background points (dark feature points). This process continues until the structure operator S has scanned every pixel in the solder ball image, and the final image obtained is the first feature image.
[0063] The circular feature obtained after the etching operation can intuitively display the defect detection results of the solder ball. If the circular feature is a bright feature, the solder ball corresponding to the circular feature is considered to be a defective solder ball. If the circular feature is a dark feature, the solder ball corresponding to the circular feature is considered to be a defect-free solder ball.
[0064] In step S140, since the solder ball in the solder ball image is a circle and the bright area feature is a circle smaller than the size of the solder ball, the first pixel value of the pixel in the solder ball image is subtracted from the second pixel value of the pixel in the first feature image to remove the bright area feature of the top of the solder ball from the solder ball image, thus obtaining the ring feature, that is, the second feature image includes the ring feature.
[0065] In step S150, threshold segmentation is performed on the second feature image. Pixels larger than the threshold are designated as bright features, and pixels smaller than or equal to the threshold are designated as dark features, resulting in a target image. If a bright feature exists in the target image, it indicates that the solder ball corresponding to that bright feature is defective; if a dark feature exists in the target image, it indicates that the solder ball corresponding to that dark feature is defect-free, thus achieving defect detection for BGA packaged solder balls. It should be noted that when the difference between bright and dark features is large, threshold segmentation can detect defective solder balls from the target image.
[0066] The solder ball defect detection method proposed in this application obtains an initial image, performs an affine transformation on the initial image to obtain a solder ball image, performs an etching operation on the solder ball image according to a preset structure operator to obtain a first feature image, subtracts the solder ball image from the first feature image to obtain a second feature image, and performs threshold segmentation on the second feature image to obtain the defect detection result. This method not only requires less computation and has a fast detection speed, but also can accurately detect defective solder balls and reduce the missed detection rate of defective solder balls.
[0067] In some embodiments, such as Figure 2 As shown, step S110 specifically includes, but is not limited to, steps S210 to S220.
[0068] S210, acquire a color image;
[0069] S220: Extract the green channel image component of the color image and obtain the initial image based on the green channel image component.
[0070] In step S210, a color image is acquired, wherein the color image is composed of image components of three channels: red channel image component, green channel image component, and blue channel image component.
[0071] In step S220, in order to convert the color image to grayscale, the green channel image component of the color image is extracted from the image components of the three channels of the color image, and the green channel image component is used as the initial image.
[0072] Under a white ring light source, the smooth top of a defect-free solder ball will show a bright area, while the rest will be dark. When a defective solder ball is illuminated, the bright area on the top of the ball will increase, and the surface of the ball will emit light, displaying a bright color that contrasts significantly with the dark areas, facilitating subsequent image processing. By converting the image to grayscale, the difference between the bright and dark areas is amplified, meaning a large difference in grayscale values. This allows for subsequent etching and subtraction operations on the solder ball image based on structural operators, resulting in more accurate solder ball defect detection results.
[0073] In some embodiments, such as Figure 3As shown, step S120 specifically includes, but is not limited to, one of steps S310 to S340.
[0074] S310, If the initial image is a noisy image, then Gaussian filtering is applied to the initial image to obtain the first intermediate image, and affine transformation is applied to the first intermediate image to obtain the tin ball image;
[0075] S320, if the initial image is a weak image, then perform grayscale enhancement on the initial image to obtain a second intermediate image, and perform an affine transformation on the second intermediate image to obtain a tin ball image;
[0076] S330, if the initial image is a blurred image, then the initial image is deblurred to obtain a third intermediate image, and the third intermediate image is subjected to an affine transformation to obtain a tin ball image;
[0077] S340, if the initial image is a distorted image, then perform geometric correction on the initial image to obtain a fourth intermediate image, and perform an affine transformation on the fourth intermediate image to obtain a tin ball image.
[0078] In step S310, in order to avoid the influence of noise on the detection results of solder ball defects, which may cause noise to be misdetected as defective solder balls, if the initial image is a noisy image, a two-dimensional Gaussian filter is used to smooth and denoise the initial image to obtain the first intermediate image, wherein the first intermediate image is the image after Gaussian filtering, and the definition of the two-dimensional Gaussian filter is shown in formula (1).
[0079]
[0080] Where x is the horizontal coordinate of the image space, y is the vertical coordinate of the image space, and σ is the blur radius.
[0081] To avoid smoothing out the details of the initial image, which would result in a blurred initial image, the blur radius is set to 1 in this embodiment.
[0082] In step S320, due to the low contrast of the weak image, the edges and other details of the solder balls are not obvious, making it impossible to detect defective solder balls. To improve the accuracy of solder ball defect detection, if the initial image is a weak image, grayscale enhancement is performed on the initial image to obtain a second intermediate image, where the second intermediate image is the grayscale-enhanced image. In this embodiment, grayscale transformation is used to enhance the initial image. The grayscale transformation can be a piecewise linear transformation, logarithmic transformation, gamma transformation, etc.
[0083] In step S330, the blurred image has low image quality. To obtain a clear image, an image restoration method is used to deblur the blurred image, resulting in a third intermediate image, which is the deblurred image. It is understood that image restoration methods include inverse filtering, Wiener filtering, constrained least squares filtering, etc.
[0084] In step S340, the image may be distorted during the shooting process due to issues such as camera exposure, resulting in a decrease in image quality. If the initial image is a distorted image, geometric correction is performed on the initial image to obtain a fourth intermediate image, which is the image after geometric correction. This is achieved by solving for the distortion correction matrix of the initial image and then performing geometric correction on the initial image based on the distortion correction matrix.
[0085] In some embodiments, such as Figure 4 As shown, step S130 specifically includes, but is not limited to, steps S410 to S440.
[0086] S410, Obtain the solder ball outline image;
[0087] S420, obtain the image of the defective solder ball based on the solder ball contour image;
[0088] S430, Remove defective solder balls from the solder ball image to obtain a defect-free solder ball image;
[0089] S440, perform etching operation on the defect-free tin ball image according to the circular structure operator to obtain the first feature image.
[0090] In step S410, a solder ball contour image is acquired, wherein the solder ball contour image is acquired by 3D line laser.
[0091] In step S420, defective solder balls are identified by calculating the average height and surface area of each solder ball in the solder ball contour image, thus obtaining an image of defective solder balls.
[0092] In step S430, defective solder ball images are removed from the solder ball images to avoid repeated detection of defective solder balls, which would result in low detection efficiency.
[0093] In step S440, an etching operation is performed on the image of the defect-free solder ball according to the circular structure operator to further detect the defect-free solder ball and avoid missing defective solder balls.
[0094] In some embodiments, such as Figure 5 As shown, step S420 specifically includes, but is not limited to, steps S510 to S520.
[0095] S510, calculate the height and surface area of the solder ball in the solder ball profile image;
[0096] S520 obtains images of defective solder balls based on their height and surface area.
[0097] In step S510, wear or flattening of the solder balls will cause a decrease in their average height and an increase in their surface area. By calculating the average height and surface area of the solder balls, solder balls with obvious defects can be identified for preliminary screening.
[0098] In step S520, if the average height of the solder balls is less than a preset first threshold, or the surface area of the solder balls is greater than a preset second threshold, it indicates that the surface of the solder balls is worn or flattened, thus obtaining an image of defective solder balls. The first threshold is the average height of the sample solder balls, and the second threshold is the surface area of the sample solder balls. For example, the average heights of the solder balls in rows 5, columns 6, 7, 8, and 9 of the chip are 0.1707, 0.1642, 0.1586, and 0.1689, respectively, and the corresponding surface areas are 0.0845, 0.0920, 0.0923, and 0.1042, respectively. If the first threshold is 0.15 and the second threshold is 0.08, and the average height is greater than the first threshold and the surface area of the solder balls is greater than the second threshold, then the solder balls in rows 5, columns 6, 7, 8, and 9 are solder balls with obvious defects.
[0099] In some embodiments, such as Figure 6 As shown, step S150 specifically includes, but is not limited to, steps S610 to S630.
[0100] S610, Obtain the grayscale histogram of the second feature image;
[0101] S620, determine the threshold based on the grayscale histogram;
[0102] S630, threshold segmentation is performed on the second feature image based on the threshold to obtain the defect detection result.
[0103] In steps S610 to S630, a grayscale histogram of the second feature image is obtained. The minimum value between the foreground peak and the background peak of the grayscale histogram is used as a threshold. If the pixel value of a pixel in the second feature image is greater than the threshold, the pixel is classified as a bright feature point; if the pixel value of a pixel in the second feature image is less than or equal to the threshold, the pixel is classified as a dark feature point. When all pixels in the second feature image are classified as either bright or dark feature points, the target image is obtained. If a bright feature exists in the target image, the solder ball corresponding to the bright feature is defective; if a dark feature exists in the target image, the solder ball corresponding to the dark feature is defect-free, thereby achieving defect detection of BGA packaged solder balls.
[0104] The following describes in detail the solder ball defect detection method according to an embodiment of the present invention with a specific example. It is worth understanding that the following description is merely illustrative and not a specific limitation of the invention.
[0105] Acquire a color image captured by a camera, extract the green channel image component from the color image, use the green channel image component as the initial image, apply Gaussian filtering to the initial image to obtain the first intermediate image, perform grayscale transformation on the first intermediate image to obtain the second intermediate image, perform image restoration on the second intermediate image to obtain the third intermediate image, perform geometric correction on the third intermediate image to obtain the fourth intermediate image, perform affine transformation on the fourth intermediate image to obtain the solder ball image, acquire the solder ball contour image acquired by 3D line laser, calculate the average height and surface area of the solder ball in the solder ball contour image, if the average height of the solder ball is small... If the surface area of the solder ball is greater than a preset first threshold, or if the surface area of the solder ball is greater than a preset second threshold, a defective solder ball image is obtained. The defective solder ball image is removed from the solder ball image to obtain a defect-free solder ball image. An erosion operation is performed on the defect-free solder ball image according to the circular structure operator to obtain a first feature image. The first pixel value of the pixel in the solder ball image is subtracted from the second pixel value of the pixel in the first feature image to obtain a second feature image. The grayscale histogram of the second feature image is obtained. A segmentation threshold is determined according to the grayscale histogram. Threshold segmentation is performed on the second feature image according to the segmentation threshold to obtain the defect detection result.
[0106] By using 3D line laser and morphology-based two-dimensional image processing methods to perform multi-dimensional detection of solder balls, the accuracy of surface defect detection of solder balls is improved, the false negative rate of defects is reduced, and the computational load and detection speed are fast, which can simultaneously meet the requirements of detection speed and detection accuracy.
[0107] This application also provides a solder ball defect detection device, such as... Figure 7 As shown, the solder ball defect detection device can implement the above-mentioned solder ball defect detection method. The device includes an image acquisition module 710, a first image processing module 720, a second image processing module 730, a third image processing module 740, and an image segmentation module 750. The image acquisition module 710 is used to acquire an initial image; the first image processing module 720 is used to perform an affine transformation on the initial image to obtain a solder ball image; the second image processing module 730 performs an erosion operation on the solder ball image according to a preset structure operator to obtain a first feature image; the third image processing module 740 is used to subtract the first pixel value of a pixel in the solder ball image from the second pixel value of a pixel in the first feature image to obtain a second feature image; and the image segmentation module 750 is used to perform threshold segmentation on the second feature image to obtain a defect detection result.
[0108] The solder ball defect detection device of this application embodiment is used to perform the solder ball defect detection method in the above embodiment. Its specific processing procedure is the same as that of the solder ball defect detection method in the above embodiment, and will not be described in detail here.
[0109] The solder ball defect detection device proposed in this application acquires an initial image through an image acquisition module, performs an affine transformation on the initial image to obtain a solder ball image through a first image processing module, performs an etching operation on the solder ball image according to a preset structure operator to obtain a first feature image through a second image processing module, subtracts the first feature image from the solder ball image to obtain a second feature image through a third image processing module, and performs threshold segmentation on the second feature image through an image segmentation module to obtain a defect detection result. This device not only requires less computation and has a fast detection speed, but also can accurately detect defective solder balls and reduce the missed detection rate of defective solder balls.
[0110] This application also provides a computer device, including:
[0111] At least one processor, and,
[0112] A memory that is communicatively connected to at least one processor; wherein,
[0113] The memory stores instructions that are executed by at least one processor to implement a solder ball defect detection method as described in any of the embodiments of the first aspect of this application when the at least one processor executes the instructions.
[0114] The computer device includes: processor, memory, input / output interface, communication interface, and bus.
[0115] The processor can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solutions provided in the embodiments of this application.
[0116] The memory can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device, or RAM (Random Access Memory). The memory can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory and called and executed by the processor using the solder ball defect detection method of the embodiments of this application.
[0117] Input / output interfaces are used to implement information input and output;
[0118] The communication interface is used to enable communication and interaction between this device and other devices. Communication can be achieved via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth); and
[0119] A bus is used to transfer information between various components of a device, such as processors, memory, input / output interfaces, and communication interfaces.
[0120] The processor, memory, input / output interfaces, and communication interfaces communicate with each other within the device via a bus.
[0121] This application also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the solder ball defect detection method of this application.
[0122] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0123] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0124] It will be understood by those skilled in the art that Figures 1 to 6 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0125] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0126] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0127] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0128] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0129] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0130] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0131] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0133] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for detecting solder ball defects, characterized in that, The method includes: Get the initial image; An affine transformation is performed on the initial image to divide the array of solder balls in the initial image into individual solder balls, resulting in a solder ball image; The solder ball image is subjected to an erosion operation according to a preset structure operator to obtain a first feature image; the preset structure operator is a circular structure operator, and the first feature image includes a bright area feature at the top of the solder ball, and the bright area feature is circular; Subtract the first pixel value of the pixel in the solder ball image from the second pixel value of the pixel in the first feature image to obtain the second feature image; The second feature image is subjected to threshold segmentation to obtain the defect detection result; The step of performing an erosion operation on the solder ball image according to a preset structure operator to obtain a first feature image includes: Obtain a solder ball contour image; obtain a defective solder ball image based on the solder ball contour image; remove the defective solder ball image from the solder ball image to obtain a defect-free solder ball image; perform an erosion operation on the defect-free solder ball image based on the circular structure operator to obtain a first feature image; The step of obtaining the defective solder ball image based on the solder ball contour image includes: Calculate the average height and surface area of the solder balls in the solder ball contour image; if the average height is less than a preset first threshold, or the surface area is greater than a preset second threshold, then the solder ball is a defective solder ball, and a defective solder ball image is obtained; the first threshold is the average height of the sample solder ball, and the second threshold is the surface area of the sample solder ball; The step of thresholding the second feature image to obtain the defect detection result includes: Obtain the grayscale histogram of the second feature image; use the minimum value between the foreground peak and the background peak of the grayscale histogram as a threshold; if the pixel value of a pixel in the second feature image is greater than the threshold, then the pixel is regarded as a bright feature point; if the pixel value of a pixel in the second feature image is less than or equal to the threshold, then the pixel is regarded as a dark feature point. When all pixels in the second feature image are classified as bright feature points or dark feature points, the target image is obtained; if the solder ball in the target image has a bright feature, then it is determined that the solder ball corresponding to the bright feature has a defect, and the defect detection result is obtained.
2. The solder ball defect detection method according to claim 1, characterized in that, The process of obtaining the initial image includes: Acquire color images; Extract the green channel image component from the color image, and obtain an initial image based on the green channel image component.
3. The solder ball defect detection method according to claim 1, characterized in that, The affine transformation performed on the initial image to obtain the tin ball image includes one of the following: If the initial image is a noisy image, then Gaussian filtering is performed on the initial image to obtain a first intermediate image, and affine transformation is performed on the first intermediate image to obtain a tin ball image; If the initial image is a weak image, then the initial image is enhanced in grayscale to obtain a second intermediate image, and the second intermediate image is subjected to an affine transformation to obtain a tin ball image; If the initial image is a blurred image, then the initial image is deblurred to obtain a third intermediate image, and the third intermediate image is subjected to an affine transformation to obtain a tin ball image; If the initial image is a distorted image, then the initial image is geometrically corrected to obtain a fourth intermediate image, and the fourth intermediate image is subjected to an affine transformation to obtain a tin ball image.
4. A solder ball defect detection device, characterized in that, The device includes: The image acquisition module is used to acquire the initial image; The first image processing module is used to perform an affine transformation on the initial image to divide the array of solder balls in the initial image into individual solder balls, thereby obtaining a solder ball image; The second image processing module performs an erosion operation on the solder ball image according to a preset structure operator to obtain a first feature image; the preset structure operator is a circular structure operator, and the first feature image includes a bright area feature on the top of the solder ball, and the bright area feature is circular; The third image processing module is used to subtract the first pixel value of the pixel in the solder ball image from the second pixel value of the pixel in the first feature image to obtain the second feature image; The image segmentation module is used to perform threshold segmentation on the second feature image to obtain the defect detection result; The step of performing an erosion operation on the solder ball image according to a preset structure operator to obtain a first feature image includes: Obtain a solder ball contour image; obtain a defective solder ball image based on the solder ball contour image; remove the defective solder ball image from the solder ball image to obtain a defect-free solder ball image; perform an erosion operation on the defect-free solder ball image based on the circular structure operator to obtain a first feature image; The step of obtaining the defective solder ball image based on the solder ball contour image includes: Calculate the average height and surface area of the solder balls in the solder ball contour image; if the average height is less than a preset first threshold, or the surface area is greater than a preset second threshold, then the solder ball is a defective solder ball, and a defective solder ball image is obtained; the first threshold is the average height of the sample solder ball, and the second threshold is the surface area of the sample solder ball; The step of thresholding the second feature image to obtain the defect detection result includes: Obtain the grayscale histogram of the second feature image; use the minimum value between the foreground peak and the background peak of the grayscale histogram as a threshold; if the pixel value of a pixel in the second feature image is greater than the threshold, then the pixel is regarded as a bright feature point; if the pixel value of a pixel in the second feature image is less than or equal to the threshold, then the pixel is regarded as a dark feature point. When all pixels in the second feature image are classified as bright feature points or dark feature points, the target image is obtained; if the solder ball in the target image has a bright feature, then it is determined that the solder ball corresponding to the bright feature has a defect, and the defect detection result is obtained.
5. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a program, which the processor executes when the program is executed: The solder ball defect detection method as described in any one of claims 1 to 4.
6. A storage medium, said storage medium being a computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer, enables the computer to perform: The solder ball defect detection method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for detecting ampoule bottle appearance quality through medical visual inspection robot
CN103018253A