NOTE: this submission is obsolete. The version here:
is in every sense better.
I leave this submission online, because it contains som MEX optimization in a streaming application that might be useful for some. Since Matlab incorporated JIT compilation, these mex optimizations are less effecient than doing it purely in Matlab, even with using openMP. Original description follows:
Start by running "runMe.m"
Supports input through:
a) synthetically generated test images
b) reading avi-file
c) camera input (requires image aquisition toolbox)
Calculates optical flow by 4 different local methods(all moment based), 2 implementations of Lucas and Kanade, and 2 implementations of point-line flow.
Can process easily hundreds of frames per second on a laptop for resolution 200x200 images.
Entirely implemented in Matlab, except for a small mex-module that calculates the gradient field. You can either download this mex binary here:
... or you can compile the code in the folder c-code. This has a script "make.m".
Stefan Karlsson (2024). Real time optical flow, and video processing (https://www.mathworks.com/matlabcentral/fileexchange/40968-real-time-optical-flow-and-video-processing), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!