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
I use the PIL package, it's very simple to do that.
from PIL import Image path = '/Users/diegodsp/sample.jpg' img = Image.open(path) img = img.rotate(90) # 90, -90, 180, ... img.save(path) # to override your old file