# width, height = 458, 371 width, height = 250, 350pts1 = np.float32([[109, 220], [282, 189], [154, 483], [353, 434]]) pst2 = np.float32([[0, 0], [width, 0], [0, height], [width, height]])matrix = cv2.getPerspectiveTransform(pts1, pst2) imgOutput = cv2.warpPerspective(img, matrix, (width, height))