From ea9e7c81e9d9bc22c14863f8b0f416175967137b Mon Sep 17 00:00:00 2001 From: Natengaki <74347423+Natengaki@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:30:34 +0200 Subject: [PATCH] Update ridge_filter.py I replace line 45 to avoid the following error : TypeError: object of type cannot be safely interpreted as an integer. --- enhance/ridge_filter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/enhance/ridge_filter.py b/enhance/ridge_filter.py index 9fd9e6a..302f586 100644 --- a/enhance/ridge_filter.py +++ b/enhance/ridge_filter.py @@ -77,7 +77,8 @@ def ridge_filter(im, orient, freq, kx, ky): sigmax = 1/unfreq[0]*kx; sigmay = 1/unfreq[0]*ky; - sze = np.round(3*np.max([sigmax,sigmay])); + #sze = np.round(3*np.max([sigmax,sigmay])); + sze = np.round(3*np.max([sigmax,sigmay])).astype('int'); x,y = np.meshgrid(np.linspace(-sze,sze,(2*sze + 1)),np.linspace(-sze,sze,(2*sze + 1))); @@ -138,4 +139,4 @@ def ridge_filter(im, orient, freq, kx, ky): newim[r][c] = np.sum(img_block * gabor_filter[int(orientindex[r][c]) - 1]); - return(newim); \ No newline at end of file + return(newim);