图像的旋转
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/73db7073a188ab02dd6349ee0a398709.png)
import cv2
if __name__ == '__main__':
image = cv2.imread("000200.jpg")
cv2.imshow("image", image)
rImg = cv2.rotate(image, cv2.ROTATE_180)
cv2.imshow("rImg", rImg)
cv2.waitKey(0)
cv2.destroyAllWindows()
投影变换
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/73b1e009a0b074dbf93bc614b1125ba3.png)
import cv2
import numpy as np
if __name__ == '__main__':
image = cv2.imread("000200.jpg")
h, w, d = image.shape
src = np.array([[0, 0], [w - 1, 0], [0, h - 1], [w - 1, h - 1]], np.float32)
dst = np.array([[50, 50], [w / 3, 50], [50, h - 1], [w - 1, h - 1]], np.float32)
p = cv2.getPerspectiveTransform(src, dst)
r = cv2.warpPerspective(image, p, (w, h), borderValue=125)
cv2.imshow("image", image)
cv2.imshow("warpPerspective", r)
cv2.waitKey(0)
cv2.destroyAllWindows()