A method and system for detecting lane drift based on point sets
By calculating the center point set of the template and the detection map, performing registration and mapping, and obtaining the glue path offset, the problem of inaccurate calculation of the glue path offset between the glue dispensing device and the standard position is solved, and efficient and accurate glue path offset detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN LINGYUN VISION TECH CO LTD
- Filing Date
- 2023-07-27
- Publication Date
- 2026-05-12
AI Technical Summary
The calculation results of the offset between the glue path of the glue applicator and the standard position are inaccurate and unreliable, and the existing manual measurement methods are slow and have large errors.
By acquiring the template image after standard glue application and the detection image after actual glue application, the template center point set and the detection center point set are calculated. Registration and mapping are performed to obtain affine transformation information. The first offset, the second offset and the total offset are calculated, and the detection result of the glue path is generated according to the offset threshold.
It enables rapid and high-precision detection of glue path deviation defects, improving the accuracy and reliability of the calculation of the offset between the glue path and the standard position of the glue dispensing device.
Smart Images

Figure CN116862899B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of machine vision and image processing technology, and in particular to a method and system for detecting adhesive path offset based on point set. Background Technology
[0002] In industrial glue application processes, glue application devices have a standard application position when applying glue. However, due to errors between the actual operating trajectory of the glue application device (i.e., the glue path) and the standard trajectory, the glue path of the glue application device will deviate from the standard application position.
[0003] To assess whether the glue path of the glue applicator is within the reasonable range of the standard glue application position, a threshold range for deviation can be set. For example, if the measured deviation is within the reasonable threshold range, the glue path of the glue applicator can be considered defect-free. Conversely, if the deviation exceeds the reasonable threshold range, such as when the deviation is too large, the glue path can be considered defective, requiring re-applying or correction.
[0004] To obtain the offset between the actual glue path and the standard glue application position, in some embodiments, the specific value of the offset is measured and determined manually. However, due to potential errors and slow speed during manual measurement, the measurement result of the glue path offset is inaccurate and unreliable. Summary of the Invention
[0005] Some embodiments of this application provide a method and system for detecting glue path offset based on point set detection, in order to solve the problems of inaccurate and unreliable calculation results of the offset between the glue path of the glue applicator and the standard position.
[0006] In a first aspect, some embodiments of this application provide a method for detecting adhesive path offset based on point sets, including:
[0007] Obtain a standard template image after glue application, and calculate the template center point set based on the template image;
[0008] Obtain the actual inspection image after glue application, and calculate the set of inspection center points based on the inspection image;
[0009] Registration is performed on the template center point set and the detection center point set to obtain affine transformation information;
[0010] The detection center point set is mapped according to the affine transformation information to obtain the mapped center point set;
[0011] Calculate a first offset, a second offset, and a total offset based on the set of mapping center points and the set of template center points. The first offset is the offset in a first direction, the second offset is the offset in a second direction, the first direction is perpendicular to the second direction, and the total offset is the vector sum of the first offset and the second offset.
[0012] The detection results of the adhesive path are generated based on the first offset, the second offset, the total offset, and the offset threshold.
[0013] In some embodiments, the step of calculating the template center point set based on the template diagram includes:
[0014] Edge extraction is performed on the template image to obtain the adhesive path edge point pairs of the template image;
[0015] Traverse the pairs of glue path edge points in the template diagram, and calculate the coordinates of the center point of each pair of glue path edge points in the template diagram;
[0016] Generate a template center point set based on the center point coordinates.
[0017] In some embodiments, the step of calculating the detection center point set based on the detection map includes:
[0018] Edge extraction is performed on the detection map to obtain pairs of adhesive path edge points in the detection map;
[0019] Traverse the detection map adhesive path edge point pairs and calculate the point spacing of each group of detection map adhesive path edge point pairs;
[0020] The effective edge point pairs in the detection map are determined based on the point spacing, and the effective edge points are edge point pairs whose point spacing is greater than or equal to the distance threshold.
[0021] Calculate the coordinates of the center point of each pair of valid edge points;
[0022] A set of detection center points is generated based on the coordinates of the center point.
[0023] In some embodiments, the step of determining the valid edge point pairs in the detected adhesive path edge point pairs based on the point spacing includes:
[0024] Iterate through all the point spacings of each group of detection map edge point pairs;
[0025] Obtain a distance threshold; if the point spacing is greater than or equal to the distance threshold, mark the detected map adhesive path edge point pair as the valid edge point pair.
[0026] If the point spacing is less than the distance threshold, the detected map edge point pair is marked as an invalid point pair, and the invalid point pair is deleted.
[0027] In some embodiments, the affine transformation information includes rotation data information and translation data information. The step of performing mapping on the detection center point set according to the affine transformation information to obtain the mapped center point set includes:
[0028] The template center point set and the detection center point set are registered using the nearest point iteration algorithm to obtain rotation data information and translation data information;
[0029] The detection center point set is mapped by using the rotation data information and the translation data information to obtain the mapped center point set.
[0030] In some embodiments, the method for detecting adhesive path offset based on point set further includes:
[0031] The offset angle of the detection map is obtained based on the rotation data information;
[0032] Obtain the offset angle threshold;
[0033] Compare the first offset with the first threshold, the second offset with the second threshold, the total offset with the third threshold, and the offset angle with the offset angle threshold;
[0034] If the first offset is less than the first threshold, the second offset is less than the second threshold, the total offset is less than the third threshold, and the offset angle is less than the offset angle threshold, a detection result is generated indicating that the adhesive path has no offset.
[0035] If the first offset is greater than or equal to the first threshold, and / or the second offset is greater than or equal to the second threshold, and / or the total offset is greater than or equal to the third threshold, and / or the offset angle is greater than or equal to the offset angle threshold, a detection result indicating that the adhesive path is offset is generated.
[0036] In some embodiments, the step of calculating a first offset, a second offset, and a total offset based on the mapping center point set and the template center point set includes:
[0037] Calculate the first mean point of the template center point set;
[0038] Calculate the second mean point of the set of mapped center points;
[0039] Calculate the difference between the first mean point and the second mean point to obtain the first offset, the second offset, and the total offset.
[0040] In some embodiments, the method for detecting adhesive path offset based on point set further includes:
[0041] Obtain the segment template diagram of the segment adhesive path in the template diagram, and calculate the segment template center point set based on the segment template diagram;
[0042] Obtain the segment detection map of the segment adhesive path in the detection map, and calculate the segment detection center point set based on the segment detection map;
[0043] Registration is performed on the set of center points of the fragment template and the set of center points of the fragment detection to obtain fragment affine transformation information;
[0044] The fragment detection center point set is mapped according to the fragment affine transformation information to obtain the mapped fragment center point set;
[0045] Calculate the fragment offset based on the set of center points of the mapped fragment and the set of center points of the fragment template;
[0046] The detection results of the segment adhesive path are generated based on the segment offset and the segment offset threshold.
[0047] In some embodiments, the offset threshold includes a first threshold, a second threshold, and a third threshold, wherein the first threshold is a threshold in a first direction, the second threshold is a threshold in a second direction, and the third threshold is the geometric mean of the first threshold and the second threshold; the step of determining the offset of the adhesive path in the detection image based on the first offset, the second offset, the total offset, and the offset threshold includes:
[0048] Compare the first offset with the first threshold, the second offset with the second threshold, and the total offset with the third threshold;
[0049] If the first offset is less than the first threshold, the second offset is less than the second threshold, and the total offset is less than the third threshold, a detection result is generated indicating that the adhesive path has no offset.
[0050] If the first offset is greater than or equal to the first threshold, and / or the second offset is greater than or equal to the second threshold, and / or the total offset is greater than or equal to the third threshold, a detection result indicating that the adhesive path has an offset is generated.
[0051] Secondly, some embodiments of this application provide a system for detecting adhesive path offset based on point set detection, including:
[0052] The template center point set acquisition unit acquires a standard template image after glue application and calculates the template center point set based on the template image.
[0053] The detection center point set calculation unit acquires the detection map after actual glue application and calculates the detection center point set based on the detection map.
[0054] The registration unit performs registration on the template center point set and the detection center point set to obtain affine transformation information;
[0055] The mapping unit performs mapping on the detection center point set according to the affine transformation information to obtain the mapped center point set;
[0056] The offset calculation unit calculates a first offset, a second offset, and a total offset based on the mapping center point set and the template center point set. The first offset is the offset in a first direction, the second offset is the offset in a second direction, the first direction is perpendicular to the second direction, and the total offset is the vector sum of the first offset and the second offset.
[0057] The offset determination unit generates the detection result of the adhesive path based on the first offset, the second offset, the total offset, and the offset threshold.
[0058] As can be seen from the above technical solutions, some embodiments of this application provide a method and system for detecting glue path offset based on point set. The method includes acquiring a template image after standard glue application, and calculating a template center point set based on the template image; acquiring an actual glue application detection image, and calculating a detection center point set based on the detection image; performing registration on the template center point set and the detection center point set to obtain affine transformation information; performing mapping on the detection center point set based on the affine transformation information to obtain a mapped center point set; calculating a first offset, a second offset, and a total offset based on the mapped center point set and the template center point set; and generating the glue path detection result based on the first offset, the second offset, the total offset, and the offset threshold. This method can achieve rapid and high-precision detection of glue path offset defects, thereby solving the problems of inaccurate and low-reliability calculation results of the offset between the glue path of the glue application device and the standard position. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in some embodiments of this application or in the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a schematic flowchart of a method for detecting adhesive path offset based on point set according to some embodiments of this application;
[0061] Figure 2This is a schematic diagram of the template adhesive path effect provided in some embodiments of this application;
[0062] Figure 3 This is a schematic diagram of the actual adhesive path effect provided for some embodiments of this application;
[0063] Figure 4 A flowchart illustrating the process of calculating the first offset, the second offset, and the total offset based on the mapping center point set and the template center point set, provided for some embodiments of this application;
[0064] Figure 5 This is a schematic diagram illustrating the effect of adhesive path offset in the detection diagram provided in some embodiments of this application;
[0065] Figure 6 This is a schematic diagram of a system structure for detecting adhesive path offset based on point set detection, provided for some embodiments of this application. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. The technical solutions provided by each embodiment of this application will be described in detail below with reference to the accompanying drawings.
[0067] In industrial glue application processes, glue application devices have a standard application position when applying glue. However, due to errors between the actual operating trajectory of the glue application device (i.e., the glue path) and the standard trajectory, the glue path of the glue application device will deviate from the standard application position.
[0068] To assess whether the glue path of the glue applicator is within the reasonable range of the standard glue application position, a threshold range for deviation can be set. For example, if the measured deviation is within the reasonable threshold range, the glue path of the glue applicator can be considered defect-free. Conversely, if the deviation exceeds the reasonable threshold range, such as when the deviation is too large, the glue path can be considered defective, requiring re-applying or correction.
[0069] To address the issues of inaccurate and unreliable calculations of the offset between the glue path and the standard position in a glue dispensing device, some embodiments of this application provide a method for detecting glue path offset based on point sets. This method extracts edges from a pre-defined standard glue-dispensed template image and calculates a template center point set based on the edge extraction results. When detecting the actual glue path, the same algorithm is used to obtain a detection center point set from the glue-dispensed detection image. Then, the template center point set and the detection center point set are used to calculate the offset relative to the template image using point set registration technology. Finally, a set offset threshold range is used to determine whether there is a glue path offset defect in the actual glue-dispensed detection image, and the final judgment result is output. This method enables rapid and high-precision detection of glue path offset defects, thereby solving the problems of inaccurate and unreliable calculations of the offset between the glue path and the standard position in a glue dispensing device.
[0070] To facilitate understanding of the technical solutions in some embodiments of this application, the steps are described in detail below with reference to some specific embodiments and accompanying drawings. Figure 1 This is a schematic flowchart of a method for detecting adhesive path offset based on point set detection provided in some embodiments of this application, such as... Figure 1 As shown, in some embodiments, a method for detecting adhesive path offset based on point sets may include the following steps S1-S6, the details of which are as follows:
[0071] Step S1: Obtain the template image after standard glue application, and calculate the template center point set based on the template image.
[0072] Figure 2 This is a schematic diagram of the template adhesive path effect provided in some embodiments of this application, such as... Figure 2 As shown, in some embodiments, in order to calculate the template center point set, the template image can first be edge extracted to obtain the template image glue path edge point pairs, then the template image glue path edge point pairs are traversed, and the center point coordinates of each set of template image glue path edge point pairs are calculated, and finally the template center point set is generated based on the center point coordinates.
[0073] For example, after obtaining the template glue path image, i.e., the template image after standard glue application, the first step is to extract the edge point pairs of the template image to obtain the glue path edge point pairs. Then, the template center point set is calculated based on the extracted glue path edge point pairs. Since all edge point pairs in the template image are valid, when calculating the center point set, all glue path edge point pairs can be retained, and the center point sets calculated sequentially are used as the template center point set, such as... Figure 2 The dashed line in the middle represents the set of template center points. After step S1 is completed, step S2 can be executed.
[0074] Step S2: Obtain the actual detection image after glue application, and calculate the detection center point set based on the detection image.
[0075] To calculate the detection center point set, edge extraction is first performed on the detection map to obtain the glue path edge point pairs. Then, these glue path edge point pairs are traversed, and the point spacing of each pair is calculated. Based on the point spacing, the valid edge point pairs are determined, where valid edge points are those with a point spacing greater than or equal to a distance threshold. Next, the center point coordinates of each valid edge point pair are calculated. Finally, the detection center point set is generated based on these center point coordinates.
[0076] For example, Figure 3 This is a schematic diagram of the actual adhesive path effect provided for some embodiments of this application, such as... Figure 3 As shown, after edge extraction is performed on the actual glue path, i.e. the detection map after actual glue application, the point spacing between the edge point pairs of the glue path in each group of detection maps can be calculated, and the effective edge point pairs in the glue path edge point pairs of the detection map can be determined according to the point spacing.
[0077] In some embodiments, when determining valid edge point pairs, the point spacing of all points in each group of detected glue path edge point pairs can be traversed first. Then, a distance threshold can be obtained, and the following judgment can be made: If the point spacing is greater than or equal to the distance threshold, the detected glue path edge point pair can be marked as a valid edge point pair; if the point spacing is less than the distance threshold, the detected glue path edge point pair can be marked as an invalid point pair, and the invalid point pair can be deleted.
[0078] For example, when setting a distance threshold and determining the validity of detected adhesive path edge point pairs based on the distance threshold, if the point spacing between the detected adhesive path edge point pairs is greater than the set distance threshold, the detected adhesive path edge point pair can be determined to be valid and retained. Conversely, if the point spacing is less than the distance threshold, the detected adhesive path edge point pair can be determined to be invalid. Figure 3 As shown in the dashed box, the two pairs of points are invalid because their point spacing is less than the set distance threshold. The invalid point pairs can be deleted to detect the center point set.
[0079] In other words, after calculating the distance between two points on the edge points of the adhesive path extracted from the detection map, a distance threshold can be used to filter valid edge point pairs. When the distance between points is less than the distance threshold, the width of the adhesive path is considered unreasonable, and the invalid point pair is deleted. Otherwise, valid point pairs are retained, and the detection center point set is calculated based on the valid point pairs obtained from the detection map.
[0080] After determining the valid and invalid point pairs in the edge point pairs of the detection map, the detection center point set can be calculated based on the valid point pairs. Invalid point pairs will not participate in the calculation of the detection center point set. The final result is as follows: Figure 3 The calculation results of the center points are shown. It should be noted that when calculating the detection center point set and the template center point set, the detection center point set can be calculated first, followed by the template center point set, or they can be calculated simultaneously. This application does not limit the calculation order of the detection center point set and the template center point set. After step S2 is completed, step S3 can be executed.
[0081] Step S3: Perform registration on the template center point set and the detection center point set to obtain affine transformation information.
[0082] After calculating the template center point set and the detection center point set, in some embodiments, registration can be performed on the template center point set and the detection center point set to obtain affine transformation information. The registration process involves aligning the template center point set and the detection center point set to find corresponding points. In practice, a probability value can be used to describe this correspondence; the higher the probability value, the greater the certainty of the correspondence. Modified models can also be used, such as uniform distribution, binomial distribution, normal distribution, etc. For example, a normal distribution can be used to describe the correspondence between one point and another, while a Gaussian mixture model can be used when multiple points exist. In practical applications, the dimensionality information of the point set and the actual situation of the point set data can be considered comprehensively. This application does not limit the specific registration method. After step S3 is completed, step S4 can be executed.
[0083] Step S4: Perform mapping on the detection center point set according to the affine transformation information to obtain the mapped center point set.
[0084] In some embodiments, the affine transformation information includes rotation data information and translation data information. After obtaining the affine transformation information, the detection center point set can be mapped according to the affine transformation information to obtain the mapped center point set. When mapping the center point set, the template center point set and the detection center point set can first be registered using the nearest point iteration algorithm to obtain rotation data information and translation data information, so as to minimize the difference between the mapped detection center point set and the template center point set. Then, the detection center point set is mapped using the rotation data information and translation data information to obtain the mapped center point set.
[0085] For example, a set of mapping data, such as rotation data R and translation data T, can be calculated for the template center point set and the detection center point set using the Iterative Closest Point (ICP) algorithm, to minimize the difference between the mapped detection center point set and the template center point set. This mapping is an affine transformation, including rotation and translation.
[0086] In some embodiments, the detection center point set can be mapped using rotation data information R and translation data information T. For example, the mapping formula for a single point can be OriPoint*R+T=point', and the center point set consists of multiple single points, thus obtaining the mapped center point set. After step S4 is completed, step S5 can be executed.
[0087] Step S5: Calculate the first offset, the second offset, and the total offset based on the mapping center point set and the template center point set.
[0088] To obtain the offset of the adhesive path in the detection image, after obtaining the set of mapped center points, a first offset, a second offset, and a total offset can be calculated based on the set of mapped center points and the set of template center points. In some embodiments, the first offset can be an offset in a first direction, the second offset can be an offset in a second direction, wherein the first direction is perpendicular to the second direction, and the total offset can be the vector sum of the first offset and the second offset.
[0089] Figure 4 This application provides a flowchart illustrating the calculation of the first offset, second offset, and total offset based on the mapped center point set and the template center point set in some embodiments of the application. Figure 4 As shown, the first mean point of the template center point set can be calculated first, then the second mean point of the mapped center point set can be calculated, and finally the difference between the first mean point and the second mean point can be calculated to obtain the first offset, the second offset and the total offset.
[0090] For example, when calculating the offset, the mean points of the template center point set and the mapping center point set can be calculated. The difference between the two mean points can be used to obtain the first offset, second offset, and total offset of the adhesive path in the detection map. In some embodiments, the formula for calculating the mean point can be:
[0091]
[0092] Where x and y can represent the x-axis and y-axis respectively, n is the number of points in the point set, and k is a natural number ranging from 0 to n. It can be understood that when calculating the mean point of the template center point set, n is the number of template center points; when calculating the mean point of the mapping center point set, n is the number of mapping center points. After step S5 is completed, step S6 can be executed.
[0093] Step S6: Generate the detection results of the adhesive path based on the first offset, the second offset, the total offset, and the offset threshold.
[0094] To determine the offset of the adhesive path in the detection diagram, an offset threshold can be preset. In some embodiments, the first offset can be an offset along the X-axis, the second offset can be an offset along the Y-axis, and the offset threshold can include a first threshold, a second threshold, and a third threshold. The first threshold is a threshold for a first direction, the second threshold is a threshold for a second direction, and the third threshold can be the geometric mean of the first and second thresholds. When determining the offset of the adhesive path, the first offset can be compared with the first threshold, the second offset with the second threshold, and the total offset with the third threshold. Then, the following judgment is made: If the first offset is less than the first threshold, the second offset is less than the second threshold, and the total offset is less than the third threshold, a detection result indicating no offset of the adhesive path can be generated. If the first offset is greater than or equal to the first threshold, and / or the second offset is greater than or equal to the second threshold, and / or the total offset is greater than or equal to the third threshold, a detection result indicating an offset of the adhesive path can be generated. For example, there may be an offset in the X-axis direction, or an offset in the Y-axis direction, or an offset in both the X-axis and Y-axis directions.
[0095] Figure 5 This is a schematic diagram illustrating the effect of adhesive path offset in the detection diagram provided in some embodiments of this application, such as... Figure 5 As shown, after mapping the detection center point set through affine transformation information, the first offset, second offset, and total offset can be calculated based on the mapped center point set and the template center point set. This allows the detection of the actual adhesive path's x-axis offset, y-axis offset, and total offset. Figure 5 As shown in the annotation. After calculating the x-axis offset, y-axis offset, and total offset, the actual offset of the adhesive path can be determined by setting offset thresholds. It should be noted that in the actual process of determining the offset, only one offset threshold can be set, or a combination of multiple thresholds can be set to comprehensively determine the offset of the adhesive path. The specific conditions set can be determined according to actual needs, and this application does not limit this.
[0096] In some embodiments, the offset angle of the detection map can be obtained based on rotation data information, and the offset of the adhesive path can be determined based on the first offset, the second offset, the total offset, the offset angle, and the offset threshold. This allows for multi-dimensional detection of the adhesive path offset, resulting in more accurate detection results.
[0097] For example, after obtaining the offset angle, a pre-set offset angle threshold can be obtained. Then, the first offset is compared with the first threshold, the second offset with the second threshold, the total offset with the third threshold, and the offset angle with the offset angle threshold. Upon comparison, if the first offset is less than the first threshold, the second offset is less than the second threshold, the total offset is less than the third threshold, and the offset angle is less than the offset angle threshold, a detection result indicating no offset in the adhesive path is generated. If the first offset is greater than or equal to the first threshold, and / or the second offset is greater than or equal to the second threshold, and / or the total offset is greater than or equal to the third threshold, and / or the offset angle is greater than or equal to the offset angle threshold, a detection result indicating an offset in the adhesive path is generated. This adds the offset angle as a judgment dimension to the original judgment. In practical applications, specific judgment dimensions can be set according to requirements.
[0098] To detect the offset of a certain adhesive path segment, in some embodiments, the following operation process can also be performed: First, obtain the segment template image of the segment adhesive path in the template image, and calculate the segment template center point set based on the segment template image. Then, obtain the segment detection image of the segment adhesive path in the detection image, and calculate the segment detection center point set based on the segment detection image. Next, perform registration on the segment template center point set and the segment detection center point set to obtain segment affine transformation information. Then, perform mapping on the segment detection center point set based on the segment affine transformation information to obtain the mapped segment center point set. Finally, calculate the segment offset based on the mapped segment center point set and the segment template center point set. Finally, generate the detection result of the segment adhesive path segment based on the segment offset and the segment offset threshold.
[0099] When calculating the center point set of the segment template, the center point set of the segment detection, the affine transformation information of the segment, the center point set of the mapped segment, and the segment offset, the calculation method for the relevant parameters of the glue path can be referenced as described above. The difference lies in that, after extracting the center point set of the template and the center point set of the detection to obtain the center point set of the segment template and the center point set of the segment detection, the offset of that segment of the glue path can be obtained. Therefore, the glue path offset can be obtained segment by segment to perform local glue path offset calculation. In this way, during the actual glue application process, if a certain segment of the glue path is prone to misplacement or defects such as glue overflow, the segment method can quickly determine that there is an offset defect in that area. Compared with the calculation of glue path offset, this method can improve detection and calculation efficiency, and at the same time avoid missing the detection of defects in key areas when calculating the overall glue path offset.
[0100] It should be noted that the point set-based method for detecting adhesive path offset in this application embodiment is not limited to rigid registration or non-rigid registration; both are applicable. Furthermore, when detecting adhesive path offset, it can be used for overall adhesive path defect detection or segmented detection, thus making it applicable to cases of missing adhesive path sections or insufficient adhesive path length, thus broadening its applicability. Simultaneously, this method avoids manual intervention, enabling rapid and high-precision detection of adhesive path offset defects, improving processing efficiency and accuracy, and ultimately solving the problems of inaccurate and unreliable calculation results of the offset between the adhesive path and the standard position in the glue dispensing device.
[0101] As can be seen from the above technical solutions, the above embodiments provide a method for detecting glue path offset based on point sets. The method includes obtaining a template image after standard glue application, and calculating a template center point set based on the template image; obtaining an actual glue application detection image, and calculating a detection center point set based on the detection image; performing registration on the template center point set and the detection center point set to obtain affine transformation information; performing mapping on the detection center point set based on the affine transformation information to obtain a mapped center point set; calculating a first offset, a second offset, and a total offset based on the mapped center point set and the template center point set; and generating the glue path detection result based on the first offset, the second offset, the total offset, and the offset threshold. The method can achieve rapid and high-precision detection of glue path offset defects, thereby solving the problems of inaccurate and low-reliability calculation results of the offset between the glue path of the glue application device and the standard position.
[0102] Some embodiments of this application also provide a system for detecting adhesive path offset based on point set detection. Figure 6 This is a schematic diagram of a system structure for detecting adhesive path offset based on point set detection, as provided in some embodiments of this application. Figure 6 As shown, in some embodiments, the system for detecting adhesive path offset based on point set may include a template center point set acquisition unit 100, a center point set detection calculation unit 200, a registration unit 300, a mapping unit 400, an offset calculation unit 500, and an offset judgment unit 600. Each unit is configured to perform the following functions:
[0103] Template center point set acquisition unit 100 acquires a template image after standard glue application and calculates the template center point set based on the template image;
[0104] The detection center point set calculation unit 200 acquires the detection map after actual glue application and calculates the detection center point set based on the detection map;
[0105] Registration unit 300 performs registration on the template center point set and the detection center point set to obtain affine transformation information;
[0106] The mapping unit 400 performs mapping on the detection center point set according to the affine transformation information to obtain the mapped center point set;
[0107] Offset calculation unit 500 calculates a first offset, a second offset, and a total offset based on the mapping center point set and the template center point set; wherein, the first offset is the offset in the first direction, the second offset is the offset in the second direction, the first direction is perpendicular to the second direction, and the total offset is the vector sum of the first offset and the second offset;
[0108] The offset judgment unit 600 generates the detection result of the adhesive path based on the first offset, the second offset, the total offset, and the offset threshold.
[0109] As can be seen from the above technical solutions, the above embodiments provide a system for detecting glue path offset based on point set detection. The system can realize rapid and high-precision detection of glue path offset defects, thereby solving the problems of inaccurate and low reliability of the offset calculation results between the glue path of the glue dispensing device and the standard position.
[0110] Similar parts between the embodiments provided in this application can be referred to mutually. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods extended from the solution of this application without creative effort shall fall within the scope of protection of this application.
Claims
1. A method for detecting adhesive path offset based on point set detection, characterized in that, include: Obtain a standard template image after glue application, and perform edge extraction on the template image to obtain glue path edge point pairs; Traverse the pairs of glue path edge points in the template diagram, and calculate the coordinates of the center point of each pair of glue path edge points in the template diagram; Generate a template center point set based on the center point coordinates; Obtain the actual glue application result image and perform edge extraction on the result image to obtain glue path edge point pairs; Traverse the detection map adhesive path edge point pairs and calculate the point spacing of each group of detection map adhesive path edge point pairs; The effective edge point pairs in the detection map are determined based on the point spacing, and the effective edge points are edge point pairs whose point spacing is greater than or equal to the distance threshold. Calculate the coordinates of the center point of each pair of valid edge points; Generate a set of detection center points based on the coordinates of the center points; Registration is performed on the template center point set and the detection center point set to obtain affine transformation information; The detection center point set is mapped according to the affine transformation information to obtain the mapped center point set; Calculate a first offset, a second offset, and a total offset based on the set of mapping center points and the set of template center points. The first offset is the offset in a first direction, the second offset is the offset in a second direction, the first direction is perpendicular to the second direction, and the total offset is the vector sum of the first offset and the second offset. The detection results of the adhesive path are generated based on the first offset, the second offset, the total offset, and the offset threshold.
2. The method for detecting adhesive path offset based on point set detection according to claim 1, characterized in that, The step of determining the effective edge point pairs in the detected adhesive path edge point pairs based on the point spacing includes: Iterate through all the point spacings of each group of detection map edge point pairs; Obtain a distance threshold; if the point spacing is greater than or equal to the distance threshold, mark the detected map adhesive path edge point pair as the valid edge point pair. If the point spacing is less than the distance threshold, the detected map edge point pair is marked as an invalid point pair, and the invalid point pair is deleted.
3. The method for detecting adhesive path offset based on point set detection according to claim 1, characterized in that, The affine transformation information includes rotation data information and translation data information. The step of mapping the detection center point set according to the affine transformation information to obtain the mapped center point set includes: The template center point set and the detection center point set are registered using the nearest point iteration algorithm to obtain rotation data information and translation data information; The detection center point set is mapped by using the rotation data information and the translation data information to obtain the mapped center point set.
4. The method for detecting adhesive path offset based on point set detection according to claim 3, characterized in that, The offset threshold includes a first threshold, a second threshold, and a third threshold. The first threshold is a threshold in a first direction, the second threshold is a threshold in a second direction, and the third threshold is the geometric mean of the first and second thresholds. The step of determining the offset of the adhesive path in the detection diagram based on the first offset, the second offset, the total offset, and the offset threshold includes: Compare the first offset with the first threshold, the second offset with the second threshold, and the total offset with the third threshold; If the first offset is less than the first threshold, the second offset is less than the second threshold, and the total offset is less than the third threshold, a detection result is generated indicating that the adhesive path has no offset. If the first offset is greater than or equal to the first threshold, and / or the second offset is greater than or equal to the second threshold, and / or the total offset is greater than or equal to the third threshold, a detection result indicating that the adhesive path has an offset is generated.
5. The method for detecting adhesive path offset based on point set detection according to claim 4, characterized in that, Also includes: The offset angle of the detection map is obtained based on the rotation data information; Obtain the offset angle threshold; Compare the first offset with the first threshold, the second offset with the second threshold, the total offset with the third threshold, and the offset angle with the offset angle threshold; If the first offset is less than the first threshold, the second offset is less than the second threshold, the total offset is less than the third threshold, and the offset angle is less than the offset angle threshold, a detection result is generated indicating that the adhesive path has no offset. If the first offset is greater than or equal to the first threshold, and / or the second offset is greater than or equal to the second threshold, and / or the total offset is greater than or equal to the third threshold, and / or the offset angle is greater than or equal to the offset angle threshold, a detection result indicating that the adhesive path is offset is generated.
6. The method for detecting adhesive path offset based on point set detection according to claim 1, characterized in that, The steps of calculating the first offset, the second offset, and the total offset based on the mapping center point set and the template center point set include: Calculate the first mean point of the template center point set; Calculate the second mean point of the set of mapped center points; Calculate the difference between the first mean point and the second mean point to obtain the first offset, the second offset, and the total offset.
7. The method for detecting adhesive path offset based on point set detection according to claim 1, characterized in that, Also includes: Obtain the segment template diagram of the segment adhesive path in the template diagram, and calculate the segment template center point set based on the segment template diagram; Obtain the segment detection map of the segment adhesive path in the detection map, and calculate the segment detection center point set based on the segment detection map; Registration is performed on the set of center points of the fragment template and the set of center points of the fragment detection to obtain fragment affine transformation information; The fragment detection center point set is mapped according to the fragment affine transformation information to obtain the mapped fragment center point set; Calculate the fragment offset based on the set of center points of the mapped fragment and the set of center points of the fragment template; The detection results of the segment adhesive path are generated based on the segment offset and the segment offset threshold.
8. A system for detecting adhesive path offset based on point set detection, characterized in that, include: The template center point set acquisition unit acquires the template image after standard glue application and performs edge extraction on the template image to obtain the glue path edge point pairs of the template image; Traverse the pairs of glue path edge points in the template diagram, and calculate the coordinates of the center point of each pair of glue path edge points in the template diagram; Generate a template center point set based on the center point coordinates; The detection center point set calculation unit obtains the detection map after actual glue application and performs edge extraction on the detection map to obtain glue path edge point pairs in the detection map; Traverse the detection map adhesive path edge point pairs and calculate the point spacing of each group of detection map adhesive path edge point pairs; The effective edge point pairs in the detection map are determined based on the point spacing, and the effective edge points are edge point pairs whose point spacing is greater than or equal to the distance threshold. Calculate the coordinates of the center point of each pair of valid edge points; Generate a set of detection center points based on the coordinates of the center points; The registration unit performs registration on the template center point set and the detection center point set to obtain affine transformation information; The mapping unit performs mapping on the detection center point set according to the affine transformation information to obtain the mapped center point set; The offset calculation unit calculates a first offset, a second offset, and a total offset based on the mapping center point set and the template center point set. The first offset is the offset in a first direction, the second offset is the offset in a second direction, the first direction is perpendicular to the second direction, and the total offset is the vector sum of the first offset and the second offset. The offset determination unit generates the detection result of the adhesive path based on the first offset, the second offset, the total offset, and the offset threshold.