Getperspectivetransform Python, warpPerspective, with which you can have all kinds of transformations.