Method and system for measuring transparent dispensing volume, computer readable storage medium and computer program product

The three-dimensional depth distribution model is reconstructed through the linear laser scanning camera and laser triangulation principle, and combined with principal component analysis and three-dimensional connectivity domain analysis, the problem of difficulty in accurately measuring transparent gel volume in the existing technology is solved, achieving high-precision and efficient measurement effects.

CN120212867APending Publication Date: 2025-06-27GUANGDONG AOPUTE TECH CO LTD

Patent Information

Application Number
CN202510527086.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately measure the volume of transparent dispensing, especially in the case of complex shapes and high precision requirements. Traditional methods have problems such as large errors, low efficiency, and high equipment costs.

Method used

The cross-sectional profile image data of transparent dispensing was taken using a linear laser scanning camera, and the height of each contour point in the contour line was calculated through the laser triangle principle, and the three-dimensional depth distribution model was reconstructed. The dosing volume was calculated by combining principal component analysis and three-dimensional connectivity domain analysis.

Benefits of technology

High-speed and high-precision measurement of transparent gel volume is realized, which reduces transmitted light scattering and reflection interference, improves measurement accuracy and efficiency, and is suitable for scenarios with complex shapes and high-precision requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120212867A_ABST
    Figure CN120212867A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of three-dimensional measurement, and discloses a method and system for measuring the transparent dispensing volume, a computer readable storage medium and a computer program product. The method comprises the following steps: placing transparent dispensing glue on a preset metal sheet, and shooting to obtain cross section contour image data of the transparent dispensing glue; extracting a laser stripe center contour line of the two-dimensional contour slice; reconstructing a complete three-dimensional depth distribution model to obtain a dispensing depth map; carrying out plane attitude correction to realize fitting; performing three-dimensional connected domain analysis on the fitted dispensing depth map to screen out a dispensing volume measurement area; and calculating the dispensing volume in the dispensing volume measurement area by using a projection method. In combination with a depth map processing algorithm, high-speed and high-precision measurement of the dispensing volume is realized, so that the dispensing volume before dispensing is accurately controlled, and the method has important significance on product quality control in dispensing process production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional measurement, and particularly to a method, a system, a computer-readable storage medium and a computer program product for measuring the volume of transparent dispensing glue. Background Art

[0002] Traditional manual dispensing has problems such as unstable quality and low efficiency, and is still commonly used in fields such as electronic packaging and precision device manufacturing, seriously restricting the high-quality development of the manufacturing industry. As an automated device, a dispensing machine realizes precise dotting, line drawing or coating of complex shapes of liquids such as glue and paint on the product surface through high-precision control technology, effectively solving the above problems, and is widely used in precision manufacturing links in fields such as electronics, automotive, and medical, improving production efficiency and product quality.

[0003] In the field of precision assembly of automobiles, consumer goods and electronic components, dispensing, pasting and bonding processes have become the first choice of manufacturers. With the wide application of this process, manufacturers have put forward higher requirements for the stability detection of the dispensing volume to ensure product consistency and reliability and meet the market demand for high-quality products. Traditional pneumatic dispensing machines control the dispensing volume by the air pressure magnitude and the opening and closing time. However, due to air pressure fluctuations, it is difficult to ensure uniform dispensing. Excessive dispensing volume will cause glue overflow, while too little may result in insufficient bonding strength or poor airtightness, leading to product performance failure and affecting quality. In addition, inaccurate glue volume will also cause rework and material waste, increasing production costs. Therefore, accurately measuring the volume of the dispensed glue and providing data guidance and real-time feedback for the calibration of the glue volume of the dispensing head are the key links to effectively control the dispensing volume, improve product quality and production efficiency.

[0004] At present, the methods for measuring the dispensing volume mainly include traditional manual measurement methods, ultrasonic methods, electrochemical methods, optical non-contact three-dimensional measurement methods, etc. The traditional manual measurement method measures the piston movement trajectory with an electronic ruler and calculates the glue volume by combining the colloid volume and the glue ratio, but it has problems such as long time consumption, large error and high labor cost, and it is difficult to meet the requirements of high precision and high efficiency. The ultrasonic method is based on the propagation characteristics of ultrasonic waves, and indirectly calculates the glue volume by measuring the propagation time, reflection signal or attenuation situation. However, its accuracy is greatly affected by the glue characteristics and the environment, and its measurement ability for complex shapes and transparent glue is limited, and the equipment cost is high and the measurement speed is slow. The electrochemical method is less used, mainly because most glues are insulators or lack electrochemical activity, and it has problems such as low accuracy, sensitivity to glue components, complex equipment and high cost, and it is difficult to meet the requirements of real-time and complex shape measurement.

[0005] With the development of machine vision technology, traditional two-dimensional vision technology is difficult to meet the broader application requirements due to the lack of depth perception ability. The rapid development of optical imaging technology has made three-dimensional vision detection technology a research hotspot. As a high-precision, real-time, and non-contact 3D vision measurement technology, the optical non-contact three-dimensional measurement method captures the light reflection signals on the object surface to obtain geometric, object, and optical feature information, and reconstructs a three-dimensional model based on this information to generate high-precision 3D data. Combining image processing and three-dimensional data processing algorithms, this method can meet diverse measurement requirements and is widely used in fields such as object volume measurement and industrial defect detection. Compared with other methods, the optical non-contact three-dimensional measurement method solves problems such as low precision and poor stability, and is especially suitable for high-precision three-dimensional reconstruction and volume calculation of non-transparent objects.

[0006] Traditional optical three-dimensional measurement methods (such as time-of-flight method, structured light projection method, photometric stereo method, and stereo vision) do not perform well when measuring transparent objects, usually with large errors or even unable to complete the reconstruction. This is because the transparent surface does not meet the diffuse reflection assumption relied on by traditional methods, making it difficult to directly apply to the three-dimensional reconstruction of transparent objects. The interaction between transparent objects and light is complex, including multiple reflection and refraction phenomena, and it is difficult to trace the light path. In addition, transparent objects lack local appearance features, and the surface is presented by distorting the surrounding environment, making it vulnerable to perspective and environmental interference. Their refraction behavior also depends on unknown and possibly non-uniform refractive indices, further increasing the difficulty of light path analysis. These factors make three-dimensional information acquisition, feature matching, and data processing more complex, bringing great challenges to the three-dimensional reconstruction and volume measurement of transparent glue. Coupled with the complex and irregular shapes (such as conical, arc-shaped, circular, etc.) formed after the glue is dispensed, it further increases the measurement difficulty and poses extremely high requirements on the imaging ability of the 3D camera and anti-interference algorithms. Therefore, developing an optical three-dimensional measurement technology that can effectively solve the above problems is the key to realizing the volume measurement of transparent dispensing. Summary of the Invention

[0007] The purpose of the present invention is to provide a method, system, computer-readable storage medium, and computer program product for measuring the volume of transparent glue to solve or at least partially solve the technical problems mentioned in the above background technology.

[0008] To achieve this purpose, the present invention adopts the following technical solutions:

[0009] In the first aspect, the present invention provides a method for measuring the volume of transparent glue, including:

[0010] Place the transparent dispensing glue on a predetermined metal sheet, and obtain the cross-sectional profile image data of the transparent dispensing glue by taking pictures with a line laser scanning camera; wherein, the cross-sectional profile image data of the transparent dispensing glue includes a plurality of two-dimensional profile slices, and the color of the laser used by the line laser scanning camera and the background color of the metal sheet are complementary colors;

[0011] Extract the laser stripe center contour line of the two-dimensional profile slice;

[0012] Calculate the height of each contour point position in the laser stripe center contour line through the laser triangulation principle, and then combine all the laser stripe center contour lines and input them into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain the dispensing glue depth map;

[0013] Select the point set of the measurement reference plane area in the dispensing glue depth map, solve the optimal plane equation through the fitting plane algorithm based on principal component analysis, and perform plane attitude correction to achieve fitting;

[0014] Perform three-dimensional connected domain analysis on the fitted dispensing glue depth map to screen out the dispensing glue volume measurement area;

[0015] Calculate the dispensing glue volume in the dispensing glue volume measurement area by using the projection method.

[0016] Optionally, the extraction of the laser stripe center contour line of the two-dimensional profile slice specifically includes:

[0017] Preprocess the cross-sectional profile image data of the transparent dispensing glue to obtain the corresponding grayscale image;

[0018] Adopt the gray gradient analysis method combined with the sliding window mechanism, and locate the sub-pixel multi-peak candidate center point set through the gray centroid method;

[0019] Perform preliminary screening on the points in the sub-pixel multi-peak candidate center point set through the multi-factor constraint algorithm based on the dynamic weighted scoring model to obtain the pre-screened point set;

[0020] Evaluate the neighborhood coordinate continuity of the points in the pre-screened point set through position offset and continuous length constraints, eliminate abnormal jump points and filter out discrete broken line segments that do not meet the continuous length requirements to obtain the screened center one-dimensional point set;

[0021] Repair the missing center break points caused by screening through the linear interpolation algorithm, and generate a continuous and smooth laser stripe center line in combination with adaptive smoothing filtering.

[0022] Optionally, the adoption of the gray gradient analysis method combined with the sliding window mechanism and the location of the sub-pixel multi-peak candidate center point set through the gray centroid method specifically includes:

[0023] Vertically scan the pixels in each row of the grayscale image to obtain a number of candidate line segments;

[0024] Use a sliding window based on the gray gradient change rate to detect the boundaries of the candidate line segments, control the edge detection sensitivity using a transition length threshold, take the rising edge of the gray level as the starting point and the falling edge of the gray level as the end point of the line segment to determine the corresponding candidate regions;

[0025] Use a gray density weighted model to increase the weight of the high gray value pixels in the candidate region; the gray density weighted model is:

[0026] where w is the weight coefficient and I x is the pixel gray value;

[0027] In the candidate region, use the gray centroid method to calculate and locate the positions of the points in the sub-pixel level multi-peak candidate center point set. The calculation method is:

[0028] Assume that the range of points in the candidate region is x ∈ [x s , x c , and the coordinate y center of the sub-pixel level weighted center candidate point in the candidate region is:

[0029] where y x is the pixel row coordinate;

[0030] Finally, perform peak effective value filtering verification, that is: filter out the abnormal candidate points in each row of the sub-pixel level multi-peak candidate center point set and the peak candidate points in the abnormal width candidate region;

[0031] where the abnormal candidate point is a candidate point whose ratio of the gray value to the maximum gray value of the row where the abnormal candidate point is located is less than a predetermined ratio, and the abnormal width candidate region is a candidate region whose line segment width is greater than a predetermined width.

[0032] Optionally, the points in the sub-pixel level multi-peak candidate center point set are preliminarily screened through a multi-factor constraint algorithm based on a dynamic weighted scoring model to obtain a preliminary screening point set, which specifically includes:

[0033] Perform continuity analysis on the points in the sub-pixel level multi-peak candidate center point set, search for each point in the sub-pixel level multi-peak candidate center point set vertically forward and backward, and count the number of consecutive occurrences L k that satisfy the position offset constraint;

[0034] Calculate the normalized continuity score of the points in the sub-pixel level multi-peak candidate center point set gray intensity evaluation score and the historical position constraint score of the candidate points

[0035] Use a dynamic weighted comprehensive scoring model to statistically calculate the final scores of the points in the sub-pixel multi-peak candidate center point set The calculation method is as follows:

[0036] Among them, α, β, and γ are weight parameters set in advance according to the usage scenario;

[0037] Select the point with the largest final score in each column of the sub-pixel multi-peak candidate center point set to obtain the preliminary screening point set;

[0038] The calculation of the normalized continuity score of the points in the sub-pixel multi-peak candidate center point set Gray intensity evaluation score And the historical position constraint score of the candidate points Specifically include:

[0039] The calculation method of the position offset constraint is:

[0040] Among them, is the coordinate of the k-th point in the sub-pixel multi-peak candidate center point set, X neighbor is the coordinate of the adjacent points in the rows before and after the k-th point;

[0041] The calculation methods of are respectively:

[0042]

[0043] Among them, max(L) is the maximum consecutive number of all points in the row where the k-th point in the sub-pixel multi-peak candidate center point set is located, I (k) is the gray value of the k-th point, I max is the maximum gray value of all points in the column where the k-th point in the sub-pixel multi-peak candidate center point set is located, X prev is the coordinate of the finally selected point in the row before the k-th point, and R is the normalization coefficient.

[0044] Optionally, the neighborhood coordinate continuity of the points in the preliminary screening point set is evaluated by position offset and continuous length constraints, abnormal jump points are eliminated, and discrete broken line segments that do not meet the continuous length requirements are filtered out to obtain the screened center one-dimensional point set, including:

[0045] Re-evaluate the neighborhood coordinate continuity by using the position offset constraint, that is, judge whether the adjacent coordinate positions of the points in the preliminary screening point set in the vertical direction are greater than zValue;

[0046] If so, regard this point as an abnormal jump point and eliminate it;

[0047] Otherwise, perform sliding window detection to eliminate regions where the continuous length of points in the preliminary screening point set is less than a preset minimum continuous length, and then perform sliding mean filtering on the obtained one-dimensional data of the screened center point set to obtain the one-dimensional data of the screened center point set.

[0048] Optionally, the method for repairing the missing center breakpoints caused by screening through the linear interpolation algorithm and generating a continuous and smooth laser stripe centerline by combining adaptive smoothing filtering includes:

[0049] Based on the assumption of spatial continuity between adjacent valid data points, perform interpolation repair on the discontinuous region of the laser profile by establishing a local linear model; specifically including:

[0050] Detect the break region of the contour line and locate the two breakpoint endpoints P1(x1, y1) and P2(x2, y2);

[0051] Judge whether the number of invalid points between the two breakpoint endpoints is greater than or equal to a preset interpolation threshold;

[0052] If not, directly connect the two breakpoint endpoints;

[0053] If so, construct a parametric straight-line equation: P(t) = P1 + t(P2 - P1), where t ∈ [0, 1];

[0054] After constructing the parametric straight-line equation, it further includes:

[0055] Calculate the coordinates of the missing points according to the sampling interval:

[0056]

[0057] Reconstruct a geometrically continuous complete centerline contour by supplementing the points (x i , y i ).

[0058] Optionally, calculate the height of each contour point in the laser stripe center contour line through the laser triangulation principle, and then combine all the laser stripe center contour lines and input them into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain a dispensing depth map, specifically including:

[0059] Calculate the height information of each contour point in the laser stripe center contour line through the principle of direct incidence and oblique reception laser triangulation method;

[0060] Initialize the spatial structure of the depth map matrix according to the measurement range of the transparent dispensing surface and the preset spatial resolution parameters to obtain the original depth map;

[0061] Synchronize the data of all the two-dimensional contour slices in time sequence, map the column coordinates of the center points of the laser stripe centerlines to the grid coordinates corresponding to the original depth map in the scanning row order, and store their height information in the internal space of the matrix of the original depth map to construct a complete three-dimensional depth distribution model and obtain the dispensing depth map.

[0062] Optionally, select the point set of the measurement reference plane area in the dispensing depth map, solve the optimal plane equation through the fitting plane algorithm based on principal component analysis, and perform plane attitude correction to achieve fitting, specifically including:

[0063] First, use ROI to select the measurement reference plane in the dispensing depth map, and then convert all the points in the ROI. It can be converted into a set of three-dimensional point sets:

[0064] P = {(x i , y i , z i ) || i = 1, 2..., n}; where (x i , y i ) are the image coordinates of the pixels, z i is the depth value, and n is the total number of points in the ROI;

[0065] Perform centering processing on the three-dimensional point set, calculate the centroid μ of the three-dimensional point set, and then subtract the centroid from each point in the three-dimensional point set to obtain the centered point set:

[0066] p i = (x i - μ x , y i - μ y , z i - μ z ), i = 1, 2,..., n;

[0067] Represent the centered point set as an n×3 matrix X, and each row represents the three-dimensional coordinates of a point:

[0068]

[0069] For the centered point set X, define its covariance matrix C as:

[0070]

[0071] Perform SVD decomposition on the matrix X: X = U∑V T ;

[0072] Among them, U is an n×n orthogonal matrix, representing the spatial distribution of the input data; ∑ is an n×3 diagonal matrix, whose diagonal elements are singular values, arranged in descending order; the right singular vector matrix V is a 3×3 orthogonal matrix, and its column vectors are the principal component directions of the point set and also the eigenvectors of the covariance matrix X T of X;

[0073] Using the relationship between the covariance matrix and the right singular vectors, diagonalize X T X and perform eigenvalue decomposition on the covariance matrix X T X to calculate the right singular vector matrix V;

[0074] The normal vector of the fitting plane according to the calculated right singular vector matrix V is:

[0075] n = v3 = (a, b, c); where v3 is the principal component direction corresponding to the minimum singular value σ3;

[0076] According to the normal vector n of the fitting plane and the centroid μ, construct the equation of the fitting plane:

[0077] a(x - μ x ) + b(y - μ y ) + c(z - μ z ) = 0, which simplifies to:

[0078] ax + by + cz + d = 0; where d = -(aμ x + bμ y + cμ z ) is the distance from the plane to the origin;

[0079] Through the rigid body transformation matrix T, each point p = {(x i , y i , z i )|i = 1, 2,..., n} in the dispensing depth map is transformed to a new coordinate system:

[0080] p′ = T·p; where p’ is the transformed point;

[0081] Among them, the method for obtaining the rigid body transformation matrix T is:

[0082] Use the rotation matrix to straighten the plane. According to the relationship between the normal vector n of the fitting plane and the z-axis of the world coordinate system, generate the rotation matrix R, and the expression of R is:

[0083] R = I + sinθ·K + (1 - cosθ)·K 2 where: I is the identity matrix; K is the skew-symmetric matrix constructed by the rotation axis k;

[0084]

[0085] The translation vector t is as follows:

[0086] t = -R·μ;

[0087] The rigid body transformation matrix form T is as follows:

[0088]

[0089] Optionally, performing three-dimensional connected component analysis on the fitted dispensing depth map to screen out the dispensing volume measurement region specifically includes:

[0090] Performing 3D binarization on the fitted dispensing depth map using the OTSU algorithm to obtain a dispensing binary map;

[0091] Using run-length encoding technology to perform connected component analysis and connection on the dispensing binary map;

[0092] Based on depth features, screening and segmenting the protruding three-dimensional connected components that meet the predetermined depth threshold conditions to obtain the dispensing volume measurement region.

[0093] Optionally, calculating the dispensing volume within the dispensing volume measurement region using the projection method specifically includes:

[0094] Using the projection method to regard each pixel point in the dispensing volume measurement region as an independent cuboid, the bottom surface of these cuboids is determined by the spatial resolution Δx×Δy of the pixel, and the height is determined by the depth value z xy determined;

[0095] Accumulating the volumes of all cuboids to calculate the dispensing volume V within the dispensing volume measurement region, and the calculation formula is:

[0096]

[0097] In a second aspect, the present invention provides a system for measuring the volume of transparent dispensing, including:

[0098] A line laser scanning camera, which is used to photograph the cross-sectional profile of the transparent dispensing placed on a predetermined metal sheet to obtain the cross-sectional profile image data of the transparent dispensing; wherein, the cross-sectional profile image data of the transparent dispensing includes a plurality of two-dimensional contour slices, and the color of the laser used by the line laser scanning camera and the background color of the metal sheet are complementary colors;

[0099] A contour line extraction module, electrically connected to the line laser scanning camera, which is used to extract the laser stripe center contour line of the two-dimensional contour slice;

[0100] The depth map construction module, electrically connected to the contour line extraction module, is used to calculate the height of each contour point in the center contour line of the laser stripe through the laser triangulation principle, and then combine all the center contour lines of the laser stripe and input them into the depth map space to reconstruct a complete three-dimensional depth distribution model, obtaining the dispensing depth map;

[0101] The fitting module, electrically connected to the depth map construction module, is used to select the point set of the measurement reference plane area in the dispensing depth map, solve the optimal plane equation through the fitting plane algorithm based on principal component analysis, and perform plane attitude correction to achieve fitting;

[0102] The screening module, electrically connected to the fitting module, is used to perform three-dimensional connected domain analysis on the fitted dispensing depth map to screen out the dispensing volume measurement area;

[0103] The volume calculation module, electrically connected to the screening module, is used to calculate the dispensing volume in the dispensing volume measurement area by using the projection method.

[0104] Optionally, the contour line extraction module is specifically used for:

[0105] Preprocess the cross-sectional contour image data of the transparent dispensing to obtain the corresponding grayscale image;

[0106] Adopt the gray gradient analysis method combined with the sliding window mechanism, and locate the sub-pixel multi-peak candidate center point set through the gray centroid method;

[0107] Through the multi-factor constraint algorithm based on the dynamic weighted scoring model, preliminarily screen the points in the sub-pixel multi-peak candidate center point set to obtain the pre-screened point set;

[0108] Evaluate the neighborhood coordinate continuity of the points in the pre-screened point set through position offset and continuous length constraints, eliminate abnormal jump points and filter out discrete broken line segments that do not meet the continuous length requirements, and obtain the screened center one-dimensional point set;

[0109] Repair the missing center break points caused by screening through the linear interpolation algorithm, and generate a continuous and smooth laser stripe center line in combination with adaptive smoothing filtering.

[0110] Optionally, the adoption of the gray gradient analysis method combined with the sliding window mechanism to locate the sub-pixel multi-peak candidate center point set specifically includes:

[0111] Vertically scan the pixels in each row of the grayscale image to obtain a number of candidate line segments;

[0112] Detect the boundaries of candidate line segments using a sliding window based on the rate of change of gray - scale gradient. Control the edge - detection sensitivity using a transition - length threshold. Take the rising edge of the gray - scale as the starting point and the falling edge of the gray - scale as the end point of the line segment to determine the corresponding candidate region.

[0113] Use a gray - scale density weighted model to increase the weight of high - gray - value pixels in the candidate region. The gray - scale density weighted model is:

[0114] where \(w\) is the weight coefficient, and \(I\) x is the pixel gray - scale value;

[0115] In the candidate region, use the gray - scale centroid method to calculate and locate the positions of each point in the sub - pixel - level multi - peak candidate center point set. The calculation method is:

[0116] Assume that the range of points in the candidate region is \(x\in[x\) s , \(x\) c . The coordinate \(y\) center of the sub - pixel - level weighted center candidate point in the candidate region is:

[0117] where \(y\) x is the pixel row coordinate;

[0118] Finally, perform peak effective - value filtering verification, that is: filter out the abnormal candidate points in each row of the sub - pixel - level multi - peak candidate center point set and the peak candidate points in the abnormal - width candidate region.

[0119] Among them, the abnormal candidate point is a candidate point whose ratio of the gray - scale value to the maximum gray - scale value of the row where the abnormal candidate point is located is less than a predetermined ratio, and the abnormal - width candidate region is a candidate region where the line segment width is greater than a predetermined width.

[0120] Optionally, perform a preliminary screening on the points in the sub - pixel - level multi - peak candidate center point set through a multi - factor constraint algorithm based on a dynamic weighted scoring model to obtain a pre - screened point set, specifically including:

[0121] Perform a continuity analysis on the points in the sub - pixel - level multi - peak candidate center point set. Search for each point in the sub - pixel - level multi - peak candidate center point set vertically forward and backward, and count the number of consecutive occurrences \(L\) k that satisfy the position - offset constraint;

[0122] Calculate the normalized continuity score of the points in the sub - pixel - level multi - peak candidate center point set gray - scale intensity evaluation score and the historical - position constraint score of the candidate points

[0123] The final score of the points in the sub-pixel multi-peak candidate center point set is statistically calculated using a dynamic weighted comprehensive scoring model. The calculation method is as follows:

[0124] Among them, α, β, and γ are weight parameters set in advance according to the usage scenario;

[0125] Select the point with the largest final score in each column of the sub-pixel multi-peak candidate center point set to obtain a preliminary screening point set;

[0126] The calculation of the normalized continuity score of the points in the sub-pixel multi-peak candidate center point set Gray intensity evaluation score And the historical position constraint score of the candidate points Specifically include:

[0127] The calculation method of the position offset constraint is as follows:

[0128] Among them, is the coordinate of the k-th point in the sub-pixel multi-peak candidate center point set, X neighbor is the coordinate of the adjacent points in the rows before and after the k-th point;

[0129] and The calculation methods are as follows:

[0130]

[0131] Among them, max(L) is the maximum continuous number of all points in the row where the k-th point in the sub-pixel multi-peak candidate center point set is located, I (k) is the gray value of the k-th point, I max is the maximum gray value of all points in the column where the k-th point in the sub-pixel multi-peak candidate center point set is located, X prev is the coordinate of the finally selected point in the row before the k-th point, and R is the normalization coefficient.

[0132] Optionally, the neighborhood coordinate continuity of the points in the preliminary screening point set is evaluated by position offset and continuous length constraints, abnormal jump points are eliminated, and discrete broken line segments that do not meet the continuous length requirements are filtered out to obtain a screened center one-dimensional point set, including:

[0133] The neighborhood coordinate continuity is re-evaluated by using the position offset constraint, that is, it is judged whether the adjacent coordinate positions of the points in the preliminary screening point set in the vertical direction are greater than zValue;

[0134] If so, this point is regarded as an abnormal jump point and eliminated;

[0135] If not, then perform sliding window detection to eliminate regions in the preliminary screening point set where the continuous length of points is less than a preset minimum continuous length, and then perform sliding mean filtering on the obtained screened center one-dimensional point set data to obtain the screened center one-dimensional point set data.

[0136] Optionally, the method for repairing the missing central breakpoints caused by screening through a linear interpolation algorithm and generating a continuous and smooth laser stripe centerline in combination with adaptive smoothing filtering includes:

[0137] Based on the assumption of spatial continuity between adjacent valid data points, perform interpolation repair on the discontinuous region of the laser profile by establishing a local linear model; specifically including:

[0138] Detect the break region of the contour line and locate the two breakpoint endpoints P1(x1, y1) and P2(x2, y2);

[0139] Judge whether the number of invalid points between the two breakpoint endpoints is greater than or equal to a preset interpolation threshold;

[0140] If not, directly connect the two breakpoint endpoints;

[0141] If so, construct a parametric line equation: P(t) = P1 + t(P2 - P1), where t ∈ [0, 1];

[0142] After constructing the parametric line equation, it further includes:

[0143] Calculate the missing point coordinates according to the sampling interval:

[0144]

[0145] By supplementing the points (x i , y i ) to reconstruct a geometrically continuous complete centerline contour.

[0146] Optionally, the depth map construction module is specifically used for:

[0147] Calculate the height information of each contour point in the laser stripe center contour line through the principle of direct incidence and oblique reception laser triangulation method;

[0148] Initialize the spatial structure of the depth map matrix according to the measurement range of the transparent glue surface and the preset spatial resolution parameters to obtain the original depth map;

[0149] Synchronize all the data of the two-dimensional contour slices in time sequence, map the column coordinates of the center points of the laser stripe centerline to the corresponding grid coordinates of the original depth map according to the scanning row order, and store its height information in the internal space of the matrix of the original depth map to construct a complete three-dimensional depth distribution model to obtain the glue depth map.

[0150] Optionally, the fitting module is specifically configured to:

[0151] First, use the ROI to select the measurement reference plane in the dispensing depth map, and then convert all the points in the ROI. It can be converted into a set of three-dimensional point sets:

[0152] P = {(x i , y i , z i ) || i = 1, 2,..., n}; where (x i , y i ) are the image coordinates of the pixels, zi is the depth value, and n is the total number of points in the ROI;

[0153] Perform centering processing on the three-dimensional point set, calculate the centroid μ of the three-dimensional point set, and then subtract the centroid from each point in the three-dimensional point set to obtain the centered point set:

[0154] p i = (x i - μ x , y i - μ y , z i - μ z ), i = 1, 2,..., n;

[0155] Represent the centered point set as an n×3 matrix X, where each row represents the three-dimensional coordinates of a point:

[0156]

[0157] For the centered point set X, define its covariance matrix C as:

[0158]

[0159] Perform SVD decomposition on the matrix X: X = U∑V T ;

[0160] Among them, U is an n×n orthogonal matrix representing the spatial distribution of the input data; ∑ is an n×3 diagonal matrix, and its diagonal elements are singular values, arranged in descending order; the right singular vector matrix V is a 3×3 orthogonal matrix, and its column vectors are the principal component directions of the point set and also the eigenvectors of the covariance matrix X T X;

[0161] Use the relationship between the covariance matrix and the right singular vector to diagonalize X T X and perform eigenvalue decomposition on the covariance matrix X T X to calculate the right singular vector matrix V;

[0162] The normal vector of the plane fitted according to the calculated right singular vector matrix V is:

[0163] n = v3 = (a, b, c); where v3 is the principal component direction corresponding to the minimum singular value σ3;

[0164] According to the normal vector n of the fitted plane and the centroid μ, construct the equation of the fitted plane:

[0165] a(x - μ x ) + b(y - μ y ) + c(z - μ z ) = 0, which simplifies to:

[0166] ax + by + cz + d = 0; where: d = -(aμ x + bμ y + cμ z ) is the distance from the plane to the origin;

[0167] Through the rigid body transformation matrix T, each point p = {(x i , y i , z i )|i = 1, 2,..., n} in the dispensing depth map is transformed to a new coordinate system:

[0168] p' = T · p; where p' is the transformed point;

[0169] Among them, the method for obtaining the rigid body transformation matrix T is:

[0170] Use the rotation matrix to correct the plane. According to the relationship between the normal vector n of the fitted plane and the z-axis of the world coordinate system, generate the rotation matrix R, and the expression of R is:

[0171] R = I + sinθ · K + (1 - cosθ) · K 2 ; where: I is the identity matrix; K is the skew-symmetric matrix constructed by the rotation axis k;

[0172]

[0173] The translation vector t is:

[0174] t = -R · μ;

[0175] The form of the rigid body transformation matrix T is:

[0176]

[0177] Optionally, the screening module is specifically used for:

[0178] Perform 3D binarization on the fitted dispensing depth map using the OTSU algorithm to obtain the dispensing binary map;

[0179] Use run - length encoding technology to perform connected - component analysis and connection on the dispensing binary image;

[0180] Based on depth features, screen and segment the protruding three - dimensional connected components that meet the predetermined depth - threshold conditions to obtain the dispensing volume measurement area.

[0181] Optionally, the volume calculation module is specifically configured to:

[0182] Use the projection method to regard each pixel point in the dispensing volume measurement area as an independent cuboid. The bottom surface of these cuboids is determined by the spatial resolution Δx×Δy of the pixel, and the height is determined by the depth value z xy determined;

[0183] Accumulate the volumes of all cuboids to calculate the dispensing volume V within the dispensing volume measurement area. The calculation formula is:

[0184]

[0185] Optionally, the line - laser scanning camera uses purple laser with a wavelength of 405nm, and the background color of the metal sheet is yellow - green.

[0186] In a third aspect, the present invention also provides a computer - readable storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement a method for measuring the volume of transparent dispensing glue as described above.

[0187] In a fourth aspect, the present invention also provides a computer program product, including a computer program / instructions, characterized in that when the computer program / instructions are executed by a processor, a method for measuring the volume of transparent dispensing glue as described above is implemented.

[0188] Compared with the prior art, the beneficial effects of the present invention are:

[0189] A method for measuring the volume of transparent dispensing glue proposed by the present invention uses a background color of the metal sheet that is complementary to the color of the laser. By utilizing its characteristic of absorbing complementary transmitted light, it reduces the interference of transmitted - light scattering and reflection, and greatly improves the imaging effect of the transparent glue; combined with the depth - map processing algorithm, it realizes high - speed and high - precision measurement of the volume of transparent dispensing glue, and can further more accurately control the amount of glue output before dispensing, which is of great significance for product - quality control in the dispensing process production. BRIEF DESCRIPTION OF THE DRAWINGS

[0190] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0191] Figure 1 It is a flowchart of a method for measuring the volume of transparent dispensing glue provided by an embodiment of the present invention.

[0192] Figure 2 It is a schematic diagram of the architecture principle of a system for measuring the volume of transparent dispensing glue provided by an embodiment of the present invention.

[0193] Figure 3 It is a schematic diagram of the correspondence between the object color and the absorbed light color.

[0194] Figure 4 It is a three-dimensional view of the 3*3 pixel size provided by an embodiment of the invention.

[0195] Figure 5 It is a schematic diagram of the structure of a dispensing head provided by an embodiment of the present invention.

[0196] Figure 6 It is for Figure 5 The schematic diagram of the transparent dispensing glue extruded by the dispensing head in [[]] placed on metal sheets with four different background colors.

[0197] Figure 7 It is the effect diagram of the laser stripe center contour line extracted by an embodiment of the present invention.

[0198] Figure 8 It is the depth map of the transparent dispensing glue provided by an embodiment of the present invention on a metal plate with a yellow-green background color.

[0199] Figure 9 It is a schematic diagram of the principle of the direct incidence and oblique reception type laser triangulation method provided by an embodiment of the present invention.

[0200] Figure 10 It is a schematic diagram of the measurement reference plane provided by an embodiment of the present invention.

[0201] Figure 11 It is the effect diagram of the three-dimensional connected domain analysis algorithm provided by an embodiment of the present invention.

[0202] Figure 12 It is the measurement result of the dispensing glue volume provided by an embodiment of the present invention.

[0203] Figure 13 It is the comparative measurement result of the volume error ratio provided by an embodiment of the present invention. Detailed implementation manners

[0204] In order to make the objectives, features, and advantages of the present invention more obvious and understandable, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the embodiments described below are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0205] Embodiment 1:

[0206] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for measuring the volume of transparent dispensing glue provided by an embodiment of the present invention. The method specifically includes:

[0207] Step 110: Place the transparent dispensing glue on a predetermined metal sheet, and obtain the cross-sectional contour image data of the transparent dispensing glue by shooting with a line laser scanning camera.

[0208] As a preferred implementation manner, the color of the laser used by the line laser scanning camera and the background color of the metal sheet are complementary colors; as Figure 3 shown, Figure 3 is a schematic diagram of the correspondence between the object color and the absorbed light color;

[0209] Further, in order to test which complementary color is the best combination, in this embodiment, a dispensing head is used to extrude the transparent glue in a strip shape onto metal sheets with four different background colors (including: yellow-green, blue, pink, and purple);

[0210] According to the principle of selective absorption of light (substances have wavelength dependence on the absorption of light, that is, only absorb light in a specific wavelength range, and allow other wavelengths of light to pass through or be reflected), atoms or molecules in substances have discrete energy levels (ground state and excited state). When the photon energy matches the energy difference between the two energy levels, the electron absorbs the photon and jumps to the high energy state; therefore, the energy difference ΔE of different substances is different, and only absorbs light of a specific wavelength, forming a unique complementary absorbed light;

[0211] The photon energy E is:

[0212]

[0213] where f is the frequency of light, h is Planck's constant, c is the speed of light, and λ 吸收 is the wavelength of the absorbed light.

[0214] Please refer to Figure 5 and Figure 6 , Figure 5 which is a schematic structural diagram of a dispensing head provided by an embodiment of the present invention.Figure 6 Schematic diagram of placing transparent dispensing glue extruded by the dispensing head in Figure 5 on metal sheets with four different background colors; Figure 6 In, (a) corresponds to the metal sheet with a green background color, (b) corresponds to the metal sheet with a blue background color, (c) corresponds to the metal sheet with a pink background color, and (d) corresponds to the metal sheet with a purple background color.

[0215] Through experimental verification, yellow-green objects have a strong absorption of 405nm purple light. Therefore, in this embodiment, the background color of the metal sheet is selected as yellow-green, and the laser uses 405nm purple light; by utilizing the characteristic that the background color of the metal sheet absorbs complementary transmitted light to reduce the interference of transmitted light scattering and reflection, the imaging effect of the transparent glue can be greatly improved;

[0216] In this embodiment, after extruding the dispensing glue, the weight of the dispensing glue is measured by a precision electronic balance and recorded as a reference value. The cured dispensing glue sample is fixed on a three-dimensional motion platform, and the imaging height and the spatial pose of the sample of the 3D line laser scanning camera are calibrated. Then, the moving range of the motion platform is set so that the line laser scanning camera can completely cover the dispensing area for scanning and data acquisition, and then the cross-sectional profile image data of the transparent dispensing glue is obtained. It should be noted that in this embodiment, the cross-sectional profile image data of the transparent dispensing glue includes multiple two-dimensional profile slices.

[0217] Step 120: Extract the laser stripe center contour line of the two-dimensional profile slice.

[0218] Specifically, step 120 includes:

[0219] Step 121: Preprocess the cross-sectional profile image data of the transparent dispensing glue to obtain the corresponding grayscale image.

[0220] More specifically, in step 121, first, the RGB (red, green, yellow) three-channel information is converted into a single-channel grayscale image by using a weighted average algorithm, and the color information is compressed to retain continuous grayscale values (range 0-255);

[0221] Subsequently, the mean filter algorithm is applied to the grayscale image for smoothing processing to effectively suppress noise interference;

[0222] Finally, a matrix transpose operation is performed to convert the column-first storage structure into a row-first storage mode, and the data access efficiency is optimized by using the CPU (Central Processing Unit) cache locality principle, thereby improving the overall processing speed. The grayscale conversion formula of the weighted average method is as follows:

[0223] Gray = 0.299×R + 0.587×G + 0.114×B, where R, G, and B are the three channel values of the input image, and the weight coefficients are 0.299, 0.587, and 0.114 respectively;

[0224] Subsequently, image smoothing is required to remove noise: First, perform mirror filling on the boundary based on the principle of symmetric reflection. By mirroring the pixels in the neighborhood of the image edge with the boundary as the axis of symmetry, virtual boundary pixels are generated to ensure the continuity of the edge region during the image processing;

[0225] Exemplarily, assuming the input image is I(x, y), the output image is O(x, y), and the size of the filtering window is (2k + 1)×(2k + 1), the calculation method of the mean filtering method is as follows:

[0226]

[0227] where: (x, y) is the position of the current pixel, and k is the radius of the filtering window (i.e., half of the window size. For example, for a 3×3 window, k = 1); I(x + i, y + j) represents the gray value of the pixel in the neighborhood centered on (x, y); (2k + 1) 2 is the total number of pixels in the filtering window;

[0228] If the input image is a two-dimensional matrix I with a size of M×N, then the size of the transposed image I T is N×M, and the image transposition operation is as follows:

[0229] I T (i, j) = I(j, i);

[0230] where: I(j, i) is the pixel value of the i-th row and j-th column in the original image; I T (i, j) is the pixel value of the i-th row and j-th column in the transposed image.

[0231] Step 122: Adopt the gray gradient analysis method combined with the sliding window mechanism to locate the sub-pixel multi-peak candidate center point set through the gray centroid method.

[0232] Specifically, step 122 includes:

[0233] Step 1221: Vertically scan the pixels in each row of the gray image to obtain a number of candidate line segments.

[0234] Precisely locate the start and end points and peak points of the candidate line segments through multi-stage gradient analysis by vertically scanning the pixels in each row of the image.

[0235] Step 1222: Detect the boundaries of candidate line segments using a sliding window based on the gray - scale gradient change rate. Control the edge detection sensitivity using a transition length threshold. Use the rising edge of the gray - scale as the starting point and the falling edge of the gray - scale as the end point of the line segment to determine the corresponding candidate regions.

[0236] Step 1223: Use a gray - scale density weighted model to increase the weights of high - gray - value pixels within the candidate regions.

[0237] Apply the gray - scale density weighted model to each candidate point within the candidate regions so that high - gray - value pixels obtain exponentially increasing weights, thereby highlighting the significant features of the target region and improving the positioning accuracy.

[0238] The gray - scale density weighted model is:

[0239] where \(w\) is the weight coefficient, and \(I\) x is the pixel gray - scale value;

[0240] Step 1224: Calculate and locate the positions of each point in the sub - pixel - level multi - peak candidate center point set using the gray - scale centroid method within the candidate regions. The calculation method is as follows:

[0241] Assume the range of points in the candidate region is \(x\in[x\) s , \(x\) c , and the coordinate \(y\) center of the sub - pixel - level weighted center candidate point in the candidate region is:

[0242] where \(y\) x is the pixel row coordinate.

[0243] Step 1225: Finally, perform peak effective value filtering and verification. That is:

[0244] Filter out the abnormal candidate points in each row of the sub - pixel - level multi - peak candidate center point set and the peak candidate points in the abnormal width candidate regions;

[0245] Among them, the abnormal candidate points are the candidate points whose ratio of the gray - scale value to the maximum gray - scale value of the row where the abnormal candidate point is located is less than a predetermined ratio, and the abnormal width candidate region is the candidate region where the line segment width is greater than a predetermined width.

[0246] Exemplarily, for example, filter out the candidate points in a certain row whose gray - scale value is less than 10% of the maximum gray - scale value and the peak candidate points in the abnormal width candidate regions where the candidate region line segment is greater than 20 pixel positions, so as to obtain the center candidate points in each row, for example, the number is 2 - 3.

[0247] Step 123: Through a multi - factor constraint algorithm based on a dynamic weighted scoring model, preliminarily screen the points in the sub - pixel - level multi - peak candidate center point set to obtain a preliminary screening point set.

[0248] Specifically, step 123 includes:

[0249] Step 1231: Perform continuity analysis on the points in the sub-pixel multi-peak candidate center point set. Search for each point in the sub-pixel multi-peak candidate center point set vertically forward and backward, and count the number of consecutive occurrences L that meet the position offset constraint. k ;

[0250] Step 1232: Calculate the normalized continuity score of the points in the sub-pixel multi-peak candidate center point set. Gray-scale intensity evaluation score And the historical position constraint score of the candidate points

[0251] Step 1233: Use a dynamic weighted comprehensive scoring model to statistically calculate the final score of the points in the sub-pixel multi-peak candidate center point set. The calculation method is:

[0252]

[0253] Among them, α, β, and γ are weight parameters set in advance according to the usage scenario; the weight parameters can be dynamically adjusted according to the usage scenario. For example, in this embodiment, it is set as: α = 0.5, β = 0.1, γ = 0.4.

[0254] Step 1234: Select the point with the largest final score in each column of the sub-pixel multi-peak candidate center point set to obtain the preliminary screening point set.

[0255] Specifically, the calculation method of the position offset constraint is:

[0256] Among them, is the coordinate of the k-th point in the sub-pixel multi-peak candidate center point set, and X neighbor is the coordinate of the points adjacent to the k-th point in the front and back rows;

[0257] and The calculation methods are respectively:

[0258]

[0259] Among them, max(L) is the maximum number of consecutive occurrences among all points in the row where the k-th point in the sub-pixel multi-peak candidate center point set is located, and I (k) is the gray value of the k-th point, and I max is the maximum gray value among all points in the column where the k-th point in the sub-pixel multi-peak candidate center point set is located, and X previs the coordinate of the finally selected point in the previous row of the k-th point, and R is the normalization coefficient.

[0260] Step 124: Evaluate the continuity of the neighborhood coordinates of the points in the initially screened point set through position offset and continuous length constraints, eliminate abnormal jump points, and filter out discrete broken line segments that do not meet the continuous length requirements to obtain a one-dimensional point set of the screening center.

[0261] Specifically, Step 124 includes:

[0262] Step 1241: Re-evaluate the continuity of the neighborhood coordinates by using the position offset constraint, that is, judge whether the adjacent coordinate positions of the points in the initially screened point set in the vertical direction are greater than zValue; if so, execute Step 1242; if not, execute Step 1243;

[0263] Step 1242: Regard this point as an abnormal jump point and eliminate it;

[0264] Step 1243: If not, then through sliding window detection, eliminate the area where the continuous length of the points in the initially screened point set is less than the preset minimum continuous length, and then perform sliding mean filtering on the obtained one-dimensional point set data of the screening center to obtain the one-dimensional point set data of the screening center.

[0265] After the preliminary screening is completed, post-processing operations need to be carried out. First, the points with insufficient continuity in the vertical direction need to be removed. The continuity of the neighborhood coordinates is re-evaluated by using the position offset constraint to eliminate abnormal jump points. When the adjacent coordinate position is greater than zValue, this point is regarded as an abnormal jump point and then eliminated;

[0266] Then, through sliding window detection and judging the continuous length of the center point, the area smaller than the minimum continuous length condition (such as 5-6 pixel points) will be cleared to filter out discrete broken line segments that do not meet the length requirements;

[0267] Finally, sliding mean filtering is performed on the obtained one-dimensional point set data of the screening center to simply and quickly remove noise. The calculation method of one-dimensional data sliding mean filtering is as follows:

[0268]

[0269] Assume that the input data is I(1, y), the output data is O(1, y), the filter window size is 1×(2k + 1), (1, y) is the position of the current pixel; k is the radius of the filter window (that is, half of the window size, for example, a 1×3 window corresponds to k = 1); I(1, y + i) represents the gray value of the pixel in the neighborhood centered on (1, y); 2k + 1 is the total number of pixels in the filter window.

[0270] As Figure 4 shown, Figure 4A stereogram with a pixel size of 3*3 provided for an invention embodiment.

[0271] Step 125: Repair the missing central breakpoints caused by screening through a linear interpolation algorithm, and generate a continuous and smooth centerline of the laser stripe by combining adaptive smoothing filtering.

[0272] Specifically, step 125 is implemented as follows:

[0273] Based on the assumption of spatial continuity between adjacent valid data points, interpolate and repair the discontinuous region of the laser profile by establishing a local linear model; specifically including:

[0274] Detect the break region of the contour line and locate the two break point endpoints P1(x1, y1) and P2(x2, y2);

[0275] Judge whether the number of invalid points between the two break point endpoints is greater than or equal to a preset interpolation threshold;

[0276] If not, directly connect the two break point endpoints;

[0277] If so, construct a parametric straight line equation: P(t) = P1 + t(P2 - P1), where t ∈ [0, 1];

[0278] After constructing the parametric straight line equation, it further includes:

[0279] Calculate the coordinates of the missing points according to the sampling interval:

[0280]

[0281] Reconstruct a complete centerline contour with geometric continuity by supplementing the points (x i , y i ).

[0282] It should be noted that when the number of invalid values between breakpoints is greater than or equal to the interpolation threshold, the breakpoints are not connected at this place to avoid generating false interpolation points in the area without real data support; this method ensures the spatial consistency of interpolation points through the Δx / Δy slope constraint.

[0283] Please refer to Figure 7 , Figure 7 for the effect diagram of the extracted center contour line of the laser stripe.

[0284] Step 130: Calculate the height of each contour point in the center contour line of the laser stripe through the laser triangulation principle, and then input all the center contour lines of the laser stripe into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain a dispensing depth map.

[0285] Step 130 includes:

[0286] Step 131. Calculate the height information of each contour point in the laser stripe center contour line through the principle of direct incidence and oblique reception laser triangulation method.

[0287] Please refer to Figure 8 and Figure 9 , Figure 8 which is the depth map of the transparent dispensing on the metal plate with yellow-green background color provided by the embodiment of the present invention, Figure 9 and

[0288] Figure 9 which is the schematic diagram of the principle of the direct incidence and oblique reception laser triangulation method provided by the embodiment of the present invention; Exemplarily, as shown in

[0289]

[0290] Let the included angle between the extension line of the imaging lens center and the normal of the measured object surface be θ, the object distance be a, in the focused imaging state, take the focal length f at a distance OB, when the height of the measured object is h, the aberration on the imaging element is x, draw CD perpendicular to the extension line of the object distance, and it is easy to get that RtΔABO is similar to RtΔCDO, so there is:

[0291]

[0292] From the above formula, the height h of each contour point can be deduced, and thus the height information of each contour point can be obtained.

[0293] Step 132. Initialize the spatial structure of the depth map matrix according to the measurement range on the surface of the transparent dispensing and the preset spatial resolution parameter to obtain the original depth map.

[0294] Synchronize the data of all two-dimensional contour slices in time sequence, map the column coordinates of the center point of the laser stripe center line to the corresponding grid coordinates of the original depth map according to the scanning row sequence, and store its height information in the internal space of the matrix of the original depth map to construct a complete three-dimensional depth distribution model to obtain the dispensing depth map, as shown in Figure 8 .

[0295] Step 140. Select the point set of the measurement reference plane area in the dispensing depth map, solve the optimal plane equation through the fitting plane algorithm based on principal component analysis, and perform plane attitude correction to achieve fitting.

[0296] Step 140 includes:

[0297] Step 141. First, use ROI to select the measurement reference plane in the dispensing depth map, and then convert all the points in the ROI, which can be converted into a set of three-dimensional points.

[0298] Represent the three-dimensional point set as: P = {(x i ,y i, z i ) | i = 1, 2, ..., n}; where, (x i , y i ) are the image coordinates of the pixel, z i is the depth value, and n is the total number of points in the ROI;

[0299] Step 142: Centralize the three-dimensional point set, calculate the centroid μ of the three-dimensional point set, and then subtract the centroid from each point in the three-dimensional point set to obtain the centralized point set.

[0300] The calculation method for the centroid (mean point) of the point set is as follows:

[0301]

[0302] The centralized point set is represented as: p i = (x i - μ x , y i - μ y , z i - μz), i = 1, 2..., n.

[0303] Step 143: Represent the centralized point set as an n×3 matrix X and define its covariance matrix C.

[0304] Matrix X is represented as:

[0305] In matrix X, each row represents the three-dimensional coordinates of a point.

[0306] The covariance matrix C is:

[0307]

[0308] Then, perform SVD decomposition on matrix X.

[0309] Since directly calculating the covariance matrix may involve a large amount of computation, SVD decomposition is performed on matrix X to directly extract the principal component information:

[0310] X = U∑V T ;

[0311] where, U is an n×n orthogonal matrix representing the spatial distribution of the input data; ∑ is an n×3 diagonal matrix whose diagonal elements are singular values arranged in descending order; the right singular vector matrix V is a 3×3 orthogonal matrix whose column vectors are the principal component directions of the point set and also the eigenvectors of the covariance matrix X T X;

[0312] Then, using the relationship between the covariance matrix and the right singular vectors, X TDiagonalize X and calculate the covariance matrix X T Perform eigenvalue decomposition on X to calculate the right singular vector matrix V.

[0313] Step 144: The normal vector of the plane fitted according to the calculated right singular vector matrix V is:[[]]

[0314] n = v3 = (a, b, c); where v3 is the principal component direction corresponding to the minimum singular value σ3.

[0315] Construct the equation of the fitted plane based on the normal vector n of the fitted plane and the centroid μ:[[]]

[0316] a(x - μ x ) + ·b(y - μ y ) + c(z - μ z ) = 0, which simplifies to:[[]]

[0317] ax + ·by + ·cz + d = 0; where: d = -(aμ x + bμ y + cμ z ) is the distance from the plane to the origin.

[0318] Through the rigid body transformation matrix T, transform each point p = {(x i , y i , z i )|i = 1, 2,..., n} in the dispensing depth map to a new coordinate system:[[]]

[0319] p' = T · p; where p' is the transformed point.

[0320] Step 145: Use the rotation matrix to straighten the plane, and generate the rotation matrix R according to the relationship between the normal vector n of the fitted plane and the z-axis of the world coordinate system.

[0321] The expression of R is:[[]]

[0322] R = I + sinθ · K + (1 - cosθ) · K 2 ; where: I is the identity matrix; K is the skew-symmetric matrix constructed from the rotation axis k.

[0323]

[0324] The translation vector t is:[[]]

[0325] t = -R · μ;

[0326] The form of the rigid body transformation matrix T is:[[]]

[0327]

[0328] Finally, to evaluate the fitting effect, the sum of the squared residuals from the point set to the fitted plane can be calculated:

[0329] The smaller the calculated residual, the better the fitting effect.

[0330] Step 150: Perform three-dimensional connected component analysis on the fitted dispensing depth map to screen out the dispensing volume measurement area.

[0331] Step 150 includes:

[0332] Step 151: Use the OTSU algorithm to perform 3D binarization on the fitted dispensing depth map to obtain a dispensing binary map.

[0333] First, count the depth histogram H(z) and perform normalization to calculate the normalized probability distribution P(z);

[0334] Then, traverse each candidate depth threshold and calculate the background probability P0(T), foreground probability P1(T), average depth values μ0(T) and μ1(T) of the background and foreground, the overall mean μ of the depth map, and finally calculate the between-class variance of the candidate depth threshold

[0335] Select the threshold with the largest between-class variance as the optimal threshold, set the depth values of the regions greater than this threshold range to 255, and fill other regions with invalid values to distinguish the object and the background.

[0336] Exemplarily, assume that the depth value range of the depth map is [z min , z max , where z min and z max are the minimum and maximum depth values in the depth map respectively, then the depth histogram H(z) can be expressed as:

[0337] H(z) = count(D(x, y) = z), z ∈ [z min , z max ;

[0338] where: H(z) is the number of pixels with depth value z; D(x, y) is the depth value of the pixel (x, y) in the depth map;

[0339] For the convenience of subsequent calculations, the depth histogram is usually normalized to a probability distribution:

[0340]

[0341] where: P(z) is the probability of the depth value z occurring; N is the total number of pixels in the depth map:

[0342]

[0343] For each candidate threshold \(T\in[z min ,z max \), \(P_0(T)\) and \(P_1(T)\) are respectively defined as:

[0344]

[0345] \(\mu_0(T)\) and \(\mu_1(T)\) are respectively:

[0346]

[0347] The overall mean \(\mu\) of the depth map point set is:

[0348]

[0349] Finally, the between-class variance is used to measure the difference between the background and the foreground. The calculation method of the between-class variance is as follows:

[0350]

[0351] where \(\mu_0(T)-\mu\) and \(\mu_1(T)-\mu\) respectively represent the deviations of the background and the foreground from the overall mean.

[0352] Step 152: Use the run-length encoding technology to perform connected component analysis and connection on the dispensing binary image.

[0353] Specifically, after obtaining the binary image, use the efficient compression and connectivity detection technology of run-length encoding to record the starting position and length of consecutive identical values in each row. Based on run-length encoding, the connected regions can be labeled through the following steps. First, initialize the equivalence table to create an empty equivalence table for recording the connectivity relationships between different runs. Then, traverse the binary image in row-major order, encode the runs in each row, and check whether the current run overlaps with the run in the previous row: if there is an overlap, label them as the same connected region; if there is no overlap, assign a new label. Then merge the equivalent labels: merge the labels with the same connectivity relationship through the equivalence table. Finally, generate a connected region label matrix to connect the same connected regions: finally, a label matrix \(L(x,y)\) is obtained, where the value of each pixel represents the number of the connected region to which it belongs.

[0354] Exemplarily, assume that the encoding representation of run-length encoding is \(R k =(x k , l k ), where: \(x k \) is the starting column coordinate of the run; \(l k \) is the length of the run. For two runs \(R i \) and \(R j, if they satisfy one of the following conditions, they are considered to belong to the same connected region L(x, y), that is:

[0355] Horizontal adjacent condition: |x i -x j | ≤ 1 and l i +l j >|x i -x j |;

[0356] Vertical adjacent condition: R i and R j are located in adjacent rows respectively and there is an overlapping part.

[0357] Step 153: Based on the depth features, screen and segment the protruding three-dimensional connected regions that meet the predetermined depth threshold conditions to obtain the dispensing volume measurement region.

[0358] Specifically, after completing the connected region analysis and connection, calculate the average depth feature μ D of the connected region, and the calculation method is as follows:

[0359] where |R| is the total number of pixels in the connected region.

[0360] Finally, in order to screen out the three-dimensional protruding connected regions that meet the specific depth threshold conditions, depth screening is performed based on the following conditions:

[0361] μ D >T depth ; where T depth is a set depth threshold for excluding the background region.

[0362] Please refer to Figure 11 , Figure 11 for the effect diagram of the three-dimensional connected region analysis algorithm provided by the embodiment of the present invention.

[0363] Step 160: Use the projection method to calculate the dispensing volume in the dispensing volume measurement region.

[0364] Using the projection method, each pixel point in the dispensing volume measurement region is regarded as an independent cuboid. The bottom surface of these cuboids is determined by the spatial resolution Δx×Δy of the pixel, and the height is determined by the depth value z xy ;

[0365] Accumulate the volumes of all cuboids to calculate the dispensing volume V in the dispensing volume measurement region. The calculation formula is:

[0366]

[0367] The experiment uses the weight comparison method. Assuming the measured value of the dispensing volume is V and the density value of the dispensed material is ρ, the volume measurement error ratio can be obtained by calculating the weight G = V·ρ and comparing the error ratio with the true weight.

[0368] Among them, the dispensing volume measurement error ratio of the metal sheet with yellow-green background color is the lowest, and the volume error rate can reach about 1.5%. It can be proved that the effect of reducing the interference of transmitted light scattering and reflection of the yellow-green background color is better than that of other colors. Using the yellow-green background color as the background color can effectively improve the imaging effect of the transparent dispensing.

[0369] Please refer to Figure 12 and Figure 13 , Figure 12 which are the dispensing volume measurement results provided by the embodiments of the present invention. Figure 13 which are the comparative measurement results of the volume error ratio provided by the embodiments of the present invention.

[0370] In summary, compared with the prior art, the present invention has at least the following advantages:

[0371] (1) The background color of the metal sheet uses a color complementary to the laser color. By using its characteristic of absorbing complementary transmitted light, the interference of transmitted light scattering and reflection is reduced, and the imaging effect of the transparent glue is greatly improved, providing more complete depth map data for subsequent volume measurement, and optimizing the imaging effect of the transparent dispensing without relying on other auxiliary measurement techniques or equipment;

[0372] (2) Through the multi-factor constraint algorithm based on the dynamic weighted scoring model, the central candidate extraction points are preliminarily screened, enhancing the stability and accuracy of the screening process and reducing the judgment error caused by ignoring other important factors due to a single variable;

[0373] (3) By selecting the point set in the fitting reference plane to calculate the fitting plane and combining with the attitude correction algorithm, a higher-precision plane fitting is achieved, providing a high-precision measurement reference plane;

[0374] (4) Using the three-dimensional connected domain analysis algorithm can more accurately screen out the dispensing volume measurement area, improving the accuracy of subsequent dispensing volume measurement.

[0375] Embodiment 2:

[0376] Please refer to Figure 2 , Figure 2 which is the schematic architecture diagram of a system for measuring the volume of transparent dispensing provided by the embodiments of the present invention. The system specifically includes:

[0377] A line laser scanning camera 10 is used to capture the cross-sectional profile of a transparent dispensing on a predetermined metal sheet and obtain the cross-sectional profile image data of the transparent dispensing. Among them, the cross-sectional profile image data of the transparent dispensing includes a plurality of two-dimensional profile slices, and the color of the laser used by the line laser scanning camera and the background color of the metal sheet are complementary colors.

[0378] A contour line extraction module 20 is electrically connected to the line laser scanning camera 10 and is used to extract the laser stripe center contour line of the two-dimensional profile slice.

[0379] A depth map construction module 30 is electrically connected to the contour line extraction module 20 and is used to calculate the height of each contour point in the laser stripe center contour line through the laser triangulation principle, and then combine all the laser stripe center contour lines and input them into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain a dispensing depth map.

[0380] A fitting module 40 is electrically connected to the depth map construction module 30 and is used to select a set of points in the measurement reference plane area of the dispensing depth map, solve the optimal plane equation through the fitting plane algorithm based on principal component analysis, and perform plane attitude correction to achieve fitting.

[0381] A screening module 50 is electrically connected to the fitting module 40 and is used to perform three-dimensional connected domain analysis on the fitted dispensing depth map to screen out the dispensing volume measurement area.

[0382] A volume calculation module 60 is electrically connected to the screening module 50 and is used to calculate the dispensing volume in the dispensing volume measurement area by using the projection method.

[0383] Since the method for measuring the volume of the transparent dispensing has been described in detail in Embodiment 1, it will not be repeated in this embodiment.

[0384] A system for measuring the volume of a transparent dispensing proposed in this embodiment can be applied to the dispensing process flow to provide accurate data support and real-time feedback for calibrating the glue amount of the dispensing head, thereby effectively optimizing the control of the glue output before dispensing, which is of great significance for product quality control and production efficiency improvement in the dispensing process.

[0385] Embodiment 3:

[0386] This embodiment also provides a computer-readable storage medium, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement a method for measuring the volume of a transparent dispensing as described in Embodiment 1.

[0387] Since the method for measuring the volume of the transparent dispensing has been described in detail in Embodiment 1, it will not be repeated in this embodiment.

[0388] Embodiment 4:

[0389] The present invention also provides a computer program product, comprising a computer program / instructions, characterized in that when the computer program / instructions are executed by a processor, a method for measuring the volume of transparent dispensing as described in Embodiment 1 is implemented.

[0390] Since Embodiment 1 has elaborated in detail on the method for measuring the volume of transparent dispensing, it will not be repeated in this embodiment.

[0391] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical discs that can store program codes.

[0392] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of various embodiments of the present invention.

Claims

1. A method for measuring the volume of transparent glue dispensing, characterized in that: include: Placing a transparent glue dot on a predetermined metal sheet, and acquiring cross-sectional profile image data of the transparent glue dot by photographing with a line laser scanning camera; wherein the cross-sectional profile image data of the transparent glue dot includes a plurality of two-dimensional profile slices, and the color of the laser used by the line laser scanning camera and the background color of the metal sheet are complementary colors; Extracting the center contour line of the laser stripe of the two-dimensional contour slice; The height of each contour point in the center contour line of the laser stripe is calculated by the laser triangulation principle, and then all the center contour lines of the laser stripe are combined and input into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain a dispensing depth map; Select the measurement reference surface area point set in the dispensing depth map, use the principal component analysis-based fitting plane algorithm to solve the optimal plane equation, and perform plane posture correction to achieve fitting; Perform three-dimensional connected domain analysis on the fitted dispensing depth map to screen out the dispensing volume measurement area; The dispensing volume within the dispensing volume measurement area is calculated using the projection method.

2. A method for measuring the volume of transparent glue dispensing according to claim 1, characterized in that: The step of extracting the laser stripe center contour line of the two-dimensional contour slice specifically includes: Preprocess the cross-sectional profile image data of the transparent dispensing glue to obtain the corresponding grayscale image; The grayscale gradient analysis method is combined with the sliding window mechanism to locate the sub-pixel multi-peak candidate center point set through the grayscale centroid method; Through a multi-factor constraint algorithm based on a dynamic weighted scoring model, the points in the sub-pixel multi-peak candidate center point set are preliminarily screened to obtain a preliminary screening point set; The continuity of the neighborhood coordinates of the points in the initial screening point set is evaluated through position offset and continuous length constraints, abnormal jump points are eliminated, and discrete broken line segments that do not meet the continuous length requirements are filtered out to obtain a one-dimensional point set of the screening center; The missing center breakpoints caused by screening are repaired by linear interpolation algorithm, and a continuous and smooth center line of the laser stripe is generated by combining adaptive smoothing filtering.

3. A method for measuring the volume of transparent glue dispensing according to claim 2, characterized in that: The grayscale gradient analysis method is combined with a sliding window mechanism to locate the sub-pixel multi-peak candidate center point set by a grayscale centroid method, specifically including: Vertically scan the pixels in each row of the grayscale image to obtain several candidate line segments; The boundary of the candidate line segment is detected by using a sliding window based on the grayscale gradient change rate, and the edge detection sensitivity is controlled by using the transition length threshold. The grayscale rising edge is taken as the starting point and the grayscale falling edge is taken as the end point of the line segment to determine the corresponding candidate area. The grayscale density weighted model is used to increase the weight of high grayscale value pixels in the candidate area; the grayscale density weighted model is: Among them, w is the weight coefficient, I x is the pixel gray value; In the candidate area, the grayscale centroid method is used to calculate and locate the positions of each point in the sub-pixel multi-peak candidate center point set. The calculation method is: Assume that the range of the candidate region midpoints is x∈[x s , x c ], the coordinate y of the sub-pixel weighted center candidate point in the candidate area center for: Among them, y x is the pixel row coordinate; Finally, the peak effective value filtering verification is performed, that is, the abnormal candidate points in each row of the sub-pixel multi-peak candidate center point set and the peak candidate points in the abnormal width candidate area are filtered out; The abnormal candidate point is a candidate point whose ratio of grayscale value to the maximum grayscale value of the row where the abnormal candidate point is located is less than a predetermined ratio, and the abnormal width candidate area is a candidate area whose line segment width is greater than a predetermined width.

4. A method for measuring the volume of transparent glue dispensing according to claim 3, characterized in that: The method uses a multi-factor constraint algorithm based on a dynamic weighted scoring model to preliminarily screen the points in the sub-pixel multi-peak candidate center point set to obtain a preliminarily screened point set, specifically including: Perform continuity analysis on the points in the sub-pixel multi-peak candidate center point set, search each point in the sub-pixel multi-peak candidate center point set forward and backward along the vertical direction, and count the number of consecutive occurrences that meet the position offset constraint L k ; Calculate the normalized continuity score of the sub-pixel multi-peak candidate center point concentration Grayscale intensity evaluation score And the historical position constraint score of the candidate point The dynamic weighted comprehensive scoring model is used to calculate the final score of the sub-pixel multi-peak candidate center point concentration point The calculation method is: Among them, α, β and γ are weight parameters pre-set according to the usage scenario; Select the point with the largest final score in each column of the sub-pixel multi-peak candidate center point set to obtain the initial screening point set; The calculation of the normalized continuity score of the sub-pixel multi-peak candidate center point concentration point Grayscale intensity evaluation score And the historical position constraint score of the candidate point Specifically include: The position offset constraint is calculated as: in, is the coordinate of the kth point in the sub-pixel multi-peak candidate center point set, X neighbor are the coordinates of the points in the rows before and after the kth point; and The calculation methods are: Among them, max(L) is the maximum number of consecutive times among all points in the row where the kth point of the sub-pixel multi-peak candidate center point set is located, and I (k) is the gray value of the kth point, I max is the maximum gray value of all points in the column where the kth point of the sub-pixel multi-peak candidate center point set is located, X prev are the coordinates of the final selected point in the row before the kth point, and R is the normalization coefficient.

5. A method for measuring the volume of transparent glue dispensing according to claim 4, characterized in that: The continuity of the neighborhood coordinates of the points in the initial screening point set is evaluated by position offset and continuous length constraint, abnormal jump points are eliminated, and discrete broken line segments that do not meet the continuous length requirements are filtered out to obtain a one-dimensional point set of the screening center, including: The continuity of the neighborhood coordinates is evaluated again by adopting the position offset constraint, that is, judging whether the adjacent coordinate position of the points in the initial screening point set in the vertical direction is greater than zValue; If so, treat the point as an abnormal jump point and eliminate it; If not, the sliding window detection is used to eliminate the areas in the initial screening point set where the continuous length of the points is less than the preset minimum continuous length, and then the one-dimensional point set data of the obtained screening center is subjected to sliding mean filtering to obtain the one-dimensional point set data of the screening center.

6. A method for measuring the volume of transparent glue dispensing according to claim 5, characterized in that: The method of repairing the missing center breakpoints caused by screening by a linear interpolation algorithm and combining the adaptive smoothing filter to generate a continuous and smooth center line of the laser stripe includes: Based on the assumption of spatial continuity between adjacent valid data points, the discontinuous area of ​​the laser profile is interpolated and repaired by establishing a local linear model; specifically, it includes: Detect the discontinuity area of ​​the contour line and locate the two breakpoint endpoints P1(x1,y1) and P2(x2,y2); Determine whether the number of invalid points between two breakpoint endpoints is greater than or equal to a preset interpolation threshold; If not, connect the two breakpoint endpoints directly; If so, construct the parameterized straight line equation: P(t) = P1 + t(P2 - P1), where t∈[0, 1]; After constructing the parameterized straight line equation, the following steps are further included: Calculate the missing point coordinates based on the sampling interval: By adding the point (x i ,y i )Reconstruct the geometrically continuous complete centerline profile.

7. A method for measuring the volume of transparent glue dispensing according to claim 6, characterized in that: The height of each contour point in the center contour line of the laser stripe is calculated by the laser triangulation principle, and then all the center contour lines of the laser stripe are combined and input into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain the dispensing depth map, which specifically includes: The height information of each contour point in the center contour line of the laser stripe is calculated by the principle of direct oblique laser triangulation method; According to the measurement range of the transparent dispensing surface and the preset spatial resolution parameters, the spatial structure of the depth map matrix is ​​initialized to obtain the original depth map; By synchronizing the data of all the two-dimensional contour slices in time series, the column coordinates of the center point of the center line of the laser stripe are mapped to the grid coordinates corresponding to the original depth map in the scanning row order, and its height information is stored in the internal space of the matrix of the original depth map to construct a complete three-dimensional depth distribution model and obtain the dispensing depth map.

8. A method for measuring the volume of transparent glue dispensing according to claim 7, characterized in that: The method of selecting a measurement reference plane area point set in the dispensing depth map, performing a plane fitting algorithm based on principal component analysis to solve the optimal plane equation, and performing plane posture correction to achieve fitting specifically includes: First, use ROI to select the measurement reference plane in the dispensing depth map, and then convert all the points in ROI into a set of three-dimensional point sets: P = {(x i ,y i , z i )|i=1,2,...,n};where, (x i ,y i ) is the image coordinate of the pixel, z i is the depth value, n is the total number of points in the ROI; Centralize the three-dimensional point set, calculate the centroid μ of the three-dimensional point set, and then subtract the centroid from each point in the three-dimensional point set to obtain the centralized point set: p′ i =(x i -m x ,y i -m y ,z i -m z ),i=1,2,...,n; The centralized point set is represented as an n×3 matrix X, where each row represents the three-dimensional coordinates of a point: For the centered point set X, its covariance matrix C is defined as: Perform SVD decomposition on matrix X: X=UΣV T ; Among them, U is an n×n orthogonal matrix, which represents the spatial distribution of the input data; ∑ is an n×3 diagonal matrix whose diagonal elements are singular values, arranged in descending order; the right singular vector matrix V is a 3×3 orthogonal matrix whose column vectors are the principal component directions of the point set, which is also the covariance matrix X T The eigenvector of X; Using the relationship between the covariance matrix and the right singular vector, X T X is diagonalized and the covariance matrix X is T Perform eigenvalue decomposition on X and calculate the right singular vector matrix V; The normal vector of the fitted plane according to the calculated right singular vector matrix V is: n=v3=(a,b,c); where v3 is the principal component direction corresponding to the minimum singular value σ3; According to the normal vector n and the center of mass μ of the fitting plane, the equation of the fitting plane is constructed: a(x-μ x )+b(y-μ y )+c(z-μ z )=0, simplifying to get: ax+by+cz+d=0; where: d=-(aμ x +bμ y +cμ z ) is the distance from the plane to the origin; Through the rigid body transformation matrix T, each point P in the dispensing depth map is transformed into {(x i ,y i , z i )|i=1,2,...,n}, transform to the new coordinate system: p′=T·p; where p' is the transformed point; Among them, the method for obtaining the rigid body transformation matrix T is: Use the rotation matrix to normalize the plane, and generate the rotation matrix R according to the relationship between the normal vector n of the fitted plane and the z-axis of the world coordinate system. The expression of R is: R=I+sinθ·K+(1-cosθ)·K 2 ; Where: I is the identity matrix; K is the antisymmetric matrix constructed by the rotation axis k; The translation vector t is: t=-R·μ; The rigid body transformation matrix form T is:

9. A method for measuring the volume of transparent glue dispensing according to claim 8, characterized in that: The three-dimensional connected domain analysis is performed on the fitted dispensing depth map to screen out the dispensing volume measurement area, specifically including: The fitted dispensing depth map is converted into a 3D binary map using the OTSU algorithm to obtain a dispensing binary map. Run-length encoding technology is used to analyze and connect the connected domains of the glue-dot binary graph; Based on the depth feature, the convex three-dimensional connected domain that meets the predetermined depth threshold condition is screened and segmented to obtain the dispensing volume measurement area.

10. A method for measuring the volume of transparent glue dispensing according to claim 9, characterized in that: The method of calculating the dispensing volume in the dispensing volume measurement area by using the projection method specifically includes: The projection method is used to treat each pixel point in the dispensing volume measurement area as an independent cuboid. The bottom of these cuboids is determined by the spatial resolution Δx×Δy of the pixel, and the height is determined by the depth value z. xy Decide; The volumes of all cuboids are accumulated to calculate the dispensing volume V in the dispensing volume measurement area. The calculation formula is:

11. A system for measuring the volume of transparent glue dispensing, characterized in that: include: A line laser scanning camera is used to photograph the cross-sectional profile of a transparent adhesive dot placed on a predetermined metal sheet to obtain cross-sectional profile image data of the transparent adhesive dot; wherein the cross-sectional profile image data of the transparent adhesive dot includes a plurality of two-dimensional profile slices, and the color of the laser used by the line laser scanning camera and the background color of the metal sheet are complementary colors; A contour line extraction module, electrically connected to the line laser scanning camera, for extracting the center contour line of the laser stripe of the two-dimensional contour slice; A depth map construction module, electrically connected to the contour extraction module, is used to calculate the height of each contour point in the center contour of the laser stripe by laser triangulation principle, and then input all the center contours of the laser stripe into the depth map space to reconstruct a complete three-dimensional depth distribution model to obtain a dispensing depth map; A fitting module, electrically connected to the depth map building module, is used to select a measurement reference plane area point set in the dispensing depth map, perform a fitting plane algorithm based on principal component analysis to solve the optimal plane equation, and perform plane posture correction to achieve fitting; A screening module, electrically connected to the fitting module, for performing a three-dimensional connected domain analysis on the fitted dispensing depth map to screen out a dispensing volume measurement area; The volume calculation module is electrically connected to the screening module and is used to calculate the dispensing volume within the dispensing volume measurement area by using a projection method.

12. A system for measuring transparent glue dispensing volume according to claim 11, characterized in that: The contour extraction module is specifically used for: Preprocess the cross-sectional profile image data of the transparent dispensing glue to obtain the corresponding grayscale image; The grayscale gradient analysis method is combined with the sliding window mechanism to locate the sub-pixel multi-peak candidate center point set through the grayscale centroid method; Through a multi-factor constraint algorithm based on a dynamic weighted scoring model, the points in the sub-pixel multi-peak candidate center point set are preliminarily screened to obtain a preliminary screening point set; The continuity of the neighborhood coordinates of the points in the initial screening point set is evaluated through position offset and continuous length constraints, abnormal jump points are eliminated, and discrete broken line segments that do not meet the continuous length requirements are filtered out to obtain a one-dimensional point set of the screening center; The missing center breakpoints caused by screening are repaired by linear interpolation algorithm, and a continuous and smooth center line of the laser stripe is generated by combining adaptive smoothing filtering.

13. A system for measuring transparent glue dispensing volume according to claim 12, characterized in that: The grayscale gradient analysis method is combined with a sliding window mechanism to locate the sub-pixel multi-peak candidate center point set by a grayscale centroid method, specifically including: Vertically scan the pixels in each row of the grayscale image to obtain several candidate line segments; The boundary of the candidate line segment is detected by using a sliding window based on the grayscale gradient change rate, and the edge detection sensitivity is controlled by using the transition length threshold. The grayscale rising edge is taken as the starting point and the grayscale falling edge is taken as the end point of the line segment to determine the corresponding candidate area. The grayscale density weighted model is used to increase the weight of high grayscale value pixels in the candidate area; the grayscale density weighted model is: Among them, w is the weight coefficient, I x is the pixel gray value; In the candidate area, the grayscale centroid method is used to calculate and locate the positions of each point in the sub-pixel multi-peak candidate center point set. The calculation method is: Assume that the range of the candidate region midpoints is x∈[x s , x c ], the coordinate y of the sub-pixel weighted center candidate point in the candidate area center for: Among them, y x is the pixel row coordinate; Finally, the peak effective value filtering verification is performed, that is, the abnormal candidate points in each row of the sub-pixel multi-peak candidate center point set and the peak candidate points in the abnormal width candidate area are filtered out; The abnormal candidate point is a candidate point whose ratio of grayscale value to the maximum grayscale value of the row where the abnormal candidate point is located is less than a predetermined ratio, and the abnormal width candidate area is a candidate area whose line segment width is greater than a predetermined width.

14. A system for measuring transparent glue dispensing volume according to claim 13, characterized in that: The method uses a multi-factor constraint algorithm based on a dynamic weighted scoring model to preliminarily screen the points in the sub-pixel multi-peak candidate center point set to obtain a preliminarily screened point set, specifically including: Perform continuity analysis on the points in the sub-pixel multi-peak candidate center point set, search each point in the sub-pixel multi-peak candidate center point set forward and backward along the vertical direction, and count the number of consecutive occurrences that meet the position offset constraint L k ; Calculate the normalized continuity score of the sub-pixel multi-peak candidate center point concentration Grayscale intensity evaluation score And the historical position constraint score of the candidate point The dynamic weighted comprehensive scoring model is used to calculate the final score of the sub-pixel multi-peak candidate center point concentration point The calculation method is: Among them, α, β and γ are weight parameters pre-set according to the usage scenario; Select the point with the largest final score in each column of the sub-pixel multi-peak candidate center point set to obtain the initial screening point set; The calculation of the normalized continuity score of the sub-pixel multi-peak candidate center point concentration point Grayscale intensity evaluation score And the historical position constraint score of the candidate point Specifically include: The position offset constraint is calculated as: in, is the coordinate of the kth point in the sub-pixel multi-peak candidate center point set, X neighbor are the coordinates of the points in the rows before and after the kth point; and The calculation methods are: Among them, max(L) is the maximum number of consecutive times among all points in the row where the kth point of the sub-pixel multi-peak candidate center point set is located, and I (k) is the gray value of the kth point, I max is the maximum gray value of all points in the column where the kth point of the sub-pixel multi-peak candidate center point set is located, X prev are the coordinates of the final selected point in the row before the kth point, and R is the normalization coefficient.

15. A system for measuring transparent glue dispensing volume according to claim 14, characterized in that: The continuity of the neighborhood coordinates of the points in the initial screening point set is evaluated by position offset and continuous length constraint, abnormal jump points are eliminated, and discrete broken line segments that do not meet the continuous length requirements are filtered out to obtain a one-dimensional point set of the screening center, including: The continuity of the neighborhood coordinates is evaluated again by adopting the position offset constraint, that is, judging whether the adjacent coordinate position of the points in the initial screening point set in the vertical direction is greater than zValue; If so, treat the point as an abnormal jump point and eliminate it; If not, the sliding window detection is used to eliminate the areas in the initial screening point set where the continuous length of the points is less than the preset minimum continuous length, and then the one-dimensional point set data of the obtained screening center is subjected to sliding mean filtering to obtain the one-dimensional point set data of the screening center.

16. A system for measuring transparent glue dispensing volume according to claim 15, characterized in that: The method of repairing the missing center breakpoints caused by screening by a linear interpolation algorithm and combining the adaptive smoothing filter to generate a continuous and smooth center line of the laser stripe includes: Based on the assumption of spatial continuity between adjacent valid data points, the discontinuous area of ​​the laser profile is interpolated and repaired by establishing a local linear model; specifically, it includes: Detect the discontinuity area of ​​the contour line and locate the two breakpoint endpoints P1(x1,y1) and P2(x2,y2); Determine whether the number of invalid points between two breakpoint endpoints is greater than or equal to a preset interpolation threshold; If not, connect the two breakpoint endpoints directly; If so, construct the parameterized straight line equation: P(t) = P1 + t(P2 - P1), where t∈[0, 1]; After constructing the parameterized straight line equation, the following steps are further included: Calculate the missing point coordinates based on the sampling interval: By adding the point (x i ,y i )Reconstruct the geometrically continuous complete centerline profile.

17. A system for measuring transparent glue dispensing volume according to claim 16, characterized in that: The depth map construction module is specifically used for: The height information of each contour point in the center contour line of the laser stripe is calculated by the principle of direct oblique laser triangulation method; According to the measurement range of the transparent dispensing surface and the preset spatial resolution parameters, the spatial structure of the depth map matrix is ​​initialized to obtain the original depth map; By synchronizing the data of all the two-dimensional contour slices in time series, the column coordinates of the center point of the center line of the laser stripe are mapped to the grid coordinates corresponding to the original depth map in the scanning row order, and its height information is stored in the internal space of the matrix of the original depth map to construct a complete three-dimensional depth distribution model and obtain the dispensing depth map.

18. A system for measuring transparent glue dispensing volume according to claim 17, characterized in that: The fitting module is specifically used for: First, use ROI to select the measurement reference plane in the dispensing depth map, and then convert all the points in ROI into a set of three-dimensional point sets: P = {x i ,y i , z i )|i=1,2,...,n};where, (x i ,y i ) is the image coordinate of the pixel, z i is the depth value, n is the total number of points in the ROI; Centralize the three-dimensional point set, calculate the centroid μ of the three-dimensional point set, and then subtract the centroid from each point in the three-dimensional point set to obtain the centralized point set: The centralized point set is represented as an n×3 matrix X, where each row represents the three-dimensional coordinates of a point: For the centered point set X, its covariance matrix C is defined as: Perform SVD decomposition on matrix X: X = U∑V T ; Among them, U is an n×n orthogonal matrix, which represents the spatial distribution of the input data; ∑ is an n×3 diagonal matrix whose diagonal elements are singular values, arranged in descending order; the right singular vector matrix V is a 3×3 orthogonal matrix whose column vectors are the principal component directions of the point set, which is also the covariance matrix X T The eigenvector of X; Using the relationship between the covariance matrix and the right singular vector, X T X is diagonalized and the covariance matrix X is T Perform eigenvalue decomposition on X and calculate the right singular vector matrix V; The normal vector of the fitted plane according to the calculated right singular vector matrix V is: n=v3=(a, b, c); where v3 is the principal component direction corresponding to the minimum singular value σ3; According to the normal vector n and the center of mass μ of the fitting plane, the equation of the fitting plane is constructed: (x-μ x )+b(y-μ y )+c(z-μ z )=0, simplifying to get: ax+by+cz+d=0; where: d=-(aμ x +bμ y +cμ z ) is the distance from the plane to the origin; Through the rigid body transformation matrix T, each point p in the dispensing depth map is transformed into {(x i ,y i , z i )|i=1,2,...,n}, transform to the new coordinate system: p′=T·p; where p' is the transformed point; Among them, the method for obtaining the rigid body transformation matrix T is: Use the rotation matrix to normalize the plane, and generate the rotation matrix R according to the relationship between the normal vector n of the fitted plane and the z-axis of the world coordinate system. The expression of R is: R=I+sinθ·K+(1-cosθ)·K 2 ; Where: I is the identity matrix; K is the antisymmetric matrix constructed by the rotation axis k; The translation vector t is: t=-R·μ; The rigid body transformation matrix form T is:

19. A system for measuring transparent glue dispensing volume according to claim 18, characterized in that: The screening module is specifically used for: The fitted dispensing depth map is converted into a 3D binary map using the OTSU algorithm to obtain a dispensing binary map. Run-length encoding technology is used to analyze and connect the connected domains of the glue-dot binary graph; Based on the depth feature, the convex three-dimensional connected domain that meets the predetermined depth threshold condition is screened and segmented to obtain the dispensing volume measurement area.

20. The system for measuring the volume of transparent glue dispensing according to claim 19, characterized in that: The volume calculation module is specifically used for: The projection method is used to treat each pixel point in the dispensing volume measurement area as an independent cuboid. The bottom surface of these cuboids is determined by the spatial resolution Δx×Δy of the pixel, and the height is determined by the depth value z. xy Decide; The volumes of all cuboids are accumulated to calculate the dispensing volume V in the dispensing volume measurement area. The calculation formula is:

21. The system for measuring the volume of transparent glue dispensing according to claim 11, characterized in that: The line laser scanning camera uses a violet laser with a wavelength of 405nm, and the base color of the metal sheet is yellow-green.

22. A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, characterized in that: The instructions are loaded and executed by the processor to implement a method for measuring the volume of transparent glue dispensing as described in any one of claims 1-10.

23. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, a method for measuring the volume of transparent glue dispensing as described in any one of claims 1-10 is implemented.

Citation Information

Patent Citations

  • Method for measuring gluing volume distribution

    CN101144884A

  • A method of 3D contour measurement of a workpiece on a conveyor belt based on line laser scanning

    CN107578464A

  • Glue dispensing device, detection method for glue dispensing size, and glue dispensing equipment

    CN110376208A

  • Circuit board dispensing detection method and device and computer readable storage medium

    CN113866171A

  • Packing box geometric dimension measuring method based on structured light camera

    CN115682941A

Cited By

  • Tortoise-shell glue quality detection method and system based on image recognition

    CN120976170A

  • An image recognition-based quality detection method and system for tortoise shell glue

    CN120976170B