def fd_conv(Img_xy, h2d, mode ='same'): #return convolve2d(Img_xy, h2d, mode=mode) return fftconvolve(Img_xy, h2d, mode=mode)