[Scipy-tickets] [SciPy] #1443: correlate2d's output does not agree with correlate's output in scipy.signal module

SciPy Trac scipy-tickets@scipy....
Sun May 22 20:54:07 CDT 2011


#1443: correlate2d's output does not agree with correlate's output in scipy.signal
module
--------------------------+-------------------------------------------------
 Reporter:  SevenSea      |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:          
Component:  scipy.signal  |     Version:  0.8.0   
 Keywords:  correlate2d   |  
--------------------------+-------------------------------------------------
 When the 2-dimensional array size is even, correlate2d's output does not
 agree with correlate's output in scipy.signal module. There is a shift of
 index in the output of correlate2d function. (Information for comparition:
 convolv2d works good.)

 Testing code:
 {{{
 import numpy as np
 import scipy.signal as sn

 d = np.ones((4,4))
 print "data: "
 print d

 print "correlate(d,d,'same'): "
 print sn.correlate(d,d,'same')

 print "correlate2d(d,d,'same'): "
 print sn.correlate2d(d,d,'same')
 }}}

 The output:
 {{{
 data:
 [[ 1.  1.  1.  1.]
  [ 1.  1.  1.  1.]
  [ 1.  1.  1.  1.]
  [ 1.  1.  1.  1.]]
 correlate(d,d,'same'):
 [[  4.   6.   8.   6.]
  [  6.   9.  12.   9.]
  [  8.  12.  16.  12.]
  [  6.   9.  12.   9.]]
 correlate2d(d,d,'same'):
 [[  9.  12.   9.   6.]
  [ 12.  16.  12.   8.]
  [  9.  12.   9.   6.]
  [  6.   8.   6.   4.]]
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1443>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list