转载
2017年05月08日 20:16:31
5115
[html]
view plain
copy
# coding=gbk from PIL import Image import numpy as np # import scipy def loadImage(): # 读取图片 im = Image.open("lena.jpg") # 显示图片 im.show() im = im.convert("L") data = im.getdata() data = np.matrix(data) # print data # 变换成512*512 data = np.reshape(data,(512,512)) new_im = Image.fromarray(data) # 显示图片 new_im.show() loadImage()
转载请注明原文地址: https://www.6miu.com/read-2626612.html