Convolving image with kernel in Fourier domain
I'm using zero padding around my image and convolution kernel, converting them to the Fourier domain, and inverting them back to get the convolved image, see code below. The result, however, is wrong. I was expecting a blurred image, but the output is four shifted quarters. Why is the output wrong, and how can I fix the code? Input image: Result of convolution: from PIL import Image,ImageDraw,ImageOps,ImageFilter import numpy as np from scipy import fftpack from copy import deepcopy import imageio ## STEP 1 ## im1=Image.open("pika.jpeg") im1=ImageOps.grayscale(im1) im1.show() print("s",im1