Video-based matlab optical flow method