label

Evan Daugharthy evan.daugharthy at gmail.com
Wed Jul 31 16:55:20 EDT 2013


Hello all,

Based on the discussion here: 
https://groups.google.com/forum/#!topic/pythonvision/AVrnueiKKYI

It seems like this label function should be faster than the scipy version. 
However, I find it to be much slower:

from skimage import morphology
from scipy import ndarray as nd

k = np.zeros((4000,4000),dtype=int)
k[100,100] = 1
strel = np.ones((3,3))

%timeit morphology.label(k) 
                                                                                                                                                                
1 loops, best of 3: 1.46 s per loop

%timeit nd.label(k,strel) 
                                                                                                                                                                  
1 loops, best of 3: 355 ms per loop

If you have any insight, I would be very grateful. I am using version 0.8.2 
on the versions of python/numpy/cython, etc. included in the most recent 
edition of Enthought/Canopy.

Thanks,

Evan Daugharthy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130731/bcf2e7d1/attachment.html>


More information about the scikit-image mailing list