Learning and work in progress
- ImageIO (load images)
- NumPy
- SciPy
- matplotlib
import imageio
im = imageio.imread('image.format')
Image is stored as matrix, values can be accessed, as well as features
im[0,0]
im[0:4,0:4]
print('Image type:', type(im))
print('Shape of image array:', im.shape)
Image comes with stored metadata if available.
im.meta
im.meta['Category']
print(im.meta.keys())
import matplotlib.pyplot as plt
plt.imshow(im, cmap = 'gray')
plt.show()
####imshow() further allows to modify the plotted image. Not the underlying data!
plt.imshow(im, cmap = 'gray',vmin= -200, vmax= 200)
plt.axis('off')