Introduction: Measure Microscopic Surface Deformations (waves) Using a Camera (PIV)
In this instructable I'll show you how to measure microscopic deformations (or waves) formed on a clear surface, and how I used it to study the waves created by droplets bouncing on a surface of a liquid. The reconstructed waves shown above many times smaller than the width of human hair, and were captured using very simple optics! Instructables called for all scientists to share their work, so here I am! I've been working on this post and wanting share it for a very long time :)
I tried to squeeze months of work into the shortest instructable possible, and I also tried to include as many explanations and nice videos as I could, but there are certainly some micro-steps missing, so feel free to ask questions in the comments sections!
I hope you enjoy!
Some things to note:
Much of this instructable is based on a paper (free access in this link - thanks AndrewA167 for the great find) published a few years ago about how to quantify surface deformations of a transparent substance, and the authors deserve all the credit. My in input comes in two forms. First, I made a step-by-step tutorial which might be easier to follow than the actual paper, and included my applications for it. Second, I added my code which might help you get started. It's written in MATLAB, but I can translate much of it to Python if you there's interest. All that being said, I believe that if you decide to use the methods shown here, you should really go and read the original paper! The authors worked
Also, all of the explanations I'll be using are going to assume deformations are formed on a transparent liquid surface (water, oil and so on), but it could just as well be a solid - all methods would work there too.
To measure static surface deformations, you'll only need access to a camera and a nice magnifying lens.
If you decide to measure waves on a liquid surface, which is a dynamic phenomenon, you'll also need a high-speed camera (though the frame-rate doesn't have to be too high, depending on the time-scales of the phenomena you're working on).
Step 1: Overview
Imagine you have a container, say a bowl, filled with a liquid, and you want to see how surface waves of the liquid look like. For example, if a drop of rain falls into the bowl, it creates beautiful ripples, and you want to study these waves quantitatively.
The way we're going to reconstruct these waves is conceptually simple. Put an image or a pattern at the bottom of the container. As the droplet hits the liquid, it will create ripples. Looking from above, you'll see that the image you placed is deformed due to refraction (Snell's law!). Our goal is to measure the deformation of the reference image as seen from above, and reconstruct the waves that caused this deformation.
The video above is of a bouncing droplet! A container filled with silicon oil was vibrated vertically, and a droplet of the same liquid (silicon oil in our case) is dropped on it. If the vibrations are fast enough, the droplet does not coalesce with the rest of the liquid. Instead, it bounces over and over - indefinitely! You can see how the dotted pattern beneath the silicon oil is modulated as the waves are formed.
Step 2: Surface Deformations Lead to Image Deformation
Place a dotted pattern at the bottom of your container. The dots pattern should be made of many different sizes of dots, and should be pretty dense (see if ones I used for the example). Take a reference image of the pattern. Now, as surface deformations are introduced, light will be refracted as it passes through the liquid, and the image, as seen from above, will be deformed (see 1st image). If we capture this deformation well enough and use geometric optics, we can reverse-engineer the surface deformations we're looking for.
The deformation of the pattern of dots can be described by a two-dimensional vector field, which we call the displacement field. The displacement field measures the displacement between the reference image and the deformed one. Each arrow shows us the direction and length of the displacement of a given point between the reference image and the deformed one (see 2nd image).
I attached a short MATLAB code that creates a pattern of dots of varying sizes. You can play with the parameters to get something you like.
Step 3: Data Collection
The first step towards reconstructing the surface waves would be to capture them. For that, you'll need to place a camera above the sample. It should be as far as possible, since the entire process we're going to follow assumes that all angles are small (paraxial approximation). We used 2 meters and zoomed in with an appropriate lens, and the results were great.
Capture a reference image (before surface deformations are introduced) and images of the deformed pattern using your camera. If you're capturing some sort of a wave, you'll need to capture a video (separated into individual frames).
Note that the waves you can capture with this method are small - the slope of the waves should remain within the paraxial approximation of small angles. The method makes it possible to measure microscopic waves using simple optics, but it's not suitable for large-amplitude waves.
The GIF above shows what typical data we collected looks like. In the video you see two 'walking droplets' orbiting one-another (seen as two shiny dots). You can see the deformations of the dotted pattern as the droplets deform the liquid surface
(I'll talk some more about 'walking droplets' in the last section!)
Step 4: Finding the Displacement Field
Once you have a sequence of images (at least 2), one of the images being the reference image, you can now try to recover the displacement field.
The most convenient and scientifically credible method I found was using PIVlab. PIVlab is a free tool for MATLAB developed by William Thielicke - he has done a great job. It uses a method called PIV (particle image velocimetry) to find the displacement field between an image and its reference image. The software is super simple, all you have to do is open a sequence of images, chose the reference image, and let the software do its magic!
The GIF above shows the result of a 1,000 FPS sequence of images of an experiment we performed. We made a disturbance to a vibrating bath filled with silicon oil, just below its Faraday's instability threshold. What you see is an outgoing traveling wave and a slowly-decaying standing wave left behind.
(The reconstructed surface waves are shown as a GIF in the introduction!)
Step 5: Almost Done! Relating the Displacement Field to the Surface Deformation
The authors of the paper I mentioned earlier showed that there is a linear relation between the displacement field (delta-r) and the gradient field of the surface height (h) (see the image above).
So, once we measured the displacement field, we basically already know the gradient of the surface! All we have to do is rescale it be a constant factor marked by h*.
Finally, all we have to do now, is integrate the gradient field grad(h(x,y)) to obtain the shape of the surface itself, h(x,y). To do that, we can perform numerical integration of grad(h(x,y)). Luckily, someone work a code that does just that!
I attached my implementation for the code using MATLAB. It will integrate the gradient field and plot a sequence of images which you can turn into a video if you like (I didn't write intgrad2, it's from the link above).
Step 6: That's It!
If you followed along, you should be seeing images like the ones I attached!
To summarize - if you place an image beneath a liquid, any disturbance to the liquid will deform the way you see the image from above. We measured this deformation and used it to reconstruct the shape of the surface itself, allowing us to study surface waves.
We used this method to study the waves created by walkers (aka Coder droplets), which are really exciting and full of surprises! Even Veritasium made a video about it :) The first GIF is an actual droplet moving on a vibrating bath (video was slowed down by a factor of 2). You can see the droplet as a small shiny object, and the waves it produces as a deformation around it. The second GIF shows the reconstructed wave-field caused by one of these droplets.
Thanks for reading! If you have any questions, feel free to ask!
If you liked my instructable, you're welcome to visit my instructables page!
If you want to support me in making more projects, you can buy me a coffee!
Donations of any amount are appreciated, and 100% of your donations go to future projects! Huge thanks to all the people who have already supported me!!
Second Prize in the
Explore Science Challenge