[Scipy-tickets] [SciPy] #1570: Some scipy.ndimage functions fails for Yx1024x1024 images

SciPy Trac scipy-tickets@scipy....
Sun Dec 11 09:40:16 CST 2011


#1570: Some scipy.ndimage functions fails for Yx1024x1024 images
---------------------------------------+------------------------------------
 Reporter:  chcomin                    |       Owner:  somebody   
     Type:  defect                     |      Status:  new        
 Priority:  high                       |   Milestone:  Unscheduled
Component:  scipy.ndimage              |     Version:  0.9.0      
 Keywords:  image dimension correlate  |  
---------------------------------------+------------------------------------

Old description:

> When you use some functions in scipy.ndimage you get unexpected results
> for three dimensional images where two dimensions have size 1024, for
> example:
>
> img = numpy.ones([1,1023,1023])
> s = numpy.ones([3,3,3])
> res = scipy.ndimage.filters.correlate(img,s)
>
> the output, as expected, is the number 27 for every element of res (the
> sum of s).
>
> Now, if you change img dimension to 1024:
>
> img = numpy.ones([1,1024,1024])
> s = numpy.ones([3,3,3])
> res = scipy.ndimage.filters.correlate(img,s)
>
> you get strange values that are wrong.
>
> With a two dimensional matrix everything is fine:
>
> img = numpy.ones([1024,1024])
> s = numpy.ones([3,3])
> res = scipy.ndimage.filters.correlate(img,s)
>
> every element of res is 9.
>
> This error also happens with scipy.ndimage.measurements.label and
> probably with other functions (maybe they all use correlate?)
>
> So far I verified that the error occurs in scipy 0.9 and 0.10.

New description:

 When you use some functions in scipy.ndimage you get unexpected results
 for three dimensional images where two dimensions have size 1024, for
 example:
 {{{
 img = numpy.ones([1,1023,1023])
 s = numpy.ones([3,3,3])
 res = scipy.ndimage.filters.correlate(img,s)
 }}}
 the output, as expected, is the number 27 for every element of res (the
 sum of s).

 Now, if you change img dimension to 1024:
 {{{
 img = numpy.ones([1,1024,1024])
 s = numpy.ones([3,3,3])
 res = scipy.ndimage.filters.correlate(img,s)
 }}}
 you get strange values that are wrong.

 With a two dimensional matrix everything is fine:
 {{{
 img = numpy.ones([1024,1024])
 s = numpy.ones([3,3])
 res = scipy.ndimage.filters.correlate(img,s)
 }}}
 every element of res is 9.

 This error also happens with scipy.ndimage.measurements.label and probably
 with other functions (maybe they all use correlate?)

 So far I verified that the error occurs in scipy 0.9 and 0.10.

--

Comment(by warren.weckesser):

 Add markup to description.

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


More information about the Scipy-tickets mailing list