# 90degree
image = cv2.rotate(src, cv2.cv2.ROTATE_90_CLOCKWISE)
# 180 degrees
image = cv2.rotate(src, cv2.ROTATE_180)
# 270 degrees
image = cv2.rotate(src, cv2.ROTATE_90_COUNTERCLOCKWISE)
M = cv2.getRotationMatrix2D(center, angle, scale)
rotated = cv2.warpAffine(img, M, (w, h))