def vbreak(image, mask=None, iterations=1):
    '''Remove horizontal breaks
    
    1 1 1     1 1 1
    0 1 0 ->  0 0 0 (this case only)
    1 1 1     1 1 1
    '''
    global vbreak_table
    if mask is None:
        masked_image = image
    else:
        masked_image = image.astype(bool).copy()
        masked_image[~mask] = False
    result = table_lookup(masked_image, vbreak_table, False)
    if not mask is None:
        result[~mask] = image[~mask]
    return result
Remove horizontal breaks
    
    1 1 1     1 1 1
    0 1 0 ->  0 0 0 (this case only)
    1 1 1     1 1 1