%run ../common.ipynb
Populating the interactive namespace from numpy and matplotlib
img = imread('../MP.tiff')
# make a circle mask
r = 30
size = 2*r
x,y = np.meshgrid(range(size), range(size))
R = np.sqrt((x-r)**2+(y-r)**2)
mask = np.ones((size,size), bool)
mask[R>r] = 0
# discard values below 10
img[img<10]=0
# opening
imshow(ndimage.binary_opening(img, structure=mask))
(<matplotlib.figure.Figure at 0x1114ee890>, <matplotlib.axes._subplots.AxesSubplot at 0x1114f1710>, <matplotlib.image.AxesImage at 0x11fc87c50>)