morphology.label() bug?

karoyakani tj.takei at gmail.com
Fri Dec 16 20:16:16 EST 2011


Hi Group,

lable() of my skimage 0.4.2 generates a wierd label value "2" at the
bottom-right corner.

a = np.array([
    [0,1,1,0,0,0],
    [0,1,1,0,1,0],
    [0,0,0,1,1,1],
    [0,0,0,0,1,0]])

from skimage import morphology
morphology.label(a)

Out[]:
array([
 [0, 1, 1, 0, 0, 0],
       [0, 1, 1, 0, 1, 0],
       [0, 0, 0, 1, 1, 1],
       [0, 0, 0, 0, 1, 2]])

Is this a bug or a feature?
Documentation virtually tells nothing and no example.

In comparison, scipy.ndimage.label() looks behaving better in this
testcase.
It also allows an optional arg of 4-connected and 8-connected se and
it outputs the number of labels.
So I would say it appears more matured and useful to me.

I may be too new and know too little about the current status and the
roadmap in a big picture.

Regards,
TJ



More information about the scikit-image mailing list