Search code examples
opencvopticalflow

Is my understanding right about "Intensity" of Lukas-Kanade method of optical flow?


From 'http://docs.opencv.org/3.1.0/d7/d8b/tutorial_py_lucas_kanade.html', it says that intensities are gradients. f(x), f(y) are gradients and f(t) is similarly gradient along time. My confusion starts now. In above link, f(x) and f(y) are also in derivative form but we cannot calculate derivative along x and y because we don't know where the same point goes to, actually that's what we are going to find in this method. So I wonder what it says is that, since it says f(t) is gradient of one point along time so, can I assume f(t) like average of gradient of a point that is collected by several certain period and f(x) and f(y) are collected every period that average of f(t) gradient is collected?

For example, if f(t) is calculated every 20ms and trying to calculate average in every 100ms. In every 100ms f(x) and f(y) is calculated. Is my understanding right?

If wrong then, what is difference between f(x), f(y) and f(t)?


Solution

  • Let I(x,y) be an intensity value at a pixel position (x,y), than as in the description fx(x,y) is the derivative in x direction and fy(x,y) in the y direction and ft(x,y) in the temporal direction at the position (x,y). However, in the discret world in our programm, we could only approximate these derivative we also call this gradient. Therfore e.g. the Sobel filters could be used. Or in a more easy way the differenz operator i.e.

    fx(x,y) = I(x,y) - I(x-1,y)

    fy(x,y) = I(x,y) - I(x,y-1)

    similar is that for the temporal gradient but now with the image intensity of the previous image A(x,y)

    ft(x,y) = I(x,y) - A(x,y)

    idealy and mostly in practice A is one frame befor I, but in the theory A could be taken from more previous frames but this will make ft less accurate.