Compute homography matrix