Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- close all;
- clc
- Image = imread('Lenna.png');
- %Image = imread('k.jpg');
- Gray = rgb2gray(Image);
- GrayFFT = fft(Gray);
- dim = length (GrayFFT);
- sample = zeros(3);
- mask = [ 0,-1, 0;
- -1, 4,-1;
- 0,-1, 0];
- %co tu powinno być?
- Masked = Gray;
- for row = 2:dim -1
- for col = 2:dim-1
- sample = GrayFFT((row-1):(row+1),(col-1):(col+1));
- sample = sample .* mask;
- Masked(row,col) = sum(sum(sample));
- end
- end;
- Out = ifft(Masked);
- imwrite(real(Out),'Out.png');
- imshow(real(Out), [real(min(Out(:))) real(max(Out(:)))] );
- % Comparison = [Gray,Out];
- % imwrite(Comparison,'Comparison.png');
- % imshow(Comparison);
Advertisement
Add Comment
Please, Sign In to add comment