# Help determining velocity of Bubbles

8 views (last 30 days)
Nichoals Curci on 17 Apr 2021
Commented: Nichoals Curci on 19 Apr 2021
Hi all, I am very new to Matlab and am trying to determine the average velocity of bubbles as they rise against a black background. Same with the flux rate as the bubbles cross a line in the image.
I have about 50 images over the span of a few seconds. I understand the main workflow of what to do: Start by finding the bubbles in each frame, find and match the next bubble to the bubble from the previous frame, calculate the distance that each bubble moved, and then divide by the time between frames. It seems simple enough but I am honestly just not too sure where to start. Any help or examples would be greatly appreciated.
TYIA

The main workflow that you gave is right and one of the names this process is known is optical flow. Matlab has some functions that make most of those steps at once (you can check it here:https://de.mathworks.com/help/vision/ref/opticalflowhs.estimateflow.html).
In case you don't have the image processing you could do a manually implementation of the method. Someone did a good tutorial in matlab that can be found here: https://de.mathworks.com/matlabcentral/fileexchange/48744-lucas-kanade-tutorial-example-1 .
The main additional thing you will need to do is to average only velocities above a given threshold so your result is not distorted by the points with no bubbles.
For the flux rate you can define an area around your division line and calculate the rate with the speeds in this area.
If you want the most exact result possible you will need to track each ball and average the speeds only in the tracked areas. This can be done by find blobs (how your bubles would be called) with image segmentation techniques, you can check this nice tutorial as a reference https://de.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial?s_tid=srchtitle .
Nichoals Curci on 19 Apr 2021
That's good to know, I'll check in on some examples of the Lucas-Kanade algorithm. It makes sense using the "closest to the previous position" way of determining movement. Thank you!

### Categories

Find more on Tracking and Motion Estimation in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by