[Scipy-tickets] [SciPy] #1518: ndimage.label gives incorrect labeled components

SciPy Trac scipy-tickets@scipy....
Wed Sep 14 18:52:55 CDT 2011


#1518: ndimage.label gives incorrect labeled components
---------------------------+------------------------------------------------
 Reporter:  stefan         |       Owner:  somebody   
     Type:  defect         |      Status:  new        
 Priority:  normal         |   Milestone:  Unscheduled
Component:  scipy.ndimage  |     Version:  devel      
 Keywords:                 |  
---------------------------+------------------------------------------------
 {{{
 x = np.array([[1,1,2,3],[1,2,1,3],[1,1,2,3]])
 y = ndi.label(x)
 print x
 print y
 }}}

 Unexpected result:

 {{{
 [[1 1 2 3]
  [1 2 1 3]
  [1 1 2 3]]

 (array([[1, 1, 1, 1],
        [1, 1, 1, 1],
        [1, 1, 1, 1]]), 1)
 }}}

 Expected output, as generated by scikits.image:

 {{{
 In [7]: from scikits.image.morphology import label

 In [8]: label(x)
 Out[8]:
 array([[0, 0, 1, 2],
        [0, 1, 0, 2],
        [0, 0, 1, 2]])
 }}}

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


More information about the Scipy-tickets mailing list