def rotateImage(image, angle, center=None, scale=1.0):
h, w = image.shape[:2]
if center is None:
center = (w / 2, h / 2)
rot_mat = cv2.getRotationMatrix2D(center, angle, scale)
result = cv2.warpAffine(image, rot_mat, (w, h), flags=cv2.INTER_CUBIC)
return result
评论列表
文章目录