Glue path detection method and device, storage medium and system
By combining machine vision recognition and glue path detection models, the problems of glue overflow risk after dispensing and slow detection progress have been solved, achieving refined detection and improved yield rate.
Patent Information
- Application Number
- CN202510696088.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-19
AI Technical Summary
In the existing technology, there may be a risk of glue overflow after dispensing, which affects the product yield. In addition, the detection progress is slow and the standard parameters cannot be adjusted in time.
Use machine vision to identify the borders of the target product before and after glue dispensing, optimize the border after glue dispensing, divide the area between the outer contour and inner contour of the glue path, use the glue path detection model to compare the glue width, glue margin and glue area of each area, and output the detection results.
It realizes the refined detection of glue paths, improves the detection efficiency and yield rate, timely detects abnormalities such as glue overflow, glue breakage and glue thinness, and improves the accuracy and reliability of detection.
Smart Images

Figure CN120672673A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of product detection technology, and in particular to a glue path detection method and device, a storage medium and a system. Background Art
[0002] In the dispensing industry, finished materials must meet both glue path parameter testing and ALT air barrier testing to better control production yield. In some conventional testing methods, generally, after dispensing, the air barrier test abnormal data is used to manually check whether the glue margins of the abnormal materials corresponding to the abnormal data of the pre-production test are batch abnormal. After confirming that there are batch abnormalities, the standard parameters of the glue margins are adjusted. However, in the above conventional testing methods, materials that pass the air barrier test may have the risk of glue overflow in the product glue path, affecting the product yield; on the other hand, the standard parameters used for testing cannot be adjusted in time, affecting the product testing progress. Summary of the Invention
[0003] The embodiments of the present application provide a glue path detection method and device, a storage medium and a system, through which the glue path detection method can realize automatic detection of whether the glue path of the target product meets the standards, improve the detection efficiency, and improve the effect and reliability of the yield screening.
[0004] In a first aspect, an embodiment of the present application provides a glue path detection method, comprising: obtaining a first image of a target product before gluing, and determining a first frame of the target product based on the first image; obtaining a second image of the target product after gluing, and determining a second frame of the target product and a glue path contour based on the second image; restoring and optimizing the second frame based on the first frame, wherein the optimized second frame is consistent with the shape of the first frame, and the glue path contour includes a glue path outer contour and a glue path inner contour; dividing the portion between the glue path outer contour and the glue path inner contour into multiple areas, determining the glue width, glue margin and glue area of each area and inputting them into a glue path detection model, wherein the glue margin is the distance between the optimized second frame and the glue path outer contour; the glue path detection model compares the glue width, glue margin and glue area of each area with the glue path detection standard value of the corresponding area in the glue path detection model, and outputs a detection result, wherein the glue path detection standard value includes a first glue width threshold, a second glue width threshold, a first glue margin threshold, a second glue margin threshold, a first glue area threshold and a second glue area threshold.
[0005] In a possible implementation, the inputting of the glue path detection model includes training the glue path detection model. The training process of the glue path detection model includes:
[0006] A training set is obtained, where the training set includes n training subsets, one training subset corresponds to an area of the glue road contour, each training subset includes m sets of sample data, and each set of sample data includes the minimum glue width, maximum glue width, minimum glue margin, maximum glue margin and glue area of the corresponding area, where m and n are both positive integers greater than 1; each training subset is input into the glue road detection model, and the glue road detection standard value of the corresponding area is obtained through training.
[0007] In one possible implementation, each training subset is input into a glue road detection model, and the training to obtain the glue road detection standard value of the corresponding area includes: inputting each training subset into the glue road detection model, calculating m probability values corresponding to the current training subset through the glue road detection model, and configuring sample labels for the corresponding sample data in the current training subset based on the m probability values corresponding to the current training subset, wherein a negative label is configured when the probability value is less than the probability threshold, and a positive label is configured when the probability value is not less than the probability threshold; based on the predicted data, associating air leakage prevention values for the m sample data in the current training data, and obtaining m air leakage prevention values; calculating a correlation coefficient based on the sample labels and m air leakage prevention values of the m sample data in the current training data; when the correlation coefficient is less than the coefficient threshold, screening out the first sample data with the smallest probability value and the second sample data with the largest probability value in the sample data with the positive label, and determining the glue road detection standard value for the corresponding area of the current training subset based on the first sample data and the second sample data.
[0008] In one possible implementation, the step of inputting each training subset into the rubber road detection model and training to obtain the rubber road detection standard value for the corresponding area further includes: when the correlation coefficient is not less than the coefficient threshold, performing dimensionality reduction processing on the m sample data in the current training data to eliminate irrelevant sample data; inputting the sample data after dimensionality reduction processing into the rubber road detection model for retraining until the correlation coefficient is less than the coefficient threshold, screening out the first sample data and the second sample data, and determining the rubber road detection standard value for the corresponding area of the current training subset based on the first sample data and the second sample data.
[0009] In one possible implementation, determining the glue road detection standard value of the area corresponding to the current training subset based on the first sample data and the second sample data includes: setting the minimum glue width in the first sample data to the first glue width threshold, the minimum glue margin to the first glue margin threshold, and the minimum glue area to the first glue area threshold; setting the maximum glue width in the second sample data to the second glue width threshold, the maximum glue margin to the second glue margin threshold, and the maximum glue area to the second glue area threshold.
[0010] In one possible implementation, the glue width, glue margin and glue area of a region are compared with the glue road detection standard value of the corresponding region in the glue road detection model, and the output detection results include: comparing the minimum glue width of the current region with the first glue width threshold of the current region, and determining whether the minimum glue width of the current region is less than the first glue width threshold; if not, determining that the minimum glue width of the current region meets the standard; if less, determining that the minimum glue width of the current region does not meet the standard; comparing the maximum glue width of the current region with the second glue width threshold of the current region, and determining whether the maximum glue width of the current region is greater than the second glue width threshold; if not, determining that the maximum glue width of the current region meets the standard; if greater, determining that the maximum glue width of the current region does not meet the standard; comparing the minimum glue margin of the current region with the first glue margin threshold of the current region, and determining whether the minimum glue margin of the current region is greater than the second glue width threshold. is smaller than the first glue margin threshold; if not, it is determined that the minimum glue margin of the current area meets the standard; if less than, it is determined that the minimum glue margin of the current area does not meet the standard; the maximum glue margin of the current area is compared with the second glue margin threshold of the current area to determine whether the maximum glue margin of the current area is greater than the second glue margin threshold; if not, it is determined that the maximum glue margin of the current area meets the standard; if greater, it is determined that the maximum glue margin of the current area does not meet the standard; the glue area of the current area is compared with the standard glue area range to determine whether the glue area of the current area falls within the standard glue area range; if it falls within the range, it is determined that the glue area of the current area meets the standard; if it does not fall within the range, it is determined that the surface area of the current area does not meet the standard; wherein, the standard glue area range is a range value greater than or equal to the first glue area threshold of the current area and less than the second glue area threshold of the current area.
[0011] In one possible implementation, the restoring and optimizing the second frame based on the first frame includes: rotating the first frame at multiple angles until the positions of the first frame and the second frame match, thereby completing the restoration and optimization.
[0012] In a second aspect, an embodiment of the present application further provides a glue path detection device, comprising: a processor and a memory, wherein the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the glue path detection method provided in the first aspect is implemented.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the glue path detection method provided in the first aspect is implemented.
[0014] Through the above technical solution, the borders of the target product before and after gluing can be identified through image recognition, and the borders of the product after gluing can be optimized based on the borders of the product before gluing, and the outline of the glue path after gluing can be further identified. The part between the outer contour of the glue path and the inner contour of the glue path is divided into multiple areas, and the glue width, glue margin and glue area of each area are determined and input into the glue path detection model. The glue path detection model compares the glue width, glue margin and glue area of each area with the glue path detection standard value of the corresponding area and outputs the detection results. It can achieve more refined detection effects, improve detection accuracy, and improve the screening efficiency of yield rate. Among them, the detection efficiency of glue path detection can be improved by multi-area parallel detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 A schematic diagram of the outer frame of a product provided in one embodiment of the present application;
[0017] Figure 2 A schematic diagram of a product glue path provided for one embodiment of the present application;
[0018] Figure 3 A schematic diagram of the architecture of a glue road detection system provided in one embodiment of the present application;
[0019] Figure 4 A schematic flow chart of a glue path detection method provided in one embodiment of the present application;
[0020] Figure 5 A schematic diagram of optimizing the second frame of a target product provided in one embodiment of the present application;
[0021] Figure 6 A schematic diagram of area division information provided in one embodiment of the present application;
[0022] Figure 7 A schematic structural diagram of a glue path detection device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0023] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] To facilitate understanding of the technical solution of this application, the products and product adhesive paths involved in this application are explained below with reference to the accompanying drawings.
[0025] In some practical application scenarios, in order to ensure the airtightness and other related characteristics of the product, it is necessary to perform glue dispensing on the target product. Different products have different shapes, and thus the glue paths formed after glue dispensing also vary greatly. In some embodiments, the shape of the product can be a regular shape, such as a rectangle, a circle, an ellipse, a triangle, etc. In other embodiments, the shape of the product can also be an irregular shape. This application does not limit the shape of the product.
[0026] Figure 1 A schematic diagram of the outer frame of a product provided in one embodiment of the present application.
[0027] Reference Figure 1 As shown, the target product is an irregular shape. Based on the viewing angle perpendicular to the main plane of the product, the outer frame 10 of the target product can be determined. Figure 1 The product outline shown is an example only.
[0028] Figure 2 A schematic diagram of the product glue path provided for one embodiment of the present application.
[0029] Reference Figure 2 As shown, based on Figure 1 By performing glue dispensing on the product of the shape shown, at least one glue path 20 can be formed on the surface of the product. The glue path has a certain width and includes a glue path outer contour 20a and a glue path inner contour 20b.
[0030] The embodiment of the present application provides a glue path detection method, through which the border information and glue path contour of the target product before and after glue dispensing can be collected based on machine vision, by dividing the part between the glue path outer contour and the glue path inner contour into multiple regions, and identifying the glue width, glue margin and glue area of each region, and then inputting the glue width, glue margin and glue area of each region into a trained glue path detection model for detection, so as to obtain the detection results of each region output by the glue path detection model. Among them, the recognition of border information, glue path contour and glue width, glue margin and glue area of each region by machine vision can improve the accuracy of data acquisition. In addition, by detecting the difference between the glue width, glue margin and glue area of each region and the corresponding detection standard in a regional manner, the precision of glue path detection can be improved, thereby improving the reliability of product yield screening.
[0031] In order to implement the above-mentioned glue path detection method, an embodiment of the present application provides a glue path detection system, and the glue path detection method can be implemented through the glue path detection system.
[0032] Figure 3 A schematic diagram of the architecture of a glue path detection system provided in one embodiment of the present application.
[0033] Reference Figure 3 As shown, the system may include: an image acquisition device D1 and a glue path detection device D2.
[0034] In some embodiments, the image acquisition device D1 may be a camera that can capture images of the target product before, during, and after glue dispensing during the glue path inspection process. In one embodiment, the image acquisition device D1 can capture a first image of the target product before glue dispensing and a second image of the target product after glue dispensing.
[0035] In some embodiments, the image acquisition device D1 can be integrated into the glue path detection device D2, for example, disposed in a housing.
[0036] In other embodiments, the image acquisition device D1 and the glue path detection device D2 can be set independently of each other. In one embodiment, the glue path detection device D2 can be a mobile terminal device, and the image acquisition device D1 and the glue path detection device D2 are connected by wire or wirelessly at adjacent positions. The connection method includes but is not limited to connection via a bus, Bluetooth (BT), Wi-Fi, etc. In another embodiment, the glue path detection device D2 can be a server or cloud server device, which is set at the remote end of the image acquisition device D1, and the image acquisition device D1 and the glue path detection device D2 are connected by wire or wirelessly at adjacent positions.
[0037] In some embodiments, after the glue line detection device D2 obtains the first image and the second image of the target product captured by the image acquisition device D1, the glue line detection device D2 detects the glue line on the target product by executing the glue line detection method and outputs the detection result.
[0038] The following is a detailed description of the glue path detection method provided in the embodiment of the present application with reference to the accompanying drawings.
[0039] Figure 4 A schematic flow chart of a glue path detection method provided in one embodiment of the present application.
[0040] Reference Figure 4 As shown, the glue path detection method may include the following steps:
[0041] S401: Acquire a first image of a target product before glue dispensing, and determine a first border of the target product based on the first image.
[0042] In some embodiments, after the image acquisition device captures a first image of the target product before gluing, the first image can be sent to a glue path detection device. The glue path detection device can identify a first border of the target product in the image based on the first image. For example, the first border can be the outer border 10 of the target product shown in 1.
[0043] S402: Acquire a second image of the target product after glue dispensing, and determine a second border and glue path contour of the target product based on the second image.
[0044] In some embodiments, after the image acquisition device captures a second image of the target product after gluing, the second image can be sent to the glue path detection device, and the glue path detection device can then identify the second border and glue path outline of the target product in the image after gluing based on the second image.
[0045] In some embodiments, the glue path detection device can identify the first and second borders of the target product by extracting the first and second borders from the first and second images before and after glue dispensing through the PP-Liteseg semantic segmentation model, and the first and second borders can be used as input information for subsequent glue path detection.
[0046] It should be noted that after the glue is applied to the target product, the glue path may overflow, covering the outer border of the target product. This may result in the glue path detection device identifying the target product's second border after glue application as incomplete based on the second image. The glue path detection process requires the glue path's glue margin, which is the distance between the target product's second border after glue application and the outer edge of the glue path. To ensure the integrity of the second border, the integrity of the second border can be restored and optimized in S403.
[0047] S403: Restoring and optimizing the second frame based on the first frame.
[0048] Since the first frame and the second frame are respectively the outer frames of the same target product collected and identified before and after dispensing, and the first frame has the complete outer frame lines of the target product, the second frame can be restored and optimized based on the first frame, so that the optimized second frame has the same shape as the first frame and also has the complete outer frame lines of the target product.
[0049] In some embodiments, the specific implementation method of restoring and optimizing the second frame based on the first frame includes: rotating the first frame at multiple angles until the positions of the first frame and the second frame match, completing the restoration optimization, and obtaining the optimized second frame.
[0050] Figure 5 A schematic diagram of optimizing the second border of a target product provided in one embodiment of the present application.
[0051] Reference Figure 5 As shown, when restoring and optimizing the second frame 10a, the second frame 10a can be matched using a rotational multi-angle template matching algorithm based on the first frame 10. In one embodiment, after the matching is completed, the second frame 10a can be replaced with the complete lines of the first frame 10, thereby outputting an optimized second image, wherein the optimized second image includes the optimized second frame 10b, and the optimized second frame 10b has the same shape as the first frame 10 and has the complete outer frame lines of the target product.
[0052] S404: Divide the portion between the outer contour of the glue path and the inner contour of the glue path into multiple regions, determine the glue width, glue margin, and glue area of each region, and input them into the glue path detection model. The glue margin is the distance between the optimized second frame and the outer contour of the glue path.
[0053] In some embodiments, to improve the precision of glue path detection, the portion between the identified glue path outer contour and the identified glue path inner contour may be divided into multiple areas.
[0054] In one embodiment, the portion between the outer contour of the glue path and the inner contour of the glue path is divided into multiple areas as follows:
[0055] Figure 6 A schematic diagram of area division information provided for one embodiment of the present application.
[0056] Reference Figure 6 The target product and its glue path profile shown can set the width n of the divided area based on the dispensing width standard and dispensing width deviation value of the target product, and set the length m of the divided area based on the length value of the target product.
[0057] In one embodiment, the dispensing width standard can be the dispensing width Y0 required for the target product, and the dispensing width deviation value can be the difference Δ between the maximum glue width in the historical data and the corresponding dispensing width standard, and then the width of the divided area n = (Y0 + Δ) can be calculated.
[0058] In one embodiment, the actual length of the target product can be divided into multiple sections, and the distance of each section is set to the length m of the divided area. Figure 6 The target product shown can be divided into 10 sections along its actual length. That is, the area between the outer and inner contours of the adhesive path can be divided into 10 regions along its length, such as Regions 1 to 9 and Regions 8 to 16. The length m of each region is 1 / 10 of the actual length of the target product.
[0059] It should be noted that, in other embodiments, the length m and width n of the divided area may be set in other ways, and this application does not limit how to set the length m and width n of the divided area.
[0060] In some embodiments, after the portion between the outer contour of the glue path and the inner contour of the glue path is divided into multiple regions, the glue width, glue margin, and glue area of each region may be further identified.
[0061] In some embodiments, the pixel values corresponding to the pixels occupied by the glue path in the region can be determined. After the pixel values are determined, the glue width, glue margin, and glue area of the region can be determined by converting the pixel values to the target units. For example, when the target units are millimeters (mm), the formula actual size = measured pixels p * (actual width ÷ imaged width) is used to convert from pixel units to millimeters.
[0062] Reference Figure 6 As shown, in this embodiment, through area division, the part between the outer contour and the inner contour of the glue path on the target product can be divided into 32 areas, and the glue width, glue margin and glue area information of each area in the 32 areas can be further identified.
[0063] In some embodiments, the glue width of each region can include a maximum glue width Y(i)max and a minimum glue width Y(i)min; the glue margin of each region can include a maximum glue margin X(i)max and a minimum glue margin X(i)min. The glue area S(i) of each region can also be determined based on the pixel value occupied by the glue wheel in each region. Where i represents an identifier for each region, such as a region number.
[0064] Among them, reference Figure 6As shown, the maximum glue margin X(i)max of the area is the maximum distance between the outer contour 20a of the glue path in the area and the optimized second frame 10b, and the minimum glue margin X(i)min of the area is the minimum distance between the outer contour 20a of the glue path in the area and the optimized second frame 10b.
[0065] Reference Figure 6 As shown, the maximum glue width Y(i)max of the area is the maximum distance between the outer contour 20a of the glue path and the inner contour 20b of the glue path in the area, and the minimum glue width Y(i)min of the area is the minimum distance between the outer contour 20a of the glue path and the inner contour 20b of the glue path in the area.
[0066] by Figure 6 Taking the shown area 21 as an example, the maximum glue width Y(21)max, the minimum glue width Y(21)min, the maximum glue margin X(21)max, the minimum glue margin X(21)min and the glue area S(21) of the area 21 can be determined based on image recognition technology.
[0067] S405: Based on the glue width, glue margin and glue area of each area, the glue road detection standard values of the corresponding area are compared in the glue road detection model, and the detection results are output.
[0068] In some embodiments, a glue path detection model to be trained can be pre-trained to obtain a glue path detection model. The trained glue path detection model can include configured glue path detection standard values, wherein the glue path detection standard values include a first glue width threshold, a second glue width threshold, a first glue margin threshold, a second glue margin threshold, a first glue area threshold, and a second glue area threshold.
[0069] In one embodiment, the step of training the glue path detection model before inputting the glue path detection model may include the following steps:
[0070] S11: Obtain a training set, where the training set includes n training subsets, one training subset corresponds to an area of the glue path contour, each training subset includes m sets of sample data, each set of sample data includes the minimum glue width, maximum glue width, minimum glue margin, maximum glue margin and glue area of the corresponding area, where m and n are both positive integers greater than 1; illustratively, in the relevant data of the training set, the part between the glue path outer contour and the glue path inner contour of the target product is divided into 32 areas, and the training set can include 32 training subsets, each training subset corresponds to one of the 32 areas, and each training subset includes 100 sets of sample data.
[0071] S12: Input each training subset into the glue road detection model to obtain the glue road detection standard value of the corresponding area through training.
[0072] In some embodiments, inputting each training subset into the glue path detection model to train and obtain the glue path detection standard value of the corresponding area includes the following steps:
[0073] S121: Input each training subset into the glue road detection model, calculate the m probability values corresponding to the current training subset through the glue road detection model, and configure sample labels for the corresponding sample data in the current training subset based on the m probability values corresponding to the current training subset, wherein a negative label is configured when the probability value is less than the probability threshold, and a positive label is configured when the probability value is not less than the probability threshold.
[0074] In some embodiments, a sample data set of each training subset may include a minimum glue width, a maximum glue width, a minimum glue margin, a maximum glue margin, and a glue area. In one embodiment, the glue path detection model may be an OCSVM model, and each training subset may be used as input to an unsupervised anomaly detection model (OCSVM), the goal of which is to identify abnormal points or outliers in the data.
[0075] In some embodiments, network optimization can be performed, specifically by defining a parameter grid and creating a grid search object. This involves defining the kernel function's regularization method and gamma value, and creating a grid search object, GridSearchCV, to perform a grid search and cross-validation of model parameters, automatically traversing multiple parameter value combinations to find the optimal parameter combination for optimizing model performance.
[0076] S122: Based on the predicted data, associate the gas leakage prevention values with the m pieces of sample data in the current training data, and obtain m gas leakage prevention values.
[0077] In some embodiments, during the training of the OCSVM model based on the training subset, the m obtained gas leakage prevention values can be sorted by quartiles, and the last 99% of the m samples with completed gas leakage prevention value associations can be used as the sample data to be processed. In other embodiments, all of the m obtained samples with completed gas leakage prevention value associations can be directly used as the sample data to be processed.
[0078] S123: Calculate a correlation coefficient based on the sample labels of m pieces of sample data in the current training data and m leakage prevention values.
[0079] In some embodiments, after obtaining the training data, a correlation coefficient P can be calculated based on the sample labels of m sample data in the current training data and m air leakage prevention values (i.e., the sample data to be processed associated with the air leakage prevention values). Specifically, the correlation coefficient P can be obtained by performing a point-two series correlation coefficient calculation.
[0080] S124: When the correlation coefficient is less than the coefficient threshold, the first sample data with the smallest probability value and the second sample data with the largest probability value are screened out from the sample data with positive labels, and the glue road detection standard value of the area corresponding to the current training subset is determined based on the first sample data and the second sample data.
[0081] In some embodiments, after completing the calculation of the correlation coefficient P, the calculated m correlation coefficients P can be compared with the coefficient threshold. According to the comparison result, when the calculated m correlation coefficients P are all less than the coefficient threshold, the first sample data with the smallest probability value and the second sample data with the largest probability value in the sample data with positive labels are screened out, and the glue road detection standard value of the corresponding area of the current training subset is determined based on the first sample data and the second sample data.
[0082] S125: When the correlation coefficient is not less than the coefficient threshold, perform dimensionality reduction processing on the m sample data in the current training data, eliminate irrelevant sample data, input the sample data after dimensionality reduction processing into the rubber road detection model for retraining until the correlation coefficient is less than the coefficient threshold, filter out the first sample data and the second sample data, and determine the rubber road detection standard value of the area corresponding to the current training subset based on the first sample data and the second sample data.
[0083] In some embodiments, if, after a current round of calculations, several of the m correlation coefficients P are not less than a coefficient threshold, VAE dimensionality reduction can be performed on the m samples in the current training data. This involves feature engineering, thereby reducing the influence of irrelevant parameters on the results. Furthermore, irrelevant sample data can be removed and the sample data after dimensionality reduction can be input into the rubber road inspection model for retraining until all correlation coefficients P are less than the coefficient threshold.
[0084] In some embodiments, the coefficient threshold can be 0.5, wherein when the m correlation coefficients P calculated in this round are all less than 0.5, the glue road detection standard value of the area corresponding to the current training subset can be determined by the above method; when there are several correlation coefficients P not less than 0.5 among the m correlation coefficients P calculated in this round, the sample is subjected to VAE dimensionality reduction until the m correlation coefficients P calculated are all less than 0.5, and then the glue road detection standard value of the area corresponding to the current training subset is determined.
[0085] In some embodiments, determining the glue road detection standard value of the area corresponding to the current training subset based on the first sample data and the second sample data includes: setting the minimum glue width in the first sample data to the first glue width threshold, the minimum glue margin to the first glue margin threshold, and the minimum glue area to the first glue area threshold; setting the maximum glue width in the second sample data to the second glue width threshold, the maximum glue margin to the second glue margin threshold, and the maximum glue area to the second glue area threshold.
[0086] Through the above training method, after determining the glue road detection standard values corresponding to all the divided areas, the training of the glue road detection model to be trained is completed, that is, the glue road detection model is obtained.
[0087] After obtaining the glue path detection model, during the actual application of glue path detection, the glue path detection model compares the glue width, glue margin and glue area of each area with the glue path detection standard value of the corresponding area and outputs the detection result.
[0088] After obtaining the glue width, glue margin, and glue area of multiple regions of the glue path outline on the target product currently being inspected through the aforementioned steps, the glue width, glue margin, and glue area of each region are compared with the glue path inspection standard values for the corresponding region. In one embodiment, the glue width, glue margin, and glue area of each region can be compared with the glue path inspection standard values for the corresponding region simultaneously through parallel processing.
[0089] In some embodiments, the method of comparing the glue width, glue margin, and glue area of one region with the glue path detection standard values of the corresponding region in the glue path detection model may include:
[0090] Minimum glue width detection
[0091] Compare the minimum glue width of the current area with the first glue width threshold to determine whether the minimum glue width of the current area is less than the first glue width threshold. If not, determine that the minimum glue width of the current area meets the standard; if less, determine that the minimum glue width of the current area does not meet the standard.
[0092] Detection of maximum glue width in an area
[0093] Compare the maximum glue width of the current area with the second glue width threshold to determine whether the maximum glue width of the current area is greater than the second glue width threshold. If not, determine that the maximum glue width of the current area meets the standard; if greater, determine that the maximum glue width of the current area does not meet the standard.
[0094] Minimum detection of area glue margin
[0095] Compare the minimum glue margin value of the current area with the first glue margin threshold to determine whether the minimum glue margin value of the current area is less than the first glue margin threshold. If not, determine that the minimum glue margin value of the current area meets the standard; if less, determine that the minimum glue margin value of the current area does not meet the standard.
[0096] Maximum detection of regional glue margin
[0097] Compare the maximum value of the glue margin of the current area with the second glue margin threshold to determine whether the maximum value of the glue margin of the current area is greater than the second glue margin threshold. If not, determine that the maximum value of the glue margin of the current area meets the standard; if greater, determine that the maximum value of the glue margin of the current area does not meet the standard.
[0098] Regional glue area detection
[0099] The first and second glue area thresholds in the glue path detection standard values can define a glue area standard range. The glue area of the current region can be compared with the glue area standard range to determine whether the glue area of the current region falls within the glue area standard range. If it does, the glue area of the current region is determined to meet the standard. If it does not, the surface area of the current region is determined to not meet the standard. When the glue area is within the range of greater than or equal to the first glue area threshold and less than or equal to the second glue area threshold, it is determined to fall within the range. Conversely, when the glue area is less than the first glue area threshold or greater than the second glue area threshold, it is determined to not fall within the range.
[0100] The glue path inspection model uses parallel testing to detect the minimum glue margin, maximum glue margin, minimum glue width, maximum glue width, and glue area of each region. It then outputs the test results for each region. By summarizing the test results for each region, the test results for the entire glue path on the target product can be determined. By dividing the area between the outer and inner glue path contours of the target product into multiple regions and performing glue path inspection on each region, more refined inspection results can be achieved, improving detection accuracy and increasing the screening efficiency for yield rate. Specifically, multi-region parallel testing can improve glue path inspection efficiency.
[0101] In some embodiments, after outputting the glue path detection results for the current area, the glue path detection model can also classify glue path anomalies based on the detection results. In one embodiment, the glue dispensing anomalies can include the following types: glue thin, glue breakage, and glue overflow.
[0102] In some embodiments, when it is determined that the minimum glue width of a certain area is less than a first glue width threshold, it can be determined that an abnormal glue thinning condition exists in the glue path of the glue dispensed in the area.
[0103] In some embodiments, when it is determined that the minimum glue width and the maximum glue width in a certain area are both 0, it can be determined that the glue path of the glue dispenser in the area has an abnormal glue break condition.
[0104] In some embodiments, when it is determined that a minimum glue margin value in a certain area is less than a first glue margin threshold, it can be determined that an abnormal condition of glue overflow exists in the glue path of the glue dispensed in the area.
[0105] In some embodiments, when the detection result of the area output by the glue path detection model does not meet the standards, the type of glue dispensing abnormality that exists can be specifically displayed, and the user can quickly determine the type of abnormality that exists in the glue dispensing path based on the detection result.
[0106] Figure 7 A schematic structural diagram of a glue path detection device provided in one embodiment of the present application.
[0107] Reference Figure 7 As shown, the device may include a processor 701 and a memory 702, and the memory 702 is used to store at least one instruction, which, when loaded and executed by the processor 701, implements the glue path detection method provided by any embodiment of the present application.
[0108] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the glue path detection method provided in any embodiment of the present application is implemented.
[0109] It should be noted that the terminals or electronic devices involved in the embodiments of the present application may include but are not limited to personal computers (PCs), personal digital assistants (PDAs), wireless handheld devices, tablet computers, mobile phones, MP3 players, MP4 players, etc.
[0110] It is understandable that the application may be an application program (nativeApp) installed on the terminal, or may be a web page program (webApp) of a browser on the terminal, and this embodiment of the present application does not limit this.
[0111] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0112] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, which may be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0114] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0115] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.
[0116] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A glue road detection method, characterized in that: The method comprises: Acquire a first image of a target product before dispensing glue, and determine a first border of the target product based on the first image; Acquire a second image of the target product after dispensing glue, and determine a second border and a glue path contour of the target product based on the second image; Restoring and optimizing the second frame based on the first frame, wherein the optimized second frame has the same shape as the first frame, and the glue path contour includes a glue path outer contour and a glue path inner contour; Divide the portion between the outer contour of the glue path and the inner contour of the glue path into multiple regions, determine the glue width, glue margin, and glue area of each region, and input them into a glue path detection model, where the glue margin is the distance between the optimized second frame and the outer contour of the glue path; The glue path detection model compares the glue width, glue margin and glue area of each area with the glue path detection standard value of the corresponding area, and outputs the detection result, wherein the glue path detection standard value includes the first threshold value of glue width, the second threshold value of glue width, the first threshold value of glue margin, the second threshold value of glue margin, the first threshold value of glue area and the second threshold value of glue area.
2. The glue path detection method according to claim 1, characterized in that: The step of inputting the glue path detection model includes training the glue path detection model. The training process of the glue path detection model includes: Obtaining a training set, wherein the training set includes n training subsets, one training subset corresponds to an area of the glue path profile, each training subset includes m sets of sample data, each set of sample data includes a minimum glue width, a maximum glue width, a minimum glue margin, a maximum glue margin, and a glue area of the corresponding area, wherein m and n are both positive integers greater than 1; Each training subset is input into the glue road detection model to train and obtain the glue road detection standard value of the corresponding area.
3. The glue path detection method according to claim 2, characterized in that: Inputting each training subset into the glue road detection model to train and obtain the glue road detection standard value of the corresponding area includes: Input each training subset into the glue road detection model, calculate the m probability values corresponding to the current training subset through the glue road detection model, and assign sample labels to the corresponding sample data in the current training subset based on the m probability values corresponding to the current training subset. When the probability value is less than the probability threshold, a negative label is assigned, and when the probability value is not less than the probability threshold, a positive label is assigned. Based on the predicted data, associate the gas leakage prevention value with the m sample data in the current training data, and obtain m gas leakage prevention values; A correlation coefficient is calculated based on the sample labels of m sample data and m gas leakage prevention values in the current training data; When the correlation coefficient is less than the coefficient threshold, the first sample data with the smallest probability value and the second sample data with the largest probability value are screened out from the sample data with positive labels, and the glue road detection standard value of the area corresponding to the current training subset is determined based on the first sample data and the second sample data.
4. The glue path detection method according to claim 3, characterized in that: Inputting each training subset into the rubber road detection model to train and obtain the rubber road detection standard value of the corresponding area also includes: When the correlation coefficient is not less than the coefficient threshold, dimensionality reduction processing is performed on the m sample data in the current training data to eliminate irrelevant sample data; The sample data after dimensionality reduction processing is input into the rubber road detection model for retraining until the correlation coefficient is less than the coefficient threshold, the first sample data and the second sample data are screened out, and the rubber road detection standard value of the area corresponding to the current training subset is determined based on the first sample data and the second sample data.
5. The glue path detection method according to claim 3, characterized in that: Determining the glue road detection standard value of the area corresponding to the current training subset based on the first sample data and the second sample data includes: In the first sample data, the minimum glue width is set as the first glue width threshold, the minimum glue margin is set as the first glue margin threshold, and the minimum glue area is set as the first glue area threshold; In the second sample data, the maximum glue width is set as the second glue width threshold, the maximum glue margin is set as the second glue margin threshold, and the maximum glue area is set as the second glue area threshold.
6. The glue path detection method according to any one of claims 1 to 5, characterized in that: The glue width, glue margin and glue area of a region are compared with the glue path detection standard value of the corresponding region in the glue path detection model, and the output detection result includes: Comparing the minimum glue width of the current area with a first glue width threshold of the current area to determine whether the minimum glue width of the current area is less than the first glue width threshold; if not, determining that the minimum glue width of the current area meets the standard; if less, determining that the minimum glue width of the current area does not meet the standard; Comparing the maximum glue width of the current area with a second glue width threshold of the current area to determine whether the maximum glue width of the current area is greater than the second glue width threshold; if not, determining that the maximum glue width of the current area meets the standard; if greater, determining that the maximum glue width of the current area does not meet the standard; Compare the minimum glue margin value of the current region with the first glue margin value threshold of the current region to determine whether the minimum glue margin value of the current region is less than the first glue margin value threshold; if not, determine that the minimum glue margin value of the current region meets the standard; if less, determine that the minimum glue margin value of the current region does not meet the standard; Comparing the maximum glue margin of the current region with the second glue margin threshold of the current region to determine whether the maximum glue margin of the current region is greater than the second glue margin threshold; if not, determining that the maximum glue margin of the current region meets the standard; if greater, determining that the maximum glue margin of the current region does not meet the standard; The glue area of the current area is compared with the glue area standard range to determine whether the glue area of the current area falls within the glue area standard range. If it falls within the range, it is determined that the glue area of the current area meets the standard; if it does not fall within the range, it is determined that the surface area of the current area does not meet the standard; wherein the glue area standard range is a range value greater than or equal to a first glue area threshold of the current area and less than a second glue area threshold of the current area.
7. The glue path detection method according to claim 1, characterized in that: The restoring and optimizing the second frame based on the first frame includes: The first frame is rotated at multiple angles until the positions of the first frame and the second frame match, thereby completing the restoration optimization.
8. A glue path detection device, characterized in that: The glue path detection device comprises: A processor and a memory, wherein the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the glue path detection method according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the glue path detection method according to any one of claims 1 to 6 is implemented.
10. A glue road detection system, characterized in that: The glue road detection system includes: An image acquisition device, configured to acquire a first image of the target product before glue dispensing and a second image of the target product after glue dispensing; and The glue path detection device according to claim 8.