Open pydemo opened 4 years ago
Hi! you can use scipy.ndimage library to get your desired output. Check out the documentation here. Let me show an example
from skimage import io
from scipy import ndimage
image = io.imread('https://www.pyimagesearch.com/wp-content/uploads/2019/12/tensorflow2_install_ubuntu_header.jpg')
io.imshow(image)
plt.show()
rotated = ndimage.rotate(image, angle=234, mode='nearest')
rotated = cv2.resize(rotated, (image.shape[:2]))
# rotated = cv2.cvtColor(rotated, cv2.COLOR_BGR2RGB) # if you wish to save it using opencv
io.imshow(rotated)
plt.show()
Note: For Scipy you may encounter an error if not properly imported kindly check here
can you add background colour var to your rotate method?