In order to avoid the problem I just mentioned,

which is having two unknowns and only one equation.

I do a similar thing to what we did

when we talked about the block matching, original matching.

That is, we assume that there is a neighborhood of pixels.

That they all undergo the same motion.

So the pixel location is indicated here by q1, q2, qn.

So little n pixels in this neighborhood.

Then for each pixel location I write optical flow equation.

So this is the spatial delivery at the x direction at the pixel location q1.

Spacial derivative of the intense derivatives in

the y direction again at pixel q1.

And this is the temporal derivative at pixel location q1.

So I do this same thing.

These are the optical flow equations for the location

q 2, all the way to the location q n.

If n is equal 2, then I have two equations in two unknowns.

And if n is greater than 2, I have an undetermined system of equations.

Typically I choose n greater than 2 so that I accommodate

noise issues and I get the more robust solution that way.

I can write this system of equations in matrix

vector form, that is I can stuck here.

The spatial index of q1, spatial index

direction of q2, spatial index direction of

qn, spatial in the y direction q1, y direction

q2, y direction qn, so this is the matrix.

It's an n by 2 matrix that will multiply

the unknowns vx, vy, and this is

equal to the temple derivatives,

q1, q2, all the way to qn.