ocrd_cis/ocropy/common.py
def compute_colseps(binary, scale, maxcolseps=3, maxseps=0, csminheight=7):
    """Computes column separators either from vertical black lines or whitespace.

    Parameters:
    - ``binary``, a bool or int array of the page image, with 1=black
    - ``scale``, square root of average bbox area of characters
    - ``maxcolseps``, maximum number of white separators to keep
    - ``maxseps``, maximum number of black separators to keep
    - ``csminheight``, minimum height (in ``scale`` multiples)
    (Non-contiguous separator lines count piece-wise. Equally,
     minimum height applies piece-wise.)
    
    Returns a tuple:
    - same-size int array as (combined) separator mask,
    - same-size int array of foreground without black separators.
    """
    colseps = compute_colseps_conv(binary, scale,
                                   maxcolseps=maxcolseps,
                                   csminheight=csminheight)
    DSAVE("colwsseps",0.7*colseps+0.3*binary)
    if maxseps > 0:
        seps = compute_separators_morph(binary, scale,
                                        maxseps=maxseps,
                                        csminheight=csminheight)
        DSAVE("colseps", [binary, colseps, seps])
        #colseps = compute_colseps_morph(binary,scale)
        colseps = np.maximum(colseps,seps)
        binary = np.minimum(binary,1-seps)
    #binary,colseps = apply_mask(binary,colseps)
    return colseps,binary
Computes column separators either from vertical black lines or whitespace.

    Parameters:
    - ``binary``, a bool or int array of the page image, with 1=black
    - ``scale``, square root of average bbox area of characters
    - ``maxcolseps``, maximum number of white separators to keep
    - ``maxseps``, maximum number of black separators to keep
    - ``csminheight``, minimum height (in ``scale`` multiples)
    (Non-contiguous separator lines count piece-wise. Equally,
     minimum height applies piece-wise.)
    
    Returns a tuple:
    - same-size int array as (combined) separator mask,
    - same-size int array of foreground without black separators.
    
Computes column separators either from vertical black lines or whitespace.

Returns a tuple:
same-size int array as (combined) separator mask,
same-size int array of foreground without black separators.
Computes column separators either from vertical black lines or whitespace . Returns a tuple : same - size int array as ( combined ) separator mask same - size int array of foreground without black separators .
def compute_colseps(binary, scale, maxcolseps=3, maxseps=0, csminheight=7):
    colseps = compute_colseps_conv(binary, scale,
                                   maxcolseps=maxcolseps,
                                   csminheight=csminheight)
    DSAVE("colwsseps",0.7*colseps+0.3*binary)
    if maxseps > 0:
        seps = compute_separators_morph(binary, scale,
                                        maxseps=maxseps,
                                        csminheight=csminheight)
        DSAVE("colseps", [binary, colseps, seps])
        colseps = np.maximum(colseps,seps)
        binary = np.minimum(binary,1-seps)
    return colseps,binary
def compute_colseps ( binary , scale , maxcolseps = 3 , maxseps = 0 , csminheight = 7 ) : colseps = compute_colseps_conv ( binary , scale , maxcolseps = maxcolseps , csminheight = csminheight ) DSAVE ( "colwsseps" , 0.7 * colseps + 0.3 * binary ) if maxseps > 0 : seps = compute_separators_morph ( binary , scale , maxseps = maxseps , csminheight = csminheight ) DSAVE ( "colseps" , [ binary , colseps , seps ] ) colseps = np . maximum ( colseps , seps ) binary = np . minimum ( binary , 1 - seps ) return colseps , binary
Computes column separators either from vertical black lines or whitespace.
Computes column separators either from vertical black lines or whitespace .
"""Computes column separators either from vertical black lines or whitespace.

    Parameters:
    - ``binary``, a bool or int array of the page image, with 1=black
    - ``scale``, square root of average bbox area of characters
    - ``maxcolseps``, maximum number of white separators to keep
    - ``maxseps``, maximum number of black separators to keep
    - ``csminheight``, minimum height (in ``scale`` multiples)
    (Non-contiguous separator lines count piece-wise. Equally,
     minimum height applies piece-wise.)
    
    Returns a tuple:
    - same-size int array as (combined) separator mask,
    - same-size int array of foreground without black separators.
    """ #colseps = compute_colseps_morph(binary,scale) #binary,colseps = apply_mask(binary,colseps)
binary
scale
maxcolseps
maxseps
csminheight