KDOXG

transform_freq

Nov 15th, 2020
679
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function img_transform = transform_freq(imagem, s)
  2.   #img_transform = "";
  3.   img_transform = [];
  4.   if s != 0 && s != 1
  5.     return
  6.   endif
  7.   #Im = imread(imagem);
  8.   Im = imagem;
  9.   if s == 0
  10.     Im = im2double(Im);
  11.     Im = fft2(Im);
  12.     Im = fftshift(Im);
  13.     #Im = log(abs(Im));
  14.   else
  15.     Im = ifftshift(Im);
  16.     Im = ifft2(Im);
  17.     Im = abs(Im);
  18.     #Im = uint8(Im);
  19.   endif
  20.   imwrite(Im,"result.bmp");
  21.   #img_transform = "result.png";
  22.   img_transform = Im;
  23.   return
  24. endfunction
  25.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×