# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import matplotlib.pyplot as plt from mymodule import lena img = lena() plt.gray() plt.imshow(img) plt.show() print(img[0:3, 0:7]) img[1, 1:6] = 0 print(img[0:3, 0:7])
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import scipy.misc import numpy from mymodule import lena img = lena().astype('float32') scores = numpy.array([101, 103, 84], dtype = 'float32') print(scores) print(img)
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import mymodule img = mymodule.lena() value = 0 for item in img.flat: value += item print(value) #array conversion img.tofile("lena.txt", sep=" ", format="%i")