In [57]:
%pylab inline
import random
img = imread('imgs/firestar.png')
img[0]
img[1]
img[2]
img[4]
Out[57]:
In [58]:
subplot(121)
plot(abs(fft.fft(img[0])))
title('The magnitude spectrum')
subplot(122)
plot(angle(fft.fft(img[0])));
title('The phase spectrum')
gcf().set_figwidth(10)
In [59]:
subplot(121)
plot(abs(fft.fft(img[1])))
title('The magnitude spectrum')
subplot(122)
plot(angle(fft.fft(img[1])));
title('The phase spectrum')
gcf().set_figwidth(10)
In [60]:
subplot(121)
plot(abs(fft.fft(img[2])))
title('The magnitude spectrum')
subplot(122)
plot(angle(fft.fft(img[2])));
title('The phase spectrum')
gcf().set_figwidth(10)
In [61]:
subplot(121)
plot(abs(fft.fft(img[812])))
title('The magnitude spectrum')
subplot(122)
plot(angle(fft.fft(img[812])));
title('The phase spectrum')
gcf().set_figwidth(10)
In [62]:
new_img = img[2]
In [63]:
new_img
Out[63]:
In [66]:
new_img[3][1]
Out[66]:
In [87]:
for each in new_img:
i = random.randint(0,811)
for pix in each:
j = random.randint(0,2)
pix = img[i][j][j]
In [88]:
subplot(121)
plot(abs(fft.fft(new_img)))
title('The magnitude spectrum')
subplot(122)
plot(angle(fft.fft(new_img)));
title('The phase spectrum')
gcf().set_figwidth(10)
In [89]:
imgplot = plt.imshow(img) # This is what we started with.