ocrd_cis/ocropy/ocrolib/morph.py
def propagate_labels(image,labels,conflict=0):
    """Given an image and a set of labels, apply the labels
    to all the connected components in the image that overlap a label.
    Assign the value `conflict` to any components that have a conflict."""
    rlabels,_ = label(image)
    cors = correspondences(rlabels,labels)
    outputs = zeros(amax(rlabels)+1,'i')
    oops = -(1<<30)
    for o,i,_ in cors.T:
        if outputs[o]!=0: outputs[o] = oops
        else: outputs[o] = i
    outputs[outputs==oops] = conflict
    outputs[0] = 0
    return outputs[rlabels]
Given an image and a set of labels, apply the labels
    to all the connected components in the image that overlap a label.
    Assign the value `conflict` to any components that have a conflict.
Given an image and a set of labels, apply the labels
to all the connected components in the image that overlap a label.
Assign the value `conflict` to any components that have a conflict.
Given an image and a set of labels apply the labels to all the connected components in the image that overlap a label . Assign the value ` conflict ` to any components that have a conflict .
def propagate_labels(image,labels,conflict=0):
    rlabels,_ = label(image)
    cors = correspondences(rlabels,labels)
    outputs = zeros(amax(rlabels)+1,'i')
    oops = -(1<<30)
    for o,i,_ in cors.T:
        if outputs[o]!=0: outputs[o] = oops
        else: outputs[o] = i
    outputs[outputs==oops] = conflict
    outputs[0] = 0
    return outputs[rlabels]
def propagate_labels ( image , labels , conflict = 0 ) : rlabels , _ = label ( image ) cors = correspondences ( rlabels , labels ) outputs = zeros ( amax ( rlabels ) + 1 , 'i' ) oops = - ( 1 << 30 ) for o , i , _ in cors . T : if outputs [ o ] != 0 : outputs [ o ] = oops else : outputs [ o ] = i outputs [ outputs == oops ] = conflict outputs [ 0 ] = 0 return outputs [ rlabels ]
Given an image and a set of labels, apply the labels
to all the connected components in the image that overlap a label.
Given an image and a set of labels apply the labels to all the connected components in the image that overlap a label .
"""Given an image and a set of labels, apply the labels
    to all the connected components in the image that overlap a label.
    Assign the value `conflict` to any components that have a conflict."""
image
labels
conflict