Added homography scaling function.