import cv2 as cv
import numpy as np

if __name__ == '__main__':
    img = cv.imread("affine1.jpg")

    pts1 = np.float32([[50, 50], [200, 50], [50, 200]])
    pts2 = np.float32([[50, 100], [200, 50], [100, 250]])
    MA = cv.getAffineTransform(pts1, pts2)
    dst = cv.warpAffine(img, MA, img.shape[:2])

    cv.imshow("Origin image", img)
    cv.imshow("Affine transform", dst)
    cv.waitKey(0)
