import cv2
import numpy as np
img = cv2.imread('ruonan.jpg',1)
Info = img.shape
height = Info[0]
width = Info[1]
matRotate = cv2.getRotationMatrix2D((width*0.5,0.5*height),-45,0.4) #C参数1 旋转中心的位置,参数2 旋转的角度 参数3 缩放比例
dat = cv2.warpAffine(img,matRotate,(width,height)) #此处注意需要参数三是宽和高
cv2.imshow('datImg',dat)
cv2.waitKey(0)
15_图片的旋转变换
最新推荐文章于 2022-08-30 11:42:42 发布