Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Tutorials

Views: 1311
Kernel: Python 3 (Ubuntu Linux)

Image processing

Python offers many tools for image processing using the SciKit module

# load modules import numpy as np from skimage import data import matplotlib.pyplot as plt
# load standard image camera = data.camera() # plot plt.imshow(camera,cmap='gray')
<matplotlib.image.AxesImage at 0x7f38c6a087b8>
Image in a Jupyter notebook
# images are numerical arrays camera[0:50,0:50] = 0 # plt.imshow(camera,cmap='gray')
<matplotlib.image.AxesImage at 0x7f38c617e0b8>
Image in a Jupyter notebook
# filtering from skimage.morphology import disk from skimage.filters import gaussian selem = disk(20) blurred = gaussian(camera, sigma=(10,10)) plt.imshow(blurred,cmap='gray')
<matplotlib.image.AxesImage at 0x7f38c515ab00>
Image in a Jupyter notebook
# load standard image camera = data.camera() camera = camera + 100*np.random.random(camera.shape) # plot plt.imshow(camera,cmap='gray')
<matplotlib.image.AxesImage at 0x7f38c47827f0>
Image in a Jupyter notebook