Extracting homography matrix