How to calculate derivative with respect to time for Optical Flow

609 Views Asked by At

Suppose we have 2 images in motion for detecting the object in movement according to Lucas and Kanade [u, v] = inv(H)*[dxdt, dydt] where H is the Hessian for partial derivatives for image x and y direction dxdx, dxdy, dydx, dydy.

I know for partial derivatives with respect to x a y we need to just use the following formula for derivatives

dx = (img[i-1] - img[i+1]) / 2; dy = (img[j-1] - img[j+1]) / 2;

but I also need to calculate the derivative for time t as we are given 2 frames in space time, I was thinking it might be smth. like this:

dz = (img1[i] - img1[i]) / 2;

But I am not sure exactly, can anyone suggest me an idea ?