def skeletonize_lines(contour):
    """
    The founded lines could have extra pixel due to some approximation. This situation leads to recognize
    these pixels as junction in the stripper project

    example of lines with extra pixel:
                                        ***    ********
                                           ****     *********
    example of skeletonize line
                                        ***    ********
                                           ****        ******
    :param contour: list of lines
    :return:
    """
    for l in contour:
        list_remove = list()
        prev_col = l.col[0]
        prev_row = l.row[0]
        for index in range(1, l.num - 1, 2):
            next_col = l.col[index + 1]
            next_row = l.row[index + 1]
            if l.col[index] == prev_col and l.row[index] == next_row or l.col[
                index] == next_col and l.row[index] == prev_row:
                list_remove.append(index)
            prev_row = next_row
            prev_col = next_col
        for p in list_remove[::-1]:
            l.col.pop(p)
            l.row.pop(p)
        l.num = len(l.col)
