Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lucas Kanade Optical Flow, Direction Vector

I am working on optical flow, and based on the lecture notes here and some samples on the Internet, I wrote this Python code.

All code and sample images are there as well. For small displacements of around 4-5 pixels, the direction of vector calculated seems to be fine, but the magnitude of the vector is too small (that's why I had to multiply u,v by 3 before plotting them).

Is this because of the limitation of the algorithm, or error in the code? The lecture note shared above also says that motion needs to be small "u, v are less than 1 pixel", maybe that's why. What is the reason for this limitation?

like image 279
BBSysDyn Avatar asked Sep 30 '11 14:09

BBSysDyn


People also ask

How does Lucas Kanade optical flow work?

The Lucas-Kanade optical flow algorithm is a simple technique which can provide an estimate of the movement of interesting features in successive images of a scene. We would like to associate a movement vector (u, v) to every such ”interesting” pixel in the scene, obtained by comparing the two consecutive images.

What is optical flow vector?

Optical flow is a vector field between two images, showing how the pixels of an object in the first image can be moved to form the same object in the second image . It is a kind of correspondence learning, because if the corresponding pixels of an object are known, the optical flow field can be calculated.

What assumption is made by the Lucas Kanade method for computing optical flow that requires us to use a Gaussian pyramid?

It assumes that the flow is essentially constant in a local neighbourhood of the pixel under consideration, and solves the basic optical flow equations for all the pixels in that neighbourhood, by the least squares criterion.

What is the drawback of Lucas Kanade algorithm?

The advantages and disadvantages of Lucas kanade method is: Advantages –this method is easy compare another method, very fast calculation and accurate time derivatives. Disadvantage - errors on boundaries of moving object [10].


1 Answers

@belisarius says "LK uses a first order approximation, and so (u,v) should be ideally << 1, if not, higher order terms dominate the behavior and you are toast. ".

like image 156
BBSysDyn Avatar answered Sep 29 '22 19:09

BBSysDyn