A method for measuring the optical contact angle of non-axisymmetric droplets based on an improved Young-Laplace algorithm
By improving the Young-Laplace algorithm and combining it with differential evolution and dynamic time warping algorithms, the error and efficiency problems in non-axisymmetric droplet measurement are solved, achieving high-precision and reliable contact angle measurement, which is applicable to fields such as ship antifouling, mineral flotation, and medical materials.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG HOLDER ELECTRONIC TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-30
AI Technical Summary
The existing Young-Laplace algorithm suffers from large errors and low efficiency when measuring non-axisymmetric droplets, and traditional methods cannot adapt to real-world scenarios such as rough and uneven sample surfaces and tilted sample stages.
An improved Young-Laplace algorithm is adopted, which extracts the true contour of the droplet using the Canny operator. The differential evolution algorithm and dynamic time warping algorithm are combined to fit the left and right halves of the droplet contour respectively, optimize the fitting parameters, eliminate the influence of step size, and improve measurement accuracy and efficiency.
It achieves high-precision measurement of non-axisymmetric droplets, reduces systematic errors, and improves the reliability and adaptability of measurement results, making it suitable for research on material surface properties in multiple fields.
Smart Images

Figure CN121921323B_ABST
Abstract
Description
Technical Field
[0001] This invention is a non-axisymmetric droplet optical contact angle measurement method based on an improved Young-Laplace algorithm, belonging to the field of optical system technology. Background Technology
[0002] Contact angle is an important parameter characterizing the surface properties of materials. Digital image measurement of contact angle of droplets on solid surfaces can conveniently and quickly obtain important information such as solid surface free energy, liquid thermodynamic surface free energy, adhesion work, and surface tension. Therefore, it is widely used in fields such as ship antifouling, mineral flotation, oil extraction, medical materials, agronomy, and detergent manufacturing.
[0003] Currently, commonly used digital image measurement methods for contact angles include: height measurement, angle measurement, circle fitting, ellipse fitting, curve fitting, and the Young-Laplace equation method. Height measurement, angle measurement, circle fitting, and ellipse fitting methods assume the droplet shape is approximately spherical or ellipsoidal. These methods lack support from surface chemistry theory, only satisfying geometric similarity, and their accuracy is significantly affected by droplet size or gravity. Curve fitting directly fits the droplet profile near the triple point using polynomial curves or smooth splines. Because its fitting range lacks ideal or target boundaries, its accuracy significantly depends on the quality of the profile image near the triple point, the curve fitting method, and the number of fitting points. The Young-Laplace equation, based on the relationship between the internal and external pressure difference of a closed interface and the interface curvature and tension, can accurately describe the shape profile of an axisymmetric droplet. Therefore, it can be used to calculate the surface tension of a droplet and to obtain a relatively accurate contact angle at the triple point.
[0004] The use of the Young-Laplace equation method for contact angle measurement is currently a trend in this field, offering significantly higher accuracy than conventional methods such as circle fitting, ellipse fitting, and polynomial fitting. However, there is still considerable room for improvement, such as: 1) Some existing technologies use Euclidean distance as the objective function of the Young-Laplace equation, which leads to varying coordinate changes at different step lengths and requires careful selection of a suitable step size, resulting in larger errors. Therefore, the objective function needs to be improved to eliminate the influence of step size variations on the fitting results and enhance the accuracy of contact angle measurement; 2) The nonlinear multivariable differential properties of the Young-Laplace equation system mean that the speed, accuracy, and reliability of the actual solution are affected by the solution algorithm. Some existing technologies use algorithms such as least squares, Newton's iteration method, and simplex method for optimization, which are inefficient and slow. 3) Currently available Young-Laplace algorithms treat droplets as axisymmetric during measurement. However, due to issues such as rough and uneven sample surfaces and tilted sample stages, actual droplets are usually non-axisymmetric, with unequal contact angles on the left and right sides. Continuing to use axisymmetric Young-Laplace algorithms will result in significant errors. Therefore, it is necessary to improve the Young-Laplace algorithm to make it suitable for measuring non-axisymmetric droplets. Summary of the Invention
[0005] The technical problem to be solved by this invention is to address the above-mentioned shortcomings by providing a non-axisymmetric droplet optical contact angle measurement method based on an improved Young-Laplace algorithm. The Young-Laplace algorithm is improved by adopting an optical contact angle measurement method suitable for non-axisymmetric droplets, thereby improving the accuracy, efficiency and reliability of contact angle measurement, reducing various error interferences, obtaining more realistic measurement results, and providing more accurate and reliable parameter data support for the study of material surface properties in various fields.
[0006] To solve the above technical problems, the present invention adopts the following technical solution:
[0007] A method for measuring the optical contact angle of a non-axisymmetric droplet based on an improved Young-Laplace algorithm includes the following steps:
[0008] Step 1, Droplet image acquisition and preprocessing;
[0009] The original digital image of the droplet under test is acquired by an optical contact angle measuring instrument, and then the image processing algorithm of binarization and Gaussian filtering is used to remove image noise and enhance the contrast between the droplet and the background.
[0010] Step 2, extraction and feature analysis of the true contour of the droplet;
[0011] The Canny operator is used to extract the true profile of the droplet, the tangent slope is calculated by traversing the profile points, the contact points of the solid, liquid and gas phases with abrupt slope changes are located, the baseline equation is obtained by straight-line fitting of the two three-phase contact points, and then the droplet profile curve is simplified.
[0012] Step 3: Calculate the initial values of the fitting parameters based on the actual contour;
[0013] Determine the initial values of the calibration parameters of the Young coordinate system relative to the image coordinate system. , α, ( , Let α be the coordinates of the origin of the Young's coordinate system in the image coordinate system, and let α be the rotation angle of the camera, which is also the rotation angle of the Young's coordinate system relative to the image coordinate system. Then, set two sets of shape factors. , , , Adapting to the left and right halves of the droplet contour respectively, the derivation and determination are then performed. , , , The initial values are integrated to obtain , α , , , There are a total of 7 initial values for the fitting parameters;
[0014] Step 4: Solve the improved Young-Laplace equations and fit the theoretical curve;
[0015] Based on the initial values of 7 fitting parameters, the droplet profile is ( , The contour is divided into left and right halves centered on the center. The fourth-order Runge-Kutta method is used to solve the Young-Laplace equation system for the left and right halves respectively, and the theoretical curve points of the left and right halves are obtained and spliced into a complete theoretical curve.
[0016] Step 5: Establish the objective function and constraints;
[0017] The theoretical curve points in the Young coordinate system are transformed to the image coordinate system to achieve coordinate system one. The Euclidean distance matrix between the theoretical curve points and the real contour points is constructed. The shortest path from the upper left corner to the lower right corner in the distance matrix is solved by the dynamic time warping algorithm. The length of the shortest path is used as the objective function to characterize the similarity between the theoretical curve and the real contour.
[0018] Step 6: Use the differential evolution algorithm to iteratively optimize the fitted parameters;
[0019] Population initialization is performed based on 7 initial values of fitting parameters. Experimental individuals are generated through mutation and crossover operations. A greedy selection strategy is used to select individuals with better fitness to enter the next generation. The new individuals are substituted into steps 4 and 5 to resolve the theoretical curve and shortest path. The mutation, crossover and selection process is repeated until the maximum number of iterations or the shortest path value converges.
[0020] Step 7: Solve for the optimal theoretical curve;
[0021] When the maximum number of iterations is reached, or the new shortest path converges, the optimal curve is found, and the optimal fitting parameters corresponding to the optimal curve are obtained. These parameters, along with the step size d=1, are then substituted into the fourth-order Runge-Kutta method to solve for the dense theoretical curve points.
[0022] Step 8: Find the intersection point of the optimal curve and the baseline, and output the contact angle value of that point. Iterate through every point on the curve to find the curve point closest to the two triple points. Calculate the angle between the contour tangent corresponding to the curve point at the two triple points and the x-axis. This refers to the left and right contact angles of the droplet.
[0023] Furthermore, the specific process of step 2 is as follows:
[0024] Step 2.1: Use the Canny operator to extract the true outline of the droplet and transform the blurry droplet photo into a mathematical coordinate sequence containing only the edge lines of the droplet.
[0025] Step 2.2, locate the three-phase contact points;
[0026] Three-phase contact point calculation method:
[0027] Traverse all points on the droplet profile and calculate the tangent slope at each point;
[0028] Find the two points where the slope changes the most; these two points are the left and right contact points between the droplet and the sample surface. and ;
[0029] Step 2.3, for the two contact points and The baseline equation is obtained by performing a straight line fit.
[0030] The baseline is a straight line on the sample surface and also the support line at the bottom of the droplet, passing through the two contact points. and Fit a straight line;
[0031] ;
[0032] Where k is the baseline slope and b is the baseline intercept on the y-axis, the baseline equation is: ;
[0033] Step 2.4, simplify the droplet profile curve;
[0034] The distances between adjacent contour points are calculated sequentially, and then summed to obtain the total length S of the droplet contour. This is done at intervals along the droplet contour. By selecting a single point, we obtain a simplified contour curve, reducing the computational load. The simplified contour consists of only about 60 points.
[0035] Furthermore, in step 3, the initial values of the calibration parameters of the Young's coordinate system relative to the image coordinate system are determined. , The process of α is as follows:
[0036] Traverse all droplet profile points, calculate the vertical distance from each point to the baseline, and find the point with the largest vertical distance as the baseline. , The initial value of α is the rotation angle between the two coordinate systems. Since the horizontal / vertical axis of the Young's coordinate system is aligned with the baseline and the vertical direction of the droplet, the angle between the baseline and the x-axis of the image coordinate system is directly used as the initial value of α.
[0037] Furthermore, in step 3, it is determined that... , The initial value process is as follows:
[0038] Using a set of shape factors , Simultaneously, the left and right contours are fitted. The left half of the droplet's contour is considered as half of the contour of a certain axisymmetric droplet, and the right half of the droplet's contour is considered as half of the contour of another axisymmetric droplet, thus using two sets of shape factors. , , , By fitting the contours of the left and right halves respectively, two different contact angles are obtained;
[0039] Derivation of 2 Initial value of shape factor: , The point corresponding to the initial value is the droplet vertex. Extract the N nearest contour points to this vertex, and perform a circle fitting on the vertex and these N points (a total of N+1 points). Use the radius of the fitted circle as the basis for the circle's value. , The initial value of .
[0040] Furthermore, in step 3, it is determined that... , The initial value process is as follows:
[0041] Derivation of 2 Initial value of shape factor: (This is the initial value of the shape factor.) , The initial value of α, and the newly determined Initial values are all considered known quantities, only As the parameters to be optimized, the complete optimization and fitting process of the Young-Laplace algorithm is executed once, namely, steps 4 to 6: solving the system of equations → establishing the objective function → iterating with the differential evolution algorithm. The result obtained from this optimization is... Optimal value, and also as , The initial value of .
[0042] Furthermore, in step 4, the fourth-order Runge-Kutta method is used to solve the Young-Laplace equations for the left and right halves of the contour, respectively. The process is as follows:
[0043] Use different shapes for the left and right outlines. and Fitting is performed separately. First, starting from the vertex of half of the contour, the Euclidean distance between two adjacent true contour points is calculated as the step size d. Substituting this into the fourth-order Runge-Kutta method, the formula is as follows:
[0044] ;
[0045] ;
[0046] ;
[0047] ;
[0048] ;
[0049] ;
[0050] ;
[0051] in, , , Let x and z be the x and z coordinates of the nth point on the theoretical curve and the angle between the tangent line at the nth point and the x-axis;
[0052] , , Let x and z coordinates of the (n+1)th point derived from the nth point and the angle between the tangent line of the (n+1)th point and the x-axis be the coordinates of the x and z coordinates of the (n+1)th point.
[0053] d is the distance between the nth true contour point and the (n+1)th true contour point;
[0054] , , The derivation formulas for the Young-Laplace equations;
[0055] , , , These are four intermediate increment values used in solving the droplet profile differential equation using the fourth-order Runge-Kutta method, corresponding to slope sampling at different locations. , , , Corresponding to x, z, The temporary values in the three dimensions are then weighted and averaged to obtain the true coordinates of the next contour point. x is the horizontal coordinate of the contour point, and z is the vertical coordinate. It is the angle between the tangent to the contour at the contour point and the horizontal direction.
[0056] Furthermore, the specific process of coordinate system one in step 5 is as follows:
[0057] A dynamic time warping algorithm is used to establish an objective function to characterize the similarity between the real contour and the theoretical curve. First, the theoretical curve points are transformed into the coordinate system of the real contour points. Let any theoretical curve point be... ,but:
[0058] ;
[0059] ;
[0060] Finally, find a path in the matrix from the top left corner to the bottom right corner such that the sum of the elements on that path is minimized.
[0061] Furthermore, the process of constructing the Euclidean distance matrix in step 5 is as follows:
[0062] To quantify the local deviation of a single point pair, suppose the transformed theoretical curve has m points and the true contour has n points. Calculate the Euclidean distance between each theoretical point and each true point, and arrange the distance values in rows and columns to form an m×n distance matrix M. Each element M(i,j) in the matrix represents the local deviation between the i-th theoretical point and the j-th true point, thus completing the transformation from point pair to numerical deviation.
[0063] Furthermore, the process of finding the shortest path in step 5 is as follows:
[0064] Starting from any point M(1,1) at the top left corner of the matrix The shortest path length is Use a recursive algorithm to find the shortest path, with the following initial conditions: ;
[0065] According to the recursion rules:
[0066] ;
[0067] Calculate point by point to any position in the matrix The shortest cumulative path length, the rules only allow movement to the right, down, and down to the right, to ensure that the temporal / contour order of the point set is not disrupted;
[0068] Finally, the shortest path length at the bottom right corner (m, n) of the matrix is taken. As the objective function, the smaller this value, the smaller the overall deviation between the theoretical curve and the real contour, and the higher the similarity.
[0069] Furthermore, the specific implementation process of step 6 is as follows:
[0070] Step 6.1, population initialization, there are 7 fitting parameters in total, namely , α , , , Based on the initial values in step 3, an initial population of size NP is randomly generated in the search space: ;
[0071] Where D=7 corresponds to 7 fitting parameters. Step 6.1 is executed only once;
[0072] Step 6.2, Mutation, for each individual Three different individuals were randomly selected. , , , ( , Generate mutation vectors:
[0073] ;
[0074] in, This is a scaling factor that controls the magnitude of the difference vector;
[0075] Step 6.3, Crossover: Cross the mutation vector with the target individual to generate experimental individuals.
[0076] ;
[0077] in, For crossover probability, Ensure that at least one dimension comes from the mutation vector;
[0078] Step 6.4, Selection: A greedy selection strategy is used to select individuals with better fitness from the target individuals and experimental individuals to enter the next generation.
[0079] ;
[0080] get Then, substitute it into step 4 to find the new theoretical curve, and then substitute it into step 5 to find the new shortest path. ;
[0081] Step 6.5, Convergence check: If the maximum number of iterations is reached... or the new shortest path If convergence is achieved, the algorithm stops; otherwise, return to step 6.2.
[0082] The present invention adopts the above technical solution and has the following technical effects compared with the prior art:
[0083] 1. Improve measurement accuracy and adapt to actual measurement scenarios of non-axisymmetric droplets;
[0084] Breaking away from the limitations of the traditional Young-Laplace algorithm that treats droplets as axisymmetric, this algorithm addresses non-axisymmetric droplets caused by uneven sample surface or tilted sample stage. It uses two sets of shape factors to fit the left and right halves of the droplet profile, which can accurately calculate the unequal left and right contact angles. This eliminates the systematic errors caused by the axisymmetric assumption and closely matches the droplet morphology in actual measurements.
[0085] 2. Optimize the objective function to eliminate fitting errors caused by the step size;
[0086] Abandoning the traditional approach of using Euclidean distance as the objective function, this paper adopts the Dynamic Time Warping (DTW) algorithm to construct the objective function. It characterizes the similarity between the real contour and the theoretical curve by unifying the coordinate system, constructing the distance matrix, and solving the shortest path. This solves the problem of different coordinate changes under different step sizes, eliminates the need to deliberately select the step size value, and greatly reduces the impact of step size changes on the fitting results.
[0087] 3. Improve algorithm solution efficiency while balancing computation speed and reliability;
[0088] On the one hand, the original droplet profile is simplified, reducing the number of fitting points without losing key morphological information, thus reducing the computational load of equation solving and optimization iteration. On the other hand, the differential evolution algorithm is used to iteratively optimize the seven fitting parameters. Compared with traditional optimization algorithms, this significantly improves the speed, accuracy, and reliability of solving nonlinear multivariable differential equation systems, avoiding the problems of low efficiency and slow speed of traditional algorithms.
[0089] 4. Eliminate coordinate system deviations and avoid system calculation errors;
[0090] By establishing the Young's coordinate system as the standard analysis coordinate system and determining the initial values of the coordinate system calibration parameters, the droplet contour coordinates in the image coordinate system are transformed and calibrated. This eliminates the problems of origin offset and coordinate axis angle deviation between the image coordinate system and the Young's coordinate system caused by camera installation rotation, and avoids system errors in curvature and contact angle calculations caused by coordinate system misalignment.
[0091] 5. Reduce human intervention and minimize human error;
[0092] The entire measurement process automates steps such as droplet profile extraction, three-phase contact point localization, and baseline fitting, eliminating the need for manual labeling of contact points and baselines. This effectively avoids subjective errors caused by manual operation and improves the objectivity and consistency of the measurement results.
[0093] 6. Optimize preprocessing and contour extraction to solidify the data foundation;
[0094] Image noise is removed and contrast is enhanced by preprocessing algorithms such as binarization and Gaussian filtering. Then, the Canny operator is used to extract clean and continuous true droplet contours, accurately locating the three-phase contact points. This provides a high-quality contour data foundation for subsequent fitting calculations, reduces the impact of image quality on measurement accuracy, and makes up for the shortcomings of traditional curve fitting methods that depend on image quality for accuracy.
[0095] 7. The measurement results are more practical and adaptable to the needs of multiple fields;
[0096] This invention retains the advantages of the Young-Laplace equation method, which is based on surface chemistry theory and has a measurement accuracy far superior to conventional methods such as the height measurement method and the circle fitting method. At the same time, it further improves the accuracy and adaptability through a series of improvements, which can provide more reliable data support for the study of material surface properties in many fields such as ship antifouling, mineral flotation, and medical materials. Attached Figure Description
[0097] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0098] Figure 1 This is a flowchart of the contact angle measurement method in this invention;
[0099] Figure 2 This is the original image of the droplet acquired by the measuring instrument in this invention;
[0100] Figure 3 This is an image of a droplet acquired after the measuring instrument camera rotates in this invention. Detailed Implementation
[0101] Examples, such as Figure 1 As shown, a method for measuring the optical contact angle of a non-axisymmetric droplet based on an improved Young-Laplace algorithm includes the following steps:
[0102] Step 1, Droplet image acquisition and preprocessing;
[0103] The original digital image of the test droplet is acquired using an optical contact angle meter: The test liquid (such as deionized water, diiodomethane, etc.) is drawn using the syringe of the optical contact angle meter. The test sample (solid, such as tempered glass film, non-woven fabric, metal, plastic, etc.) is fixed on the stage of the meter. The micro-dispensing device of the meter is rotated to dispense a suitable droplet, which is then caught by the test sample. Finally, the image of the test droplet is acquired using the high-definition camera of the meter. Figure 2 As shown.
[0104] The original digital image of the droplet is preprocessed: image processing algorithms such as binarization and Gaussian filtering are used to remove noise interference in the image, highlight the outline details of the droplet, reduce noise filtering to remove image noise and improve outline clarity; contrast enhancement highlights the boundary between the droplet and the background.
[0105] Step 2, extraction and feature analysis of the true contour of the droplet;
[0106] The droplet profile was accurately located from the original image, the solid-liquid-gas three-phase contact point was found, and the profile data was simplified to prepare for subsequent Young-Laplace equation fitting. The specific process is as follows:
[0107] Step 2.1: Extract the true contour of the droplet using the Canny operator;
[0108] The Canny operator can efficiently identify clear boundaries between droplets and the background, and between droplets and solid samples in an image, filtering out noise interference and obtaining clean, continuous droplet outlines.
[0109] This step transforms the "blurred droplet photograph" into a sequence of mathematical coordinates "containing only the droplet's edge lines," providing the foundational data for subsequent calculations.
[0110] Step 2.2, locate the three-phase contact points;
[0111] like Figure 2 As shown, the three-phase contact point is the point where the solid, liquid, and gas phases meet, and it is also the location where the slope of the tangent on the droplet profile changes abruptly. At the contact point, the droplet profile changes abruptly from a "curved droplet surface" to a "straight sample surface baseline".
[0112] Calculation method:
[0113] Traverse all points on the droplet profile and calculate the tangent slope at each point;
[0114] Find the two points where the slope changes the most; these two points are the left and right contact points between the droplet and the sample surface. and .
[0115] The key to this step is to automatically identify the interface between the droplet and the sample, avoiding errors caused by manual labeling.
[0116] Step 2.3, for the two contact points and The baseline equation is obtained by performing a straight line fit.
[0117] The baseline is a straight line on the sample surface and also the support line at the bottom of the droplet, passing through the two contact points. and Fit a straight line;
[0118] ;
[0119] Where k is the baseline slope and b is the baseline intercept on the y-axis, the baseline equation is: ;
[0120] The role of the baseline: It serves as a reference for subsequent calculation of the contact angle, which is the angle between the tangent of the droplet profile and the baseline; it is used to separate the droplet profile from the sample background, ensuring that subsequent fitting is only for the droplet portion.
[0121] Step 2.4, simplify the droplet profile curve;
[0122] The original droplet profile may contain hundreds or even thousands of points, which would be extremely computationally intensive to use directly for fitting the Young-Laplace equation. Without losing key morphological information, this paper significantly reduces the computational cost of subsequent equation solving and optimization iterations, thereby improving the efficiency of the algorithm.
[0123] The distances between adjacent contour points are calculated sequentially, and then summed to obtain the total length S of the droplet contour. This is done at intervals along the droplet contour. By selecting a single point, we obtain a simplified contour curve, reducing the computational load. The simplified contour consists of only about 60 points.
[0124] Step 3: Calculate the initial values of the fitting parameters based on the actual contour;
[0125] Step 3.1: Determine the initial values of the coordinate system calibration parameters. , α;
[0126] like Figure 3The image shown is a droplet image captured by the camera of an optical contact angle measuring instrument. The black semicircle represents the droplet, and the gray square represents the solid sample. Due to the camera's rotation during installation, both the droplet and the solid sample in the image have undergone the same rotation. The black coordinate system in the image is the image coordinate system, which is the pixel coordinate system of the image itself after the camera captures the droplet. This coordinate system rotates with the camera's orientation, recording only the pixel position of the droplet in the image. The red coordinate system is the coordinate system established by Young-Laplace geometric analysis, or simply the Young coordinate system. The origin of the Young coordinate system is fixed at the droplet vertex (the very top of the droplet), and the coordinate axes conform to the natural shape of the droplet. It is the standard coordinate system for algorithms to accurately calculate curvature and contact angle. The direction and origin of this coordinate system are fixed and unaffected by camera placement.
[0127] The rotation during camera installation causes a misalignment between the image coordinate system and the Young's coordinate system: not only are the origins of the two coordinate systems not in the same position, but the directions of the coordinate axes also form an angle (this angle is α). If the droplet profile coordinates from the image coordinate system are directly substituted into the Young-Laplace equation for calculation, systematic errors will occur in the calculation results of curvature and contact angle due to the coordinate system deviation, which is why calibration is necessary.
[0128] ( , ) represents the coordinates of the origin of the Young's coordinate system in the image coordinate system, and α is the rotation angle of the camera, which is also the rotation angle of the Young's coordinate system relative to the image coordinate system.
[0129] The specific process is as follows: traverse all droplet contour points, calculate the vertical distance from each point to the baseline, and find the point with the largest vertical distance as the baseline. , The initial value of α is the rotation angle between the two coordinate systems. Since the horizontal / vertical axis of the Young's coordinate system is aligned with the baseline and the vertical direction of the droplet, the angle between the baseline and the x-axis of the image coordinate system is directly used as the initial value of α.
[0130] Step 3.2, Determine the shape factor , The initial value;
[0131] The existing Young-Laplace method for determining the contact angle treats the droplet as axisymmetric and uses a set of shape factors. , Simultaneously, the left and right contours are fitted, and the calculated left and right contact angles are equal. However, in actual measurement, the left and right contours of the droplet are not symmetrical, and the left and right contact angles are not equal.
[0132] The specific process is as follows:
[0133] This invention considers the left half of the contour as half of the contour of a certain axisymmetric droplet, and the right half of the contour as half of the contour of another axisymmetric droplet, thereby using two sets of shape factors ( , , , By fitting the contours of the left and right halves respectively, two different contact angles are obtained.
[0134] Derivation of 2 Initial value of shape factor: , The point corresponding to the initial value is the droplet vertex. Extract the N nearest contour points to this vertex, and perform a circle fitting on the vertex and these N points (a total of N+1 points). Use the radius of the fitted circle as the basis for the circle's value. , The initial value of .
[0135] Derivation of 2 Initial value of shape factor: (This is the initial value of the shape factor.) , The initial value of α, and the newly determined Initial values are all considered known quantities, only As the parameters to be optimized, the complete optimization and fitting process of the Young-Laplace algorithm is executed once, namely, steps 4-6: solving the system of equations → establishing the objective function → iterating with the differential evolution algorithm. The result obtained from this optimization is... Optimal value, and also as , The initial value of .
[0136] Integrate to obtain all 7 initial values: (This refers to the values determined step-by-step above.) , α , , , The sum of the initial values yields the initial values of all seven optimization parameters required for subsequent complete optimization and fitting.
[0137] Step 4: Solve the improved Young-Laplace equations and fit the theoretical curve;
[0138] Because the left and right contours need to be fitted separately, the overall contour is obtained from each iteration. , Divide the image into two parts around the center point to obtain a left half and a right half, each with approximately 30 points. Apply different methods to the left and right half of the outline. and We perform fitting separately, taking the right half of the contour as an example. First, starting from the vertex, we calculate the Euclidean distance between two adjacent true contour points as the step size d, and then substitute it into the fourth-order Runge-Kutta method, as shown in the following formula:
[0139] ;
[0140] ;
[0141] ;
[0142] ;
[0143] ;
[0144] ;
[0145] ;
[0146] in, , , Let x and z be the x and z coordinates of the nth point on the theoretical curve and the angle between the tangent line at the nth point and the x-axis; , , Let x and z be the x and z coordinates of the (n+1)th point derived from the nth point, and the angle between the tangent line of the (n+1)th point and the x-axis; d is the distance between the nth and (n+1)th true contour points. , , The derivation formulas for the Young-Laplace equations; , , , These are four intermediate increment values used in solving the droplet profile differential equation using the fourth-order Runge-Kutta method, corresponding to slope sampling at different locations. , , , Corresponding to x, z, The temporary values in the three dimensions are then weighted and averaged to obtain the true coordinates of the next contour point. x is the horizontal coordinate of the contour point, and z is the vertical coordinate. It is the angle between the tangent to the contour at the contour point and the horizontal direction.
[0147] This allows us to find approximately 30 theoretical curve points for the right half. We can then use the same method to find the theoretical curve points for the left half and piece them together to form a complete theoretical curve.
[0148] Step 5: Establish the objective function and constraints;
[0149] Step 5.1, Coordinate System 1: Eliminate coordinate system bias and provide a unified benchmark for comparison. The theoretical curve points are obtained based on the Young's coordinate system, while the real contour points are located in the image coordinate system. There is an origin offset and a difference in rotation angle between the two, making direct comparison impossible. Therefore, we first use the coordinate transformation formula to map all theoretical curve points to the image coordinate system where the real contour is located, so that the two sets of points are in the same coordinate system, ensuring the effectiveness of subsequent distance calculations.
[0150] A dynamic time warping algorithm is used to establish an objective function to characterize the similarity between the real contour and the theoretical curve. First, the theoretical curve points are transformed into the coordinate system of the real contour points. Let any theoretical curve point be... ,but:
[0151] ;
[0152] ;
[0153] Finally, find a path in the matrix from the top left corner to the bottom right corner such that the sum of the elements on that path is minimized.
[0154] Step 5.2, Construct the distance matrix: Quantify the local deviation of a single point pair. Suppose that the transformed theoretical curve has m points and the true contour has n points. Calculate the Euclidean distance between each theoretical point and each true point, and arrange these distance values in rows and columns to form an m×n distance matrix M. Each element M(i,j) in the matrix represents the local deviation between the i-th theoretical point and the j-th true point, completing the transformation from "point pair" to "numerical deviation".
[0155] Step 5.3, Solving for the shortest path: Aggregating local deviations into an overall similarity index. Since the number of points and the spacing between points on the theoretical curve and the actual contour may not be the same, it is not possible to simply calculate the total deviation by pairing them in order. The DTW algorithm solves this problem by finding the shortest cumulative path from the top left corner to the bottom right corner in the distance matrix:
[0156] Starting from any point M(1,1) at the top left corner of the matrix The shortest path length is Use a recursive algorithm to find the shortest path, with the following initial conditions: ;
[0157] According to the recursion rules:
[0158] ;
[0159] Calculate point by point to any position in the matrix The shortest cumulative path length, the rules only allow movement to the right, down, and down to the right, to ensure that the temporal / contour order of the point set is not disrupted;
[0160] Finally, the shortest path length at the bottom right corner (m, n) of the matrix is taken. As the objective function, the smaller this value, the smaller the overall deviation between the theoretical curve and the real contour, and the higher the similarity.
[0161] Step 6: Use the differential evolution algorithm to iteratively optimize the fitting parameters. Through mutation, crossover, and selection operations of the population, the optimal parameters are continuously screened out, so that the similarity between the theoretical curve and the real droplet profile is continuously improved until the convergence condition is met.
[0162] Step 6.1, population initialization, there are 7 fitting parameters in total, namely , α , , , Based on the initial values in step 3, an initial population of size NP is randomly generated in the search space: ;
[0163] Where D=7 corresponds to 7 fitting parameters. This step is executed only once.
[0164] Step 6.2, Mutation, for each individual Three different individuals were randomly selected. , , , ( , Generate mutation vectors:
[0165] ;
[0166] in, This is a scaling factor that controls the magnitude of the difference vector.
[0167] Step 6.3, Crossover: Cross the mutation vector with the target individual to generate experimental individuals.
[0168] ;
[0169] in, For crossover probability, Ensure that at least one dimension comes from the mutation vector.
[0170] Step 6.4, Selection: A greedy selection strategy is used to select individuals with better fitness from the target individuals and experimental individuals to enter the next generation.
[0171] ;
[0172] get Then, substitute it into step 4 to find the new theoretical curve, and then substitute it into step 5 to find the new shortest path. .
[0173] Step 6.5, Convergence check: If the maximum number of iterations is reached... or the new shortest path If convergence is achieved, the algorithm stops; otherwise, return to step 6.2.
[0174] Step 7, when the maximum number of iterations is reached or the new shortest path Upon convergence, the optimal curve has been found, and the optimal fitting parameters corresponding to the optimal curve are obtained. These parameters, along with the step size d=1, are then substituted into the fourth-order Runge-Kutta method to solve for the dense theoretical curve points.
[0175] Step 8: Find the intersection point of the optimal curve and the baseline, output the contact angle value of that point, traverse every point on the curve, find the curve point closest to the two triple points, and the corresponding... The value is the left and right contact angle value.
[0176] The description of this invention is given for illustrative and descriptive purposes only and is not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention and to enable those skilled in the art to understand the invention and design various embodiments with various modifications suitable for a particular purpose.
Claims
1. A method for measuring the optical contact angle of a non-axisymmetric droplet based on an improved Young-Laplace algorithm, characterized in that: Includes the following steps: Step 1, Droplet image acquisition and preprocessing; The original digital image of the droplet under test is acquired by an optical contact angle measuring instrument, and then the image processing algorithm of binarization and Gaussian filtering is used to remove image noise and enhance the contrast between the droplet and the background. Step 2, extraction and feature analysis of the true contour of the droplet; The Canny operator is used to extract the true profile of the droplet, the tangent slope is calculated by traversing the profile points, the contact points of the solid, liquid and gas phases with abrupt slope changes are located, the baseline equation is obtained by straight-line fitting of the two three-phase contact points, and then the droplet profile curve is simplified. Step 3: Calculate the initial values of the fitting parameters based on the actual contour; Determine the initial values of the calibration parameters of the Young coordinate system relative to the image coordinate system. , α, ( , Let α be the coordinates of the origin of the Young's coordinate system in the image coordinate system, and let α be the rotation angle of the camera, which is also the rotation angle of the Young's coordinate system relative to the image coordinate system. Then, set two sets of shape factors. , , , Adapting to the left and right halves of the droplet contour respectively, the derivation and determination are then performed. , , , The initial values are integrated to obtain , α , , , There are a total of 7 initial values for the fitting parameters; Step 4: Solve the improved Young-Laplace equations and fit the theoretical curve; Based on the initial values of 7 fitting parameters, the droplet profile is ( , The contour is divided into left and right halves centered on the center. The fourth-order Runge-Kutta method is used to solve the Young-Laplace equation system for the left and right halves respectively, and the theoretical curve points of the left and right halves are obtained and spliced into a complete theoretical curve. Step 5: Establish the objective function and constraints; The theoretical curve points in the Young coordinate system are transformed to the image coordinate system to achieve coordinate system one. The Euclidean distance matrix between the theoretical curve points and the real contour points is constructed. The shortest path from the upper left corner to the lower right corner in the distance matrix is solved by the dynamic time warping algorithm. The length of the shortest path is used as the objective function to characterize the similarity between the theoretical curve and the real contour. Step 6: Use the differential evolution algorithm to iteratively optimize the fitted parameters; Population initialization is performed based on 7 initial values of fitting parameters. Experimental individuals are generated through mutation and crossover operations. A greedy selection strategy is used to select individuals with better fitness to enter the next generation. The new individuals are substituted into steps 4 and 5 to resolve the theoretical curve and shortest path. The mutation, crossover and selection process is repeated until the maximum number of iterations or the shortest path value converges. Step 7: Solve for the optimal theoretical curve; When the maximum number of iterations is reached, or the new shortest path converges, the optimal curve is found, and the optimal fitting parameters corresponding to the optimal curve are obtained. These parameters, along with the step size d=1, are then substituted into the fourth-order Runge-Kutta method to solve for the dense theoretical curve points. Step 8: Find the intersection point of the optimal curve and the baseline, and output the contact angle value of that point. Iterate through every point on the curve to find the curve point closest to the two triple points. Calculate the angle between the contour tangent corresponding to the curve point at the two triple points and the x-axis. This refers to the left and right contact angle values of the droplet; The specific process of step 2 is as follows: Step 2.1: Use the Canny operator to extract the true outline of the droplet and transform the blurry droplet photo into a mathematical coordinate sequence containing only the edge lines of the droplet. Step 2.2, locate the three-phase contact points; Three-phase contact point calculation method: Traverse all points on the droplet profile and calculate the tangent slope at each point; Find the two points where the slope changes the most; these two points are the left and right contact points between the droplet and the sample surface. and ; Step 2.3, for the two contact points and The baseline equation is obtained by performing a straight line fit. The baseline is a straight line on the sample surface and also the support line at the bottom of the droplet, passing through the two contact points. and Fit a straight line; ; Where k is the baseline slope and b is the baseline intercept on the y-axis, the baseline equation is: ; Step 2.4, simplify the droplet profile curve; The distances between adjacent contour points are calculated sequentially, and then summed to obtain the total length S of the droplet contour. This is done at intervals along the droplet contour. By selecting a single point, we obtain a simplified contour curve, reducing the computational load. The simplified contour consists of 60 points.
2. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 1, characterized in that: In step 3, the initial values of the calibration parameters of the Young's coordinate system relative to the image coordinate system are determined. , The process of α is as follows: Traverse all droplet profile points, calculate the vertical distance from each point to the baseline, and find the point with the largest vertical distance as the baseline. , The initial value of α is the rotation angle between the two coordinate systems. Since the horizontal / vertical axis of the Young's coordinate system is aligned with the baseline and the vertical direction of the droplet, the angle between the baseline and the x-axis of the image coordinate system is directly used as the initial value of α.
3. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 1, characterized in that: In step 3, the determination is made , The initial value process is as follows: Using a set of shape factors , Simultaneously, the left and right contours are fitted. The left half of the droplet's contour is considered as half of the contour of a certain axisymmetric droplet, and the right half of the droplet's contour is considered as half of the contour of another axisymmetric droplet, thus using two sets of shape factors. , , , By fitting the contours of the left and right halves respectively, two different contact angles are obtained; Derivation of 2 Initial value of shape factor: , The point corresponding to the initial value is the droplet vertex. Extract the N nearest contour points to this vertex, and perform a circle fitting on the vertex and these N points (a total of N+1 points). Use the radius of the fitted circle as the basis for the circle's value. , The initial value of .
4. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 3, characterized in that: In step 3, the determination is made , The initial value process is as follows: Derivation of 2 Initial value of shape factor: (This is the initial value of the shape factor.) , The initial value of α, and the newly determined Initial values are all considered known quantities, only As the parameters to be optimized, the complete optimization and fitting process of the Young-Laplace algorithm is executed once, namely, steps 4 to 6: solving the system of equations → establishing the objective function → iterating with the differential evolution algorithm. The result obtained from this optimization is... Optimal value, and also as , The initial value of .
5. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 1, characterized in that: In step 4, the fourth-order Runge-Kutta method is used to substitute the left and right halves of the contour into the Young-Laplace equations for solution. The process is as follows: Use different shapes for the left and right outlines. and Fitting is performed separately. First, starting from the vertex of half of the contour, the Euclidean distance between two adjacent true contour points is calculated as the step size d. Substituting this into the fourth-order Runge-Kutta method, the formula is as follows: ; ; ; ; ; ; ; in, , , Let x and z be the x and z coordinates of the nth point on the theoretical curve and the angle between the tangent line at the nth point and the x-axis; , , Let x and z coordinates of the (n+1)th point derived from the nth point and the angle between the tangent line of the (n+1)th point and the x-axis be the coordinates of the x and z coordinates of the (n+1)th point. d is the distance between the nth true contour point and the (n+1)th true contour point; , , The derivation formulas for the Young-Laplace equations; , , , These are four intermediate increment values used in solving the droplet profile differential equation using the fourth-order Runge-Kutta method, corresponding to slope sampling at different locations. , , , Corresponding to x, z, The temporary values in the three dimensions are then weighted and averaged to obtain the true coordinates of the next contour point. x is the horizontal coordinate of the contour point, and z is the vertical coordinate. It is the angle between the tangent to the contour at the contour point and the horizontal direction.
6. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 1, characterized in that: The specific process of coordinate system one in step 5 is as follows: A dynamic time warping algorithm is used to establish an objective function to characterize the similarity between the real contour and the theoretical curve. First, the theoretical curve points are transformed into the coordinate system of the real contour points. Let any theoretical curve point be... ,but: ; ; Finally, find a path in the matrix from the top left corner to the bottom right corner such that the sum of the elements on that path is minimized.
7. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 1, characterized in that: The process of constructing the Euclidean distance matrix in step 5 is as follows: To quantify the local deviation of a single point pair, suppose the transformed theoretical curve has m points and the true contour has n points. Calculate the Euclidean distance between each theoretical point and each true point, and arrange the distance values in rows and columns to form an m×n distance matrix M. Each element M(i,j) in the matrix represents the local deviation between the i-th theoretical point and the j-th real point, completing the transformation from point pair to numerical deviation.
8. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 7, characterized in that: The process of finding the shortest path in step 5 is as follows: Starting from any point M(1,1) at the top left corner of the matrix The shortest path length is Use a recursive algorithm to find the shortest path, with the following initial conditions: ; According to the recursion rules: ; Calculate point by point to any position in the matrix The shortest cumulative path length, the rules only allow movement to the right, down, and down to the right, to ensure that the temporal / contour order of the point set is not disrupted; Finally, the shortest path length at the bottom right corner (m, n) of the matrix is taken. As the objective function, the smaller this value, the smaller the overall deviation between the theoretical curve and the real contour, and the higher the similarity.
9. The method for measuring the optical contact angle of a non-axisymmetric droplet based on the improved Young-Laplace algorithm as described in claim 1, characterized in that: The specific implementation process of step 6 is as follows: Step 6.1, population initialization, there are 7 fitting parameters in total, namely , α , , , Based on the initial values in step 3, an initial population of size NP is randomly generated in the search space: ; Where D=7 corresponds to 7 fitting parameters. Step 6.1 is executed only once; Step 6.2, Mutation, for each individual Three different individuals were randomly selected. , , Generate a mutation vector, where , : ; in, This is a scaling factor that controls the magnitude of the difference vector; Step 6.3, Crossover: Cross the mutation vector with the target individual to generate experimental individuals. ; in, For crossover probability, Ensure that at least one dimension comes from the mutation vector; Step 6.4, Selection: A greedy selection strategy is used to select individuals with better fitness from the target individuals and experimental individuals to enter the next generation. ; get Then, substitute it into step 4 to find the new theoretical curve, and then substitute it into step 5 to find the new shortest path. ; Step 6.5, Convergence check: If the maximum number of iterations is reached... or the new shortest path If convergence is achieved, the algorithm stops; otherwise, return to step 6.2.