Measure Microscopic Surface Deformations (waves!) Using a Camera (PIV)

4,143

102

20

Introduction: Measure Microscopic Surface Deformations (waves!) Using a Camera (PIV)

About: Thanks for stopping by! I'm Nir, and I'm a currently getting my Masters in physics. On my free time I enjoy building stuff :) Some of my upcoming projects - making a wooden drill-press, how to keep your drinks…

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 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.

Supplies

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 diffraction (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 diffracted 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!

Explore Science Challenge

This is an entry in the
Explore Science Challenge

Be the First to Share

    Recommendations

    • Arduino Contest

      Arduino Contest
    • Make it Real Student Design Challenge #3

      Make it Real Student Design Challenge #3
    • Home Decor Challenge

      Home Decor Challenge

    20 Comments

    0
    Castirondog
    Castirondog

    Question 3 days ago on Step 6

    So...this is very cool. The speckle pattern beneath the surface reminds me of using a speckle pattern to gather stress/strain data from a tensile test sample such as in this link:

    https://www.researchgate.net/figure/Tensile-testin...

    (skip to ~11:00 mark)This guy is doing something similar:


    My question is: Can this method be used to gather the 2D data of a pull test sample if one could add a speckle pattern to the test sample? Your method seems simpler and more intuitive than the others I have seen.

    Great work!

    0
    NirL
    NirL

    Answer 1 day ago

    thanks for the question! The method I showed is made of two separate parts. First, we measure the deformations of the dotted pattern (the displacement field), and then we use the measured displacement field to reconstruct the waves causing the image deformation.
    In stuff like you showed, you actually don't need the second part - all you need is the displacement field itself. For that, PIV is a perfect method. Instead of tracking individual particles, like Stefan (and any other particle-tracking methods) use, you look at the entire image and look for a displacement field that minimizes the difference between the two images. The paper you attached uses a DIC method, which is similar to PIV.

    The answer to your question is yes - and it should be really (really) simple to implement!
    Try looking PIVlab to see what people use it for, and you should get the idea. PIVlab is based on MATLAB, but you can find similar software for free (let me know if you need help with that!).
    p.s. - you can use PIV with nearly any optical setup since you can use the method to measure the lens distortion too! :)

    0
    Kdemon
    Kdemon

    4 days ago

    This blew my mind. I love it. Some initial thoughts; outside of surface deformation, this would work with crystal formation. Growing crystals using this setup, the crystals would also deform the light a second time. This could be achieved using timelapse photography.

    Also, my brain thinks this could be done on other surfaces like our Earth's magnetic field and a telescope. The starts are the random backdrop... hmmm so much good stuff!

    0
    AndrewA167
    AndrewA167

    Reply 3 days ago

    I'm not an astronomer, or know that much about the subject - but is the earth's magnetic field strong enough to distort light?

    I could see how this could be applied toward gravitational lensing, perhaps...

    The method seems like it could generally be applied to any set of images with a random dot pattern to detect displacements between those two images. One interesting potential would be to have a very large dot pattern (or maybe trees would suffice?) with some kind of real-time aerial or satellite view overhead of the earth - when an earthquake happens...How do the surface waves actually appear, as they happen? Or, if you had a "before" reference image, versus an "after" (this is where things would get difficult, because you'd need both images to be taken at the same location in "space") - could the displacement be found - a "static" image of old earthquake waves?

    This seems like a fun and widely applicable technique for both visualizing a lot of interesting phenomena, and generating useful quantitative data from them, too!

    0
    NirL
    NirL

    Reply 2 days ago

    Thanks for the comment! I like your ideas :)
    Actually, you don't really need the dotted pattern - it's, in a sense, the optimal pattern to use, but any pattern could potentially work! so your idea about the trees and such could work :)
    To reconstruct the waves that formed with deformation of the pattern, you need some physical theory of what's going on. Here, the authors of the paper used Snell's law, but in other cases you'll have to use other tools (perhaps Snell's law would work as well). In the case of earthquakes and such, part of the wave is longitudinal. Such waves can measured directly using PIV without the need of integration! I'm so happy posting this instructable inspire you with so many great ideas! :)

    0
    NirL
    NirL

    Reply 2 days ago

    The method I showed is based on an image being deformed. If you're looking at a phenomenon that deforms some kind of an image (being optic or anything else), you can try to reconstruct the phenomenon that caused the deformation of the image. In the case I showed, it is assumed that the deformations are small, and in that case, you can use Snell's law to map the deformations of an image to the deformations of the surface itself. The good news are that if you look at small enough deformations, often things will appear as linear and methods the like ones I used here, apply.
    Thanks a lot for the comment! your ideas are super interesting! :)

    0
    AndrewA167
    AndrewA167

    3 days ago

    This is a pretty cool technique, and I have an idea on how I could apply it to something that has almost nothing to do with waves. Thank you for posting this instructable.

    BTW - while the author of this instructable posted a link to the Springer publication of the paper, it's not easily accessible (to laymen, at least). I did, however, find a copy of the paper on the website of one of the paper's principle researchers:

    www.fast.u-psud.fr/~moisy/papers/mrs_eif09.pdf

    0
    NirL
    NirL

    Reply 2 days ago

    Thanks for the comment and for the link! I'll make sure to include it in the text ASAP (and give you credit for it). I was unhappy about referencing to a paper which most people cannot access. Thanks!
    If you need any help with your ideas, let me know! :)

    0
    KarelK16
    KarelK16

    3 days ago

    Very cool!!!

    0
    NirL
    NirL

    Reply 2 days ago

    Thanks!!

    0
    avelkey
    avelkey

    3 days ago

    Could this be used to measure the volume/density of a bubble nest made by a fish?
    Right now, this process is done quite crudely using "grid counts" and only characterizes the area occupied by the nest. I, and other researchers, could certainly use a better technique!

    Sample Bubble Nest Image.jpg
    0
    NirL
    NirL

    Reply 2 days ago

    Hi, and thanks for the question!
    The problem with bubbles is that they severely deform the surface between the bubble and liquid (water), while the method I showed here depends on a 'small angles' approximation. This could result and what we call 'ray crossing' - light bouncing off entirely different areas of your image could be deflected towards the same point in your camera. So I believe this method wouldn't be too helpful for your case. However, maybe there are other methods. For one, I can think of ways for estimating the 3D volume of a bubble given it's radius measured by 2D images, but my guess is that you guys are already doing this.
    Do you capture just 2-D images (like the one you attached) or do you have other cross-sections as well? I'll try to think of a way similar to what I showed here that might work for larger deformations like yours. If you like, send me a message and give me more details, and I'll see if I have any ideas.
    Thanks again for the question :)

    0
    richg99
    richg99

    3 days ago

    I am out of my ancient league even posting this question...but..

    I've recently purchased a couple of 3D printers. One of the often-cited reasons for poor prints is that the "bed isn't level". All sorts of processes and devices exist to map the surface of the glass printer base. That "map" is input into the computer's instructions to the printer to balance off the imperfections.

    It sounds to this old, uneducated, codger that your method might be an improvement over the manual tap, tap, tapping of the glass surface by an electronic probe. Am I missing something? regards, and thanks for your work.

    0
    NirL
    NirL

    Reply 3 days ago

    Actually, I think this could potentially work, but you should have to make some modifications. This is a great idea for a future instructable, which I might actually make if you don't mind! :)
    The idea behind this method is that you need a reference image to be able to track these imperfections you mentioned. In the method I showed, you would have to place a pattern beneath the bed and the bed itself must also be transparent, so you could see the imperfections. However, there are ways to overcome this! Instead of placing an actual printed pattern, you can project one! That's a valid method which is quite often used in physics experiments. That way you don't have to make any physical changes to your printer.
    Karel did make some valid points regarding why it's not going to be easy - but the answer is still yes! it is possible! but you'll have to do some work :) maybe I will do it sometime!
    Thanks for comment! it's a great idea :)


    0
    richg99
    richg99

    Reply 3 days ago

    Please do proceed if you think that the use of your idea for 3D printing will be successful. Since MANY 3D users already utilize a clear sheet of glass, slipping a pattern underneath that object would be easy. Something similar is already used by some 3D scanner programs, in that a printed pattern is placed on a table, and the to-be-scanned object is placed on it. Photos are taken from multiple angles, and the fixed pattern provides data for the Photogrammetry process. There are many ABL (Automatic-bed-leveling) devices being promoted daily in the 3D world. A market exists for a simpler solution to "leveling the bed". My FLSUN QQ-s-Pro Delta printer has an ABL system (using a probe) included. I hope you have good success with the project. p.s Qlone is a program that uses a pattern.

    0
    KarelK16
    KarelK16

    Reply 3 days ago

    Nice idea, interesting to think about!
    I'm afraid a direct use of the technique by Nirl is not useful: his technique creates a map created from differences/changes (with respect to a reference), but for a 3D printer you would require an absolute map which can be linked to the extruder. Nice to think about though; I think you'd need a set-up with the following properties:
    1. Camera must be level with the plane of movement of the extruder
    2. A fixed reference pattern below the glass print bed
    Step 1 would be the same (or even more difficult) as leveling the print bed itself, and keeping it fixed...

    1
    MaciejG17
    MaciejG17

    3 days ago

    Every once in a while someone (and it's often Nirl) posts an instructable like this. Thank you very much! This is exactly why I keep coming to this website.

    0
    NirL
    NirL

    Reply 3 days ago

    That's probably the nicest comment anyone has ever written!! Thank you so much :) I appreciate it!!!

    0
    mcgurkryan
    mcgurkryan

    10 days ago

    this is amazing

    1
    NirL
    NirL

    Reply 10 days ago

    Thank you so much! :)
    If you ever go for it and need some extra pointers, let me know!