We can change perspective in OpenCV using the functions cv2.getPerspectiveTransform(pts1,pts2) and cv2.warpPerspective(img,M,(640,480)). The cv2.getPerspectiveTransform() function calculates a perspective transform from four pairs of the corresponding points. The points pts1 and pts2 are two rectangles, where on is the source and the other the destination. Putting it together you get something li

