Drop contact angle measurement by θ/2 method

I want to get the contact angle of the drop sitting on a substrate. I have found a code on drop shape analysis (link:https://ch.mathworks.com/matlabcentral/fileexchange/57919-drop-shape-analysis-fit-contact-angle-by-double-ellipses-or-polynomials) but it does not work well on my image. I want to modify the algorithm as below:
According to the source code, I can detect the subpixel edges, then detect the longest edges, and then divide the longest edge into left and right edges. After the above stages, I want to change the algorithm as follows:
I want to identify the two edge points at the drop base (pt. 1 and pt. 2), draw a straight line through the points, so this will be the base of the drop, divide the base at middle (r), get the height of drop at the middle point of base (h), then get contact angle θ. Important is that I need an algorithm so that the two edge points at the drop base will always be detected at the intersection of the drop and its reflection and I don’t know how to do it as I am really new in image processing.
I have uploaded the source code but now I am really stuck with the remaining stages. I would really appreciate and be grateful if someone can help me with this.
For more clear understanding of the problem description, I have also uploaded a MS Word file, containg the problem statement with pictorial descriptions.

Réponses (1)

Image Analyst
Image Analyst le 5 Fév 2022
Modifié(e) : Image Analyst le 5 Fév 2022

0 votes

In your other question I gave you code to get the equation of the circle. And to find the baseline. So you just need to see when the baseline is above the circle. Then differentiate the circle to get dy/dx at that point. Knowing that slope, you can get the angle using the arctangent.

7 commentaires

JUBAIR AHMED SHAMIM
JUBAIR AHMED SHAMIM le 5 Fév 2022
Modifié(e) : JUBAIR AHMED SHAMIM le 5 Fév 2022
Dear Image Analyst, thank you so much for the hints. But I am little confused. It might be a dumb question but I just want to confirm this fact: as you know drop base is flat. So, I want the angle between drop height and flat drop base. That's why I need to detect the two end points of drop base. If I take the slope when the base line is on the circle, I think it will be the tangent on the circle but not the contact angle formed with the flat drop base at its end point. Please excuse me if I am wrong.
Image Analyst
Image Analyst le 5 Fév 2022
Look at your base. It's not flat as far as image pixels go. It could be that you have glare that's causing the digitized base to appear larger than it should be. It could also be due to overexposure. You should also lower the camera so that the optic axis is along the surface of the base, not looking down onto it at an oblique angle like you currently have it, meaning it's better to get a perpendicular side view, which is not what you have.
To determine contact angle you need to fit the "good" part of the droplet to an ellipse. See attached function. Then you need to determine the baseline, and where the ellipse crosses the baseline. Then at that (x,y) contact point you need to get the tangent line to the ellipse at that point and determine the angle between that tangent line and your baseline. As you can see because of overexposure and glare, you cannot get a good line for your baseline so that's what you need to fix.
Dear Image Analyst, thanks a lot for your time to answer my question again. I really appreciate it. Also, I agree with your suggestion that drop base isn't clear and I need to fix the camera position during experiment. I will take care of it next time. Also, you are right that fitting ellipse will give better accuracy. But what I am trying is to get a simple estimate of contact angle with reasonable accuracy.
I modified the code you gave me last time to find the drop diameter by fitting circle. I used "detectHarrisFeatures" to get the corner points at the drop base. For smaller drop (static-1_R0040C01.bmp) this works and gives a reasonable value. But for bigger drop (static-1_R0040C01.bmp) points are detected elsewhere, not on the drop base. I am attaching the m file and image files too.
Can you please just help me to find a better method to detect corner points of drop base so that it will work on any drop size universally? If so, the problem will be solved for now. Actually, I can try to picup corner points manually from the image. But I will have a sequential images from high speed camera, so I need the code to detect corner points of drop base automatically, to run it within for loop for all the images.
Thank you once again in advance for your great co-operation.
yanqi liu
yanqi liu le 6 Fév 2022
yes,sir,may be upload more image files from high speed camera
Image Analyst
Image Analyst le 6 Fév 2022
Modifié(e) : Image Analyst le 6 Fév 2022
Maybe try hough or houghlines to find the baseline. Or if you know the baseline is perfectly level, just sum your image horizontally and examine the vertical profile
verticalProfile = mean(grayImage, 2);
plot(verticalProfile, 'b-')'
Or simply look at the mask of the blob. Then find the line at which the width is widest and look below there to find the min width.
widths = sum(mask, 2);
[widestWidth, lineNumber] = max(widths);
widths(1:lineNumber) = widestWidth; % Make top part wide so we won't find it below.
[narrowestWidth, lineNumber] = min(widths);
Thank you so much for the hints Image Analyst. I will try all the possibilities and if something works, I will post it here with the code.
Dear Image analyst, I tired getting vertical profile and scanning min width. But it did not work well because base of the images are not same all the time. What I have done so far is use getpoints to select corner points manually. This code works fine as attached but its manual.
I realized that these two corners are already included in the matrix xb1, yb1 when we plot the boundary in attached code. We just need to introduce a logic to extract two corners of the drop base from matrix xb1, yb1. Now I am thinking to make this logic. But if you have any good hints, please let me know. Thank you all the time for your help.
Best regards
Jubair

Connectez-vous pour commenter.

Catégories

Produits

Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by