scipy.fft.fft2 is 2-3x faster than np.fft.fft2
One of the bottlenecks of the local coregistration is the fourier transform. If pyfftw
is not available (which is everywhere, because the most recent version is currently disabled), numpy
is used.
In my testing (M3 Mac), the scipy.fft.fft2
implementation is 2-3x faster than np.fft.fft2
within arosics
.
Time per function call
479822.5 fft_arr0 = np.fft.fft2(in_arr0)
350634.3 fft_arr1 = np.fft.fft2(in_arr1)
171587.7 fft_arr0 = scipy.fft.fft2(in_arr0)
154358.3 fft_arr1 = scipy.fft.fft2(in_arr1)
It's a drop-in replacement in CoReg.py
, scipy
is already used elsewhere.
Edited by Daniel Scheffler