Python scipy.ndimage.interpolate卷积和correlate之间的差异
我只是想熟悉一下scipy.ndimage,我不知道interpolate.convalve和interpolate.correlate有什么不同Python scipy.ndimage.interpolate卷积和correlate之间的差异,python,scipy,Python,Scipy,我只是想熟悉一下scipy.ndimage,我不知道interpolate.convalve和interpolate.correlate有什么不同 In [24]: a Out[24]: array([[ 0., 1., 2.], [ 3., 4., 5.], [ 6., 7., 8.], [ 9., 10., 11.]]) In [25]: filt=array([[0,1,0],[1,2,1],[0,1,0]])
In [24]: a
Out[24]:
array([[ 0., 1., 2.],
[ 3., 4., 5.],
[ 6., 7., 8.],
[ 9., 10., 11.]])
In [25]: filt=array([[0,1,0],[1,2,1],[0,1,0]])
In [26]: convolve(a,weights=filt)
Out[26]:
array([[ 4., 9., 14.],
[ 19., 24., 29.],
[ 37., 42., 47.],
[ 52., 57., 62.]])
In [27]: correlate(a,weights=filt)
Out[27]:
array([[ 4., 9., 14.],
[ 19., 24., 29.],
[ 37., 42., 47.],
[ 52., 57., 62.]])
In [28]: correlate == convolve
Out[28]: False
它们完全相同吗?卷积[f(x),g(x)]=相关[f(x),g(-x)]
当您简单地将内核移动到图像上时,就会发生
是一个数学概念(也在物理学中使用),例如在计算时起作用。vs尝试不对称
filt
,您将看到区别。几乎可以解释一切。谢谢