From d240e9141365779b86e10a1aeed52bac903b9fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 28 Oct 2012 22:32:09 +0100 Subject: [PATCH] Fix meshgrid bug in gabor kernel and argument passing --- skimage/filter/_gabor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/filter/_gabor.py b/skimage/filter/_gabor.py index 8c2e107a..3424e12f 100644 --- a/skimage/filter/_gabor.py +++ b/skimage/filter/_gabor.py @@ -36,7 +36,7 @@ def gabor_kernel(sigmax, sigmay, frequency, theta, offset=0): x0 = np.ceil(max(3 * sigmax, 1)) y0 = np.ceil(max(3 * sigmay, 1)) - y, x = np.mgrid[-x0:x0+1, -y0:y0+1] + y, x = np.mgrid[-y0:y0+1, -x0:x0+1] rotx = x * np.cos(theta) + y * np.sin(theta) roty = -x * np.sin(theta) + y * np.cos(theta) @@ -86,7 +86,7 @@ def gabor_filter(image, sigmax, sigmay, frequency, theta, offset=0, """ - g = gabor_kernel(sigmax, sigmay, frequency, theta, offset=0) + g = gabor_kernel(sigmax, sigmay, frequency, theta, offset) filtered_real = ndimage.convolve(image, np.real(g), mode=mode, cval=cval) filtered_imag = ndimage.convolve(image, np.imag(g), mode=mode, cval=cval)