import os
import dask
import dask_image.imread
import matplotlib.pyplot as plt
import imageio
# Set up figure defaults
# plt.rc('image', cmap='gray', interpolation='nearest') # Display all images in b&w and with 'nearest' interpolation
plt.rcParams['figure.figsize'] = (16, 9) # Size up figures a bit
plt.rcParams['figure.dpi'] = 300 # Increase dpi
Images = dask_image.imread.imread(os.path.join('img', '*.jpg'))
Images
|
Images.shape
(44, 3024, 4032, 3)
# 'Roll' the array so that autumn is in the middle of the array and not at the start
# Roll along the image axis, otherwise we roll the RGB channels :)
Images = dask.array.roll(Images, shift=len(Images)//2, axis=0)
# Show every xth image
x = 5
for c, img in enumerate(Images[::x]):
plt.subplot(1,len(Images[::x]), c+1)
plt.imshow(img)
plt.title(range(len(Images))[::x][c])
plt.axis('off')
plt.show()