from numpy import *
from importlib_resources import read_binary
from io import BytesIO
import skimage.io, skimage.transform, skimage.exposure, skimage.morphology, skimage.filters, skimage.feature
flourish = skimage.io.imread(BytesIO(read_binary('deathbeds.data', 'IMG-0762.JPG')))
flat = skimage.color.rgb2gray(flourish)
It was drawn on one of them big post its.
%matplotlib inline
skimage.io.imshow(flourish)
<matplotlib.image.AxesImage at 0x1135e24a8>
%matplotlib inline
labelled = skimage.measure.label(
flat>.6)
skimage.io.imshow(labelled)
/Users/tonyfast/anaconda/envs/p6/lib/python3.6/site-packages/skimage/io/_plugins/matplotlib_plugin.py:74: UserWarning: Low image data range; displaying image with stretched contrast. warn("Low image data range; displaying image with "
<matplotlib.image.AxesImage at 0x1138b5320>
%matplotlib inline
skimage.io.imshow(
(1 - arange(labelled.shape[1])/labelled.shape[1]) * flat +
arange(labelled.shape[1])/labelled.shape[1] * labelled/labelled.max())
<matplotlib.image.AxesImage at 0x1c275c55c0>
%matplotlib inline
skimage.io.imshow(
skimage.measure.label(
skimage.color.rgb2gray(flourish)>.6));
/Users/tonyfast/anaconda/envs/p6/lib/python3.6/site-packages/skimage/io/_plugins/matplotlib_plugin.py:74: UserWarning: Low image data range; displaying image with stretched contrast. warn("Low image data range; displaying image with "
%matplotlib inline
skimage.io.imshow(
skimage.morphology.binary_dilation(
skimage.morphology.skeletonize(skimage.color.rgb2gray(flourish)>.6),
skimage.morphology.disk(5)
));