ocrd_cis/ocropy/ocrolib/psegutils.py
def show_lines(image,lines,lsort):
    """Overlays the computed lines on top of the image, for debugging
    purposes."""
    import matplotlib.pyplot as plt
    import matplotlib.patches as mpatches
    ys,xs = [],[]
    plt.clf()
    plt.cla()
    plt.imshow(image)
    for i in range(len(lines)):
        l = lines[lsort[i]]
        y,x = sl.center(l.bounds)
        xs.append(x)
        ys.append(y)
        o = l.bounds
        r = mpatches.Rectangle((o[1].start,o[0].start),edgecolor='r',fill=0,width=sl.dim1(o),height=sl.dim0(o))
        plt.gca().add_patch(r)
    h,w = image.shape
    plt.ylim(h,0)
    plt.xlim(0,w)
    plt.plot(xs,ys)
Overlays the computed lines on top of the image, for debugging
    purposes.
Overlays the computed lines on top of the image, for debugging
purposes.
Overlays the computed lines on top of the image for debugging purposes .
def show_lines(image,lines,lsort):
    import matplotlib.pyplot as plt
    import matplotlib.patches as mpatches
    ys,xs = [],[]
    plt.clf()
    plt.cla()
    plt.imshow(image)
    for i in range(len(lines)):
        l = lines[lsort[i]]
        y,x = sl.center(l.bounds)
        xs.append(x)
        ys.append(y)
        o = l.bounds
        r = mpatches.Rectangle((o[1].start,o[0].start),edgecolor='r',fill=0,width=sl.dim1(o),height=sl.dim0(o))
        plt.gca().add_patch(r)
    h,w = image.shape
    plt.ylim(h,0)
    plt.xlim(0,w)
    plt.plot(xs,ys)
def show_lines ( image , lines , lsort ) : import matplotlib . pyplot as plt import matplotlib . patches as mpatches ys , xs = [ ] , [ ] plt . clf ( ) plt . cla ( ) plt . imshow ( image ) for i in range ( len ( lines ) ) : l = lines [ lsort [ i ] ] y , x = sl . center ( l . bounds ) xs . append ( x ) ys . append ( y ) o = l . bounds r = mpatches . Rectangle ( ( o [ 1 ] . start , o [ 0 ] . start ) , edgecolor = 'r' , fill = 0 , width = sl . dim1 ( o ) , height = sl . dim0 ( o ) ) plt . gca ( ) . add_patch ( r ) h , w = image . shape plt . ylim ( h , 0 ) plt . xlim ( 0 , w ) plt . plot ( xs , ys )
Overlays the computed lines on top of the image, for debugging
purposes.
Overlays the computed lines on top of the image for debugging purposes .
"""Overlays the computed lines on top of the image, for debugging
    purposes."""
image
lines
lsort