if you want to track the motion of each pixel in the image , there is an algorithm called horn-schunk method that determines the optical flow between two successive images , and the algorithm is simple and based on iteration implementediterations,implemented here math Works