In [60]:
from __future__ import division
__author__ = 'Horea Christian'

from skimage import io
import matplotlib as ml
import matplotlib.pyplot as plt
from matplotlib import axis
from pylab import figure, show, errorbar, setp, legend, imshow, cm
import matplotlib.image as mpimg
import numpy as np
file_path = "http://photo.chymera.eu/images/photos/minis/193xNxDSC_a8273.jpg.pagespeed.ic.-7QHrrc_Xp.jpg"
In [61]:
image = io.imread(file_path, as_grey=True)
#~print(np.shape(image))
freq = np.fft.fft2(image)
#~print(np.shape(freq))
In [62]:
freq = np.abs(freq)
print freq[:2,:30] 
[[  1.02851963e+04   1.19676278e+03   1.03658018e+03   2.89850813e+02
    2.16118785e+02   3.96577962e+02   2.11539113e+02   4.89854598e+00
    1.90558805e+02   9.42415956e+01   1.00426020e+02   6.30662438e+01
    1.01535460e+02   5.15287459e+01   3.22770376e+01   6.96933338e+01
    4.74697691e+01   4.42009723e+01   5.17923893e+01   3.19722161e+01
    3.83647752e+01   3.83065723e+01   4.77872903e+01   2.81105910e+01
    3.33303467e+01   3.53984490e+01   2.90624190e+01   3.39433910e+01
    2.50777304e+01   2.71223066e+01]
 [  1.04171274e+03   1.01623266e+02   2.72763625e+02   1.81442045e+02
    3.80766383e+02   4.14212969e+02   1.48060373e+02   1.51618297e+02
    8.85737866e+01   9.07842101e+01   2.29436004e+01   3.55786521e+01
    3.65046390e+01   3.21361774e+01   1.52072211e+01   3.04676886e+01
    3.31432956e+01   2.28454279e+01   2.04767316e+01   5.67713669e+00
    2.39015914e+01   1.63727658e+01   1.03426132e+01   5.65473172e+00
    1.31673649e+01   1.16753505e+01   6.49284217e+00   1.60280416e+01
    7.87470696e+00   5.28931553e+00]]
In [46]:
fig = plt.figure(figsize=(14, 6))
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
ax2.imshow(image, interpolation = "none")
ax1.imshow(freq, interpolation= "none")
plt.show()
In [ ]: