Skip to content

Instantly share code, notes, and snippets.

@VladimirGl
Created February 25, 2017 18:31
Show Gist options
  • Save VladimirGl/a5c64e32caa2a501895ed1db6e2d52d2 to your computer and use it in GitHub Desktop.
Save VladimirGl/a5c64e32caa2a501895ed1db6e2d52d2 to your computer and use it in GitHub Desktop.
phase+mag
F_mag = np.fft.fft2(im_magnutide[:,:,0])
F_ph = np.fft.fft2(im_phase)
mag = np.absolute(F_mag)
phase = np.arctan2(F_ph.imag, F_ph.real)
re = np.multiply(mag, np.cos(phase))
im = np.multiply(mag, np.sin(phase))
res = re + 1j * im
res = np.fft.ifft2(res).real
plt.imshow(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment