This is documentation for an old release of SciPy (version 0.7.). Read this page in the documentation of the latest stable release (version 1.15.1).
correlate2d does 2d correlation of ‘data’ with ‘kernel’, storing the result in ‘output’.
If fft is True, the correlation is performed using the FFT, else the correlation is performed using the naive approach.
>>> a = np.arange(20*20)
>>> a = a.reshape((20,20))
>>> b = np.ones((5,5), dtype=np.float64)
>>> rn = correlate2d(a, b, fft=0)
>>> rf = correlate2d(a, b, fft=1)
>>> np.alltrue(np.ravel(rn-rf<1e-10))
True