I'm trying to learn about 2D fourier transforms and k-space right now.
To do this, I'm using the image at
In Matlab, I run the following code:
Im = double(imread('4kSnake.png'));
FT = fftshift(fft2(Im));
FT_Amp = abs(FT);
minAmp = min(min(FT_Amp)); maxAmp = max(max(FT_Amp));
and I get the result http://django.jayparlar.com/matlab.png (which is
what it should look like).
It matplotlib/ipython, I do the following:
In : a = imread("4kSnake.png")
In : a = double(imread("4kSnake.png"))
In : FT = fftpack.fftshift(fftpack.fft2(a))
In : FT_Amp = abs(FT)
In : imshow(FT_Amp, cmap=cm.gray)
and I get the result http://django.jayparlar.com/matplotlib.png
Can anyone offer any insight as to why? I'm fairly new to matplotlib,
but I'm a LONG time Python user, and would much rather continue my
work in Python than Matlab.
One issue might be the use of "minAmp" and "maxAmp" in the Matlab
code, and no equivalent in the Python. I thought maybe the vmin/vmax
arguments to 'imshow' might work, but they don't make much of a
For all I know, this could be a scipy issue, and not a matplotlib one,
but I thought I'd start at the top and work my way down.