import cv2
img = cv2.imread('/home/pi/Pictures/young.jpeg')

(h, w) = img.shape[:2] #get height and width
center = (w //2, h //2) #get center of image

M = cv2.getRotationMatrix2D(center, 30, 1.0) #30 degrees
img_rotated = cv2.warpAffine(img, M, (w, h))

cv2.imshow('Rotated image', img_rotated)
cv2.waitKey(0)

d422e88a78f40838755ec3289e94e1cb6338d7e7
<mask token>

<mask token>
cv2.imshow('Rotated image', img_rotated)
cv2.waitKey(0)

<mask token>
img = cv2.imread('/home/pi/Pictures/young.jpeg')
h, w = img.shape[:2]
center = w // 2, h // 2
M = cv2.getRotationMatrix2D(center, 30, 1.0)
img_rotated = cv2.warpAffine(img, M, (w, h))
cv2.imshow('Rotated image', img_rotated)
cv2.waitKey(0)

import cv2
img = cv2.imread('/home/pi/Pictures/young.jpeg')
h, w = img.shape[:2]
center = w // 2, h // 2
M = cv2.getRotationMatrix2D(center, 30, 1.0)
img_rotated = cv2.warpAffine(img, M, (w, h))
cv2.imshow('Rotated image', img_rotated)
cv2.waitKey(0)

import cv2
img = cv2.imread('/home/pi/Pictures/young.jpeg')

(h, w) = img.shape[:2] #get height and width
center = (w //2, h //2) #get center of image

M = cv2.getRotationMatrix2D(center, 30, 1.0) #30 degrees
img_rotated = cv2.warpAffine(img, M, (w, h))

cv2.imshow('Rotated image', img_rotated)
cv2.waitKey(0)
