Project 1
import cv2
import os
import numpy as np
image = cv2.imread("cat-medical-mask-protective-antiviral-260nw-1684423789.jpg")
def rotate_image(image, dimensions, angle=30, scale=1):
rot_mat = cv2.getRotationMatrix2D(center=dimensions, angle=angle, scale=scale)
rotated_image = cv2.warpAffine(image, rot_mat, (image.shape[1], image.shape[0]))
return rotated_image
trans_x = 10
trans_y = 10
center = (image.shape[1]//2 + trans_x, image.shape[0]//2 + trans_y)
result = np.hstack((image, rotate_image(image, center)))
cv2.imwrite("result.jpg", result)