Created
July 20, 2023 11:56
-
-
Save mocquin/babecc22c45ea9118560d468ba47f41b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in order to multiply the fourier transforms, we need to pad | |
# the kernel to the same size as the image | |
kernel_padded = np.pad(kernel, ((0, V-N), (0, H-N))) | |
fft_convolved = np.fft.ifft2(np.fft.fft2(img) * np.fft.fft2(kernel_padded)) | |
p_fft = PeriodicArray(fft_convolved.real) | |
p_fft.plot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment