Scikit-image Gabor Filter Error: `filter Weights Array Has Incorrect Shape`
Input is a greyscale image, converted to a 130x130 numpy matrix. I always get the error: Traceback (most recent call last): File 'test_final.py', line 87, in a
Solution 1:
Seems like you are using 'ndimage.convolve' function from scipy. Remember that ndimage provides a "N" Dimensional convolution. So if you want the convolution to work, both the image and the kernel must have the same number of dimensions. Any one of them with incorrect dimension will cause error you have descirbed.
From you comment above , kernel (4,4,7) cannot be convolved with and image (130,130). Try adding a singleton dimension before convolution and then removing it afterwards.
img = np.zeros(shape=(130,130),dtype=np.float32)
img = img[:,:,None] # Add singleton dimensionresult = convolve(img,kernel)
finalOutput = result.squeeze() # Remove singleton dimension
Post a Comment for "Scikit-image Gabor Filter Error: `filter Weights Array Has Incorrect Shape`"