# Estimating Regions of Flow in Grayscale Video

I am looking to find an algorithm/method by which I can detect regions of flow in a video. The video is that of a grayscale heatmap where the majority of the image is not in motion. The areas that are in motion generally appear as flickering/moving white dots, whereas in the rest of the image the dots do not move. The easiest way to visualize this is to think of a TV screen with noise, but the noise is only changing in certain areas; I would like to detect these areas.

The current method being implemented to do so is simply to calculate the standard deviation of each pixel over time and use this as a rough estimate of movement. While this does produce the desired image, and it is rather fast, I'm not a huge fan of the method because it doesn't care about how fast things are changing (std(sin(x) == std(sin(2x))).

Based off of this paper by the University of Texas, I tried to estimate regions of flow by the Black and Anandan algorith. Specifically, I used this piece of Matlab code produced by Brown University. Unfortunately, not only does it take forever to run, but it really does not seem to be working (shows areas of high flow where there most certainly is not any). I don't have much of a background in image/signal processing so it is entirely possible that I'm messing up the implementation, but I don't think this is the case.

My question is this: can anyone think of any alternatives I could use that help to estimate regions of flow? Also, am I wrong in thinking that the current method (taking the standard deviation wrt. time) is flawed?

Thanks in advance for any help.

• There are a couple ideas that you could try depending on how the images look. If you are able to track the points through time (eg, beads on top of a fluid), then you could try some sort of particle-tracking method or digital image correlation. Neither of these methods would work well if your points are flickering in and out, so you could run into trouble if this is the case. Maybe some moving time-average would smooth things out enough to use one of the above methods. It's hard to give better advice than that unless you post a few frames so we can get an idea of what we're looking at. Sep 17 '15 at 21:42
• @TylerOlsen, Unfortunately just a posting a few frames really isn't enough to see the effect; you would need the full video, which I don't think I can post because of policies in place (probably can't post the picture anyways). My current attempt is to look at the fast fourier transform of each pixel over time and try to isolate which frequencies correspond to the movement of particles. Sep 18 '15 at 19:34
• I also would not be offended if this question was considered too broad and as such closed, if that is what people believe. (I somewhat believe so myself...) Sep 18 '15 at 19:35
• Have you looked at current Particle Image Velocimetry software? There are good tools to turn video to a sequence of images. Sometimes they are not evenly spaced in time, but that depends on the compression. (ltcf.mechse.illinois.edu/downloads/Software/PIVSleuth/…) (ltcf.mechse.illinois.edu/downloads/Software/PIVSleuth/XP.html) Sep 18 '15 at 22:38