I have problems with the im.transform method in PIL python library. I thought I figured out the logic of parameters, A to F, however, the resulting image gets rotated in the wrong direction and cut off although all four corners calculated by the bellow function have correct positive values.
Could anybody give me formulas to calculate affine parameters (A to F) from three identical points in both coordinate systems?
def tran (x_pic, y_pic, A, B, C, D, E, F):
X = A * x_pic + B * y_pic + C
Y = D * x_pic + E * y_pic + F
return X, Y