def frame_rotate(frame,theta = 45):
(h, w) = frame.shape[:2]
center = (w / 2, h / 2)
# rotate the image by 180 degrees
M = cv2.getRotationMatrix2D(center, theta, 1.0)
rotated = cv2.warpAffine(frame, M, (w, h))
return rotated
评论列表
文章目录