[ w y P h y s . c o m ]

JContact





Contents

Introduction
Analysis Techniques
Download



Introduction

In our lab we measure contact angles by using an optical microscope to view the profile of a liquid droplet and capturing the video output from that microscope as an image file. Maximum contrast is achieved by back-lighting the sample. Traditionally, students performing research have then measured the contact angles on the stored images by hand.

I wrote JContact to automate this process (therebye removing some of the inconsistencies incurred by human measurement). JContact will analyze images contained in folders specified by the user and generate an Excel spreadsheet containing the contact angles and basic calculations that we typically do when measuring contact angles. Before generating the Excel spreadsheet, JContact presents all of the images showing what it recognized as liquid droplets so that the user can check to make sure JContact has not made any mistakes.

JContact determines contact angles by assuming that the liquid-air interface of the droplet is roughly spherical (this is not actually the case, but is a reasonable simplifying assumption in the case of the experiments we perform).


Example Excel output:
NameContact Angle (degrees)Cosine of Angle
b1_poss_170.60.333
b1_poss_282.70.128
b1_poss_376.80.228
b2_poss_189.20.014
b2_poss_288.40.028
b2_poss_387.10.05
b3_poss_188.90.019
b3_poss_287.30.047
b3_poss_384.70.092
b4_poss_1860.07
b4_poss_288.90.019
b4_poss_388.40.028
b5_poss_387.70.039
b7_poss_289.80.004
b7_poss_387.80.038
b8_poss_189.10.016
b8_poss_2850.087
b8_poss_386.30.065

Notice that b5_poss_2 which is flagged as "no good" in the screenshot at right does not appear in the output table above. Since it is clear that JContact misread the image, it should not be included as part of the output data.

Improved back-lighting technique and camera alignment can make a significant difference in how well JContact determines contact angles. The images at right were not taken under ideal lighting and placement conditions but illustrate that JContact can still perform reasonably well in such circumstances. Under ideal conditions the droplet and the surface on which it is placed would be completely black (with no reflections) while the air would be completely white.

Screenshot:




Analysis Techniques


The figures at right demonstrate some of the techniques used to determine the locations of the various interfaces. The figures are all representations of a typical grayscale image of a droplet on a surface:

(a) Animation showing light intensity as vertical axis. Animation was made using Learn3D to display as a height-map (the transparent sphere is a cursor and not part of the actual data).

(b) Vertical scan-line piercing both the droplet as well as a reflection within the droplet.

(c) Results of traditional edge detection on the image used to make these figures.

(a)

Play

Click on the blue triangle button above to play the movie.

(b)


(c)

JContact raster scans the image with vertical scanlines and detects the interfaces between the solid surface and air, and the liquid droplet and air. This is done in a similar manner to standard edge detection in images where the intensity gradient is assumed to be above some threshold (or at a local maxima) at edges (interfaces) Results from a traditional edge detection algorithm can be seen in (c) above. Additional information about which edges are important is determined by whether the slope of the intensity graph is positive or negative. If noise has been properly eliminated from the image then the final positive slope encountered by a vertical scan line advancing from the bottom of the image to the top will be the edge of interest (see b above).

After finding the important edges, JContact determines which points comprise the solid-air interface (which should be a straight line) and uses the method of least squares to determine its analytical equation. JContact then finds three non-collinear edge points on the half-plane above this line that are most likely to be part of the droplet and uses them to define a circle. The angles between the resulting circle and the solid-air interface line are the contact angles.




Download

Save the following zip file to your desktop:
JContact.zip (260KB)

Now unzip the contents to your desktop, or some other location on your hard-drive that you can remember. To run JContact, go into the JContact folder and double-click on JContact.jar.

You will need Java for JContact to work:
Java download site (most computers come with Java already installed - if the QMWave applet runs in your browser, then you already have Java)

The source code is included under the GPL .





Back to the main page...