I am working on a Python program (in Enthought Canopy) that will calculate the two point autocorrelation function for 2 and 3 dimensional images.
The core of the calculation is the following code:
fftx = fftn(newimpad)
del newimpad
ret_int = (fftx * np.conjugate(fftx))
del fftx
ret = ifftn(ret_int)
ret = fftshift(ret)
where newimpad
is the padded image.
This works. However, the back transform (the ifftn
step) is very slow - for the large images I have been working on in 2D it takes over 90 seconds. Is there any way to speed this up?