File Exchange

image thumbnail

proesmans

version 1.1.0.2 (167 KB) by Giampiero Campa
Optical flow using the Proesmans method

8 Downloads

Updated 02 Jan 2019

View License

Optical flow calculation using the gradient-based method devised by Marc Proesmans.
Look at the beginning of the cpp file for instructions on how to compile and call the proesmans function from MATLAB.

The algorithm is described and used in a couple of journal papers, look in the cpp file to find out more.

Incidentally, this also works as a good example on how to call c and cpp files from MATLAB.

Note that this has been tested mostly with Microsoft Visual C++ compilers, it's not guaranteed to work with other compilers.

Cite As

Giampiero Campa (2019). proesmans (https://www.mathworks.com/matlabcentral/fileexchange/40576-proesmans), MATLAB Central File Exchange. Retrieved .

Mammarella, M., Campa, G., Fravolini, M. L., and Napolitano, M. R., "Comparing Optical Flow Algorithms Using 6-DOF Motion of Real-World Rigid Objects"; IEEE Transaction on Systems, Man, and Cybernetics-Part C: Applications and Reviews, Vol 42, No. 6, Nov. 2012, 1752-1762

McCane, B., Novins, K., Crannitch, D., and Galvin, B. (2001) "On Benchmarking Optical Flow", Computer Vision and Image Understanding, 84(1), 126-143.

Comments and Ratings (3)

Thank you Sebastien! I'm going to try to include the code that you provided, but it might be a while before i get to do it.
I also definitely encourage anyone that uses this file to include this code and try it out!
Thanks again.
Giampiero

Very fast method, I noticed few memory leaks. You should add the following free_pic and free_float_space:

@@ -693,6 +693,9 @@ struct twin_flows calculate_flow(picture P1, picture P2,
double_flow(halff.reverse, prev.reverse);
free_flow(halff.forward);
free_flow(halff.reverse);
+
+ free_pic(half1);
+ free_pic(half2);
}

for (i = 1; i <= max_i; i++) {
@@ -720,6 +723,9 @@ struct twin_flows calculate_flow(picture P1, picture P2,
free_float_space(Ey2);
free_flow(next.forward);
free_flow(next.reverse);
+
+ free_float_space(Et1);
+ free_float_space(Et2);

return(prev);
} // twin_flows

Avi Nehemiah

Thanks for the great submission, enjoyed trying the gradient based approach.

Some other optical flow methods and examples can be found at this link: "http://www.mathworks.com/discovery/optical-flow.html"

Updates

1.1.0.2

Included a few lines of code to properly clean up after a few functions, suggested by Sebastien Martin.

1.1.0.1

Updated license

1.1.0.0

Added copyright and fixed small typos

MATLAB Release Compatibility
Created with R14SP1
Compatible with R14SP1 to any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor