November 2018
Intermediate to advanced
492 pages
12h 19m
English
The next code block shows how to display the face dataset of the misc module:
im = misc.face() # load the raccoon's face imagemisc.imsave('face.png', im) # uses the Image module (PIL)plt.imshow(im), plt.axis('off'), plt.show()
The next figure shows the output of the previous code, which displays the misc module's face image:

We can read an image from disk using misc.imread(). The next code block shows an example:
im = misc.imread('../images/pepper.jpg')print(type(im), im.shape, im.dtype)# <class 'numpy.ndarray'> (225, 225, 3) uint8
The I/O function's imread() is deprecated in SciPy 1.0.0, and will be removed ...
Read now
Unlock full access