How can I rotate an image in Python with the help of OpenCv library, and by changing the value of height and width of the image (without using the built-in methods for rotat
Does it have to be OpenCv? Cause if not you can easily do it with PIL:
from PIL import Image def rotate_img(img_path, rt_degr): img = Image.open(img_path) return img.rotate(rt_degr, expand=1) img_rt_90 = rotate_img('Images/Screenshot.png', 90) img_rt_90.save('img_rt_90.png')