Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 764 Bytes

File metadata and controls

48 lines (35 loc) · 764 Bytes

image_analysis_python

Learning and work in progress

Requirements

  • ImageIO (load images)
  • NumPy
  • SciPy
  • matplotlib

Loading images

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())

Plotting images

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')

N-dimensional images