cv2 warpaffine rotate

Solutions on MaxInterview for cv2 warpaffine rotate by the best coders in the world

showing results for - "cv2 warpaffine rotate"
Cami
31 Jun 2016
1import numpy as np
2import cv2
3
4def rotate_image(image, angle):
5  image_center = tuple(np.array(image.shape[1::-1]) / 2)
6  rot_mat = cv2.getRotationMatrix2D(image_center, angle, 1.0)
7  result = cv2.warpAffine(image, rot_mat, image.shape[1::-1], flags=cv2.INTER_LINEAR)
8  return result
9
similar questions
queries leading to this page
cv2 warpaffine rotate