Perspective transformation of images