仿射变换的难点就是计算变换矩阵,Opencv提供了计算变换矩阵的API
.getRotationMatrix2D(center,angle,scale)
.center中心点,以图片的哪个点作为旋转时的中心点...lufei1 = cv2.resize(lufei,(800,500))
h,w, ch = lufei1.shape
# M = np.float32([[1,0,100],[0,1,0]])
# 注意opencv...200,300]])
dst = np.float32([[100,150],[360,200],[280,120]])
M = cv2.getAffineTransform(src,dst)
# 注意opencv