def rotate_image(image, angle):
'''
Rotates the given image by the given angle.
'''
rows, cols, _ = np.atleast_3d(image).shape
rot_mat = cv2.getRotationMatrix2D((cols/2, rows/2), angle, 1)
return cv2.warpAffine(image, rot_mat, (cols, rows))
评论列表
文章目录