[SciPy-user] ndimage.convolve behaviour?
Tue Jun 23 04:45:48 CDT 2009
Try as I might I can't seem to figure out why this behaviour might be
In : X.shape
Out: (20, 20)
In : fm.filter.shape
Out: (5, 5)
In : ndimage.convolve(X, fm.filter, mode='constant', cval=0)[2,2]
In : (X[:5, :5] * fm.filter).sum() # which should be [2,2] in the
convolved image, no?
I get roughly the same answer with scipy.signal.convolve2d(X,
fm.filter, mode='same'). Am I missing something fundamental? Does my
kernel need to be separable or something like that?
More information about the SciPy-user