ocrd_cis/ocropy/ocrolib/morph.py
def renumber_labels_ordered(a,correspondence=0):
    """Renumber the labels of the input array contiguously so
    that they range from 1...N"""
    assert amin(a)>=0
    assert amax(a)<=2**25
    labels = sorted(unique(ravel(a)))
    renum = zeros(amax(labels)+1,dtype='i')
    renum[labels] = arange(len(labels),dtype='i')
    if correspondence:
        return renum[a],labels
    else:
        return renum[a]
Renumber the labels of the input array contiguously so
    that they range from 1...N
Renumber the labels of the input array contiguously so
that they range from 1...N
Renumber the labels of the input array contiguously so that they range from 1 ... N
def renumber_labels_ordered(a,correspondence=0):
    assert amin(a)>=0
    assert amax(a)<=2**25
    labels = sorted(unique(ravel(a)))
    renum = zeros(amax(labels)+1,dtype='i')
    renum[labels] = arange(len(labels),dtype='i')
    if correspondence:
        return renum[a],labels
    else:
        return renum[a]
def renumber_labels_ordered ( a , correspondence = 0 ) : assert amin ( a ) >= 0 assert amax ( a ) <= 2 ** 25 labels = sorted ( unique ( ravel ( a ) ) ) renum = zeros ( amax ( labels ) + 1 , dtype = 'i' ) renum [ labels ] = arange ( len ( labels ) , dtype = 'i' ) if correspondence : return renum [ a ] , labels else : return renum [ a ]
Renumber the labels of the input array contiguously so
that they range from 1...N
Renumber the labels of the input array contiguously so that they range from 1 ... N
"""Renumber the labels of the input array contiguously so
    that they range from 1...N"""
a
correspondence