Decomposing a homography