ocrd_cis/ocropy/ocrolib/morph.py
def ordered_by_xcenter(seg):
    """Verify that the labels of a segmentation are ordered
    spatially (as determined by the x-center of their bounding
    boxes) in left-to-right reading order."""
    objects = [(slice(0,0),slice(0,0))]+find_objects(seg)
    def xc(o): return mean((o[1].start,o[1].stop))
    xs = array([xc(o) for o in objects])
    for i in range(1,len(xs)):
        if xs[i-1]>xs[i]: return 0
    return 1
Verify that the labels of a segmentation are ordered
    spatially (as determined by the x-center of their bounding
    boxes) in left-to-right reading order.
Verify that the labels of a segmentation are ordered
spatially (as determined by the x-center of their bounding
boxes) in left-to-right reading order.
Verify that the labels of a segmentation are ordered spatially ( as determined by the x - center of their bounding boxes ) in left - to - right reading order .
def ordered_by_xcenter(seg):
    objects = [(slice(0,0),slice(0,0))]+find_objects(seg)
    def xc(o): return mean((o[1].start,o[1].stop))
    xs = array([xc(o) for o in objects])
    for i in range(1,len(xs)):
        if xs[i-1]>xs[i]: return 0
    return 1
def ordered_by_xcenter ( seg ) : objects = [ ( slice ( 0 , 0 ) , slice ( 0 , 0 ) ) ] + find_objects ( seg ) def xc ( o ) : return mean ( ( o [ 1 ] . start , o [ 1 ] . stop ) ) xs = array ( [ xc ( o ) for o in objects ] ) for i in range ( 1 , len ( xs ) ) : if xs [ i - 1 ] > xs [ i ] : return 0 return 1
Verify that the labels of a segmentation are ordered
spatially (as determined by the x-center of their bounding
boxes) in left-to-right reading order.
Verify that the labels of a segmentation are ordered spatially ( as determined by the x - center of their bounding boxes ) in left - to - right reading order .
"""Verify that the labels of a segmentation are ordered
    spatially (as determined by the x-center of their bounding
    boxes) in left-to-right reading order."""
seg