parameters: (binary, scale)
return_statement: return labels * binary
docstring: Function that give every pixel of every text character on a same line
    the same value so it can be easily separated latter
    This function find the upper and lower boundaries of text lines with
    a filter using the first derivative of gaussian kernel to get
    horizontal change of intensity and stretching it
    ----------------------------
      @args:
        binary: 2D array
            Represent a clean, straight binarized image from witch we will
            find the seeds
        scale: double
            Represent the size of the mean object
      @return:
        segmentation: 2D array
            Represent a picture with different pixel value for each line
            of text.
    ----------------------------
    The segmentization give us independant text lines. Rotating the
    picture to make lines more straight could improve result.
    Some args could be added to play on the stretching of the blur or
    the threeshold for finding the mask boundaries
docstring_summary: Function that give every pixel of every text character on a same line
    the same value so it can be easily separated latter
    This function find the upper and lower boundaries of text lines with
    a filter using the first derivative of gaussian kernel to get
    horizontal change of intensity and stretching it
    ----------------------------
docstring_tokens: Function that give every pixel of every text character on a same line the same value so it can be easily separated latter This function find the upper and lower boundaries of text lines with a filter using the first derivative of gaussian kernel to get horizontal change of intensity and stretching it ----------------------------
function: def getSegmentizedImage(binary, scale):
    """
    Function that give every pixel of every text character on a same line
    the same value so it can be easily separated latter
    This function find the upper and lower boundaries of text lines with
    a filter using the first derivative of gaussian kernel to get
    horizontal change of intensity and stretching it
    ----------------------------
      @args:
        binary: 2D array
            Represent a clean, straight binarized image from witch we will
            find the seeds
        scale: double
            Represent the size of the mean object
      @return:
        segmentation: 2D array
            Represent a picture with different pixel value for each line
            of text.
    ----------------------------
    The segmentization give us independant text lines. Rotating the
    picture to make lines more straight could improve result.
    Some args could be added to play on the stretching of the blur or
    the threeshold for finding the mask boundaries
    """
    boxmap = ocrolib.compute_boxmap(binary, scale, threshold = (.25, 4))
    cleaned_image = boxmap * binary
    # Finding horizontals gradient
    gradient = ndi.gaussian_filter(1.0 * cleaned_image, (0.5 * scale,
                                      scale * 6), order = (1, 0))
    gradient = ndi.uniform_filter(gradient,(1, 20))
    # Find the bottom (whiter) and top (darker) zones from grad
    bottom = ocrolib.norm_max((gradient < 0) * (-gradient))
    top = ocrolib.norm_max((gradient > 0) * gradient)
    seeds = getLineSeed(cleaned_image, scale, bottom, top)
    # Label the seeds then group them by line inside boxmaps
    seeds,_ = ocrolib.morph.label(seeds)
    labels = ocrolib.morph.propagate_labels(boxmap, seeds, conflict = 1)
    spread = ocrolib.morph.spread_labels(seeds, maxdist = (scale / 4))
    labels = np.where(labels > 0, labels, spread * binary)
    return labels * binary
function_tokens: def getSegmentizedImage ( binary , scale ) : boxmap = ocrolib . compute_boxmap ( binary , scale , threshold = ( .25 , 4 ) ) cleaned_image = boxmap * binary # Finding horizontals gradient gradient = ndi . gaussian_filter ( 1.0 * cleaned_image , ( 0.5 * scale , scale * 6 ) , order = ( 1 , 0 ) ) gradient = ndi . uniform_filter ( gradient , ( 1 , 20 ) ) # Find the bottom (whiter) and top (darker) zones from grad bottom = ocrolib . norm_max ( ( gradient < 0 ) * ( - gradient ) ) top = ocrolib . norm_max ( ( gradient > 0 ) * gradient ) seeds = getLineSeed ( cleaned_image , scale , bottom , top ) # Label the seeds then group them by line inside boxmaps seeds , _ = ocrolib . morph . label ( seeds ) labels = ocrolib . morph . propagate_labels ( boxmap , seeds , conflict = 1 ) spread = ocrolib . morph . spread_labels ( seeds , maxdist = ( scale / 4 ) ) labels = np . where ( labels > 0 , labels , spread * binary ) return labels * binary