0

I am trying to find the inverse functionality of Python PIL library function:

im.transform(size, QUAD, data)

I saw that QuadTransform takes 4 pairs of coordinates and wraps them to (0,0), (0, size), (size, 0) and (size, size) coordinates of an image. I want to give the destination coordinates (x_i,y_i) (4 coordinates) and to wrap the image to those coordinates.

Basically, I want the inverse mapping (The padding can be zeros or anything else).

I saw this answer, but it does not handle aliasing and different types of interpolations.

Do you know of any solution to this problem? Switching to other library is also fine.

Thanks!

1 Answers1

0

I think what you are looking for is the perspective transform (PIL.Image.PERSPECTIVE). You can find the homography with the four points in the source image and the four points in the target image. This answer should help you.

Xu Yao
  • 1