In [1]:
#%matplotlib inline
from skimage import data, io, filter
from PIL import Image
#fname = '66048_445402766775_10599076775_5951807_3013565_n-beauty.jpg'
#fname='../kaggle/input/images/324.jpg'
#fname='aya-ueto-00460095.jpg'
#im = Image.open(fname)
im = data.coins()
edges = filter.sobel(im)
io.imshow(edges)
io.show()
In [11]:
from PIL import Image
import numpy as np
#image = Image.open('aya-ueto-00460095.jpg')
#image = Image.open('Screenshot_2016-10-19-23-50-10.png')
image = Image.open('317_2.jpg')
image
Out[11]:
In [12]:
im = image.convert('L')
im
Out[12]:
In [14]:
np.array(im)
Out[14]:
In [17]:
from pylab import *
figure()
gray()
contour (im, origin='image')
axis('equal')
axis('off')
figure()
hist(im.flatten(),128)
show()
In [ ]: