Getting homography from optical flow