plt.imshow 图像读取,展示


#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from scipy import misc
face = misc.face()
misc.imsave('face.png', face) # First we need to create the PNG file
face = misc.imread('face.png')
print type(face)
print face.shape,face.dtype
plt.imshow(face)
plt.show()

Related posts

Leave a Comment