First, we are going to demonstrate the method described by Horn and Schunck. A good example of its usage can be found if you type vision.OpticalFlow System object
in the search box on the top-right corner of your MATLAB window. The help page for the object includes an example based on the viptraffic.avi
video. In this example, we will show some alternative steps for the same process, using a different video as input.
Since we will be using the Computer Vision System Toolbox for the optical flow algorithms, we might as well use another one of the videos included in its demos. The video is called atrium.avi
and shows several people walking in an atrium in arbitrary trajectories. Our goal is to estimate their motions. Since the methods for the optical flow we will use can be applied only to grayscale videos, we will also convert our frames to grayscale of type uint8
. Here, we will try to estimate the motion between the 89th and...