Water drop angle measurement method and system based on image processing
Through image processing-based methods, detecting and measuring the water droplet angle angle, the problems of poor environmental adaptability and noise interference in the prior art are solved, and higher measurement accuracy and environmental adaptability are achieved.
Patent Information
- Application Number
- CN202411160439.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-02-14
AI Technical Summary
The existing water drop angle angle measurement device requires a fixed detection environment and light source, and has high requirements for sampling point accuracy, is susceptible to noise interference, and has poor environmental adaptability.
Using an image-based method, the water drop angle image is obtained through the water drop angle collection device, and the Scharr operator is used for sharpening and cropping, combining closed operation and median filtering method to fill the inside of the water droplet, using Shi-Tomasi corner point detection algorithm and slope The maximum comparison method detects corner points and measures the water drop angle angle angle through the corner point neighborhood method.
It improves the accuracy and environmental adaptability of water drop angle angle measurement, reduces dependence on fixed environments and light sources, reduces noise interference, and enhances the accuracy of measurement results.
Smart Images

Figure CN119438004A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water drop angle measurement, and in particular to a water drop angle measurement method and system based on image processing. Background Art
[0002] When analyzing the properties of materials and water, it is often necessary to judge the hydrophilicity and hydrophobicity of the materials. Among them, hydrophilic materials refer to materials with strong water absorption, and hydrophobic materials have certain anti-seepage functions. This property is often used in the manufacture of daily necessities and construction projects. For example, in construction projects, hydrophilic materials can be used for more designs that require bonding, which can make the building more stable, while hydrophobic materials are often used as moisture-proof, waterproof and anti-corrosion materials. When analyzing the hydrophilicity and hydrophobicity of materials, the most effective and commonly used analysis method is to measure the contact angle between the material and water. The properties of the material to water are judged according to the size of the contact angle.
[0003] At present, the measurement devices for the contact angle of substrates and water droplets all require a fixed detection environment or light source. The calculation method is usually to fit the outer contour of the water droplet using the least squares method according to the detection sampling points, and then find the tangent of the fitted outer contour of the water droplet and the intersection of the boundary line of the water droplet and the substrate to calculate the angle of the water droplet. However, this method has high requirements on the accuracy of the sampling points and is easily affected by noise. Changes in position and number will cause changes in the outer contour of the fitted water droplet, which will in turn have a certain impact on the results of the angle calculation due to poor environmental adaptability. Summary of the invention
[0004] In order to solve the above problems in the prior art, the present invention provides a water drop angle measurement method and system based on image processing. The invention solves the error accumulation problem caused by environmental influence through image preprocessing technology and corner point screening technology, does not need to rely on fixed environment and light source, and improves detection accuracy. To achieve the above purpose, the technical solution is as follows:
[0005] In one aspect, the present invention provides a method for measuring a water drop angle based on image processing, the method comprising:
[0006] S1, obtaining a water drop angle image through a water drop angle collection device;
[0007] S2. According to the water drop angle image, a Scharr operator is used to perform a sharpening process and cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image;
[0008] S3, according to the water drop angle image after the sharpening process, using a closing operation method and a median filtering method to completely fill the inside of the water drop in the water drop angle image after the sharpening process, so as to obtain a water drop angle image of a complete water drop;
[0009] S4, obtaining the water drop angle corner point of the complete water drop using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water drop angle image of the complete water drop;
[0010] S5. According to the water droplet corner point of the complete water droplet, find a neighboring point that is to the lower right or lower left of the water droplet corner point of the complete water droplet and includes the water droplet corner point of the complete water droplet, calculate the water droplet angles of the neighboring points and average them to obtain a water droplet angle measurement value.
[0011] Optionally, the step S2 uses a Scharr operator to perform sharpening processing on the water drop angle image and cuts off the uneven area at the bottom of the substrate to obtain the sharpened water drop angle image, including:
[0012] S21, obtaining a grayscale image of the water drop angle image according to formula (1);
[0013] I″=0.299R+0.587G+0.114B (1)
[0014] Where I″ is the pixel value in the grayscale image of the water drop angle image, R corresponds to the pixel value of the red channel in the water drop angle image, G corresponds to the pixel value of the green channel in the water drop angle image, and B corresponds to the pixel value of the blue channel in the water drop angle image;
[0015] S22, performing sharpening processing using a Scharr operator according to the water drop angle image grayscale image to obtain a water drop angle image processed by the operator;
[0016] S23, according to the water drop angle image processed by the operator, using a threshold-based binarization processing method, through formula (2), to obtain a binarized contour image of the water drop and the substrate;
[0017]
[0018] Where I′(x′, y′) is the pixel value of the water droplet angle image at position (x′, y′) after operator processing, and I binary (x′, y′) is the pixel value of the binarized contour image of the water drop and the substrate at the position (x′, y′), T is the binarization threshold, x′ is the x′th row of the pixel point of the water drop angle image after the operator processing, and y′ is the y′th column of the pixel point of the water drop angle image after the operator processing;
[0019] S24, according to the binarized contour image of the water drop and the substrate, by cutting out the uneven area at the bottom of the substrate in the binarized contour image of the water drop and the substrate, a sharpened water drop angle image is obtained.
[0020] Optionally, the horizontal convolution kernel of the Scharr operator is expressed as follows:
[0021]
[0022] In the formula, G x is the Scharr operator in the horizontal direction;
[0023] The vertical convolution kernel of the Scharr operator is expressed as (4):
[0024]
[0025] In the formula, G y is the Scharr operator in the vertical direction.
[0026] Optionally, in S3, according to the sharpened water drop angle image, a closing operation method and a median filtering method are used to completely fill the interior of the water drop in the sharpened water drop angle image to obtain a water drop angle image of a complete water drop, including:
[0027] S31, according to the water drop angle image after the sharpening process, using the closing operation formula (5), by first performing an expansion process on the water drop angle image after the sharpening process, and then performing an erosion process on the water drop angle image after the sharpening process, to obtain a closed water drop angle image,
[0028] Closing(A)=Erosion(Dilation(A)) (5)
[0029] Where A is the water drop angle image after sharpening, Dilation(A) is the dilation processing of A, Erosion(Dilation(A)) is the erosion processing of Dilation(A), and Closing(A) is the closing operation processing of A.
[0030] S32, according to the closed water drop angle image, a median filtering method is used for smoothing, and a water drop angle image of a complete water drop is obtained by formula (6);
[0031] I(x,y)=median{I′(x″,y″)|(x″,y″)∈W x,y} (6)
[0032] Where I(x, y) is the pixel point of the water droplet corner image of the complete water droplet, I′(x″, y″) is the pixel point of the water droplet corner image after closure, and W x,yIt is a set of pixels in the filter window centered on pixel (x, y), median{} represents the median operation in the set, x″ is the x″th row of pixels in the closed water drop corner image, y″ is the y″th column of pixels in the closed water drop corner image, x is the xth row of pixels in the water drop corner image of a complete water drop, and y is the yth column of pixels in the water drop corner image of a complete water drop.
[0033] Optionally, the expansion processing formula is formula (7),
[0034]
[0035] Wherein, B is the translation structure element, x″′ is the translation structure element B to the x″′th row of the image pixel point, and y″′ is the translation structure element B to the y″′th column of the image pixel point;
[0036] The corrosion treatment formula is as follows:
[0037]
[0038] Optionally, in S4, obtaining the water droplet corner point of the complete water droplet by using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water droplet corner image of the complete water droplet includes:
[0039] S41, using the Shi-Tomasi corner point detection algorithm according to the water drop angle image of the complete water drop, to obtain all corner points of the binarized water drop and the substrate;
[0040] S42, according to the positions of all corner points of the water droplet and the substrate, calculate according to the following rules to obtain the slope of each corner point,
[0041] Rule 1: When the position of the corner point is less than or equal to 0.5 times the image length of the water droplet angle image of the complete water droplet, the slope calculation formula is formula (9):
[0042]
[0043] Where l is the slope of the current corner point, (m,n) is the coordinate of the current corner point;
[0044] Rule 2: When the position of the corner point is greater than 0.5 times the image length of the water droplet angle image of the complete water droplet, the slope calculation formula is formula (10):
[0045]
[0046] S43, comparing the slopes of the corner points, and selecting the corner points corresponding to the two slopes through formula (11) to obtain the corner points of the complete water drop.
[0047] corner=max (l1,l2,l3,…,l n ) (11)
[0048] Where corner is the corner point of the complete water drop, l i is the slope of the i-th corner point, and n is the number of corner points.
[0049] Optionally, the Shi-Tomasi corner detection algorithm formula is:
[0050]
[0051] Where E(u,v) is the grayscale value of the window function, u is the distance the image window moves in the x direction, v is the distance the image window moves in the y direction, and w(x,y) is the window function;
[0052] Define the matrix M as
[0053]
[0054] Then for the local small movement [u,v], equation (12) can be rewritten as
[0055]
[0056] Define the Shi-Tomasi corner response function R as
[0057] R= min (λ1,λ2) (15)
[0058] Where λ1,λ2 are the eigenvalues of each matrix M;
[0059] The Shi-Tomasi corner detection algorithm defines the corner point as the smallest eigenvalue in the matrix M and the eigenvalue needs to be greater than a threshold.
[0060] Optionally, in S5, according to the water droplet corner point of the complete water droplet, a neighboring point that is to the lower right or lower left of the water droplet corner point of the complete water droplet and includes the water droplet corner point of the complete water droplet is found, and the water droplet angles of the neighboring points are calculated and averaged to obtain a water droplet angle measurement value, including:
[0061] S51, according to the corner point of the complete water drop, find the outer contour point of the water drop that is 30 pixels away from the corner point of the complete water drop;
[0062] S52, calculating the water drop angles of six neighboring points including the water drop corner point of the complete water drop at the lower right or lower left of the water drop outer contour point of the 30 pixel points and averaging them to obtain a water drop angle measurement value.
[0063] On the other hand, the present invention provides a water drop angle measurement system based on image processing, which is applied to a water drop angle measurement method based on image processing, and the system includes:
[0064] An image acquisition module, used to obtain a water drop angle image through a water drop angle collection device;
[0065] A first processing module is used to perform a sharpening process using a Scharr operator according to the water drop angle image and to cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image;
[0066] A second processing module is used to fill the inside of the water drop in the water drop angle image after the sharpening process by using a closing operation method and a median filtering method according to the water drop angle image after the sharpening process, so as to obtain a water drop angle image of a complete water drop;
[0067] A corner point acquisition module, used for obtaining the corner point of the water droplet of the complete water droplet by using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water droplet corner image of the complete water droplet;
[0068] The angle measurement module is used to find the neighboring points of the water droplet angle point of the complete water droplet to the lower right or lower left of the water droplet angle point of the complete water droplet, calculate the water droplet angle of the neighboring points and average them to obtain the water droplet angle measurement value.
[0069] Compared with the prior art, the technical solution of the present invention has at least the following beneficial effects:
[0070] On the one hand, the above scheme uses the Shi-Tomasi corner detection algorithm combined with the maximum slope comparison method to detect and screen the water droplet corners, thereby improving the accuracy of the extraction of the intersection of the water droplet and the substrate. The angle of the water droplet is measured by using the corner neighborhood method, thereby improving the accuracy of the angle of the water droplet. On the other hand, the error accumulation problem caused by environmental influences is solved through image preprocessing technology and corner screening technology, thereby improving environmental adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0072] Figure 1 is a flow chart provided by an embodiment of the present invention;
[0073] Figure 2is a flow chart of a sharpening process provided by an embodiment of the present invention;
[0074] Figure 3 is a flow chart of filling water droplets provided by an embodiment of the present invention;
[0075] Figure 4 is a flow chart of obtaining the corner points of a water drop provided by an embodiment of the present invention;
[0076] Figure 5 is a flow chart of measuring a water drop angle provided by an embodiment of the present invention;
[0077] Figure 6 is a system block diagram provided by an embodiment of the present invention;
[0078] Figure 7 is a schematic structural diagram of a water drop angle collection device provided by an embodiment of the present invention;
[0079] Figure 8 is a schematic diagram of the effect before the closing operation provided by an embodiment of the present invention;
[0080] Fig. 9 is a schematic diagram of the effect after the closing operation provided by an embodiment of the present invention;
[0081] Fig.10 is a schematic diagram of detecting corner points of water droplets provided by an embodiment of the present invention;
[0082] Fig.11 It is a schematic diagram of measuring the water drop angle provided by an embodiment of the present invention.
[0083] Description of the reference numerals in the figure: image processing device 111 , CCD camera 112 , operating platform bracket 113 , pipetting device 114 , substrate 115 and platform 116 . DETAILED DESCRIPTION
[0084] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0085] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0086] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0087] like Figures 1 to 9As shown, the present invention provides a water drop angle measurement method based on image processing, which is implemented by a water drop angle measurement system based on image processing and a water drop angle collection device based on image processing. The method includes:
[0088] S1, obtaining a water drop angle image through a water drop angle collection device;
[0089] Specifically, firstly, water droplets are added into the pipetting device of the water drop angle collection device, and the CCD camera in the water drop angle collection device is turned on to complete the collection of the water drop angle image.
[0090] S2. According to the water drop angle image, a Scharr operator is used to perform a sharpening process and cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image;
[0091] Specifically, Figure 2 As shown, in S2, according to the water drop angle image, a Scharr operator is used to perform sharpening processing and cut out the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image, including:
[0092] S21, obtaining a grayscale image of the water drop angle image according to formula (1);
[0093] I″=0.299R+0.587G+0.114B (1)
[0094] Where I″ is the pixel value in the grayscale image of the water drop angle image, R corresponds to the pixel value of the red channel in the water drop angle image, G corresponds to the pixel value of the green channel in the water drop angle image, and B corresponds to the pixel value of the blue channel in the water drop angle image;
[0095] S22, performing sharpening processing using a Scharr operator according to the water drop angle image grayscale image to obtain a water drop angle image processed by the operator;
[0096] Specifically, the horizontal convolution kernel of the Scharr operator is expressed as formula (3):
[0097]
[0098] In the formula, G x is the Scharr operator in the horizontal direction;
[0099] The vertical convolution kernel of the Scharr operator is expressed as (4):
[0100]
[0101] In the formula, G y is the Scharr operator in the vertical direction.
[0102] S23, according to the water drop angle image processed by the operator, using a threshold-based binarization processing method, through formula (2), to obtain a binarized contour image of the water drop and the substrate;
[0103]
[0104] Where I′(x′, y′) is the pixel value of the water droplet angle image at position (x′, y′) after operator processing, and I binary (x′, y′) is the pixel value of the binarized contour image of the water drop and the substrate at the position (x′, y′), T is the binarization threshold, x′ is the x′th row of the pixel point of the water drop angle image after the operator processing, and y′ is the y′th column of the pixel point of the water drop angle image after the operator processing;
[0105] S24, according to the binarized contour image of the water drop and the substrate, by cutting out the uneven area at the bottom of the substrate in the binarized contour image of the water drop and the substrate, a sharpened water drop angle image is obtained.
[0106] Furthermore, the water drop angle image is first sharpened using the Scharr operator to extract the overall outline of the water drop angle and the substrate in the image, and then a threshold-based binarization method is used with a threshold of 45 to binarize the image after the operator processing, and the pixel values of the water drop and the substrate in the image after the operator processing are changed to 255, and the background value is 0. The uneven bottom area is cropped by the cropping method. The specific cropping method is as follows: arbitrarily take 100 random numbers within the width of the image as the horizontal coordinate, and search for the point where the pixel value first becomes 255 for each horizontal coordinate from the bottom of the image upwards, and take the average of the vertical coordinates of the points, which is the area to be cropped, and the cropping of the image is completed to obtain the water drop angle image after the sharpening process.
[0107] S3, according to the water drop angle image after the sharpening process, using a closing operation method and a median filtering method to completely fill the inside of the water drop in the water drop angle image after the sharpening process, so as to obtain a water drop angle image of a complete water drop;
[0108] Specifically, Figure 3 As shown, in S3, according to the sharpened water drop angle image, a closing operation method and a median filtering method are used to fill the inside of the water drop in the sharpened water drop angle image to obtain a water drop angle image of a complete water drop, including:
[0109] S31, according to the water drop angle image after the sharpening process, using the closing operation formula (5), by first performing an expansion process on the water drop angle image after the sharpening process, and then performing an erosion process on the water drop angle image after the sharpening process, to obtain a closed water drop angle image,
[0110] Closing(A)=Erosion(Dilation(A)) (5)
[0111] Where A is the water drop angle image after sharpening, Dilation(A) is the dilation processing of A, Erosion(Dilation(A)) is the erosion processing of Dilation(A), and Closing(A) is the closing operation processing of A.
[0112] Specifically, the expansion process is formulated as follows:
[0113]
[0114] Wherein, B is the translation structure element, x″′ is the translation structure element B to the x″′th row of the image pixel point, and y″′ is the translation structure element B to the y″′th column of the image pixel point;
[0115] The corrosion treatment formula is formula (8);
[0116]
[0117] S32, according to the closed water drop angle image, a median filtering method is used for smoothing, and a water drop angle image of a complete water drop is obtained by formula (6);
[0118] I(x,y)=median{I′(x″,y″)|(x″,y″)∈W x,y} (6)
[0119] Where I(x, y) is the pixel point of the water droplet corner image of the complete water droplet, I′(x″, y″) is the pixel point of the water droplet corner image after closure, and W x,y It is a set of pixels in the filter window centered on pixel (x, y), median{} represents the median operation in the set, x″ is the x″th row of pixels in the closed water drop corner image, y″ is the y″th column of pixels in the closed water drop corner image, x is the xth row of pixels in the water drop corner image of a complete water drop, and y is the yth column of pixels in the water drop corner image of a complete water drop.
[0120] Further, such as Figure 6 The effect diagram before the closing operation is shown in the figure and Figure 7As shown in the effect diagram after closing operation processing, the image closing operation is performed on the water drop angle image after sharpening processing, and the horizontal coordinates of 100 random points of the water drop angle image after sharpening processing are used to detect whether the pixel values of all points at the horizontal coordinate have two pixel value mutations. If mutations occur, the width needs to be increased, and the closing operation of the water drop angle image after sharpening processing is performed again. The above process is repeated until there are no two sudden changes in values, indicating that the image closing operation is completed, and the closed water drop angle image is obtained, and then the closed water drop angle image is subjected to median filtering to obtain the water drop angle image of the complete water drop.
[0121] S4, obtaining the water drop angle corner point of the complete water drop using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water drop angle image of the complete water drop;
[0122] Specifically, Figure 4 As shown, in S4, according to the water drop angle image of the complete water drop, the water drop angle corner point of the complete water drop is obtained by using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method, including:
[0123] S41, using the Shi-Tomasi corner point detection algorithm according to the water drop angle image of the complete water drop, to obtain all corner points of the binarized water drop and the substrate;
[0124] Specifically, the Shi-Tomasi corner detection algorithm formula is:
[0125]
[0126] Where E(u,v) is the grayscale value of the window function, u is the distance the image window moves in the x direction, v is the distance the image window moves in the y direction, and w(x,y) is the window function;
[0127] Define the matrix M as
[0128]
[0129] Then for the local small movement [u,v], equation (12) can be rewritten as
[0130]
[0131] Define the Shi-Tomasi corner response function R as
[0132] R= min (λ1,λ2) (15)
[0133] Where λ1,λ2 are the eigenvalues of each matrix M;
[0134] The Shi-Tomasi corner detection algorithm defines the corner point as the smallest eigenvalue in the matrix M and the eigenvalue needs to be greater than a threshold.
[0135] S42, according to the positions of all corner points of the water droplet and the substrate, calculate according to the following rules to obtain the slope of each corner point,
[0136] Rule 1: When the position of the corner point is less than or equal to 0.5 times the image length of the water droplet angle image of the complete water droplet, the slope calculation formula is formula (9):
[0137]
[0138] Where l is the slope of the current corner point, (m,n) is the coordinate of the current corner point;
[0139] Rule 2: When the position of the corner point is greater than 0.5 times the image length of the water droplet angle image of the complete water droplet, the slope calculation formula is formula (10);
[0140]
[0141] S43, comparing the slopes of the corner points, and selecting the corner points corresponding to the two slopes by formula (11), to obtain the corner point of the complete water drop,
[0142] corner=max (l1,l2,l3,…,l n ) (11)
[0143] Where corner is the corner point of the complete water drop, l i is the slope of the i-th corner point, and n is the number of corner points.
[0144] Further, such as Figure 8 As shown, the Shi-Tomasi corner point detection algorithm is used for the water drop corner image of the complete water drop. This algorithm controls the number of corner points detected to be 100, the accuracy is 0.01, and the distance between corner points is 10 pixels. According to the position coordinates of the corner points, the corner points are divided into the left half and the right half. The corner point slope calculation: For the corner point C1 of the left half, another point is the point E1 (x1+10,y1+10) on the outer contour of the water drop with the horizontal coordinate of the corner point plus 10. e1 ), where y e1 It refers to the vertical coordinate of the point where the pixel value first becomes 255 when the horizontal coordinate is x1+10. Then calculate the slope between the two points C1 and E1. For the corner point C2 in the right half, the other point is the point on the outer contour of the water droplet whose horizontal coordinate is minus 10, that is, E2 (x2-10, y e2 ), where y e2It refers to the ordinate of the point where the pixel value first becomes 255 when the abscissa is x2-10. Calculate the slope between the two points C2 and E2. Sort all the calculated slopes, and take the two position coordinates with the largest slope as the final accurate water drop corner points of the complete water drop.
[0145] S5. According to the water droplet corner point of the complete water droplet, find a neighboring point that is to the lower right or lower left of the water droplet corner point of the complete water droplet and includes the water droplet corner point of the complete water droplet, calculate the water droplet angles of the neighboring points and average them to obtain a water droplet angle measurement value.
[0146] Specifically, Figure 5 and Fig. 9 As shown, in S5, according to the water droplet corner point of the complete water droplet, a neighboring point that includes the water droplet corner point of the complete water droplet and is located to the lower right or lower left of the water droplet corner point of the complete water droplet is found, and the water droplet angles of the neighboring points are calculated and averaged to obtain a water droplet angle measurement value, including:
[0147] S51, according to the corner point of the complete water drop, find the outer contour point of the water drop that is 30 pixels away from the corner point of the complete water drop;
[0148] S52, calculating the water drop angles of six neighboring points including the water drop corner point of the complete water drop at the lower right or lower left of the water drop outer contour point of the 30 pixel points and averaging them to obtain a water drop angle measurement value.
[0149] like Fig.10 As shown, the present invention provides a water drop angle measurement system based on image processing, which is applied to a water drop angle measurement method based on image processing. The system includes an image acquisition module, a first processing module, a second processing module, a corner point acquisition module and an angle measurement module. Specifically,
[0150] The image acquisition module is used to obtain a water drop angle image through a water drop angle collection device;
[0151] The first processing module is used to perform a sharpening process using a Scharr operator according to the water drop angle image and to cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image;
[0152] The second processing module is used to fill the inside of the water drop in the sharpened water drop angle image completely by using a closing operation method and a median filtering method according to the sharpened water drop angle image, so as to obtain a water drop angle image of a complete water drop;
[0153] The corner point acquisition module is used to obtain the corner point of the water droplet of the complete water droplet by using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water droplet corner image of the complete water droplet;
[0154] The angle measurement module is used to find the neighboring point of the water droplet angle point of the complete water droplet to the lower right or lower left of the water droplet angle point of the complete water droplet, calculate the water droplet angle of the neighboring points and average them to obtain the water droplet angle measurement value.
[0155] like Fig.11 As shown, the present invention provides a water drop angle collection device based on image processing, which is applied to a water drop angle measurement method based on image processing and a water drop angle measurement system based on image processing. The device includes: a CCD camera 112, a pipetting device 114, a platform 116, a substrate 115, an image processing device 111 and an operating platform bracket 113. Specifically,
[0156] The CCD camera 112 is used to collect water drop images;
[0157] The liquid transfer device 114 is used to collect the water droplets and drop the water droplets onto the position of the substrate to be tested;
[0158] The platform 116 is used to place the substrate to be tested;
[0159] The substrate 115 is used to hold the water droplets;
[0160] The image processing device 111 is used for measuring the angle of water droplets;
[0161] The operating platform bracket 113 is used to fix the image processing equipment and the liquid transfer device.
[0162] The present invention provides a method and system for measuring the angle of water droplets based on image processing. The present invention uses a Shi-Tomasi corner point detection algorithm in combination with a maximum slope comparison method to detect and screen the corner points of water droplets, thereby improving the accuracy of extracting the intersection points of water droplets and substrates. The angle of water droplets is measured by using a corner point neighborhood method, thereby improving the accuracy of the angle of water droplets. At the same time, the error accumulation problem caused by environmental influences is solved through image preprocessing technology and corner point screening technology, thereby improving environmental adaptability.
[0163] It is to be understood that the present invention is described by the above embodiments and should not be construed as limiting the embodiments of the present invention and the scope of the present invention. It is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. A method for measuring water drop angle based on image processing, characterized in that: The method comprises: S1, obtaining a water drop angle image through a water drop angle collection device; S2. According to the water drop angle image, a Scharr operator is used to perform a sharpening process and cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image; S3, according to the water drop angle image after the sharpening process, using a closing operation method and a median filtering method to completely fill the inside of the water drop in the water drop angle image after the sharpening process, so as to obtain a water drop angle image of a complete water drop; S4. Obtaining the water drop angle corner point of the complete water drop using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water drop angle image of the complete water drop; S5. According to the water droplet corner point of the complete water droplet, find a neighboring point that is to the lower right or lower left of the water droplet corner point of the complete water droplet and includes the water droplet corner point of the complete water droplet, calculate the water droplet angles of the neighboring points and average them to obtain a water droplet angle measurement value.
2. The method for measuring water drop angle based on image processing according to claim 1, characterized in that: In S2, according to the water drop angle image, a Scharr operator is used to perform sharpening processing and cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image, including: S21, obtaining a grayscale image of the water drop angle image according to formula (1); I″=0.299R+0.587G+0.114B (1) Where I″ is the pixel value in the grayscale image of the water drop angle image, R corresponds to the pixel value of the red channel in the water drop angle image, G corresponds to the pixel value of the green channel in the water drop angle image, and B corresponds to the pixel value of the blue channel in the water drop angle image; S22, performing sharpening processing using a Scharr operator according to the water drop angle image grayscale image to obtain a water drop angle image processed by the operator; S23, according to the water drop angle image processed by the operator, using a threshold-based binarization processing method, through formula (2), to obtain a binarized contour image of the water drop and the substrate; Where I′(x′, y′) is the pixel value of the water droplet angle image at position (x′, y′) after operator processing, and I binary (x′, y′) is the pixel value of the binarized contour image of the water drop and the substrate at the position (x′, y′), T is the binarization threshold, x′ is the x′th row of the pixel point of the water drop angle image after the operator processing, and y′ is the y′th column of the pixel point of the water drop angle image after the operator processing; S24, according to the binarized contour image of the water drop and the substrate, by cutting out the uneven area at the bottom of the substrate in the binarized contour image of the water drop and the substrate, a sharpened water drop angle image is obtained.
3. The method for measuring water drop angle based on image processing according to claim 2, characterized in that: The horizontal convolution kernel of the Scharr operator is expressed as (3): In the formula, G x is the Scharr operator in the horizontal direction; The vertical convolution kernel of the Scharr operator is expressed as (4): In the formula, G y is the Scharr operator in the vertical direction.
4. The method for measuring water drop angle based on image processing according to claim 1, characterized in that: In S3, according to the sharpened water drop angle image, a closing operation method and a median filtering method are used to completely fill the inside of the water drop in the sharpened water drop angle image to obtain a water drop angle image of a complete water drop, including: S31, according to the water drop angle image after the sharpening process, using the closing operation formula (5), by first performing an expansion process on the water drop angle image after the sharpening process, and then performing an erosion process on the water drop angle image after the sharpening process, to obtain a closed water drop angle image, Closing(A)=Erosion(Dilation(A)) (5) Where A is the water drop angle image after sharpening, Dilation(A) is the dilation processing of A, Erosion(Dilation(A)) is the erosion processing of Dilation(A), and Closing(A) is the closing operation processing of A. S32, according to the closed water drop angle image, a median filtering method is used for smoothing, and a water drop angle image of a complete water drop is obtained by formula (6); I(x,y)=median{I′(x″,y″)|(x″,y″)∈W x,y } (6) Where I(x, y) is the pixel point of the water droplet corner image of the complete water droplet, I′(x″, y″) is the pixel point of the water droplet corner image after closure, and W x,y It is a set of pixels in the filter window centered on pixel (x, y), median{} represents the median operation in the set, x″ is the x″th row of pixels in the closed water drop corner image, y″ is the y″th column of pixels in the closed water drop corner image, x is the xth row of pixels in the water drop corner image of a complete water drop, and y is the yth column of pixels in the water drop corner image of a complete water drop.
5. The method for measuring water drop angle based on image processing according to claim 4, characterized in that: The expansion process is formulated as follows: Where B is the translation structure element, x″′ is the translation structure element B to the x″′th row of the image pixel, and y″′ is the translation structure element B to the y″′th column of the image pixel; The corrosion treatment formula is as follows:
6. The method for measuring water drop angle based on image processing according to claim 2, characterized in that: In S4, according to the water drop angle image of the complete water drop, the water drop angle corner point of the complete water drop is obtained by using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method, including: S41, using the Shi-Tomasi corner point detection algorithm according to the water droplet angle image of the complete water droplet to obtain all corner points of the binarized water droplet and the substrate; S42, according to the positions of all corner points of the water droplet and the substrate, calculate according to the following rules to obtain the slope of each corner point, Rule 1: When the position of the corner point is less than or equal to 0.5 times the image length of the water droplet angle image of the complete water droplet, the slope calculation formula is formula (9): Where l is the slope of the current corner point, (m,n) is the coordinate of the current corner point; Rule 2: When the position of the corner point is greater than 0.5 times the image length of the water droplet angle image of the complete water droplet, the slope calculation formula is formula (10): S43, comparing the slopes of the corner points, and selecting the corner points corresponding to the two slopes through formula (11) to obtain the corner points of the complete water drop. corner=max (l1,l2,l3,…,l n ) (11) Where corner is the corner point of the complete water drop, l i is the slope of the i-th corner point, and n is the number of corner points.
7. The method for measuring the water drop angle based on image processing according to claim 6, characterized in that: The Shi-Tomasi corner detection algorithm formula is: Where E(u,v) is the grayscale value of the window function, u is the distance the image window moves in the x direction, v is the distance the image window moves in the y direction, and w(x,y) is the window function; Define the matrix M as Then for the local small movement [u,v], equation (12) can be rewritten as Define the Shi-Tomasi corner response function R as R= min (λ1,λ2) (15) Where λ1,λ2 are the eigenvalues of each matrix M; The Shi-Tomasi corner detection algorithm defines the corner point as the smallest eigenvalue in the matrix M and the eigenvalue needs to be greater than a threshold.
8. The method for measuring water drop angle based on image processing according to claim 6, characterized in that: In S5, according to the water droplet corner point of the complete water droplet, a neighboring point that includes the water droplet corner point of the complete water droplet at the lower right or lower left of the water droplet corner point of the complete water droplet is found, and the water droplet angles of the neighboring points are calculated and averaged to obtain a water droplet angle measurement value, including: S51, according to the corner point of the complete water drop, find the outer contour point of the water drop that is 30 pixels away from the corner point of the complete water drop; S52, calculating the water drop angles of six neighboring points including the water drop corner point of the complete water drop at the lower right or lower left of the water drop outer contour point of the 30 pixel points and averaging them to obtain a water drop angle measurement value.
9. A water drop angle measurement system based on image processing, characterized in that: The system comprises: An image acquisition module, used to obtain a water drop angle image through a water drop angle collection device; A first processing module is used to perform a sharpening process using a Scharr operator according to the water drop angle image and to cut off the uneven area at the bottom of the substrate to obtain a sharpened water drop angle image; A second processing module is used to fill the inside of the water drop in the water drop angle image after the sharpening process by using a closing operation method and a median filtering method according to the water drop angle image after the sharpening process, so as to obtain a water drop angle image of a complete water drop; A corner point acquisition module, used for obtaining the corner point of the water droplet of the complete water droplet by using the Shi-Tomasi corner point detection algorithm and the maximum slope comparison method according to the water droplet corner image of the complete water droplet; The angle measurement module is used to find the neighboring points of the water droplet angle point of the complete water droplet to the lower right or lower left of the water droplet angle point of the complete water droplet, calculate the water droplet angle of the neighboring points and average them to obtain the water droplet angle measurement value.