i’m trying to solve a problem i’m facing in detecting the direction of movement of an image.
So i have this video which i’m trying to analyze, its composed of a contracting objects (continuaslly shrink and expand) and i’m trying to be able to detect if current frame of move is shrinked or expand !
here is an example of 2 frames 1 the objects there is expanded and other shrinked


Note: you can’t see deference when they are on top of each other, try to save and view one after other on your computer.
So is there a way i can detect the direction of movement in video ? (inward of outward ?)
thanks a lot
This can be solve with “optical flow” which has been studied for several decades now.
The classical method is Horn-Schnuck http://en.wikipedia.org/wiki/Horn%E2%80%93Schunck_method which you can download here: http://www.mathworks.com/matlabcentral/fileexchange/22756-horn-schunck-optical-flow-method . It’s fast but not the most accurate way to solve the problem as it tends to blur the regions you are interested in detecting since it minimizes the L2 norm of the gradients. Here’s what I got on your images using Horn-Schnuck off the shelf:
Since your images have lots of edges it’s probably worthwhile to try out some more modern algorithms. http://people.csail.mit.edu/celiu/OpticalFlow/ might help.