ocrd_cis/ocropy/ocrolib/morph.py
def correspondences(labels1,labels2):
    """Given two labeled images, compute an array giving the correspondences
    between labels in the two images (as tuples of label in `labels1`,
    label in `labels2`, and pixel count)."""
    q = 100000
    assert amin(labels1)>=0 and amin(labels2)>=0
    assert amax(labels2)<q
    combo = labels1*q+labels2
    result, counts = unique(combo, return_counts=True)
    result = array([result//q,result%q,counts])
    return result
Given two labeled images, compute an array giving the correspondences
    between labels in the two images (as tuples of label in `labels1`,
    label in `labels2`, and pixel count).
Given two labeled images, compute an array giving the correspondences
between labels in the two images (as tuples of label in `labels1`,
label in `labels2`, and pixel count).
Given two labeled images compute an array giving the correspondences between labels in the two images ( as tuples of label in ` labels1 ` label in ` labels2 ` and pixel count ) .
def correspondences(labels1,labels2):
    q = 100000
    assert amin(labels1)>=0 and amin(labels2)>=0
    assert amax(labels2)<q
    combo = labels1*q+labels2
    result, counts = unique(combo, return_counts=True)
    result = array([result//q,result%q,counts])
    return result
def correspondences ( labels1 , labels2 ) : q = 100000 assert amin ( labels1 ) >= 0 and amin ( labels2 ) >= 0 assert amax ( labels2 ) < q combo = labels1 * q + labels2 result , counts = unique ( combo , return_counts = True ) result = array ( [ result // q , result % q , counts ] ) return result
Given two labeled images, compute an array giving the correspondences
between labels in the two images (as tuples of label in `labels1`,
label in `labels2`, and pixel count).
Given two labeled images compute an array giving the correspondences between labels in the two images ( as tuples of label in ` labels1 ` label in ` labels2 ` and pixel count ) .
"""Given two labeled images, compute an array giving the correspondences
    between labels in the two images (as tuples of label in `labels1`,
    label in `labels2`, and pixel count)."""
labels1
labels2