cv2.getRotationMatrix2D函数

图片旋转 1. cv2.getRotationMatrix2D(获得仿射变化矩阵) 2. cv2.warpAffine(进行仿射变化)

 

 

1.rot_mat =  cv2.getRotationMatrix2D(center, -5, 1)

参数说明:center表示中间点的位置,-5表示逆时针旋转5度,1表示进行等比列的缩放

2. cv2.warpAffine(img, rot_mat, (img.shape[1], img.shape[0]))

参数说明: img表示输入的图片,rot_mat表示仿射变化矩阵,(image.shape[1], image.shape[0])表示变换后的图片大小


 

 

posted on 2019-09-03 11:44  一杯明月  阅读(11669)  评论(0编辑  收藏  举报