Colloid defect detection method, system, equipment and medium
Through light source irradiation and image processing technology, annular bright bands are extracted and fitted for detection, which solves the problem of low accuracy of traditional dispensing defect detection and achieves efficient and accurate colloid defect detection.
Patent Information
- Application Number
- CN202411377738.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Traditional dispensing defect detection relies on manual visual inspection or simple optical measurement, which has problems such as inconsistent detection results, interference from environmental factors, misjudgment or misjudgment, resulting in low detection accuracy.
Through the light source to detect the point of the component, collect the original images, and perform pre -processing to extract the ring -shaped bright belt, fit the geometric center CC, build a test line, perform 360 -degree continuous testing, determine lack of glue, multi -glue or less glue defect.
It improves the accuracy of colloid defect detection, reduces the probability of misjudgment or missed judgment, and meets the needs of automation, high efficiency, and high precision in industrial testing.
Smart Images

Figure CN119354970A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of surface defect detection, and in particular to a colloid defect detection method, system, equipment and medium. Background Art
[0002] In the manufacturing industry, after the dispensing operation is completed, the use of visual inspection systems to conduct 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, so 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 have been widely used in the early days, their limitations have gradually emerged with the development of technology. First, for the same colloid defect, different staff may have different judgments on the colloid defect, resulting in deviations in the detection results. In addition, environmental factors such as light changes, cleanliness of the work area, and noise will interfere with the detection results, easily leading to misjudgment or missed judgment, thereby 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 colloid defect detection method, system, equipment and medium.
[0005] In the first aspect, the present application provides a method for detecting colloid defects, which adopts the following technical solution:
[0006] A colloid defect detection method, characterized by comprising:
[0007] The glue dispensing area of the component to be inspected is illuminated by a light source, and an original image corresponding to the glue dispensing area is collected; the glue dispensing area has an annular colloid formed after the glue dispensing operation, and the annular colloid includes an annular convex portion;
[0008] Preprocessing the original image to obtain a corresponding preprocessed image; the preprocessed image includes an annular bright band corresponding to the annular raised portion;
[0009] Fitting the annular bright band according to the preprocessed image to obtain a geometric center CC corresponding to the annular bright band;
[0010] Based on the geometric center CC, a detection line of the annular bright band is constructed according to a preset interval degree;
[0011] The detection line and the annular bright band are continuously detected for 360 degrees according to a preset degree. If there is no intersection between the detection line and the annular bright band in [x, y] or (x, y), it is determined to be 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 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 to be a multiple glue defect; when the intersection distance is less than the preset distance, it is determined to be a insufficient glue defect.
[0013] By adopting the above technical solution, a light source is used to illuminate the glue dispensing area of the component to be inspected, and an original image corresponding to the glue dispensing area is collected. There is an annular colloid formed after the glue dispensing operation in the glue dispensing area, and the annular colloid includes an annular convex portion. Then, the original image is preprocessed to obtain a corresponding preprocessed image. The preprocessed image includes an annular bright band corresponding to the annular convex portion. Then, the annular bright band is fitted according to 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. Then, according to the preset degree, a detection line of the annular bright band is constructed. The detection line and the annular bright band are continuously tested for 360 degrees. If there is no intersection between the detection line and the annular bright band in [x, y] or (x, y), it is judged as a lack of glue 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 the detection line and the annular bright band have an intersection in [x, y] or (x, y), the intersection distance corresponding to the two intersections 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 judged as a multi-glue defect. When the intersection distance is less than the preset distance, it is judged as a lack of glue defect. Compared with manual visual inspection or simple optical inspection, while improving the inspection efficiency, it also improves the detection accuracy of colloid defects, reduces the probability of misjudgment or missed judgment, and meets the detection requirements of automation, high efficiency and high precision in industrial inspection.
[0014] Optionally, the step of preprocessing the original image to obtain a corresponding preprocessed image includes:
[0015] Performing sharpening processing on the original image to obtain image A;
[0016] Performing blur processing on the original image to obtain image B;
[0017] Mixing the image A and the image B to obtain an image C;
[0018] An opening operation is performed on the image C to obtain a 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, and then the original image is blurred to obtain image B, and then image A and image B are mixed to obtain image C, and finally image C is opened to obtain the corresponding preprocessed image.
[0020] Optionally, the step of fitting the annular bright band according to the preprocessed image to obtain a geometric center CC corresponding to the annular bright band includes:
[0021] Extracting the contour of the annular bright band according to the preprocessed image to obtain a contour point set corresponding to the annular bright band;
[0022] 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;
[0023] The screened contour point sets are unified into a pre-fitting point set;
[0024] Fitting the pre-fitted point set to obtain geometric features of the annular bright band;
[0025] Classifying the pre-fitted 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 corresponding to the inner circle fitting circle;
[0027] Fitting the outer circle point set of the annular bright band to obtain the outer circle center corresponding to the outer circle fitting circle;
[0028] The geometric center CC of the annular bright band is determined according to the center of the inner circle and the center of the outer circle.
[0029] By adopting the above technical scheme, in order to obtain the geometric center CC corresponding to the annular bright band, the contour of the annular bright band is extracted according to the preprocessed image to obtain the contour point set corresponding to the annular bright band, and then the contour point set corresponding to the annular bright band is screened according to the preset screening condition to obtain the screened contour point set, and then 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, and 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, and then the inner circle point set of the annular bright band is fitted to obtain the inner circle center corresponding to the inner circle fitting circle, and the outer circle point set of the annular bright band is fitted to obtain the outer circle center corresponding to 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] Acquire an image center point CA of the preprocessed image, and calculate an offset value according to the image center point CA and the geometric center CC;
[0032] It is determined whether the offset value is greater than a preset value. If so, it is determined that the colloid has been offset. If not, it is determined that the colloid has not been offset.
[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, and 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 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.
[0034] Optionally, the method further includes:
[0035] Performing image enhancement on the original image to obtain image D;
[0036] Performing smoothing on the original image to obtain image E;
[0037] Performing an image subtraction operation on the image D and the image E to obtain an image F;
[0038] Performing dynamic threshold segmentation on the image F to obtain image G;
[0039] Performing binary threshold processing on the image G to obtain an image H;
[0040] Performing an image addition operation on the image G and the image H to obtain an image I;
[0041] The width of the annular colloid is calculated according to the image I.
[0042] By adopting the above technical solution, in order to calculate the width of the annular colloid, the original image is first enhanced to obtain image D, and then the original image is smoothed to obtain image E, and then image D and image E are subtracted to obtain image F, and then image F is dynamically segmented to obtain image G, and then image G is processed by binary threshold to obtain image H, and then image G and image H are added to obtain image I, and finally the width of the annular colloid is calculated according to image I.
[0043] Optionally, the step of calculating the width of the annular colloid according to the image I includes:
[0044] Performing binary processing on the image I to obtain a binary image;
[0045] 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;
[0046] The width of the annular colloid is calculated according to the contour point set corresponding to the annular colloid.
[0047] By adopting the above technical solution, the image I is firstly binary processed to obtain a binary image, and then a contour point set corresponding to the annular colloid is generated 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. Finally, the width of the annular colloid is calculated according to the contour point set corresponding to the annular colloid.
[0048] Optionally, the contour point set corresponding to the annular colloid is converted into the 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;
[0049] The width of the annular colloid is calculated according to the physical point set corresponding to the annular colloid.
[0050] By adopting the above technical solution, the contour point set corresponding to the annular colloid is first converted into the physical point set corresponding to the annular colloid according to a preset transformation matrix, and the preset transformation matrix is used to represent the transformation relationship between the camera coordinate system and the physical coordinate system, and then the width of the annular colloid is calculated according to the physical point set corresponding to the annular colloid.
[0051] In the second aspect, the present application also provides a colloid defect detection system, which adopts the following technical solution:
[0052] A colloid defect detection system, comprising:
[0053] An image acquisition module is used to illuminate the glue dispensing area of the component to be inspected through a light source and collect an original image corresponding to the glue dispensing area; the glue dispensing area has an annular colloid formed after the glue dispensing operation, and the annular colloid includes an annular convex portion;
[0054] A preprocessing module, used for preprocessing the original image to obtain a corresponding preprocessed image; the preprocessed image includes an annular bright band corresponding to the annular raised portion;
[0055] A fitting module, used for fitting 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, used to construct a detection line of the annular bright band based on the geometric center CC and according to a preset interval degree;
[0057] The colloid defect determination module is used to perform 360-degree continuous 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 in [x, y] or (x, y), it is determined to be a glue deficiency defect; the x and y both represent degrees, and the difference between the x and y is the same as the value corresponding to the preset degree; otherwise, the intersection distance corresponding to the two intersections 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 to be a glue excess defect, and when the intersection distance is less than the preset distance, it is determined to be a glue deficiency defect.
[0058] In a third aspect, the present application also provides a computer device, which adopts the following technical solution:
[0059] A computer device comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described in the first aspect when executing the computer program.
[0060] In a fourth aspect, the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0061] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method described in the first aspect.
[0062] In summary, the present application includes at least the following beneficial technical effects: irradiating the glue dispensing area of the component to be inspected with a light source, and collecting the original image corresponding to the glue dispensing area, there is an annular colloid formed after the glue dispensing operation in the glue dispensing area, and the annular colloid includes an annular convex portion, and then preprocessing the original image to obtain a corresponding preprocessed image, the preprocessed image includes an annular bright band corresponding to the annular convex portion, and then fitting the annular bright band according to the preprocessed image to obtain the geometric center CC corresponding to the annular bright band, and then based on the geometric center CC, and according to the preset interval degree as the division to construct the detection of the annular bright band Line, then perform 360-degree continuous inspection on the inspection line and the annular bright band according to the preset degree. If there is no intersection between the inspection line and the annular bright band in [x, y] or (x, y), it is judged 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 between the inspection line and the annular bright band in [x, y] or (x, y), obtain the intersection distance corresponding to the two intersections of the inspection line and the annular bright band, and judge whether the intersection distance is greater than the preset distance. When the intersection distance is greater than the preset distance, it is judged as a multi-glue defect, and when the intersection distance is less than the preset distance, it is judged as a lack of glue defect. Compared with manual visual inspection or simple optical inspection, while improving the inspection efficiency, it also improves the detection accuracy of colloid defects, reduces the probability of misjudgment or missed judgment, and meets the detection requirements of automation, high efficiency and high precision in industrial inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a schematic diagram of the overall process of this application.
[0064] Figure 2 is an image of a ring-shaped colloid of the present application.
[0065] Figure 3 It is the pre-processed image of this application containing a ring-shaped bright band.
[0066] Figure 4 It is an image of the annular bright band of this application.
[0067] Figure 5 This is an image of the present application showing the width of a ring-shaped colloid.
[0068] Figure 6 It is a schematic diagram of the structure of the system of this application.
[0069] Figure 7 It is a structural block diagram of the computer device of the present application. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-7It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] The embodiment of the present application discloses a colloid defect detection method.
[0072] Reference Figure 1 , a colloid defect detection method, comprising:
[0073] Step S11, irradiating the glue-dispensing area of the component to be inspected with a light source, and collecting an original image corresponding to the glue-dispensing area.
[0074] Among them, reference Figure 2 There is an annular colloid formed in the dispensing area after the dispensing operation, and the annular colloid includes an annular protrusion.
[0075] It can be understood that in step S11, after the glue is dispensed, an appropriate light source will be selected to illuminate the glue dispensing area of the component to be inspected according to the type and properties of the glue. For example, when the glue is a liquid highly transparent UV glue, a mixed industrial light source of blue and red is selected. The blue light has weaker penetration and is more suitable for detecting transparent products. At the same time, the red light is used to improve the contrast, so as to better highlight the real colloid.
[0076] Step S12, preprocessing the original image to obtain a corresponding preprocessed image.
[0077] Among them, reference Figure 3 and Figure 4 , the preprocessed image contains a ring-shaped bright band corresponding to the ring-shaped bulge.
[0078] Step S13, fitting 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, and according to the preset interval degree, a detection line of the annular bright band is constructed.
[0080] It can be understood that the preset interval degree can be set according to actual conditions, and the specific value of the preset interval degree should be in the range of (0,360), such as 1 degree, 2 degrees or 5 degrees. Taking the preset interval degree as 1 degree as an example, then for every 1 degree interval, 1 detection line will be constructed. In the entire colloid detection process, the total number of detection lines constructed is 360.
[0081] Step S15, performing 360-degree continuous 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 to be a glue deficiency defect;
[0082] Wherein, x and y both 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, and 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 endpoint values of the 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 the detection line and the annular bright band do not have an intersection within the degree range of [x, x+10] or (x, x+10), it is determined to be a glue defect, x is a dynamic value, [x, x+10] or (x, x+10) is the preset degree range corresponding to the preset degree, and the difference between the two endpoint values of the preset degree range is 10; Figure 3 and Figure 4 The corresponding defect is glue deficiency.
[0084] Step S16, 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 to be a multiple glue defect; when the intersection distance is less than the preset distance, it is determined to be a insufficient glue defect.
[0085] Specifically, if the detection line and the annular bright band have an intersection in [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 judged as a multiple glue defect; when the intersection distance is less than the preset distance, it is judged as a less glue defect.
[0086] It should be noted that when the detection line and the annular bright band have only one intersection point, the two intersection points are regarded as overlapping, and the intersection distance is 0 at this time.
[0087] In the above embodiment, a light source is used to illuminate the glue spotting area of the component to be detected, and an original image corresponding to the glue spotting area is collected. There is an annular colloid formed after the glue spotting operation in the glue spotting area, and the annular colloid includes an annular convex portion. Then, the original image is preprocessed to obtain a corresponding preprocessed image. The preprocessed image includes an annular bright band corresponding to the annular convex portion. Then, the annular bright band is fitted according to 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. Then, according to The detection line and the annular bright band are continuously detected for 360 degrees at a preset degree. If there is no intersection between the detection line and the annular bright band in [x, y] or (x, y), it is determined to be a glue-deficient defect, 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 in [x, y] or (x, y), the intersection distance corresponding to the two intersections 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 to be a multiple glue defect, and when the intersection distance is less than the preset distance, it is determined to be a low glue defect. Compared with manual visual inspection or simple optical inspection, while improving the inspection efficiency, it also improves the detection accuracy of colloid defects, reduces the probability of misjudgment or missed judgment, and meets the detection requirements of automation, high efficiency, and high precision in industrial inspection.
[0088] As a further implementation of the method, the step of preprocessing the original image to obtain a corresponding preprocessed image includes:
[0089] Step S21, sharpening the original image to obtain image A.
[0090] It should be noted that, in step S11, a sharpening process is performed by using an image sharpening operator to improve the contrast of the image.
[0091] Step S22, blurring the original image to obtain image B.
[0092] Step S23, mixing image A and image B to obtain image C.
[0093] Step S24, performing an opening operation on the image C to obtain a corresponding preprocessed image.
[0094] Specifically, an erosion operation is performed on the image C to obtain a corresponding eroded image; and an expansion operation is performed on the eroded image to obtain a corresponding preprocessed image.
[0095] In the above embodiment, in order to obtain the corresponding preprocessed image, the original image is sharpened to obtain image A, and then the original image is blurred to obtain image B, and then image A and image B are mixed to obtain image C, and finally image C is opened to obtain the corresponding preprocessed image.
[0096] As a further implementation 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, extracting the contour of the annular bright band according to the preprocessed image to obtain a contour point set corresponding to the annular bright band.
[0098] Step S32, filtering the contour point set corresponding to the annular bright band according to a preset filtering condition to obtain a filtered 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 ratio of the characteristic size corresponding to the contour.
[0100] Step S33: The screened contour point sets are unified into a pre-fitting point set.
[0101] Step S34, fitting the pre-fitted point set to obtain the geometric features of the annular bright band.
[0102] It should be noted that, in this embodiment, the pre-fitted point set is fitted by the least square method to obtain the geometric features of the annular bright band.
[0103] Step S35, classifying the pre-fitted 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, fitting the inner circle point set of the annular bright band to obtain the inner circle center corresponding to the inner circle fitting circle.
[0105] Step S37, fitting the outer circle point set of the annular bright band to obtain the outer circle center corresponding to the outer circle fitting circle.
[0106] Step S38, determining the geometric center CC of the annular bright band according to the center of the inner circle and the center of the outer circle.
[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, and can also be regarded as the outer circle center of the outer circle fitting circle.
[0108] In the above embodiment, in order to obtain the geometric center CC corresponding to the annular bright band, the contour of the annular bright band is extracted according to the preprocessed image to obtain the contour point set corresponding to the annular bright band, and then the contour point set corresponding to the annular bright band is screened according to the preset screening condition to obtain the screened contour point set, and then the screened contour point set is merged 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, and 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, and then the inner circle point set of the annular bright band is fitted to obtain the inner circle center corresponding to the inner circle fitting circle, and the outer circle point set of the annular bright band is fitted to obtain the outer circle center corresponding to 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.
[0109] As a further implementation 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, determining that the colloid has been offset, if not, determining that the colloid has not been offset.
[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 been offset. 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 been offset.
[0113] In the above embodiment, in order to determine whether the colloid is offset, the image center point CA of the preprocessed image is obtained, and 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 a preset value. If the offset value is greater than the preset value, it is determined that the colloid is offset. 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 is not offset.
[0114] As a further embodiment of the method, the method further comprises:
[0115] Step S51, performing image enhancement on the original image to obtain image D.
[0116] Step S52, smoothing the original image to obtain image E.
[0117] Step S53: performing an image 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, performing binary threshold processing on image G to obtain image H.
[0120] Step S56, performing image addition operation on image G and image H to obtain image I.
[0121] Step S57, calculating the width of the annular colloid according to the image I.
[0122] In the above embodiment, in order to calculate the width of the annular colloid, the original image is first enhanced to obtain image D, and then the original image is smoothed to obtain image E, and then image D and image E are subtracted to obtain image F, and then image F is segmented by dynamic threshold to obtain image G, and then image G is processed by binary threshold to obtain image H, and then image G and image H are added to obtain image I, and finally the width of the annular colloid is calculated according to image I.
[0123] As a further embodiment of the method, the step of calculating the width of the annular colloid according to the image I comprises:
[0124] Step S61, performing binary processing on the image I to obtain a binary image.
[0125] Step S62, generating a contour point set corresponding to the annular colloid according to the binary image.
[0126] 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.
[0127] It should be noted that the reference Figure 5 , the inner circle point set of the annular colloid corresponds to Figure 5 The red area in the figure corresponds to the inner point set of the annular colloid. Figure 5 The purple area in the figure; the annular colloid includes an annular bright band, which corresponds to the annular convex part of the annular colloid, so the colloid width of the annular colloid is greater than the ring width corresponding to the annular bright band.
[0128] Step S63, calculating the width of the annular colloid according to the contour point set corresponding to the annular colloid.
[0129] In the above implementation, the image I is firstly binary processed to obtain a binary image, and then a contour point set corresponding to the annular colloid is generated 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, and finally the width of the annular colloid is calculated according to the contour point set corresponding to the annular colloid.
[0130] As a further implementation of the method, the step of calculating the width of the annular colloid according to the contour point set corresponding to the annular colloid includes:
[0131] Step S71 : converting 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 transformation matrix is used to represent the transformation relationship between the camera coordinate system and the physical coordinate system.
[0133] It should be noted that the preset transformation matrix is obtained by pre-calibration, that is, the motion axis of the machine and the detection plastic camera are calibrated and established; the preset transformation matrix is used to represent the transformation relationship between the physical coordinate system of the machine and the camera coordinate system of the detection camera.
[0134] Step S72, calculating the width of the annular colloid according to the physical point set corresponding to the annular colloid.
[0135] In the above implementation, the contour point set corresponding to the annular colloid is first converted into a physical point set corresponding to the annular colloid according to a preset transformation matrix, and the preset transformation matrix is used to represent the transformation relationship between the camera coordinate system and the physical coordinate system, and then the width of the annular colloid is calculated 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] refer to Figure 6 , a colloid defect detection system, comprising:
[0138] The image acquisition module is used to illuminate the glue dispensing area of the component to be inspected through a light source and collect the original image corresponding to the glue dispensing area; there is an annular colloid formed after the glue dispensing operation in the glue dispensing area, and the annular colloid includes an annular convex portion;
[0139] A preprocessing module is used to preprocess the original image to obtain a corresponding preprocessed image; the preprocessed image includes an annular bright band corresponding to the annular raised portion;
[0140] A fitting module is used 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, used for constructing a detection line of an annular bright band based on a geometric center CC and according to a preset interval degree;
[0142] The colloid defect judgment module is used to perform 360-degree continuous detection on the detection line and the annular bright band according to the preset degree. If there is no intersection between the detection line and the annular bright band in [x, y] or (x, y), it is judged as a lack of glue defect; x and y both 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 judged whether the intersection distance is greater than the preset distance. When the intersection distance is greater than the preset distance, it is judged as a multiple glue defect, and when the intersection distance is less than the preset distance, it is judged as a insufficient glue defect.
[0143] The colloid defect detection method of the present invention can implement any method 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] refer to Figure 7 A computer device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, any one of the above-mentioned colloidal defect detection methods is implemented.
[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 by a processor and execute any one of the above-mentioned colloid defect detection methods.
[0148] Among them, computer-readable storage media can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus or device; the program code contained on the computer-readable medium can be transmitted using 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 preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
Claims
1. A method for detecting colloid defects, characterized in that: include: The glue dispensing area of the component to be inspected is illuminated by a light source, and an original image corresponding to the glue dispensing area is collected; the glue dispensing area has an annular colloid formed after the glue dispensing operation, and the annular colloid includes an annular convex portion; Preprocessing the original image to obtain a corresponding preprocessed image; The pre-processed image includes an annular bright band corresponding to the annular raised portion; Fitting the annular bright band according to the preprocessed image to obtain a geometric center CC corresponding to the annular bright band; Based on the geometric center CC, a detection line of the annular bright band is constructed according to a preset interval degree; The detection line and the annular bright band are continuously detected for 360 degrees according to a preset degree. If there is no intersection between the detection line and the annular bright band in [x, y] or (x, y), it is determined to be 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; 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 to be a multiple glue defect; when the intersection distance is less than the preset distance, it is determined to be a insufficient glue defect.
2. A colloid defect detection method according to claim 1, characterized in that: The step of preprocessing the original image to obtain a corresponding preprocessed image comprises: Performing sharpening processing on the original image to obtain image A; Performing blur processing on the original image to obtain image B; Mixing the image A and the image B to obtain an image C; An opening operation is performed on the image C to obtain a corresponding preprocessed image.
3. A colloid defect detection method according to claim 1, characterized in that: The step of fitting the annular bright band according to the preprocessed image to obtain a geometric center CC corresponding to the annular bright band comprises: Extracting the contour of the annular bright band according to the preprocessed image to obtain a contour point set corresponding to the annular bright band; 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; The screened contour point sets are unified into a pre-fitting point set; Fitting the pre-fitted point set to obtain geometric features of the annular bright band; Classifying the pre-fitted 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; Fitting the inner circle point set of the annular bright band to obtain the inner circle center corresponding to the inner circle fitting circle; Fitting the outer circle point set of the annular bright band to obtain the outer circle center corresponding to the outer circle fitting circle; The geometric center CC of the annular bright band is determined according to the center of the inner circle and the center of the outer circle.
4. The method for detecting colloid defects according to claim 1, characterized in that: After the step of preprocessing the original image to obtain a corresponding preprocessed image, the method further includes: Acquire an image center point CA of the preprocessed image, and calculate an offset value according to the image center point CA and the geometric center CC; It is determined whether the offset value is greater than a preset value. If so, it is determined that the colloid has been offset. If not, it is determined that the colloid has not been offset.
5. The method for detecting colloid defects according to claim 1, characterized in that: The method further comprises: Performing image enhancement on the original image to obtain image D; Performing smoothing on the original image to obtain image E; Performing an image subtraction operation on the image D and the image E to obtain an image F; Performing dynamic threshold segmentation on the image F to obtain image G; Performing binary threshold processing on the image G to obtain an image H; Performing an image addition operation on the image G and the image H to obtain an image I; The width of the annular colloid is calculated according to the image I.
6. A colloid defect detection method according to claim 5, characterized in that: The step of calculating the width of the annular colloid according to the image I comprises: Performing binary processing on the 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; The width of the annular colloid is calculated according to the contour point set corresponding to the annular colloid.
7. The 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 comprises: The contour point set corresponding to the annular colloid is converted into the 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; The width of the annular colloid is calculated according to the physical point set corresponding to the annular colloid.
8. A colloid defect detection system, characterized in that: include: An image acquisition module is used to illuminate the glue dispensing area of the component to be inspected through a light source and collect an original image corresponding to the glue dispensing area; the glue dispensing area has an annular colloid formed after the glue dispensing operation, and the annular colloid includes an annular convex portion; A preprocessing module, used for preprocessing the original image to obtain a corresponding preprocessed image; The pre-processed image includes an annular bright band corresponding to the annular raised portion; A fitting module, used for fitting 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, used to construct a detection line of the annular bright band based on the geometric center CC and according to a preset interval degree; The colloid defect determination module is used to perform 360-degree continuous 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 in [x, y] or (x, y), it is determined to be a glue deficiency defect; the x and y both represent degrees, and the difference between the x and y is the same as the value corresponding to the preset degree; otherwise, the intersection distance corresponding to the two intersections 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 to be a glue excess defect, and when the intersection distance is less than the preset distance, it is determined to be a glue deficiency defect.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Coated glue detection method and device
CN104359915A
Dispensing defect detection method, device and equipment of circuit board and storage medium
CN115937056A
Method for online monitoring dispensing quality of laser radar optical lens
CN116630333A
Optical fiber ring winding defect detection system and method based on contour point fitting
CN118408938A
Semiconductor Device and Semiconductor System Capable of Operating Stably at Low Power
KR1020230167849A