In [38]:
import matplotlib.pyplot as plt

%matplotlib inline
In [39]:
I0 = plt.imread('SiebelCtr_01.jpg')
print("Dimension of I0: ", I0.shape)
plt.figure(figsize=(10,10))
plt.imshow(I0, interpolation='none')
Dimension of I0:  (370, 552, 3)
Out[39]:
<matplotlib.image.AxesImage at 0x10bc34710>
In [40]:
I1 = I0[::2, ::2, :]
print("Dimension of I1: ", I1.shape)
plt.figure(figsize=(10,10))
plt.imshow(I1, interpolation='none')
Dimension of I1:  (185, 276, 3)
Out[40]:
<matplotlib.image.AxesImage at 0x10bc5c400>
In [41]:
I2 = I1[::2, ::2, :]
print("Dimension of I2: ", I2.shape)
plt.figure(figsize=(10,10))
plt.imshow(I2, interpolation='none')
Dimension of I2:  (93, 138, 3)
Out[41]:
<matplotlib.image.AxesImage at 0x10f839d68>
In [42]:
I3 = I2[::2, ::2, :]
print("Dimension of I3: ", I3.shape)
plt.figure(figsize=(10,10))
plt.imshow(I3, interpolation='none')
Dimension of I3:  (47, 69, 3)
Out[42]:
<matplotlib.image.AxesImage at 0x10f89ba20>
In [43]:
I4 = I3[::2, ::2, :]
print("Dimension of I4: ", I4.shape)
plt.figure(figsize=(10,10))

plt.imshow(I4, interpolation='none')
Dimension of I4:  (24, 35, 3)
Out[43]:
<matplotlib.image.AxesImage at 0x10fad4588>
In [44]:
I5 = I4[::2, ::2, :]
print("Dimension of I5: ", I5.shape)
plt.figure(figsize=(10,10))
plt.imshow(I5, interpolation='none')
Dimension of I5:  (12, 18, 3)
Out[44]:
<matplotlib.image.AxesImage at 0x10fb2f400>
In [45]:
I6 = I5[::2, ::2, :]
print("Dimension of I6: ", I6.shape)
plt.figure(figsize=(10,10))
plt.imshow(I6, interpolation='none')
Dimension of I6:  (6, 9, 3)
Out[45]:
<matplotlib.image.AxesImage at 0x10fd60400>
In [46]:
I7 = I6[::2, ::2, :]
print("Dimension of I7: ", I7.shape)
plt.figure(figsize=(10,10))
plt.imshow(I7, interpolation='none')
Dimension of I7:  (3, 5, 3)
Out[46]:
<matplotlib.image.AxesImage at 0x10fea3358>
In [47]:
J = plt.imread('somerock.jpg')
print("J is ", J.shape)
Jold = J.copy()
for j in range(9):
    Jcoarse = Jold[::2, ::2, :]
    Jold = Jcoarse.copy()
    print("J is ", Jcoarse.shape)
J is  (1200, 1920, 3)
J is  (600, 960, 3)
J is  (300, 480, 3)
J is  (150, 240, 3)
J is  (75, 120, 3)
J is  (38, 60, 3)
J is  (19, 30, 3)
J is  (10, 15, 3)
J is  (5, 8, 3)
J is  (3, 4, 3)
In [48]:
plt.figure(figsize=(10,10))
plt.imshow(Jcoarse, interpolation='none')
Out[48]:
<matplotlib.image.AxesImage at 0x11089dc88>
In [49]:
plt.figure(figsize=(10,10))
plt.imshow(J, interpolation='none')
Out[49]:
<matplotlib.image.AxesImage at 0x110906160>
In [ ]: