A method, system, device and medium for detecting colloid defects
The dispensing area is irradiated by the light source, the image is collected and processed to extract the geometric center of the annular bright band, and the detection line is constructed for continuous detection, which solves the problems of inconsistent detection results and low accuracy in traditional methods, and achieves efficient and accurate colloid defect detection.
Patent Information
- Application Number
- CN202411377738.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Traditional dispensing defect detection methods rely on manual visual inspection or simple optical measurement, resulting in inconsistent detection results and are susceptible to environmental factors, with low accuracy, making it difficult to meet the automation, high efficiency and high accuracy requirements of industrial inspection.
The dispensing area is irradiated by the light source, the original image is collected and pre-processed, the geometric center of the annular bright band is extracted, and the detection line is constructed for continuous detection of 360 degrees to determine the defects or multiple glue defects. The defect type is determined by using the preset interval degree and intersection distance.
It improves detection efficiency and accuracy, reduces the probability of misjudgment or misjudgment, and meets the automation, high efficiency and high precision requirements of industrial inspection.
Smart Images

Figure CN119354970B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of surface defect detection, and in particular, to a method, system, device and medium for detecting colloid defects. Background Art
[0002] In the manufacturing industry, after the dispensing operation is completed, using a vision inspection system to perform real-time inspection and evaluation of the dispensing quality has become an important standard in the modern manufacturing industry. From the assembly of electronic products to the production of automotive parts, the dispensing quality directly affects the reliability and performance of the final product. Therefore, it is crucial to ensure the accuracy and stability of the dispensing process.
[0003] Traditional dispensing defect detection mainly relies on manual visual inspection or simple optical measurement. Although these methods were widely used in the early stage, with the development of technology, their limitations have gradually emerged. First, for the same colloid defect, the judgment results of different workers for this colloid defect may be inconsistent, resulting in deviations in the detection results. In addition, environmental factors such as light changes, cleanliness of the working area, and noise will all interfere with the detection results, easily leading to misjudgment or missed judgment, thus reducing the overall detection accuracy. Summary of the Invention
[0004] In order to improve the detection accuracy of colloid defects, the present application provides a method, system, device and medium for detecting colloid defects.
[0005] In a first aspect, the present application provides a method for detecting colloid defects, adopting the following technical solution:
[0006] A method for detecting colloid defects, characterized by comprising:
[0007] Irradiate the dispensing area of the component to be detected with a light source, and collect the original image corresponding to the dispensing area; there is a circular colloid formed after the dispensing operation in the dispensing area, and the circular colloid includes a circular convex part;
[0008] Perform preprocessing on the original image to obtain a corresponding preprocessed image; the preprocessed image includes a circular bright band corresponding to the circular convex part;
[0009] Fit the circular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the circular bright band;
[0010] Based on the geometric center CC, construct detection lines of the circular bright band according to a preset interval degree as the graduation;
[0011] Perform continuous 360-degree detection on the detection line and the annular bright band according to a preset degree. If there is no intersection between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a glue deficiency defect; both x and y represent degrees, and the difference between x and y is the same as the value corresponding to the preset degree.
[0012] Otherwise, obtain the intersection distance corresponding to the two intersections of the detection line and the annular bright band, and determine whether the intersection distance is greater than a preset distance. When the intersection distance is greater than the preset distance, it is determined as a glue excess defect. When the intersection distance is less than the preset distance, it is determined as a glue shortage defect.
[0013] By adopting the above technical solution, the dispensing area of the component to be detected is irradiated by a light source, and the original image corresponding to the dispensing area is collected. There is an annular colloid formed after the dispensing operation in the dispensing area. The annular colloid includes an annular protrusion. Then, the original image is preprocessed to obtain a corresponding preprocessed image. The preprocessed image includes the annular bright band corresponding to the annular protrusion. Then, the annular bright band is fitted based on the preprocessed image to obtain the geometric center CC corresponding to the annular bright band. Then, based on the geometric center CC, a detection line of the annular bright band is constructed according to a preset interval degree as the division. Then, continuous 360-degree detection is performed on the detection line and the annular bright band according to a preset degree. If there is no intersection between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a glue deficiency defect. Both x and y represent degrees, and the difference between x and y is the same as the value corresponding to the preset degree. If there is an intersection between the detection line and the annular bright band within [x, y] or (x, y), obtain the intersection distance corresponding to the two intersections of the detection line and the annular bright band, and determine whether the intersection distance is greater than a preset distance. When the intersection distance is greater than the preset distance, it is determined as a glue excess defect. When the intersection distance is less than the preset distance, it is determined as a glue shortage defect. Compared with manual visual inspection or simple optical inspection, while improving the detection efficiency, the detection accuracy of colloid defects is improved, the probability of misjudgment or missed judgment is reduced, and the detection requirements of automation, high efficiency, and high accuracy in industrial detection are met.
[0014] Optionally, the step of preprocessing the original image to obtain a corresponding preprocessed image includes:
[0015] Sharpen the original image to obtain image A;
[0016] Blur the original image to obtain image B;
[0017] Mix image A and image B to obtain image C;
[0018] Perform an opening operation on image C to obtain the corresponding preprocessed image.
[0019] By adopting the above technical solution, in order to obtain the corresponding preprocessed image, the original image is sharpened to obtain Image A, then the original image is blurred to obtain Image B, then Image A and Image B are blended to obtain Image C, and finally an opening operation is performed on Image C to obtain the corresponding preprocessed image.
[0020] Optionally, the step of fitting the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band includes:
[0021] Performing contour extraction on the annular bright band according to the preprocessed image to obtain a contour point set corresponding to the annular bright band;
[0022] Screening the contour point set corresponding to the annular bright band according to a preset screening condition to obtain a screened contour point set;
[0023] Merging and unifying the screened contour point set into a pre-fitting point set;
[0024] Fitting the pre-fitting point set to obtain the geometric features of the annular bright band;
[0025] Classifying the pre-fitting point set according to the geometric features to obtain an inner circle point set and an outer circle point set of the annular bright band;
[0026] Fitting the inner circle point set of the annular bright band to obtain the inner circle center of the inner circle fitting circle;
[0027] Fitting the outer circle point set of the annular bright band to obtain the outer circle center of the outer circle fitting circle;
[0028] Determining the geometric center CC of the annular bright band according to the inner circle center and the outer circle center.
[0029] By adopting the above technical solution, in order to obtain the geometric center CC corresponding to the annular bright band, contour extraction is performed on the annular bright band according to the preprocessed image to obtain a contour point set corresponding to the annular bright band, then the contour point set corresponding to the annular bright band is screened according to a preset screening condition to obtain a screened contour point set, then the screened contour point set is merged and unified into a pre-fitting point set, then the pre-fitting point set is fitted to obtain the geometric features of the annular bright band, then the pre-fitting point set is classified according to the geometric features to obtain an inner circle point set and an outer circle point set of the annular bright band, then the inner circle point set of the annular bright band is fitted to obtain the inner circle center of the inner circle fitting circle, and the outer circle point set of the annular bright band is fitted to obtain the outer circle center of the outer circle fitting circle, and finally the geometric center CC of the annular bright band is determined according to the inner circle center and the outer circle center.
[0030] Optionally, after the step of preprocessing the original image to obtain a corresponding preprocessed image, the method further includes:
[0031] Obtain the image center point CA of the preprocessed image, and calculate an offset value based on the image center point CA and the geometric center CC;
[0032] Determine whether the offset value is greater than a preset value. If so, it is determined that the colloid has shifted; if not, it is determined that the colloid has not shifted.
[0033] By adopting the above technical solution, in order to determine whether the colloid has shifted, the image center point CA of the preprocessed image is obtained, the offset value is calculated based on the image center point CA and the geometric center CC, and then it is determined whether the offset value is greater than the preset value. If the offset value is greater than the preset value, it is determined that the colloid has shifted; if the offset value is not greater than the preset value, that is, the offset value is less than or equal to the preset value, it is determined that the colloid has not shifted.
[0034] Optionally, the method further includes:
[0035] Perform image enhancement on the original image to obtain image D;
[0036] Perform smoothing processing on the original image to obtain image E;
[0037] Perform a subtraction operation on image D and image E to obtain image F;
[0038] Perform dynamic threshold segmentation on image F to obtain image G;
[0039] Perform binary threshold processing on image G to obtain image H;
[0040] Perform an addition operation on image G and image H to obtain image I;
[0041] Calculate the width of the annular colloid based on image I.
[0042] By adopting the above technical solution, in order to calculate the width of the annular colloid, first perform image enhancement on the original image to obtain image D, then perform smoothing processing on the original image to obtain image E, then perform a subtraction operation on image D and image E to obtain image F, then perform dynamic threshold segmentation on image F to obtain image G, then perform binary threshold processing on image G to obtain image H, then perform an addition operation on image G and image H to obtain image I, and finally calculate the width of the annular colloid based on image I.
[0043] Optionally, the step of calculating the width of the annular colloid based on image I includes:
[0044] Perform binary processing on the image I to obtain a binary image;
[0045] Generate a set of contour points corresponding to the annular colloid according to the binary image; the set of contour points corresponding to the annular colloid includes an inner circle point set and an outer circle point set of the annular colloid;
[0046] Calculate the width of the annular colloid according to the set of contour points corresponding to the annular colloid.
[0047] By adopting the above technical solution, first perform binary processing on the image I to obtain a binary image, then generate a set of contour points corresponding to the annular colloid according to the binary image, the set of contour points corresponding to the annular colloid includes an inner circle point set and an outer circle point set of the annular colloid, and finally calculate the width of the annular colloid according to the set of contour points corresponding to the annular colloid.
[0048] Optionally, convert the set of contour points corresponding to the annular colloid into a set of physical points corresponding to the annular colloid according to a preset conversion matrix; the preset conversion matrix is used to represent the conversion relationship between the camera coordinate system and the physical coordinate system;
[0049] Calculate the width of the annular colloid according to the set of physical points corresponding to the annular colloid.
[0050] By adopting the above technical solution, first convert the set of contour points corresponding to the annular colloid into a set of physical points corresponding to the annular colloid according to a preset conversion matrix, the preset conversion matrix is used to represent the conversion relationship between the camera coordinate system and the physical coordinate system, and then calculate the width of the annular colloid according to the set of physical points corresponding to the annular colloid.
[0051] In a second aspect, the present application also provides a colloid defect detection system, adopting the following technical solution:
[0052] A colloid defect detection system, comprising:
[0053] An image acquisition module, configured to irradiate a dispensing area of a component to be detected through a light source and acquire an original image corresponding to the dispensing area; there is an annular colloid formed after a dispensing operation in the dispensing area, and the annular colloid includes an annular protrusion;
[0054] A preprocessing module, configured to preprocess the original image to obtain a corresponding preprocessed image; the preprocessed image includes an annular bright band corresponding to the annular protrusion;
[0055] A fitting module, configured to fit the annular bright band according to the preprocessed image to obtain a geometric center CC corresponding to the annular bright band;
[0056] A detection line construction module, configured to construct a detection line of the annular bright band based on the geometric center CC and with a preset interval degree as the division.
[0057] The colloid defect determination module is used to continuously detect the detection line and the annular bright band at 360 degrees according to a preset degree. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a lack of colloid defect; both x and y represent degrees, and the difference between x and y is the same as the value corresponding to the preset degree; otherwise, the intersection distance corresponding to the two intersection points of the detection line and the annular bright band is obtained, and it is determined whether the intersection distance is greater than a preset distance. When the intersection distance is greater than the preset distance, it is determined as a multi-colloid defect, and when the intersection distance is less than the preset distance, it is determined as a lack-of-colloid defect.
[0058] In a third aspect, the present application further provides a computer device, adopting the following technical solution:
[0059] A computer device includes a memory and a processor. A computer program that can run on the processor is stored on the memory. When the processor executes the computer program, the method described in the first aspect is implemented.
[0060] In a fourth aspect, the present application further provides a computer-readable storage medium, adopting the following technical solution:
[0061] A computer-readable storage medium stores a computer program that can be loaded and executed by a processor to implement the method described in the first aspect.
[0062] In summary, the present application at least includes the following beneficial technical effects: By irradiating the dispensing area of the component to be detected with a light source and collecting the original image corresponding to the dispensing area, there is an annular colloid formed after the dispensing operation in the dispensing area, and the annular colloid includes an annular protrusion. Then, the original image is preprocessed to obtain the corresponding preprocessed image, and the preprocessed image contains an annular bright band corresponding to the annular protrusion. Then, the annular bright band is fitted based on the preprocessed image to obtain the geometric center CC corresponding to the annular bright band. Next, based on the geometric center CC, detection lines of the annular bright band are constructed with a preset interval degree as the division. Then, the detection lines and the annular bright band are continuously detected for 360 degrees according to the preset degree. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a lack of glue defect, and the difference between x and y is the same as the value corresponding to the preset degree; if there is an intersection point between the detection line and the annular bright band within [x, y] or (x, y), the intersection distance corresponding to the two intersection points of the detection line and the annular bright band is obtained, and it is determined whether the intersection distance is greater than the preset distance. When the intersection distance is greater than the preset distance, it is determined as a multi-glue defect, and when the intersection distance is less than the preset distance, it is determined as a less-glue defect. Compared with manual visual inspection or simple optical inspection, while improving the detection efficiency, the detection accuracy of colloid defects is improved, the probability of misjudgment or missed judgment is reduced, and the detection requirements of automation, high efficiency, and high precision in industrial detection are met. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is the overall flow schematic diagram of the present application.
[0064] Figure 2 is the image of the annular colloid of the present application.
[0065] Figure 3 is the preprocessed image of the present application including the annular bright band.
[0066] Figure 4 is the image of the annular bright band of the present application.
[0067] Figure 5 is the image for showing the glue width of the annular colloid of the present application.
[0068] Figure 6 is the structural schematic diagram of the system of the present application.
[0069] Figure 7 is the structural block diagram of the computer device of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0070] In order to make the purpose, technical solutions and advantages of the present application clearer, the following is combined with the attached Figure 1-7Examples are provided to further elaborate on this application. It should be understood that the specific examples described herein are for the purpose of explaining this application and not for limiting it.
[0071] An embodiment of this application discloses a method for detecting colloid defects.
[0072] Refer to Figure 1 , a method for detecting colloid defects, including:
[0073] Step S11: Irradiate the dispensing area of the component to be detected with a light source and collect the original image corresponding to the dispensing area.
[0074] Among them, refer to Figure 2 , there is an annular colloid formed after the dispensing operation in the dispensing area, and the annular colloid includes an annular convex part.
[0075] It can be understood that in step S11, after dispensing, an appropriate light source will be selected to irradiate the dispensing area of the component to be detected according to the type and properties of the glue. For example, when the glue is a liquid high-transparency UV glue, a mixed industrial light source of blue and red is selected. The blue light has weak penetrability and is more suitable for detecting transparent products. At the same time, the red light is used to enhance the contrast to better highlight the real colloid.
[0076] Step S12: Preprocess the original image to obtain the corresponding preprocessed image.
[0077] Among them, refer to Figure 3 and Figure 4 , the preprocessed image includes an annular bright band corresponding to the annular convex part.
[0078] Step S13: Fit the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band.
[0079] Step S14: Based on the geometric center CC, construct detection lines for the annular bright band according to a preset interval degree as the division degree.
[0080] It can be understood that the preset interval degree can be set according to the actual situation, and the specific value of the preset interval degree should be within the interval of (0, 360), such as 1 degree, 2 degrees or 5 degrees. Taking the preset interval degree as 1 degree as an example, then every 1 degree interval, 1 detection line will be constructed, and during the detection process of the entire colloid, the total number of constructed detection lines is 360.
[0081] Step S15: Continuously detect the detection lines and the annular bright band for 360 degrees according to the preset degree. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a glue shortage defect;
[0082] Wherein, both x and y represent degrees, and the difference between x and y is the same as the value corresponding to the preset degree.
[0083] It can be understood that the preset degree is greater than the preset interval degree. The specific value of the preset degree can be set according to the actual situation, such as 10 degrees, 20 degrees or 30 degrees. [x, y] or (x, y) is used to represent the continuous degree range corresponding to the preset degree, as long as the difference between the two end values of this degree range is the value corresponding to the preset degree. Taking the preset degree of 10 degrees as an example, during the detection process, as long as there is no intersection between the detection line and the annular bright band within the degree range of [x, x + 10] or (x, x + 10), it is determined as a glue shortage defect. x is a dynamic value, and [x, x + 10] or (x, x + 10) is the preset degree range corresponding to the preset degree. At this time, the difference between the two end values of this preset degree range is 10; Figure 3 and Figure 4 The corresponding defect is a glue shortage defect.
[0084] Step S16, otherwise, obtain the intersection distance corresponding to the two intersections of the detection line and the annular bright band, and determine whether the intersection distance is greater than the preset distance. When the intersection distance is greater than the preset distance, it is determined as a glue excess defect. When the intersection distance is less than the preset distance, it is determined as a glue shortage defect.
[0085] Specifically, if there is an intersection between the detection line and the annular bright band within [x, y] or (x, y), obtain the intersection distance corresponding to the two intersections of the detection line and the annular bright band, and determine whether the intersection distance is greater than the preset distance. When the intersection distance is greater than the preset distance, it is determined as a glue excess defect. When the intersection distance is less than the preset distance, it is determined as a glue shortage defect.
[0086] It should be noted that when there is exactly one intersection between the detection line and the annular bright band, it is regarded as the two intersections coinciding, and at this time the intersection distance is 0.
[0087] In the above embodiment, the dispensing area of the component to be detected is irradiated by a light source, and the original image corresponding to the dispensing area is collected. There is an annular colloid formed after the dispensing operation in the dispensing area. The annular colloid includes an annular protrusion. Then, the original image is preprocessed to obtain a corresponding preprocessed image. The preprocessed image includes an annular bright band corresponding to the annular protrusion. Then, the annular bright band is fitted based on the preprocessed image to obtain the geometric center CC corresponding to the annular bright band. Then, based on the geometric center CC, detection lines of the annular bright band are constructed with a preset interval degree as the graduation. Then, continuous 360-degree detection is performed on the detection lines and the annular bright band according to a preset degree. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a lack-of-glue defect, and the difference between x and y is the same as the value corresponding to the preset degree. If there is an intersection point between the detection line and the annular bright band within [x, y] or (x, y), the intersection distance corresponding to the two intersection points of the detection line and the annular bright band is obtained, and it is determined whether the intersection distance is greater than a preset distance. When the intersection distance is greater than the preset distance, it is determined as a multi-glue defect. When the intersection distance is less than the preset distance, it is determined as a less-glue defect. Compared with manual visual inspection or simple optical inspection, while improving the detection efficiency, the detection accuracy of colloid defects is improved, the probability of misjudgment or missed judgment is reduced, and the detection requirements of automation, high efficiency, and high precision in industrial inspection are met.
[0088] As a further embodiment of the method, the step of preprocessing the original image to obtain a corresponding preprocessed image includes:
[0089] Step S21: Sharpen the original image to obtain image A.
[0090] It should be noted that in step S11, the image is sharpened by an image sharpening operator to improve the contrast of the image.
[0091] Step S22: Blur the original image to obtain image B.
[0092] Step S23: Mix image A and image B to obtain image C.
[0093] Step S24: Perform an opening operation on image C to obtain a corresponding preprocessed image.
[0094] Specifically, perform an erosion operation on image C to obtain a corresponding erosion image; perform a dilation operation on the erosion image to obtain a corresponding preprocessed image.
[0095] In the above-described embodiment, in order to obtain the corresponding preprocessed image, the original image is sharpened to obtain Image A, then the original image is blurred to obtain Image B, then Image A and Image B are blended to obtain Image C, and finally Image C is subjected to an opening operation to obtain the corresponding preprocessed image.
[0096] As a further embodiment of the method, the step of fitting the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band includes:
[0097] Step S31: Extract the contour of the annular bright band from the preprocessed image to obtain the contour point set corresponding to the annular bright band.
[0098] Step S32: Screen the contour point set corresponding to the annular bright band according to the preset screening conditions to obtain the screened contour point set.
[0099] It should be noted that the screening parameters for the contour point set include one or more of the number of points in the contour point set, the size corresponding to the contour, and the characteristic size ratio corresponding to the contour.
[0100] Step S33: Merge and unify the screened contour point sets into a pre-fitting point set.
[0101] Step S34: Fit the pre-fitting point set to obtain the geometric features of the annular bright band.
[0102] It should be noted that in this embodiment, the pre-fitting point set is fitted by the least squares method to obtain the geometric features of the annular bright band.
[0103] Step S35: Classify the pre-fitting point set according to the geometric features to obtain the inner circle point set and the outer circle point set of the annular bright band.
[0104] Step S36: Fit the inner circle point set of the annular bright band to obtain the inner circle center of the inner circle fitting circle.
[0105] Step S37: Fit the outer circle point set of the annular bright band to obtain the outer circle center of the outer circle fitting circle.
[0106] Step S38: Determine the geometric center CC of the annular bright band according to the inner circle center and the outer circle center.
[0107] It can be understood that the geometric center CC of the annular bright band can be regarded as the inner circle center of the inner circle fitting circle or the outer circle center of the outer circle fitting circle.
[0108] In the above embodiments, in order to obtain the geometric center CC corresponding to the annular bright band, the contour of the annular bright band is extracted from the preprocessed image to obtain the contour point set corresponding to the annular bright band. Then, the contour point set corresponding to the annular bright band is screened according to the preset screening conditions to obtain the screened contour point set. Next, the screened contour point set is merged and unified into a pre-fitting point set, and then the pre-fitting point set is fitted to obtain the geometric features of the annular bright band. Then, the pre-fitting point set is classified according to the geometric features to obtain the inner circle point set and the outer circle point set of the annular bright band. Then, the inner circle point set of the annular bright band is fitted to obtain the inner circle center of the inner circle fitting circle, and the outer circle point set of the annular bright band is fitted to obtain the outer circle center of the outer circle fitting circle. Finally, the geometric center CC of the annular bright band is determined according to the inner circle center and the outer circle center.
[0109] As a further embodiment of the method, after the step of preprocessing the original image to obtain the corresponding preprocessed image, the method further includes:
[0110] Step S41, obtaining the image center point CA of the preprocessed image, and calculating the offset value according to the image center point CA and the geometric center CC.
[0111] Step S42, determining whether the offset value is greater than a preset value. If so, it is determined that the colloid has shifted; if not, it is determined that the colloid has not shifted.
[0112] Specifically, it is determined whether the offset value is greater than a preset value. If the offset value is greater than the preset value, it is determined that the colloid has shifted; if the offset value is not greater than the preset value, that is, the offset value is less than or equal to the preset value, it is determined that the colloid has not shifted.
[0113] In the above embodiments, in order to determine whether the colloid has shifted, the image center point CA of the preprocessed image is obtained, and the offset value is calculated according to the image center point CA and the geometric center CC. Then, it is determined whether the offset value is greater than a preset value. If the offset value is greater than the preset value, it is determined that the colloid has shifted; if the offset value is not greater than the preset value, that is, the offset value is less than or equal to the preset value, it is determined that the colloid has not shifted.
[0114] As a further embodiment of the method, the method further includes:
[0115] Step S51, performing image enhancement on the original image to obtain image D.
[0116] Step S52, performing smoothing processing on the original image to obtain image E.
[0117] Step S53, performing a subtraction operation on image D and image E to obtain image F.
[0118] Step S54, performing dynamic threshold segmentation on image F to obtain image G.
[0119] Step S55: Perform binary thresholding on image G to obtain image H.
[0120] Step S56: Perform an addition operation on image G and image H to obtain image I.
[0121] Step S57: Calculate the width of the annular colloid based on image I.
[0122] In the above embodiment, in order to calculate the width of the annular colloid, first perform image enhancement on the original image to obtain image D, then perform smoothing processing on the original image to obtain image E, then perform a subtraction operation on image D and image E to obtain image F, then perform dynamic threshold segmentation on image F to obtain image G, then perform binary thresholding on image G to obtain image H, then perform an addition operation on image G and image H to obtain image I, and finally calculate the width of the annular colloid based on image I.
[0123] As a further embodiment of the method, the step of calculating the width of the annular colloid based on image I includes:
[0124] Step S61: Perform binary processing on image I to obtain a binary image.
[0125] Step S62: Generate a set of contour points corresponding to the annular colloid based on the binary image.
[0126] Among them, the set of contour points corresponding to the annular colloid includes the inner circle point set and the outer circle point set of the annular colloid.
[0127] It should be noted that referring to Figure 5 , the inner circle point set of the annular colloid corresponds to Figure 5 the red area in Figure 5 ; the inner circle point set of the annular colloid corresponds to
[0128] the purple area in
[0129] The annular colloid includes an annular bright band, and the annular bright band corresponds to the annular convex part of the annular colloid. Therefore, the colloid width of the annular colloid is greater than the ring width corresponding to the annular bright band.
[0130] As a further embodiment of the method, the step of calculating the width of the annular colloid based on the set of contour points corresponding to the annular colloid includes:
[0131] Step S71: Convert the contour point set corresponding to the annular colloid into the physical point set corresponding to the annular colloid according to a preset conversion matrix.
[0132] The preset conversion matrix is used to represent the conversion relationship between the camera coordinate system and the physical coordinate system.
[0133] It should be noted that the preset conversion matrix is obtained through pre-calibration, that is, calibration and establishment of the motion axis of the machine platform and the glue-type camera for detection; the preset conversion matrix is used to represent the conversion relationship between the physical coordinate system of the machine platform and the camera coordinate system of the detection camera.
[0134] Step S72: Calculate the width of the annular colloid according to the physical point set corresponding to the annular colloid.
[0135] In the above implementation, first convert the contour point set corresponding to the annular colloid into the physical point set corresponding to the annular colloid according to the preset conversion matrix, where the preset conversion matrix is used to represent the conversion relationship between the camera coordinate system and the physical coordinate system, and then calculate the width of the annular colloid according to the physical point set corresponding to the annular colloid.
[0136] The embodiment of the present application also discloses a colloid defect detection system.
[0137] Reference Figure 6 , a colloid defect detection system, including:
[0138] An image acquisition module, configured to irradiate the dispensing area of the component to be detected through a light source and acquire the original image corresponding to the dispensing area; there is an annular colloid formed after the dispensing operation in the dispensing area, and the annular colloid includes an annular convex part;
[0139] A preprocessing module, configured to preprocess the original image to obtain a corresponding preprocessed image; the preprocessed image includes an annular bright band corresponding to the annular convex part;
[0140] A fitting module, configured to fit the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band;
[0141] A detection line construction module, configured to construct the detection line of the annular bright band based on the geometric center CC and at intervals of a preset angular degree as the division;
[0142] The colloid defect determination module is used to continuously detect the detection line and the annular bright band at 360 degrees according to a preset degree. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a colloid deficiency defect; both x and y represent degrees, and the difference between x and y is the same as the value corresponding to the preset degree; otherwise, the intersection distance corresponding to the two intersection points of the detection line and the annular bright band is obtained, and it is determined whether the intersection distance is greater than a preset distance. When the intersection distance is greater than the preset distance, it is determined as a multi-colloid defect, and when the intersection distance is less than the preset distance, it is determined as a less-colloid defect.
[0143] The colloid defect detection method of the present invention can implement any one of the methods in the colloid defect detection system, and the specific working process of the colloid defect detection method of the present invention can refer to the corresponding process in the above-mentioned colloid defect detection system.
[0144] The embodiment of the present application also discloses a computer device.
[0145] Reference Figure 7 , a computer device includes a memory and a processor. A computer program that can run on the processor is stored on the memory. When the processor executes the computer program, it implements any one of the above-mentioned colloid defect detection methods.
[0146] The embodiment of the present application also discloses a computer-readable storage medium.
[0147] A computer-readable storage medium stores a computer program that can be loaded and executed by a processor to implement any one of the above-mentioned colloid defect detection methods.
[0148] Among them, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or device; the program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0149] The above are all the preferred embodiments of the present application. The protection scope of the present application is not limited by this. Any feature disclosed in this specification (including the abstract and drawings), unless specifically described, can be replaced by other equivalent or similar-purpose alternative features. That is, unless specifically described, each feature is only an example in a series of equivalent or similar features.
Claims
1. A method for detecting colloid defects, characterized in that, Including: Irradiate the dispensing area of the component to be detected by a light source, and collect the original image corresponding to the dispensing area; there is an annular colloid formed after the dispensing operation in the dispensing area, and the annular colloid includes an annular convex part; Preprocess the original image to obtain the corresponding preprocessed image; The preprocessed image includes an annular bright band corresponding to the annular convex part; Fit the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band; Based on the geometric center CC, construct the detection line of the annular bright band according to the preset interval degrees as the division; Perform continuous 360-degree detection on the detection line and the annular bright band according to the preset degrees. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a glue shortage defect; both x and y represent degrees, and the difference between x and y is the same as the value corresponding to the preset degrees; Otherwise, obtain the intersection distance corresponding to the two intersection points of the detection line and the annular bright band, and determine whether the intersection distance is greater than the preset distance. When the intersection distance is greater than the preset distance, it is determined as a glue excess defect. When the intersection distance is less than the preset distance, it is determined as a glue shortage defect.
2. The colloidal defect detection method according to claim 1, wherein The step of preprocessing the original image to obtain the corresponding preprocessed image includes: Sharpen the original image to obtain image A; Blur the original image to obtain image B; Perform a mixing process on image A and image B to obtain image C; Perform an opening operation on image C to obtain the corresponding preprocessed image.
3. A method for detecting colloidal defects according to claim 1, characterized in that, The step of fitting the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band includes: Extract the contour of the annular bright band according to the preprocessed image to obtain the contour point set corresponding to the annular bright band; Screen the contour point set corresponding to the annular bright band according to the preset screening conditions to obtain the screened contour point set; Merge and unify the screened contour point set into a pre-fitting point set; Fit the pre-fitting point set to obtain the geometric features of the annular bright band; Classify the pre-fitting point set according to the geometric features to obtain the inner circle point set and the outer circle point set of the annular bright band; Fit the inner circle point set of the annular bright band to obtain the inner circle center corresponding to the inner circle fitting circle; Fit the outer circle point set of the annular bright band to obtain the outer circle center corresponding to the outer circle fitting circle; Determine the geometric center CC of the annular bright band according to the inner circle center and the outer circle center.
4. A method for detecting colloidal defects according to claim 1, characterized in that, After the step of preprocessing the original image to obtain the corresponding preprocessed image, it further includes: Obtain the image center point CA of the preprocessed image, and calculate the offset value according to the image center point CA and the geometric center CC; Determine whether the offset value is greater than the preset value. If so, it is determined that the colloid has shifted. If not, it is determined that the colloid has not shifted.
5. A method for detecting colloid defects according to claim 1, characterized in that, The method further includes: Perform image enhancement on the original image to obtain image D; Smooth the original image to obtain image E; Perform a subtraction operation on image D and image E to obtain image F; Perform dynamic threshold segmentation on image F to obtain image G; Perform binary threshold processing on image G to obtain image H; Perform an addition operation on image G and image H to obtain image I; Calculate the width of the annular colloid according to image I.
6. The colloidal defect detection method according to claim 5, wherein The step of calculating the width of the annular colloid according to image I includes: Perform binary processing on image I to obtain a binary image; Generate a contour point set corresponding to the annular colloid according to the binary image; the contour point set corresponding to the annular colloid includes an inner circle point set and an outer circle point set of the annular colloid; Calculate the width of the annular colloid according to the contour point set corresponding to the annular colloid.
7. A method for detecting colloid defects according to claim 1, characterized in that, The step of calculating the width of the annular colloid according to the contour point set corresponding to the annular colloid includes: Convert the contour point set corresponding to the annular colloid into a physical point set corresponding to the annular colloid according to a preset conversion matrix; the preset conversion matrix is used to represent the conversion relationship between the camera coordinate system and the physical coordinate system; Calculate the width of the annular colloid according to the physical point set corresponding to the annular colloid.
8. A colloidal defect detection system, characterized in that, It includes: An image acquisition module, configured to irradiate a dispensing area of a component to be detected with a light source and acquire an original image corresponding to the dispensing area; there is an annular colloid formed after a dispensing operation in the dispensing area, and the annular colloid includes an annular convex part; A preprocessing module, configured to preprocess the original image to obtain a corresponding preprocessed image; The preprocessed image includes an annular bright band corresponding to the annular convex part; A fitting module, configured to fit the annular bright band according to the preprocessed image to obtain a geometric center CC corresponding to the annular bright band; A detection line construction module, configured to construct detection lines of the annular bright band based on the geometric center CC and at intervals of a preset number of degrees; A colloid defect determination module, configured to continuously detect the detection lines and the annular bright band by 360 degrees according to a preset number of degrees. If there is no intersection point between the detection line and the annular bright band within [x, y] or (x, y), it is determined as a glue shortage defect; both x and y represent the number of degrees, and the difference between x and y is the same as the value corresponding to the preset number of degrees; otherwise, obtain the intersection distance corresponding to the two intersection points of the detection line and the annular bright band, and determine whether the intersection distance is greater than a preset distance. When the intersection distance is greater than the preset distance, it is determined as a glue excess defect, and when the intersection distance is less than the preset distance, it is determined as a glue shortage defect.
9. A computer device, characterized in that, It includes a memory and a processor. A computer program that can run on the processor is stored on the memory. When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that, A computer program that can be loaded and executed by a processor and implements the method according to any one of claims 1 to 7 is stored.
Citation Information
Patent Citations
Dispensing defect detection method, device and equipment of circuit board and storage medium
CN115937056A
KR20220067983A