Sep-29-2020, 10:07 AM
If you need to rotate an image and compose an another image from its rotated copies, you can use
numpy
. If you have scikit-image
installed, you can try the following:from skimage import data from matplotlib import pyplot as plt im = data.astronaut() m, n, c = im.shape new_im = np.zeros((m*2, n*3, c)) new_im[:m, :n, ...] = im new_im[:m, 2*n:, ...] = np.rot90(im) new_im[m:, n:2*n, ...] = np.flipud(im) new_im = new_im.astype(np.uint8) plt.imshow(new_im)You can consequently apply
np.rot90
to get desired rotation of the image.