コード例 #1
0
ファイル: LenaExample1.py プロジェクト: EdelKearney/FileDump
# -*- 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])
コード例 #2
0
ファイル: LenaExample2.py プロジェクト: EdelKearney/FileDump
# -*- 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)

コード例 #3
0
ファイル: ArrayObject.py プロジェクト: EdelKearney/FileDump
# -*- 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")