[ w y P h y s . c o m ]
JContact
Contents
IntroductionAnalysis 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:
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
|
|
(a)
![]() 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...




