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

6,443

122

29

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 PhD in physics. On my free time I enjoy building stuff :) Some of my upcoming projects - mold making for baking (3D printed), a rainbow night lig…

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.

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

Explore Science Challenge

Second Prize in the
Explore Science Challenge

Be the First to Share

    Recommendations

    • Plywood Contest

      Plywood Contest
    • Fandom Contest

      Fandom Contest
    • Cheese Challenge

      Cheese Challenge

    29 Comments

    0
    wobbler
    wobbler

    1 year ago on Step 6

    This is a really clever way to show invisible waves and a well written Instructable!

    0
    NirL
    NirL

    Reply 1 year ago

    Thanks! I don't want to take the credit of others, I didn't invent the method! I tried to show how it's done and share it with everyone :) I thought it could be useful/interesting for some people.
    Thanks for the comment :)

    1
    wobbler
    wobbler

    Reply 1 year ago

    Don't worry, you aren't taking the credit of others, you've referenced where it came from, but you have presented it as a great practical Instructable with your scientific reporter's hat on.

    0
    lacovara
    lacovara

    1 year ago on Step 6

    Excellent; great fun...
    Perhaps this technique could be applied to opaque surfaces if the reference pattern were projected onto the target surface.

    0
    NirL
    NirL

    Reply 1 year ago

    This is a valid technique, and people do use it!
    However, the fact that we're looking through the surface make it act like a 'lens' in some sense - it magnifies the distortion to the reference pattern, allowing us to measure very small surface deformations. There are many great solutions for opaque surfaces, and the one you suggested is one of them!
    Thanks a lot for the comment and for your input! :)

    0
    lacovara
    lacovara

    Reply 1 year ago

    I am looking at this technique as a means of evaluating ultrasonic surface waves. There are optical systems used to these studies, but they cost as much as a new car (or more). The amplitude of these waves is typically small, although I confess that I have not calculated slopes. I suspect the small angle approximation holds, but that's a guess. Wavelengths vary, but the speed of sound in water is about 1500 m/s, and for a 1 MHz wave, the wavelength is around 1.5 mm. Certainly something you can photograph.

    I'm more interested in Raleigh surface waves in solids. These are faster, ~3000 m/s, but depending on how you excite them you can get very high frequencies, and get correspondingly longer wavelengths. Cool...

    A pleasure chatting with you.

    0
    NirL
    NirL

    Reply 1 year ago

    My guess is that the amplitude of surface waves in solids will indeed satisfy the small-angle approximation, but the amplitude may be too small to apply the methods of PIV directly. But here's another idea that might work:
    If shine a laser on an opaque surface, it will be reflected. If the surface is deformed, the reflection will be deflected. You can measure almost arbitrarily small angles this way - just let the deflected laser travel a long enough distance.
    So, you have a way for measuring the angle at one point - just measure the deflection of the laser relative to the deflection without any deformations. To measure the entire surface you should shine a grid of dots, and find their displacement field (using PIV or other methods), which can be mapped to the surface deformation.
    Thanks again for the comments and for the interesting chat :) Feel free to contact me if you need further help.

    0
    finchts
    finchts

    1 year ago

    Snell's law does not govern DIFfraction, but REfraction. A nit, but you might want to clarify.

    0
    NirL
    NirL

    Reply 1 year ago

    It all results from the same physical origins so I never bother making the difference, but you're correct :) I updated the text, thanks

    0
    Castirondog
    Castirondog

    Question 1 year 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 year 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

    1 year 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 1 year 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 1 year 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 1 year 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

    1 year 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 1 year 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

    1 year ago

    Very cool!!!

    0
    NirL
    NirL

    Reply 1 year ago

    Thanks!!

    0
    avelkey
    avelkey

    1 year 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