Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% 1
- clc
- clear all
- close all
- A=zeros(128,128);
- A(3:4:128,:)=1;
- A(4:4:128,:)=1;
- F=fftshift(fft2(A));
- subplot(2,1,1)
- imshow(A)
- title('oryginal')
- subplot(2,1,2)
- imshow(log(1+abs(F)));
- title ('w. amplitudowe')
- %% 2
- clc
- clear all
- close all
- A=zeros(32,32);
- A(13:1:18,6:1:26)=1;
- F=fftshift(fft2(A));
- F2=fftshift(fft2(A,256,256));
- subplot(3,1,1)
- imshow(A)
- title('oryg.')
- subplot(3,1,2)
- imshow(log(1+abs(F)));
- title ('transformata')
- subplot(3,1,3)
- imshow(log(1+abs(F2)));
- title('transformata 2')
- %% 3
- clc
- clear all
- close all
- I=imread('Clown.tif');
- I2=double(I)/255;
- F=fftshift(fft2(I2));
- figure(1)
- subplot(3,1,1)
- imshow(I)
- title('oryginał')
- subplot(3,1,2)
- imshow(log10(1+abs(F)))
- title ('w. amp. log10')
- subplot(3,1,3)
- imshow(angle(F))
- title('w.fazowe')
- %% 4
- clc
- clear all
- close all
- I=imread('Road.tif');
- I2=double(I)/255;
- F=fftshift(fft2(I2));
- I3=ifft2(ifftshift(F));
- I4=imsubtract(I2,I3);
- figure(1)
- subplot(2,1,1)
- imshow(F)
- title('w.amplitudowe')
- subplot(212)
- imshow(abs(F).^2)
- title ('w.mocy')
- figure(2)
- subplot(3,1,1)
- imshow(I2)
- title('oryginalny')
- subplot(3,1,2)
- imshow(I3)
- title('odtworzony')
- subplot (3,1,3)
- imshow(I4)
- title('roznica')
- %% 5
- clc
- clear all
- close all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement