From 3fd47091dd85a8834a6fe5b2d51112d6e9815ade Mon Sep 17 00:00:00 2001 From: scottsievert Date: Sat, 12 Dec 2015 21:15:01 -0600 Subject: [PATCH] adds comment explaining time_ratio decision --- skimage/restoration/deconvolution.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skimage/restoration/deconvolution.py b/skimage/restoration/deconvolution.py index 18259127..426766f7 100644 --- a/skimage/restoration/deconvolution.py +++ b/skimage/restoration/deconvolution.py @@ -369,6 +369,8 @@ def richardson_lucy(image, psf, iterations=50, clip=True): def fft_time(m, n, k, l): return m*np.log(m) + n*np.log(n) + k*np.log(k) + l*np.log(l) + # see whether the fourier transform convolution method or the direct + # convolution method is faster (discussed in scikit-image PR #1792) time_ratio = 71.468 * fft_time(*(image.shape + psf.shape)) time_ratio /= direct_time(*(image.shape + psf.shape)) convolve_method = fftconvolve if time_ratio <= 1 else convolve2d