The general principles of optical flow method are that each pixel of the image given a velocity vector, these velocity
vectors form a image motion field, each point of the field is associated with the point of the 3D object by the transformation
relation of projection, and based on the Characteristics of velocity vectors the image is dynamic analyzed. If without moving
objects in the image, the optical flows are continuously changing; when having moving objects in the image, there is
relative motion between the moving object and the background image, the moving object’s velocity vector is different form
the near background pixel’s, thus the moving object’s position can be detected.
The Horn-Schunck algorithm assumes smoothness in the flow over the whole image creatively associates the velocity
field with the gray, introduces optical flow restrained equation. The algorithm can be described as: