Ejemplo n.º 1
0
# -*- 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])
Ejemplo n.º 2
0
# -*- 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)

Ejemplo n.º 3
0
# -*- 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")