I'm sitting working on a thingy, and using MATLAB is required. My problem is that we never learned it in school and I am not that good at MATLAB...yet...
I'm trying to show the fourier transform of an image named hex.gif, but i keep getting two completely different pictures from "image" and "pcolor".
Here's my code for reference: (with a few "extras")
- Code: Select all
A = (imread('hex.gif','gif'));
sz = size(A);
N = sz(1);
M = sz(2);
lambda = 600e-9;
%f = 16.5e-3;
W = 0.04;
f = 0.1;
%W = 2e-3;
%W = 1;
I = abs((fftshift(fft2(A))));
%I = (fftshift(double(fft2(A)))).^2;
x = linspace(-lambda*f*N/(2*W), lambda*f*N/(2*W), N);
y = linspace(-lambda*f*M/(2*W), lambda*f*M/(2*W), M);
%x = linspace(-lambda*f*187/(2*W), lambda*f*187/(2*W), 187);
%y = linspace(-lambda*f*187/(2*W), lambda*f*187/(2*W), 187);
%F= abs(I);
figure(1);
image(I)
figure(2);
pcolor(x,y,I)
figure(3);
image(A)
I would appreciate any help in the matter!

