File Exchange

image thumbnail

Lucas & Kanade Pyramidal Refined Optical Flow implementation

version 1.1 (73 KB) by

This file implements the well-known LK algorithm, with regularization and subpixelic computation.

24 Downloads

Updated

View License

This algorithm has also been implemented in CUDA language for parallel execution, which allows to perform real-time optical flow. See CUDA Zone for more details.

Comments and Ratings (13)

Y Simson

Y Simson (view profile)

Shouldn't line 98-99 be:

u=u(hw:size(u,1)-hw+1,hw:size(u,2)-hw+1);
v=v(hw:size(v,1)-hw+1,hw:size(v,2)-hw+1);

instead of:

u=u(window:size(u,1)-window+1,window:size(u,2)-window+1);
v=v(window:size(v,1)-window+1,window:size(v,2)-window+1);

Y Simson

Y Simson (view profile)

ming

ming (view profile)

Guo

Guo (view profile)

Thank you! It's my need

Andy

Andy (view profile)

Thanks for sharing it.

F Oneair

Hi,
whitch terms should I delete if I want compute the optical flow only in the horizontal direction (I work with rectified images) ? thx

Vasiliki

The code worked but I have some questions.
Why are the velocity arrays not of equal sizes as the image?
I used the images you included 252x316 and u and v where of 236x300.
While reconstuncting the image I(i,j) = Iold(i+u,j+v) the result wasn't very good. Have you tried reconstructing the image using only the first one and the velocity vectors? If so, can you provide the source ( just to check if my reconstructing code is bad written)?

Leo Ono

pupu QQ

files are not complete,what is the meaning of the result pic?

pupu QQ

pupu QQ

no problem with matlab 2009

Said Pertuz

Said Pertuz (view profile)

Sorry, the function 'impyramid' is not provided and thus, I could not test the code.
Said

us

us (view profile)

LKPR-marzat is NOT a valid file name...
us

Updates

1.1

filename fixed

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video