Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function img_transform = transform_freq(imagem, s)
- #img_transform = "";
- img_transform = [];
- if s != 0 && s != 1
- return
- endif
- #Im = imread(imagem);
- Im = imagem;
- if s == 0
- Im = im2double(Im);
- Im = fft2(Im);
- Im = fftshift(Im);
- #Im = log(abs(Im));
- else
- Im = ifftshift(Im);
- Im = ifft2(Im);
- Im = abs(Im);
- #Im = uint8(Im);
- endif
- imwrite(Im,"result.bmp");
- #img_transform = "result.png";
- img_transform = Im;
- return
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement