In [15]:
import numpy as np
import matplotlib.pyplot as plt
import scipy
import pickle
In [54]:
print(scipy.__version__)
print(scipy.__file__)
In [56]:
def loadlena():
f = open('lena.dat','rb')
lena = np.array(pickle.load(f))
f.close()
return lena
In [55]:
# Set the resize factors
yfactor = 2
xfactor = 3
#Lena's dimensions
LENA_X = 512
LENA_Y = 512
In [18]:
lena = loadlena()
In [51]:
np.testing.assert_equal((LENA_X, LENA_Y), lena.shape)
In [52]:
resized = lena.repeat(yfactor, axis=0).repeat(xfactor, axis=1)
In [53]:
plt.subplot(211)
plt.title("Lena")
plt.axis("off")
plt.imshow(lena)
plt.subplot(212)
plt.title("Resized")
plt.axis("off")
plt.imshow(resized)
plt.show()
In [32]:
In [ ]: